diff --git a/.eslintrc.json b/.eslintrc.json index c26896f46..4a4b6872d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,231 +1,188 @@ { - "root": true, - "parser": "@typescript-eslint/parser", - "env": { - "es6": true, - "node": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:security/recommended" + "root": true, + "parser": "@typescript-eslint/parser", + "env": { + "es6": true, + "node": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:security/recommended" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "rules": { + "semi": ["error", "always"], + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/explicit-member-accessibility": "off", + "@typescript-eslint/prefer-interface": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/indent": "off", + "no-await-in-loop": "warn", + "no-compare-neg-zero": "error", + "no-template-curly-in-string": "error", + "no-unsafe-negation": "error", + "accessor-pairs": "warn", + "array-callback-return": "error", + "complexity": "warn", + "curly": ["error", "multi-line", "consistent"], + "dot-location": ["error", "property"], + "dot-notation": "error", + "eqeqeq": "error", + "no-empty-function": "error", + "no-floating-decimal": "error", + "no-lone-blocks": "error", + "no-multi-spaces": "error", + "no-new-func": "error", + "no-new-wrappers": "error", + "no-new": "error", + "no-octal": "error", + "no-return-assign": "error", + "no-return-await": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-throw-literal": "error", + "no-unmodified-loop-condition": "error", + "no-unused-expressions": "error", + "no-useless-call": "error", + "no-useless-concat": "error", + "no-useless-escape": "error", + "no-useless-return": "error", + "no-void": "error", + "no-warning-comments": "off", + "prefer-promise-reject-errors": "error", + "require-await": "warn", + "yoda": "error", + "no-label-var": "error", + "no-shadow": "off", + "no-undef-init": "error", + "callback-return": "error", + "getter-return": "off", + "handle-callback-err": "error", + "no-mixed-requires": "error", + "no-new-require": "error", + "no-path-concat": "error", + "array-bracket-spacing": "error", + "block-spacing": "error", + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } ], - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "rules": { - "semi": [ - "error", - "always" - ], - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/prefer-interface": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/indent": [ - "error", - 4 - ], - "no-await-in-loop": "warn", - "no-compare-neg-zero": "error", - "no-template-curly-in-string": "error", - "no-unsafe-negation": "error", - "accessor-pairs": "warn", - "array-callback-return": "error", - "complexity": "warn", - "curly": [ - "error", - "multi-line", - "consistent" - ], - "dot-location": [ - "error", - "property" - ], - "dot-notation": "error", - "eqeqeq": "error", - "no-empty-function": "error", - "no-floating-decimal": "error", - "no-lone-blocks": "error", - "no-multi-spaces": "error", - "no-new-func": "error", - "no-new-wrappers": "error", - "no-new": "error", - "no-octal": "error", - "no-return-assign": "error", - "no-return-await": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-throw-literal": "error", - "no-unmodified-loop-condition": "error", - "no-unused-expressions": "error", - "no-useless-call": "error", - "no-useless-concat": "error", - "no-useless-escape": "error", - "no-useless-return": "error", - "no-void": "error", - "no-warning-comments": "warn", - "prefer-promise-reject-errors": "error", - "require-await": "warn", - "yoda": "error", - "no-label-var": "error", - "no-shadow": "off", - "no-undef-init": "error", - "callback-return": "error", - "getter-return": "off", - "handle-callback-err": "error", - "no-mixed-requires": "error", - "no-new-require": "error", - "no-path-concat": "error", - "array-bracket-spacing": "error", - "block-spacing": "error", - "brace-style": [ - "error", - "1tbs", - { - "allowSingleLine": true - } - ], - "capitalized-comments": [ - "error", - "always", - { - "ignoreConsecutiveComments": true - } - ], - "comma-dangle": [ - "error", - "never" - ], - "comma-spacing": "error", - "comma-style": "error", - "computed-property-spacing": "error", - "consistent-this": [ - "error", - "$this" - ], - "eol-last": "error", - "func-names": "error", - "func-name-matching": "error", - "func-style": [ - "error", - "declaration", - { - "allowArrowFunctions": true - } - ], - "indent": [ - "error", - 4, - { - "SwitchCase": 1 - } - ], - "key-spacing": "error", - "keyword-spacing": "error", - "max-depth": "error", - "max-nested-callbacks": [ - "error", - { - "max": 4 - } - ], - "max-statements-per-line": [ - "error", - { - "max": 2 - } - ], - "new-cap": "off", - "newline-per-chained-call": [ - "error", - { - "ignoreChainWithDepth": 3 - } - ], - "no-array-constructor": "error", - "no-inline-comments": "error", - "no-lonely-if": "error", - "no-mixed-operators": "error", - "no-multiple-empty-lines": [ - "error", - { - "max": 2, - "maxEOF": 1, - "maxBOF": 0 - } - ], - "no-new-object": "error", - "no-trailing-spaces": "error", - "no-unneeded-ternary": "error", - "no-whitespace-before-property": "error", - "nonblock-statement-body-position": "error", - "object-curly-spacing": [ - "error", - "always" - ], - "operator-assignment": "error", - "operator-linebreak": [ - "error", - "after" - ], - "padded-blocks": [ - "error", - "never" - ], - "quote-props": [ - "error", - "as-needed" - ], - "quotes": [ - "error", - "double", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "semi-spacing": "error", - "space-before-blocks": "error", - "space-before-function-paren": [ - "error", - { - "anonymous": "always", - "named": "always", - "asyncArrow": "always" - } - ], - "space-in-parens": "error", - "space-infix-ops": "error", - "space-unary-ops": "error", - "spaced-comment": "error", - "template-tag-spacing": "error", - "unicode-bom": "error", - "arrow-body-style": "error", - "arrow-parens": [ - "error", - "as-needed" - ], - "arrow-spacing": "error", - "no-duplicate-imports": "error", - "no-useless-computed-key": "error", - "no-useless-constructor": "error", - "prefer-arrow-callback": "error", - "prefer-numeric-literals": "error", - "prefer-rest-params": "error", - "prefer-spread": "error", - "prefer-template": "error", - "rest-spread-spacing": "error", - "template-curly-spacing": "error", - "yield-star-spacing": "error" - }, - "plugins": [ - "@typescript-eslint", - "security" - ] + "capitalized-comments": [ + "error", + "always", + { + "ignoreConsecutiveComments": true + } + ], + "comma-dangle": ["error", "never"], + "comma-spacing": "error", + "comma-style": "error", + "computed-property-spacing": "error", + "consistent-this": ["error", "$this"], + "eol-last": "error", + "func-names": "error", + "func-name-matching": "error", + "func-style": [ + "error", + "declaration", + { + "allowArrowFunctions": true + } + ], + "indent": "off", + "key-spacing": "error", + "keyword-spacing": "error", + "max-depth": "error", + "max-nested-callbacks": [ + "error", + { + "max": 4 + } + ], + "max-statements-per-line": [ + "error", + { + "max": 2 + } + ], + "new-cap": "off", + "newline-per-chained-call": [ + "error", + { + "ignoreChainWithDepth": 3 + } + ], + "no-array-constructor": "error", + "no-inline-comments": "error", + "no-lonely-if": "error", + "no-mixed-operators": "error", + "no-multiple-empty-lines": [ + "error", + { + "max": 2, + "maxEOF": 1, + "maxBOF": 0 + } + ], + "no-new-object": "error", + "no-trailing-spaces": "error", + "no-unneeded-ternary": "error", + "no-whitespace-before-property": "error", + "nonblock-statement-body-position": "error", + "object-curly-spacing": ["error", "always"], + "operator-assignment": "error", + "operator-linebreak": "off", + "padded-blocks": ["error", "never"], + "quote-props": ["error", "as-needed"], + "quotes": [ + "error", + "double", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "semi-spacing": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ + "off", + { + "anonymous": "always", + "named": "always", + "asyncArrow": "always" + } + ], + "space-in-parens": "error", + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": "error", + "template-tag-spacing": "error", + "unicode-bom": "error", + "arrow-body-style": "error", + "arrow-parens": ["error", "always"], + "arrow-spacing": "error", + "no-duplicate-imports": "error", + "no-useless-computed-key": "error", + "no-useless-constructor": "error", + "prefer-arrow-callback": "error", + "prefer-numeric-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "rest-spread-spacing": "error", + "template-curly-spacing": "error", + "yield-star-spacing": "error" + }, + "plugins": ["@typescript-eslint", "security"] } diff --git a/.gitignore b/.gitignore index 26ae198f1..75a98eb9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ node_modules coverage tests/index.js -dist +# dist # Should we really ignore the dist folder? docs site .idea +.nyc_output + +# temporary +tests_jest \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..953636624 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "tabWidth": 2, + "trailingComma": "none" +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..a9bca6dbc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.autoClosingTags": false, + "javascript.autoClosingTags": false +} diff --git a/dist/client/Client.d.ts b/dist/client/Client.d.ts new file mode 100644 index 000000000..2edb2a46b --- /dev/null +++ b/dist/client/Client.d.ts @@ -0,0 +1,37 @@ +import { ClientBase, ClientOptions } from "./ClientBase"; +import { APIs } from "./apis"; +import { ClientUser } from "../old_structures/ClientUser"; +import { RESTController } from "../controllers/rest"; +import { Group, PartialUser } from "../old_structures"; +import * as ClientSocket from "./lib/ClientSocket/ClientSocket"; +import { ChatManager } from "./lib/ChatManager/ChatManager"; +import { DataStoreManager } from "./lib/DataStoreManager/DataStoreManager"; +import { User } from "../structures/User"; +import { BaseUser } from "../structures/BaseUser"; +export declare class Client extends ClientBase { + user: ClientUser | null; + apis: APIs; + rest: RESTController; + socket: ClientSocket.Socket; + dataStoreManager: DataStoreManager; + chat: ChatManager; + constructor(options?: ClientOptions); + isLoggedIn(): boolean; + init(): void; + login(cookie?: string): Promise; + getGroup(groupId: number): Promise; + /** + * Returns a base user object from a user id. + * @param userId The user's ID + */ + getBaseUser(userId: number): BaseUser; + /** + * Returns a user object from a user id. + * @param userId The user's ID + */ + getUser(userId: number): Promise; + getUserIdFromUsername(username: string): Promise; + getUsernameFromUserId(userId: number | string): Promise; + getUsersByUserIds(userIds: number[] | string[], excludeBannedUsers?: boolean): Promise; + getUsersByUsernames(usernames: string[], excludeBannedUsers?: boolean): Promise; +} diff --git a/dist/client/Client.js b/dist/client/Client.js new file mode 100644 index 000000000..667bd76e8 --- /dev/null +++ b/dist/client/Client.js @@ -0,0 +1,146 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Client = void 0; +const tslib_1 = require("tslib"); +const ClientBase_1 = require("./ClientBase"); +const apis_1 = require("./apis"); +const ClientUser_1 = require("../old_structures/ClientUser"); +const rest_1 = require("../controllers/rest"); +const old_structures_1 = require("../old_structures"); +const ClientSocket = (0, tslib_1.__importStar)(require("./lib/ClientSocket/ClientSocket")); +const ChatManager_1 = require("./lib/ChatManager/ChatManager"); +const DataStoreManager_1 = require("./lib/DataStoreManager/DataStoreManager"); +const User_1 = require("../structures/User"); +const BaseUser_1 = require("../structures/BaseUser"); +class Client extends ClientBase_1.ClientBase { + constructor(options) { + super(options); + this.user = null; + this.apis = (0, apis_1.initAPIs)(this); + this.rest = new rest_1.RESTController(this, this.options.rest); + this.socket = new ClientSocket.Socket(this); + this.dataStoreManager = new DataStoreManager_1.DataStoreManager(this); + this.chat = new ChatManager_1.ChatManager(this); + this.init(); + } + isLoggedIn() { + return this.user !== null; + } + init() { + if (this.options.rest) { + this.rest.setOptions(this.options.rest); + } + } + login(cookie) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + this.log("info", { + name: "Client.login", + description: `Started login process..` + }); + cookie = cookie || (this.options.credentials || {}).cookie || undefined; + if (!cookie) { + throw new Error("Attempted to log in without a cookie!"); + } + this.options.credentials = Object.assign(Object.assign({}, this.options.credentials), { cookie }); + const createdCookie = this.rest.createCookie({ + key: ".ROBLOSECURITY", + value: cookie, + domain: "roblox.com", + hostOnly: false, + httpOnly: false + }); + this.rest.addCookie(createdCookie); + this.log("info", { + name: "Client.login", + description: `Added cookie to cookie jar, proceeding to fetching authenticated user information..` + }); + const getAuthenticationData = yield this.apis.usersAPI.getAuthenticatedUserInformation(); + this.user = new ClientUser_1.ClientUser({ + id: getAuthenticationData.id, + name: getAuthenticationData.name + }, this); + this.emit("loggedIn"); + this.log("info", { + name: "Client.login", + description: `Successfully logged in as ${getAuthenticationData.name}` + }); + return this.user; + }); + } + getGroup(groupId) { + return this.apis.groupsAPI + .getGroup({ + groupId + }) + .then((data) => { + if (!data) { + throw new Error(`Group not found: ${groupId}`); + } + else { + return new old_structures_1.Group(data, this); + } + }); + } + /** + * Returns a base user object from a user id. + * @param userId The user's ID + */ + getBaseUser(userId) { + return new BaseUser_1.BaseUser(this, userId); + } + /** + * Returns a user object from a user id. + * @param userId The user's ID + */ + getUser(userId) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + const data = yield this.apis.usersAPI.getUserById({ userId }); + return new User_1.User(this, data); + }); + } + getUserIdFromUsername(username) { + return this.apis.usersAPI + .getUsersByUsernames({ + usernames: [username], + excludeBannedUsers: false + }) + .then((response) => { + if (response.data && response.data[0]) { + return new old_structures_1.PartialUser(response.data[0], this); + } + else { + throw new Error("Got invalid response from getUserIdFromUsername"); + } + }); + } + getUsernameFromUserId(userId) { + if (typeof userId === "string") { + userId = parseInt(userId); + } + return this.apis.generalApi + .getUserById({ + userId + }) + .then((data) => new old_structures_1.PartialUser(data, this)); + } + getUsersByUserIds(userIds, excludeBannedUsers = false) { + if (typeof userIds[0] === "string") { + userIds = userIds.map((userId) => parseInt(userId)); + } + return this.apis.usersAPI + .getUsersByIds({ + excludeBannedUsers, + userIds: userIds + }) + .then((response) => response.data.map((userData) => new old_structures_1.PartialUser(userData, this))); + } + getUsersByUsernames(usernames, excludeBannedUsers = false) { + return this.apis.usersAPI + .getUsersByUsernames({ + excludeBannedUsers, + usernames + }) + .then((response) => response.data.map((userData) => new old_structures_1.PartialUser(userData, this))); + } +} +exports.Client = Client; diff --git a/dist/client/ClientBase.d.ts b/dist/client/ClientBase.d.ts new file mode 100644 index 000000000..2c8cb094a --- /dev/null +++ b/dist/client/ClientBase.d.ts @@ -0,0 +1,38 @@ +/// +import { EventEmitter } from "events"; +import { RESTControllerOptions } from "../interfaces/RESTInterfaces"; +import { Debugger } from "debug"; +export interface ClientCredentialsOptions { + cookie?: string; +} +export interface ClientCallbacks { + getFunCaptchaToken?: (publicKey: string, targetUrl: string) => Promise; +} +export interface ClientSetup { + websocket?: { + maxRetries: number; + }; + debug: boolean; +} +export interface ClientOptions { + credentials?: ClientCredentialsOptions; + rest?: RESTControllerOptions; + callbacks?: ClientCallbacks; + setup?: ClientSetup; +} +interface DebugData { + name: string; + description: string; +} +export declare class ClientBase extends EventEmitter { + options: ClientOptions; + debugger: { + info: Debugger; + warn: Debugger; + error: Debugger; + }; + constructor(options?: ClientOptions); + updateOptions(options?: ClientOptions): ClientOptions; + log(level: "info" | "warn" | "error", data: DebugData): void; +} +export {}; diff --git a/dist/client/ClientBase.js b/dist/client/ClientBase.js new file mode 100644 index 000000000..07931530e --- /dev/null +++ b/dist/client/ClientBase.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientBase = void 0; +const tslib_1 = require("tslib"); +const events_1 = require("events"); +const debug_1 = (0, tslib_1.__importDefault)(require("debug")); +const utilFunctions_1 = require("../util/utilFunctions"); +class ClientBase extends events_1.EventEmitter { + constructor(options) { + super(); + this.options = this.updateOptions(options); + this.debugger = { + info: (0, debug_1.default)("bloxy:info"), + warn: (0, debug_1.default)("bloxy:warn"), + error: (0, debug_1.default)("bloxy:error") + }; + } + updateOptions(options) { + this.options = (0, utilFunctions_1.utilMergeDeep)({ + credentials: {}, + rest: {}, + setup: {}, + callbacks: {} + }, options || {}); + return this.options; + } + log(level, data) { + const loggerToUse = level === "info" + ? this.debugger.info + : level === "error" + ? this.debugger.error + : this.debugger.warn; + loggerToUse(`[${new Date().toISOString()}] ${data.name}: ${data.description}`); + } +} +exports.ClientBase = ClientBase; diff --git a/dist/client/apis/AccountInformationAPI.d.ts b/dist/client/apis/AccountInformationAPI.d.ts new file mode 100644 index 000000000..9f1f44bec --- /dev/null +++ b/dist/client/apis/AccountInformationAPI.d.ts @@ -0,0 +1,73 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { UserIdOption, Privacy } from "../.."; +export declare type AccountInformationBirthdate = { + birthDay: number; + birthMonth: number; + birthYear: number; +}; +export declare type AccountInformationDescription = { + description: string; +}; +export declare type AccountInformationGender = { + gender: number; +}; +export declare type AccountInformationXboxConsecutiveLoginDays = { + count: number; +}; +export declare type AccountInformationMetaData = { + isAllowedNotificationsEndpointDisabled: boolean; + isAccountSettingsPolicyEnabled: boolean; + isPhoneNumberEnabled: boolean; + MaxUserDescriptionLength: number; + isUserDescriptionEnabled: boolean; + isUserBlockEndpointsUpdated: boolean; + isIDVerificationEnabled: boolean; + isPasswordRequiredForAgingDown: boolean; + homePageUpsellCardVariation: string; +}; +export declare type AccountInformationOwnPromotionChannels = { + promotionChannelsVisibilityPrivacy: Privacy; + facebook: string; + twitter: string; + youtube: string; + twitch: string; + guilded: string; +}; +export declare type AccountInformationPromotionChannels = Omit; +export declare type AccountInformationStarCodeAffiliate = { + userId: number; + name: string; + code: string; +}; +export declare type AccountInformationSetStarCodeAffiliate = { + code: string; +}; +export declare type AccountInformationAddStarCodeAffiliateOption = { + code: string; +}; +export declare type AccountInformationRobloxBadge = { + id: number; + name: string; + description: string; + imageUrl: string; +}; +export declare type AccountInformationRobloxBadges = AccountInformationRobloxBadge[]; +export declare class AccountInformationAPI extends BaseAPI { + constructor(client: Client); + getUserBirthdate(): Promise; + updateUserBirthdate(options: AccountInformationBirthdate): Promise; + getUserDescription(): Promise; + updateUserDescription(options: AccountInformationDescription): Promise; + getUserGender(): Promise; + updateUserGender(options: AccountInformationGender): Promise; + getConsecutiveXboxLoginDays(): Promise; + getMetaData(): Promise; + getSelfPromotionChannels(): Promise; + getUserPromotionChannels(options: UserIdOption): Promise; + updateUserPromotionChannels(options: AccountInformationOwnPromotionChannels): Promise; + removeStarCodeAffiliate(): Promise; + getStarCodeAffiliate(): Promise; + addStarCodeAffiliate(options: AccountInformationAddStarCodeAffiliateOption): Promise; + getRobloxBadges(options: UserIdOption): Promise; +} diff --git a/dist/client/apis/AccountInformationAPI.js b/dist/client/apis/AccountInformationAPI.js new file mode 100644 index 000000000..692640db5 --- /dev/null +++ b/dist/client/apis/AccountInformationAPI.js @@ -0,0 +1,160 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccountInformationAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class AccountInformationAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + baseUrl: "https://accountinformation.roblox.com/", + client + }); + } + getUserBirthdate() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/birthdate" + }, + json: true + }).then((response) => response.body); + } + updateUserBirthdate(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/birthdate", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getUserDescription() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/description" + }, + json: true + }).then((response) => response.body); + } + updateUserDescription(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/description", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getUserGender() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/gender" + }, + json: true + }).then((response) => response.body); + } + updateUserGender(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/gender", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getConsecutiveXboxLoginDays() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/xbox-live/consecutive-login-days" + }, + json: true + }).then((response) => response.body); + } + getMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: "v1/metadata" + }, + json: true + }).then((response) => response.body); + } + getSelfPromotionChannels() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/promotion-channels" + }, + json: true + }).then((response) => response.body); + } + getUserPromotionChannels(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/promotion-channels` + }, + json: true + }).then((response) => response.body); + } + updateUserPromotionChannels(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/promotion-channels", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + removeStarCodeAffiliate() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates", + method: "DELETE" + }, + json: true + }).then(() => true); + } + getStarCodeAffiliate() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates" + }, + json: true + }).then((response) => response.body); + } + addStarCodeAffiliate(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getRobloxBadges(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/roblox-badges`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } +} +exports.AccountInformationAPI = AccountInformationAPI; diff --git a/dist/client/apis/AccountSettingsAPI.d.ts b/dist/client/apis/AccountSettingsAPI.d.ts new file mode 100644 index 000000000..be078709b --- /dev/null +++ b/dist/client/apis/AccountSettingsAPI.d.ts @@ -0,0 +1,55 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { Privacy } from "../../types/GenericTypes"; +import { UserIdOption } from "../.."; +export declare type AccountSettingsMetaData = { + isAccountsRestrictionsSpamBugFixEnabled: boolean; + maximumParentalControlsMonthlySpendLimitInUSD: number; + isParentalMonthlyLimitInUIEnabled: boolean; + isParentalNotificationSettingsInUIEnabled: boolean; +}; +export declare type AccountSettingsGroup = { + title: string; + url: string; + suffix: string; +}; +export declare type AccountSettingsGroups = AccountSettingsGroup[]; +export declare type AccountSettingsAppChatPrivacy = { + appChatPrivacy: Omit | "All"; +}; +export declare type AccountSettingsGameChatPrivacy = { + gameChatPrivacy: Omit; +}; +export declare type AccountSettingsInventoryPrivacy = { + inventoryPrivacy: Privacy; +}; +export declare type AccountSettingsPrivacy = { + phoneDiscovery: Omit; +}; +export declare type AccountSettingsPrivacyInfo = { + isPhoneDiscoveryEnabled: boolean; +}; +export declare type AccountSettingsPrivateMessagePrivacy = { + privateMessagePrivacy: Privacy; +}; +export declare type AccountSettingsVisibilityPrivacy = { + visibilityPrivacy: number; +}; +export declare class AccountSettingsAPI extends BaseAPI { + constructor(client: Client); + getMetaData(): Promise; + getSettingsGroups(): Promise; + getAppChatPrivacy(): Promise; + updateAppChatPrivacy(options: AccountSettingsAppChatPrivacy): Promise; + getGameChatPrivacy(): Promise; + updateGameChatPrivacy(options: AccountSettingsGameChatPrivacy): Promise; + getInventoryPrivacy(): Promise; + updateInventoryPrivacy(options: AccountSettingsInventoryPrivacy): Promise; + getUserPrivacy(): Promise; + updateUserPrivacy(options: AccountSettingsPrivacy): Promise; + getUserPrivacySettingsInfo(): Promise; + getUserPrivateMessagePrivacy(): Promise; + updateUserPrivateMessagePrivacy(options: AccountSettingsPrivateMessagePrivacy): Promise; + blockUser(options: UserIdOption): Promise; + unblockUser(options: UserIdOption): Promise; +} diff --git a/dist/client/apis/AccountSettingsAPI.js b/dist/client/apis/AccountSettingsAPI.js new file mode 100644 index 000000000..81a710787 --- /dev/null +++ b/dist/client/apis/AccountSettingsAPI.js @@ -0,0 +1,169 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AccountSettingsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class AccountSettingsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + baseUrl: "https://accountsettings.roblox.com/", + client + }); + } + getMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/settings/metadata" + }, + json: true + }).then((response) => ({ + isAccountsRestrictionsSpamBugFixEnabled: response.body.IsAccountsRestrictionsSpamBugFixEnabled, + isParentalMonthlyLimitInUIEnabled: response.body.IsParentalMonthlyLimitInUIEnabled, + isParentalNotificationSettingsInUIEnabled: response.body.IsParentalNotificationSettingsInUIEnabled, + maximumParentalControlsMonthlySpendLimitInUSD: response.body.MaximumParentalControlsMonthlySpendLimitInUSD + })); + } + getSettingsGroups() { + return this.request({ + requiresAuth: false, + request: { + path: "v1/account/settings/settings-groups" + }, + json: true + }).then((response) => response.body.map((val) => ({ + title: val.Title, + url: val.Url, + suffix: val.Suffix + }))); + } + getAppChatPrivacy() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/app-chat-privacy" + }, + json: true + }).then((response) => response.body); + } + updateAppChatPrivacy(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/app-chat-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getGameChatPrivacy() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/game-chat-privacy" + }, + json: true + }).then((response) => response.body); + } + updateGameChatPrivacy(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/game-chat-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getInventoryPrivacy() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/inventory-privacy" + }, + json: true + }).then((response) => response.body); + } + updateInventoryPrivacy(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/inventory-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + getUserPrivacy() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy" + }, + json: true + }).then((response) => response.body); + } + updateUserPrivacy(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy", + method: "PATCH", + json: options + }, + json: true + }).then(() => true); + } + getUserPrivacySettingsInfo() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy/info" + }, + json: true + }).then((response) => response.body); + } + getUserPrivateMessagePrivacy() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/private-message-privacy" + }, + json: true + }).then((response) => response.body); + } + updateUserPrivateMessagePrivacy(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/private-message-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + blockUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/block`, + method: "POST" + }, + json: true + }).then(() => true); + } + unblockUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unblock`, + method: "POST" + }, + json: true + }).then(() => true); + } +} +exports.AccountSettingsAPI = AccountSettingsAPI; diff --git a/dist/client/apis/AdConfigurationAPI.d.ts b/dist/client/apis/AdConfigurationAPI.d.ts new file mode 100644 index 000000000..3bc17470d --- /dev/null +++ b/dist/client/apis/AdConfigurationAPI.d.ts @@ -0,0 +1,71 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { ISOString } from "../../types/GenericTypes"; +import { GroupIdOption } from "../.."; +export declare type AdConfigurationTargetGender = unknown; +export declare type AdConfigurationTargetAgeBracket = unknown; +export declare type AdConfigurationTargetDeviceType = unknown; +export declare type AdConfigurationSponsoredGame = { + adId: number; + adSetId: number; + adName: string; + adStatus: unknown; + creativeType: unknown; + creativeTargetId: number; + creativeUrl: string; + bidAmountInRobux: number; + budgetInRobux: number; + adSetStatus: unknown; + startDate: ISOString; + endDate: ISOString; + targetGender: AdConfigurationTargetGender; + targetAgeBracket: AdConfigurationTargetAgeBracket; + targetDeviceType: AdConfigurationTargetDeviceType; + campaignTargetType: unknown; + campaignTargetId: number; + totalSpendInRobux: number; + totalImpressions: number; + totalClicks: number; + totalConversions: number; + impressionConversions: number; + clickConversions: number; +}; +export declare type AdConfigurationSponsoredGames = { + sponsoredGames: AdConfigurationSponsoredGame[]; + previousPageCursor: string; + nextPageCursor: string; +}; +export declare type AdConfigurationUniverse = { + id: number; + name: string; +}; +export declare type AdConfigurationUniverses = { + universes: AdConfigurationUniverse[]; +}; +export declare type AdConfigurationCreateSponsoredGameAdOptions = { + universeId: number; + targetGender: AdConfigurationTargetGender; + targetAgeBracket: AdConfigurationTargetAgeBracket; + targetDeviceType: AdConfigurationTargetDeviceType; + budgetInRobux: number; + startDate: ISOString; + endDate: ISOString; + adName: string; + bidAmountInRobux: number; +}; +export declare type AdConfigurationStopSponsoredGameAdOptions = { + adSetId: number; +}; +export declare type AdConfigurationGetSponsoredGamesOptions = { + universeId: number; + includeReportingStats?: boolean; + isArchived?: boolean; + pageCursor?: string; +}; +export declare class AdConfigurationAPI extends BaseAPI { + constructor(client: Client); + getSponsoredGames(options: AdConfigurationGetSponsoredGamesOptions): Promise; + getUniverses(options: Partial): Promise; + createSponsor(options: AdConfigurationCreateSponsoredGameAdOptions): Promise; + stopSponsor(options: AdConfigurationStopSponsoredGameAdOptions): Promise; +} diff --git a/dist/client/apis/AdConfigurationAPI.js b/dist/client/apis/AdConfigurationAPI.js new file mode 100644 index 000000000..f5f923b79 --- /dev/null +++ b/dist/client/apis/AdConfigurationAPI.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AdConfigurationAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class AdConfigurationAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + baseUrl: "https://adconfiguration.roblox.com/", + client + }); + } + getSponsoredGames(options) { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games", + method: "GET", + qs: { + universeId: options.universeId, + includeReportingStats: options.includeReportingStats, + isArchived: options.isArchived, + pageCursor: options.pageCursor + } + }, + json: true + }).then((response) => response.body); + } + getUniverses(options) { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/universes", + method: "GET", + qs: { + groupId: options.groupId + } + }, + json: true + }).then((response) => response.body); + } + createSponsor(options) { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/create", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + stopSponsor(options) { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/stop", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } +} +exports.AdConfigurationAPI = AdConfigurationAPI; diff --git a/dist/client/apis/AdsAPI.d.ts b/dist/client/apis/AdsAPI.d.ts new file mode 100644 index 000000000..e169586c7 --- /dev/null +++ b/dist/client/apis/AdsAPI.d.ts @@ -0,0 +1,26 @@ +import BaseAPI from "./BaseAPI"; +import Client from "../Client"; +export declare type CreateAssetAdOptions = { + assetId: number; + name: string; + file: unknown; +}; +export declare type CreateGamePassAdOptions = { + gamePassId: number; + name: string; + file: unknown; +}; +export declare type CreateGroupAdOptions = { + groupId: number; + name: string; + file: unknown; +}; +export declare type CreateAssetAd = unknown; +export declare type CreateGamePassAd = unknown; +export declare type CreateGroupAd = unknown; +export default class AdsAPI extends BaseAPI { + constructor(client: Client); + createAssetAd(options: CreateAssetAdOptions): Promise; + createGamePassAd(options: CreateGamePassAdOptions): Promise; + createGroupAd(options: CreateGroupAdOptions): Promise; +} diff --git a/src/client/apis/AdsAPI.ts b/dist/client/apis/AdsAPI.js similarity index 54% rename from src/client/apis/AdsAPI.ts rename to dist/client/apis/AdsAPI.js index 03407d4fb..c11dba317 100644 --- a/src/client/apis/AdsAPI.ts +++ b/dist/client/apis/AdsAPI.js @@ -1,37 +1,15 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; - - -export declare type CreateAssetAdOptions = { - assetId: number; - name: string; - file: unknown; -}; -export declare type CreateGamePassAdOptions = { - gamePassId: number; - name: string; - file: unknown; -}; -export declare type CreateGroupAdOptions = { - groupId: number; - name: string; - file: unknown; -}; - -export declare type CreateAssetAd = unknown; -export declare type CreateGamePassAd = unknown; -export declare type CreateGroupAd = unknown; - - -export default class AdsAPI extends BaseAPI { - constructor (client: Client) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +const BaseAPI_1 = (0, tslib_1.__importDefault)(require("./BaseAPI")); +class AdsAPI extends BaseAPI_1.default { + constructor(client) { super({ baseUrl: "https://ads.roblox.com/", client }); } - - createAssetAd (options: CreateAssetAdOptions): Promise { + createAssetAd(options) { return this.request({ requiresAuth: true, request: { @@ -45,11 +23,9 @@ export default class AdsAPI extends BaseAPI { assetId: options.assetId } } - }) - .then(response => response.body as CreateAssetAd); + }).then((response) => response.body); } - - createGamePassAd (options: CreateGamePassAdOptions): Promise { + createGamePassAd(options) { return this.request({ requiresAuth: true, request: { @@ -63,11 +39,9 @@ export default class AdsAPI extends BaseAPI { gamePassId: options.gamePassId } } - }) - .then(response => response.body as CreateGamePassAd); + }).then((response) => response.body); } - - createGroupAd (options: CreateGroupAdOptions): Promise { + createGroupAd(options) { return this.request({ requiresAuth: true, request: { @@ -81,7 +55,7 @@ export default class AdsAPI extends BaseAPI { groupId: options.groupId } } - }) - .then(response => response.body as CreateGroupAd); + }).then((response) => response.body); } } +exports.default = AdsAPI; diff --git a/dist/client/apis/AssetDeliveryAPI.d.ts b/dist/client/apis/AssetDeliveryAPI.d.ts new file mode 100644 index 000000000..8cacabc9e --- /dev/null +++ b/dist/client/apis/AssetDeliveryAPI.d.ts @@ -0,0 +1,104 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type AssetDeliveryBaseOptions = { + acceptEncoding: string; + robloxPlaceId: number; + assetType: string; + accept: string; + skipSigningScripts: boolean; + clientInsert: number; + scriptInsert: number; + modulePlaceId: number; + serverPlaceId: number; + expectedAssetType: string; +}; +export declare type AssetDeliveryBaseAsset = { + location?: string; + errors?: { + code: number; + message: string; + }[]; + requestId?: string; + isHashDynamic?: boolean; + isCopyrightProtected?: boolean; + isArchived?: boolean; +}; +export declare type AssetDeliveryBaseAssetRaw = { + Location?: string; + Errors?: { + Code: number; + Message: string; + }[]; + RequestId?: string; + IsHashDynamic?: boolean; + IsCopyrightProtected?: boolean; + IsArchived?: boolean; +}; +export declare type AssetDeliveryGetAssetByAliasOptions = AssetDeliveryBaseOptions & { + alias: string; +}; +export declare type AssetDeliveryGetAssetByAlias = AssetDeliveryBaseAsset; +export declare type AssetDeliveryGetAssetByIdOptions = AssetDeliveryBaseOptions & { + id: number; +}; +export declare type AssetDeliveryGetAssetById = { + location?: string; + request?: unknown; +}; +export declare type AssetDeliveryGetAssetByHashOptions = AssetDeliveryBaseOptions & { + hash: string; +}; +export declare type AssetDeliveryGetAssetByHash = unknown; +export declare type AssetDeliveryGetAssetByAssetIdOptions = AssetDeliveryBaseOptions & { + assetId: number; +}; +export declare type AssetDeliveryGetAssetByAssetId = unknown; +export declare type AssetDeliveryGetAssetVersionByAssetIdOptions = AssetDeliveryBaseOptions & { + assetId: number; + version: number; +}; +export declare type AssetDeliveryGetAssetVersionByAssetId = unknown; +export declare type AssetDeliveryGetAssetByAssetVersionIdOptions = AssetDeliveryBaseOptions & { + assetVersionId: number; +}; +export declare type AssetDeliveryGetAssetByAssetVersionId = unknown; +export declare type AssetDeliveryGetAssetByMarAssetHashOptions = AssetDeliveryBaseOptions & { + marAssetHash: string; + marCheckSum: string; +}; +export declare type AssetDeliveryGetAssetByMarAssetHash = unknown; +export declare type AssetDeliveryGetAssetByUserAssetIdOptions = AssetDeliveryBaseOptions & { + userAssetId: number; +}; +export declare type AssetDeliveryGetAssetByUserAssetId = unknown; +export declare type AssetDeliveryGetBatchAssetsOptions = { + assetName: string; + assetType: string; + clientInsert: boolean; + placeId: number; + requestId: string; + scriptInsert: boolean; + serverPlaceId: number; + universeId: number; + accept: string; + encoding: string; + hash: string; + userAssetId: number; + assetId: number; + version: number; + assetVersionId: number; + modulePlaceId: number; +}; +export declare type AssetDeliveryGetBatchAssets = AssetDeliveryBaseAsset[]; +export declare class AssetDeliveryAPI extends BaseAPI { + constructor(client: Client); + getAssetByAlias(options: AssetDeliveryGetAssetByAliasOptions): Promise; + getAssetById(options: AssetDeliveryGetAssetByIdOptions): Promise; + getAssetByHash(options: AssetDeliveryGetAssetByHashOptions): Promise; + getAssetByAssetId(options: AssetDeliveryGetAssetByAssetIdOptions): Promise; + getAssetVersionByAssetId(options: AssetDeliveryGetAssetVersionByAssetIdOptions): Promise; + getAssetByAssetVersionId(options: AssetDeliveryGetAssetByAssetVersionIdOptions): Promise; + getAssetByMarAssetHash(options: AssetDeliveryGetAssetByMarAssetHashOptions): Promise; + getAssetByUserAssetId(options: AssetDeliveryGetAssetByUserAssetIdOptions): Promise; + getBatchAssets(options: AssetDeliveryGetBatchAssetsOptions): Promise; +} diff --git a/dist/client/apis/AssetDeliveryAPI.js b/dist/client/apis/AssetDeliveryAPI.js new file mode 100644 index 000000000..5a7472a7b --- /dev/null +++ b/dist/client/apis/AssetDeliveryAPI.js @@ -0,0 +1,156 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AssetDeliveryAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +const convertToBaseAsset = (options) => ({ + errors: typeof options.Errors !== "undefined" + ? options.Errors.map((v) => ({ + message: v.Message, + code: v.Code + })) + : undefined, + isArchived: typeof options.IsArchived !== "undefined" ? options.IsArchived : undefined, + isCopyrightProtected: typeof options.IsCopyrightProtected !== "undefined" + ? options.IsCopyrightProtected + : undefined, + isHashDynamic: typeof options.IsHashDynamic !== "undefined" + ? options.IsHashDynamic + : undefined, + location: typeof options.Location !== "undefined" ? options.Location : undefined, + requestId: typeof options.RequestId !== "undefined" ? options.RequestId : undefined +}); +const generateBaseDeliveryAssetOptions = (options) => ({ + headers: { + "Accept-Encoding": options.acceptEncoding, + "Roblox-Place-Id": options.robloxPlaceId, + AssetType: options.assetType, + Accept: options.accept + }, + qs: { + skipSigningScripts: options.skipSigningScripts ? "true" : "false", + clientInsert: options.clientInsert, + scriptinsert: options.scriptInsert, + modulePlaceId: options.modulePlaceId, + serverplaceid: options.serverPlaceId, + expectedAssetType: options.expectedAssetType + } +}); +class AssetDeliveryAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + baseUrl: "https://assetdelivery.roblox.com/", + client + }); + } + getAssetByAlias(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/alias/${options.alias}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetById(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/asset`, + qs: Object.assign(Object.assign({}, generatedOptions.qs), { id: options.id }), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => ({ + location: response.body.Location || undefined, + request: response.body.Request + })); + } + getAssetByHash(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetHash/${options.hash}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetByAssetId(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetId/${options.assetId}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetVersionByAssetId(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetId/${options.assetId}/version/${options.version}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetByAssetVersionId(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetVersionId/${options.assetVersionId}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetByMarAssetHash(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/marAssetHash/${options.marAssetHash}/marCheckSum/${options.marCheckSum}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getAssetByUserAssetId(options) { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/userAssetId/${options.userAssetId}`, + qs: Object.assign({}, generatedOptions.qs), + headers: Object.assign({}, generatedOptions.headers) + } + }).then((response) => convertToBaseAsset(response.body)); + } + getBatchAssets(options) { + return this.request({ + requiresAuth: true, + json: true, + request: { + path: "v1/assets/bath", + method: "POST", + json: options + } + }).then((response) => response.body.map((value) => convertToBaseAsset(value))); + } +} +exports.AssetDeliveryAPI = AssetDeliveryAPI; diff --git a/dist/client/apis/AuthAPI.d.ts b/dist/client/apis/AuthAPI.d.ts new file mode 100644 index 000000000..2e15fb159 --- /dev/null +++ b/dist/client/apis/AuthAPI.d.ts @@ -0,0 +1,241 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { UsernamePasswordOption } from "../../types/GenericOptionTypes"; +export declare type AuthPin = { + pin: string; +}; +export declare type AuthUnlockPinOptions = AuthPin; +export declare type AuthUnlockPin = { + unlockedUntil: number; +}; +export declare type AuthLockPin = { + success: boolean; +}; +export declare type AuthMetaData = { + isUpdateUsernameEnabled: boolean; + ftuxAvatarAssetMap: string; + isEmailUpsellAtLogoutEnabled: boolean; + shouldFetchEmailUpsellIXPValuesAtLogout: boolean; + isAccountRecoveryPromptEnabled: boolean; + isContactMethodRequiredAtSignup: boolean; + isUserAgreementsSignupIntegrationEnabled: boolean; + isRetypePasswordRequired: boolean; + arePasswordFieldsPlaintext: boolean; + isKoreaIdVerificationEnabled: boolean; + isSignupButtonGreenColorEnabled: boolean; +}; +export declare type AuthTicket = { + authTicket: string; +}; +export declare type AuthEndpointMetaData = { + cookieLawNoticeTimeout: number; +}; +export declare type AuthLoginOptions = { + ctype: "Email" | "Username" | string; + cvalue: string; + password: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export declare type AuthLogin = { + user: { + id: number; + name: string; + displayName: string; + }; + twoStepVerificationData?: { + mediaType: "Email" | string; + ticket: string; + }; +}; +export declare type AuthCredentialsVerificationOptions = { + credentialType: "Email" | "Username" | "PhoneNumber"; + credentialValue: string; + password: string; +}; +export declare type AuthGetCredentialsVerificationStatus = { + canSend: boolean; +}; +export declare type AuthGetCurrentPasswordStatus = { + valid: boolean; +}; +export declare type AuthGetPasswordResetMetaDataOptions = { + targetType: "Email" | "PhoneNumber"; + ticket: string; +}; +export declare type AuthGetPasswordResetMetaData = { + users: { + userId: number; + username: string; + displayName: string; + }[]; +}; +export declare type AuthResetPasswordOptions = { + targetType: "Email" | "PhoneNumber"; + ticket: string; + userId: number; + password: string; + passwordRepeated: string; +}; +export declare type AuthValidatePassword = { + code: string; + message: string; +}; +export declare type AuthSendPasswordResetOptions = { + targetType: AuthResetPasswordOptions["targetType"]; + target: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export declare type AuthSendPasswordReset = { + nonce: string; + transmissionType: string; +}; +export declare type AuthVerifyPasswordResetOptions = { + targetType: AuthResetPasswordOptions["targetType"]; + nonce: string; + code: string; +}; +export declare type AuthVerifyPasswordReset = { + userTickets: { + user: { + userId: number; + username: string; + displayName: string; + }; + ticket: string; + }[]; +}; +export declare type AuthChangeUserPasswordOptions = { + currentPassword: string; + newPassword: string; +}; +export declare type AuthGetRecoveryMetaData = { + isOnPhone: boolean; + codeLength: number; + isPhoneFeatureEnabledForUsername: boolean; + isPhoneFeatureEnabledForPassword: boolean; + isBedev2CaptchaEnabledForPasswordReset: boolean; +}; +export declare type AuthRevertAccountInfoOptions = { + ticket: string; +}; +export declare type AuthRevertAccountInfo = { + isTwoStepVerificationEnabled: boolean; + isEmailVerified: boolean; + isEmailChanged: boolean; + userId: number; + username: string; + ticket: string; +}; +export declare type AuthRevertAccountOptions = { + userId: number; + newPassword: string; + ticket: string; +}; +export declare type AuthGetSAMLMetaData = unknown; +export declare type AuthSAMLRequest = unknown; +export declare type AuthGetTwoStepVerificationMetaData = { + codeLength: number; + loadingImageUrl: string; + supportUrl: string; +}; +export declare type AuthResendTwoStepVerificationOptions = { + username: string; + ticket: string; + actionType: string; +}; +export declare type AuthTwoStepVerification = { + mediaType: "Email" | "PhoneNumber" | string; + ticket: string; +}; +export declare type AuthVerifyTwoStepVerificationOptions = { + username: string; + ticket: string; + code: string; + rememberDevice: boolean; + actionType: string; +}; +export declare type AuthVerifyTwoStepVerification = unknown; +export declare type AuthGetExistingUsernamesOptions = { + username: string; +}; +export declare type AuthGetExistingUsernames = { + usernames: string[]; +}; +export declare type AuthValidateUsernameOptions = { + username: string; + birthday: string; + context: "Unknown" | "Signup" | "UsernameChange" | string; +}; +export declare type AuthValidateUsername = { + code: string; + message: string; +}; +export declare type AuthRecoverUsernamesOptions = { + targetType: "Email" | string; + target: string; +}; +export declare type AuthRecoverUsernames = { + transmissionType: string; +}; +export declare type AuthSignUpOptions = { + username: string; + password: string; + gender: "Unknown" | string; + birthday: string; + isTosAgreementBoxChecked: boolean; + email: string; + locale: string; + assetIds: number[]; + bodyColorId: number; + bodyTypeScale: number; + headScale: number; + heightScale: number; + widthScale: number; + proportionScale: number; + captchaToken: string; + captchaProvider: string; +}; +export declare type AuthSignUp = { + userId: number; + starterPlaceId: number; +}; +export declare type AuthChangeUsernameOptions = { + username: string; + password: string; +}; +export declare type AuthChangeUsername = unknown; +export declare type AuthChangeUserPassword = unknown; +export declare type AuthResetPassword = AuthLogin & { + identityVerificationLoginTicket: string; + isBanned: boolean; +}; +export declare type AuthRevertAccount = AuthResetPassword; +export declare class AuthAPI extends BaseAPI { + constructor(client: Client); + unlockPin(options: AuthUnlockPinOptions): Promise; + lockPin(): Promise; + getAuthTicket(): Promise; + getMetaData(): Promise; + getCurrentUserPasswordStatus(): Promise; + getPasswordResetMetaData(options: AuthGetPasswordResetMetaDataOptions): Promise; + resetPassword(options: AuthResetPasswordOptions): Promise; + validatePassword(options: UsernamePasswordOption): Promise; + sendPasswordReset(options: AuthSendPasswordResetOptions): Promise; + verifyPasswordReset(options: AuthVerifyPasswordResetOptions): Promise; + changeUserPassword(options: AuthChangeUserPasswordOptions): Promise; + getRecoveryMetaData(): Promise; + getRevertAccountInfo(options: AuthRevertAccountInfoOptions): Promise; + revertAccount(options: AuthRevertAccountOptions): Promise; + getSAMLMetaData(): Promise; + samlAuthenticate(): Promise; + getTwoStepVerificationMetaData(): Promise; + resendTwoStepVerificationCode(options: AuthResendTwoStepVerificationOptions): Promise; + verifyTwoStepVerificationCode(options: AuthVerifyTwoStepVerificationOptions): Promise; + getExistingUsernames(options: AuthGetExistingUsernamesOptions): Promise; + validateUsername(options: AuthValidateUsernameOptions): Promise; + recoverUsernames(options: AuthRecoverUsernamesOptions): Promise; + signUp(options: AuthSignUpOptions): Promise; + changeUserUsername(options: AuthChangeUsernameOptions): Promise; +} diff --git a/dist/client/apis/AuthAPI.js b/dist/client/apis/AuthAPI.js new file mode 100644 index 000000000..c3a68c347 --- /dev/null +++ b/dist/client/apis/AuthAPI.js @@ -0,0 +1,290 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class AuthAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://auth.roblox.com/" + }); + } + unlockPin(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/pin/unlock", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + lockPin() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/pin/lock", + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getAuthTicket() { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v1/authentication-ticket", + method: "POST", + headers: { + referer: "https://www.roblox.com/", + origin: "roblox.com" + } + } + }).then((response) => ({ + authTicket: response.headers["rbx-authentication-ticket"] + })); + } + getMetaData() { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/metadata" + } + }).then((response) => ({ + isUpdateUsernameEnabled: response.body.isUpdateUsernameEnabled, + ftuxAvatarAssetMap: response.body.ftuxAvatarAssetMap, + isEmailUpsellAtLogoutEnabled: response.body.IsEmailUpsellAtLogoutEnabled, + shouldFetchEmailUpsellIXPValuesAtLogout: response.body.ShouldFetchEmailUpsellIXPValuesAtLogout, + isAccountRecoveryPromptEnabled: response.body.IsAccountRecoveryPromptEnabled, + isContactMethodRequiredAtSignup: response.body.IsContactMethodRequiredAtSignup, + isUserAgreementsSignupIntegrationEnabled: response.body.IsUserAgreementsSignupIntegrationEnabled, + isRetypePasswordRequired: response.body.IsRetypePasswordRequired, + arePasswordFieldsPlaintext: response.body.ArePasswordFieldsPlaintext, + isKoreaIdVerificationEnabled: response.body.IsKoreaIdVerificationEnabled, + isSignupButtonGreenColorEnabled: response.body.IsSignupButtonGreenColorEnabled + })); + } + getCurrentUserPasswordStatus() { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/passwords/current-status" + } + }).then((response) => response.body); + } + getPasswordResetMetaData(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset", + qs: { + "request.targetType": options.targetType, + "request.ticket": options.ticket + } + } + }).then((response) => response.body); + } + resetPassword(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset", + method: "POST", + json: options + } + }).then((response) => response.body); + } + validatePassword(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/validate", + qs: { + "request.username": options.username, + "request.password": options.password + } + } + }).then((response) => response.body); + } + sendPasswordReset(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset/send", + method: "POST", + json: options + } + }).then((response) => response.body); + } + verifyPasswordReset(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset/verify", + method: "POST", + json: options + } + }).then((response) => response.body); + } + changeUserPassword(options) { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/user/passwords/change", + method: "POST", + json: options + } + }).then((response) => response.body); + } + getRecoveryMetaData() { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/recovery/metadata" + } + }).then((response) => response.body); + } + getRevertAccountInfo(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/revert/account", + qs: { + ticket: options.ticket + } + } + }).then((response) => response.body); + } + revertAccount(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/revert/account", + method: "POST", + json: options + } + }).then((response) => response.body); + } + getSAMLMetaData() { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/saml/metadata" + } + }).then((response) => response.body); + } + samlAuthenticate() { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/saml/login", + method: "POST" + } + }).then((response) => response.body); + } + getTwoStepVerificationMetaData() { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata" + } + }).then((response) => response.body); + } + resendTwoStepVerificationCode(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/resend", + method: "POST", + json: options + } + }).then((response) => response.body); + } + verifyTwoStepVerificationCode(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/verify", + method: "POST", + json: options + } + }).then((response) => response.body); + } + getExistingUsernames(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/usernames", + qs: { + username: options.username + } + } + }).then((response) => response.body); + } + validateUsername(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/usernames/validate", + qs: { + "request.username": options.username, + "request.birthday": options.birthday, + "request.context": options.context + } + } + }).then((response) => response.body); + } + recoverUsernames(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata", + json: options + } + }).then((response) => response.body); + } + signUp(options) { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata", + method: "POST", + json: options + } + }).then((response) => response.body); + } + changeUserUsername(options) { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/username", + method: "POST", + json: options + } + }).then((response) => response.body); + } +} +exports.AuthAPI = AuthAPI; diff --git a/dist/client/apis/AvatarAPI.d.ts b/dist/client/apis/AvatarAPI.d.ts new file mode 100644 index 000000000..0d536fcaa --- /dev/null +++ b/dist/client/apis/AvatarAPI.d.ts @@ -0,0 +1,190 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import type { AssetIdOption, AssetIdsOption, SuccessResponse, UserIdOption } from "../.."; +export declare type AvatarBodyScales = { + height: number; + width: number; + head: number; + depth: number; + proportion: number; + bodyType: number; +}; +export declare type AvatarBodyColors = { + headColorId: number; + torsoColorId: number; + rightArmColorId: number; + leftArmColorId: number; + rightLegColorId: number; + leftLegColorId: number; +}; +export declare type AvatarScale = { + min: number; + max: number; + increment: number; +}; +export declare type AvatarColorPalette = { + brickColorId: number; + hexColor: string; + name: string; +}; +export declare type AvatarUserAvatar = { + scales: AvatarBodyScales; + playerAvatarType: "R6" | "R15" | string; + bodyColors: AvatarBodyColors; + assets: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + defaultShirtApplied: boolean; + defaultPantsApplied: boolean; + emotes: { + assetId: number; + assetName: string; + position: number; + }[]; +}; +export declare type AvatarGetMetaData = { + enableDefaultClothingMessage: boolean; + isAvatarScaleEmbeddedInTab: boolean; + isBodyTypeScaleOutOfTab: boolean; + scaleHeightIncrement: number; + scaleWidthIncrement: number; + scaleHeadIncrement: number; + scaleProportionIncrement: number; + scaleBodyTypeIncrement: number; + supportProportionAndBodyType: boolean; + showDefaultClothingMessageOnPageLoad: boolean; + areThreeDeeThumbsEnabled: boolean; +}; +export declare type AvatarGetRules = { + playerAvatarTypes: ("R6" | "R15" | string)[]; + scales: { + height: AvatarScale; + width: AvatarScale; + head: AvatarScale; + bodyType: AvatarScale; + }; + wearableAssetTypes: { + maxNumber: number; + id: number; + name: string; + }[]; + bodyColorsPalette: AvatarColorPalette[]; + basicBodyColorsPalette: AvatarColorPalette[]; + minimumDeltaEBodyColorDifference: number; + proportionsAndBodyTypeEnabledForUser: boolean; + defaultClothingAssetLists: { + defaultShirtAssetIds: number[]; + defaultPantAssetIds: number[]; + }; + bundlesEnabledForUser: boolean; + emotesEnabledForUser: boolean; +}; +export declare type AvatarGetUserOutfits = { + filteredCount: number; + data: { + id: number; + name: string; + isEditable: boolean; + }[]; + total: number; +}; +export declare type AvatarRedrawThumbnail = unknown; +export declare type AvatarSetPlayerAvatarWearingAssets = { + invalidAssets?: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + invalidAssetIds?: number[]; + success: boolean; +}; +export declare type AvatarGetOutfit = { + id: number; + name: string; + assets: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + bodyColors: AvatarBodyColors; + scale: { + height: number; + width: number; + head: number; + depth: number; + proportion: number; + bodyType: number; + }; + playerAvatarType: string; + isEditable: boolean; +}; +export declare type AvatarWearOutfit = AvatarSetPlayerAvatarWearingAssets; +export declare type AvatarGetRecentItems = { + data: { + id: number; + name: string; + type: string; + assetType: { + id: number; + name: string; + }; + isEditable: boolean; + }[]; + total: number; +}; +export declare type AvatarGetUserOutfitsOptions = { + userId: number; + page?: number; + itemsPerPage?: number; + isEditable?: boolean; +}; +export declare type AvatarSetSelfAvatarBodyColorsOptions = AvatarBodyColors; +export declare type AvatarSetSelfAvatarTypeOptions = { + playerAvatarType: "R6" | "R15"; +}; +export declare type AvatarSetSelfAvatarScalesOptions = AvatarBodyScales; +export declare type AvatarGetOutfitOptions = { + userOutfitId: number; +}; +export declare type AvatarDeleteOutfitOptions = AvatarGetOutfitOptions; +export declare type AvatarUpdateOutfitOptions = Omit; +export declare type AvatarWearOutfitOptions = { + userOutfitId: number; +}; +export declare type AvatarCreateOutfitOptions = AvatarUpdateOutfitOptions; +export declare type AvatarGetRecentlyUsedOptions = { + recentItemListType: string; +}; +export declare class AvatarAPI extends BaseAPI { + constructor(client: Client); + getSelfAvatar(): Promise; + getAvatarMetaData(): Promise; + getAvatarRules(): Promise; + getUserAvatar(options: UserIdOption): Promise; + getUserCurrentlyWearing(options: UserIdOption): Promise; + getUserOutfits(options: AvatarGetUserOutfitsOptions): Promise; + removeAssetFromAvatar(options: AssetIdOption): Promise; + wearAssetOnAvatar(options: AssetIdOption): Promise; + redrawThumbnail(): Promise; + setSelfAvatarBodyColors(options: AvatarSetSelfAvatarBodyColorsOptions): Promise; + setSelfAvatarType(options: AvatarSetSelfAvatarTypeOptions): Promise; + setSelfAvatarScales(options: AvatarSetSelfAvatarScalesOptions): Promise; + setSelfWearingAssets(options: AssetIdsOption): Promise; + getOutfit(options: AvatarGetOutfitOptions): Promise; + deleteOutfit(options: AvatarDeleteOutfitOptions): Promise; + updateOutfit(options: AvatarUpdateOutfitOptions): Promise; + wearOutfit(options: AvatarWearOutfitOptions): Promise; + createOutfit(options: AvatarCreateOutfitOptions): Promise; + getRecentlyUsed(options: AvatarGetRecentlyUsedOptions): Promise; +} diff --git a/dist/client/apis/AvatarAPI.js b/dist/client/apis/AvatarAPI.js new file mode 100644 index 000000000..d47bf65c7 --- /dev/null +++ b/dist/client/apis/AvatarAPI.js @@ -0,0 +1,201 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AvatarAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class AvatarAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://avatar.roblox.com/" + }); + } + getSelfAvatar() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar" + }, + json: true + }).then((response) => response.body); + } + getAvatarMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: "v1/avatar/metadata" + }, + json: true + }).then((response) => response.body); + } + getAvatarRules() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar-rules" + }, + json: true + }).then((response) => response.body); + } + getUserAvatar(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/avatar` + }, + json: true + }).then((response) => response.body); + } + getUserCurrentlyWearing(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/currently-wearing` + }, + json: true + }).then((response) => response.body); + } + getUserOutfits(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/outfits` + }, + json: true + }).then((response) => response.body); + } + removeAssetFromAvatar(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/avatar/assets/${options.assetId}/remove`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + wearAssetOnAvatar(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/avatar/assets/${options.assetId}/wear`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + redrawThumbnail() { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/redraw-thumbnail", + method: "POST" + }, + json: true + }).then((response) => response.body); + } + setSelfAvatarBodyColors(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-body-colors", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setSelfAvatarType(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-player-avatar-type", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setSelfAvatarScales(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-scales", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setSelfWearingAssets(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-swearing-assets", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getOutfit(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/details` + }, + json: true + }).then((response) => response.body); + } + deleteOutfit(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/delete`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + updateOutfit(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.id}/update`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + wearOutfit(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/wear`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + createOutfit(options) { + return this.request({ + requiresAuth: true, + request: { + path: "v1/outfits/create", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getRecentlyUsed(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/recent-items/${options.recentItemListType}/list` + }, + json: true + }).then((response) => response.body); + } +} +exports.AvatarAPI = AvatarAPI; diff --git a/dist/client/apis/BadgesAPI.d.ts b/dist/client/apis/BadgesAPI.d.ts new file mode 100644 index 000000000..1aa4c5153 --- /dev/null +++ b/dist/client/apis/BadgesAPI.d.ts @@ -0,0 +1,81 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { SortOption } from "../.."; +export declare type BadgesMetaData = { + badgeCreationPrice: number; + maxBadgeNameLength: number; + maxBadgeDescriptionLength: number; +}; +export declare type BadgesGetBadge = { + id: number; + name: string; + description: string; + displayName: string; + displayDescription: string; + enabled: boolean; + iconImageId: number; + displayIconImageId: number; + created: string; + updated: string; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: { + id: number; + name: string; + rootPlaceId: number; + }; +}; +export declare type BadgesUpdateBadge = unknown; +export declare type BadgesGetBadges = { + previousPageCursor: string; + nextPageCursor: string; + data: BadgesGetBadge[]; +}; +export declare type BadgesGetUserBadgesAwardedDates = { + data: { + badgeId: number; + awardedDate: string; + }[]; +}; +export declare type BadgesDeleteBadgeFromUser = unknown; +export declare type BadgesDeleteBadgeFromSelf = BadgesDeleteBadgeFromUser; +export declare type BadgesGetBadgeOptions = { + badgeId: number; +}; +export declare type BadgesUpdateBadgeOptions = { + id: number; + name: string; + description: string; + enabled: boolean; +}; +export declare type BadgesGetUniverseBadgesOptions = { + universeId: number; +} & SortOption; +export declare type BadgesGetUserBadgesOptions = { + userId: number; +} & SortOption; +export declare type BadgesGetUserBadgesAwardedDatesOptions = { + userId: number; + badgeIds: number[]; +}; +export declare type BadgesDeleteBadgeFromUserOptions = { + userId: number; + badgeId: number; +}; +export declare type BadgesDeleteBadgeFromSelfOptions = { + badgeId: number; +}; +export declare class BadgesAPI extends BaseAPI { + constructor(client: Client); + getMetaData(): Promise; + getBadge(options: BadgesGetBadgeOptions): Promise; + updateBadge(options: BadgesUpdateBadgeOptions): Promise; + getUniverseBadges(options: BadgesGetUniverseBadgesOptions): Promise; + getUserBadges(options: BadgesGetUserBadgesOptions): Promise; + getUserBadgesAwardedDates(options: BadgesGetUserBadgesAwardedDatesOptions): Promise; + deleteBadgeFromUser(options: BadgesDeleteBadgeFromUserOptions): Promise; + deleteBadgeFromSelf(options: BadgesDeleteBadgeFromSelfOptions): Promise; +} diff --git a/dist/client/apis/BadgesAPI.js b/dist/client/apis/BadgesAPI.js new file mode 100644 index 000000000..b9d65c241 --- /dev/null +++ b/dist/client/apis/BadgesAPI.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BadgesAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class BadgesAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://badges.roblox.com/" + }); + } + getMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: "v1/badges/metadata" + }, + json: true + }).then((response) => response.body); + } + getBadge(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.badgeId}` + }, + json: true + }).then((response) => response.body); + } + updateBadge(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.id}`, + method: "PATCH" + }, + json: true + }).then((response) => response.body); + } + getUniverseBadges(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/badges`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserBadges(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/badges`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserBadgesAwardedDates(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/badges/awarded-dates`, + qs: { + badgeIds: options.badgeIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + deleteBadgeFromUser(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/${options.userId}/badges/${options.badgeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + deleteBadgeFromSelf(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/badges/${options.badgeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } +} +exports.BadgesAPI = BadgesAPI; diff --git a/dist/client/apis/BaseAPI.d.ts b/dist/client/apis/BaseAPI.d.ts new file mode 100644 index 000000000..97a5518f0 --- /dev/null +++ b/dist/client/apis/BaseAPI.d.ts @@ -0,0 +1,26 @@ +import { BaseAPIOptions } from "../../interfaces/APIInterfaces"; +import { RESTRequestOptions, RESTResponseDataType } from "../../interfaces/RESTInterfaces"; +import { Client } from "../Client"; +export declare type BaseAPIRequestOptions = { + /** + * The request options + */ + request: Omit & { + url?: string; + path?: string; + }; + /** + * If the client must be authenticated in order to send the request + */ + requiresAuth: boolean; + /** + * If the response body is JSON + */ + json?: boolean; +}; +export declare class BaseAPI { + client: Client; + options: BaseAPIOptions; + constructor(options: BaseAPIOptions); + request(options: BaseAPIRequestOptions): Promise; +} diff --git a/dist/client/apis/BaseAPI.js b/dist/client/apis/BaseAPI.js new file mode 100644 index 000000000..49ceb1e2c --- /dev/null +++ b/dist/client/apis/BaseAPI.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseAPI = void 0; +class BaseAPI { + constructor(options) { + this.client = options.client; + this.options = options; + } + request(options) { + if (options.requiresAuth) { + if (!this.options.client.isLoggedIn()) { + throw new Error(`You must be authenticated in order to perform this request! API: ${(options.request.method || "GET").toUpperCase()} ${options.request.path ? this.options.baseUrl : ""}${options.request.path || options.request.url}`); + } + } + if (!options.request.url && !options.request.path) { + throw new Error(`Must provide a URL or path!`); + } + else if (options.request.path) { + options.request.url = this.options.baseUrl + options.request.path; + delete options.request.path; + } + return this.options.client.rest + .request(options.request) + .then((response) => { + if (options.json && !(response.body instanceof Object)) { + response.body = JSON.parse(response.body); + } + return response; + }); + } +} +exports.BaseAPI = BaseAPI; diff --git a/dist/client/apis/BillingAPI.d.ts b/dist/client/apis/BillingAPI.d.ts new file mode 100644 index 000000000..53e0b0daa --- /dev/null +++ b/dist/client/apis/BillingAPI.d.ts @@ -0,0 +1,166 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { SortOption } from "../.."; +export declare type BillingGetDeveloperExchangeRate = { + rate: number; + "currency-code": string; +}; +export declare type BillingSubmitDeveloperExchange = unknown; +export declare type BillingGetLuobuDeveloperExchangeBalance = { + amount: number; +}; +export declare type BillingGetLuobuDeveloperExchangeEligibility = { + eligibility?: "Eligible" | string; + errors?: { + code: number; + message: string; + userFacingMessage: string; + }; +}; +export declare type BillingGetLatestLuobuDeveloperExchangeStatus = { + date?: string; + status?: string; + amount?: number; +}; +export declare type BillingSubmitLuobuDeveloperExchange = unknown; +export declare type BillingGetUserPaymentsHistory = { + previousPageCursor: string; + nextPageCursor: string; + data: { + paymentDate: string; + products: { + name: string; + }[]; + money: { + Amount: number; + USDAmount: number; + Currency: { + Id: number; + CurrencyType: string; + CurrencyName: string; + CurrencySymbol: string; + }; + }; + paymentProviderType: "AppleAppStore"; + creditCardType: string; + cardNumber: string; + }; +}; +export declare type BillingPurchaseAmazonProduct = unknown; +export declare type BillingValidateAmazonProduct = unknown; +export declare type BillingPurchaseAppleProduct = BillingPurchaseAmazonProduct; +export declare type BillingValidateAppleProduct = BillingValidateAmazonProduct; +export declare type BillingRedeemDigitalCode = unknown; +export declare type BillingRedeemGameCard = { + balance: string; + successMsg: string; + successSubText: string; + bonusMsg: string; + error: string; + errorMsg: string; +}; +export declare type BillingReverseGameCard = unknown; +export declare type BillingPurchaseGoogleProduct = unknown; +export declare type BillingValidateGoogleProduct = BillingValidateAmazonProduct; +export declare type BillingSendXsollaWebhook = unknown; +export declare type BillingGetXsollaIFrameToken = { + token: string; + success: boolean; + message: string; +}; +export declare type BillingIncrementCounterByAgent = unknown; +export declare type BillingRedeemPromoCode = { + success: boolean; + errorMsg: string; + successMsg: string; +}; +export declare type BillingSubmitDeveloperExchangeOptions = { + firstName: string; + lastName: string; + emailAddress: string; + password: string; + robuxAmount: number; +}; +export declare type BillingSubmitLuobuDeveloperExchangeOptions = { + firstName: string; + lastName: string; + email: string; + amount: number; +}; +export declare type BillingGetUserPaymentsHistoryOptions = SortOption; +export declare type BillingPurchaseAmazonProductOptions = { + receiptId: string; + amazonUserId: string; + isRetry: boolean; +}; +export declare type BillingValidateAmazonProductOptions = { + productId: string; + currency: string; +}; +export declare type BillingPurchaseAppleProductOptions = { + receiptId: string; + appleUserId: string; + isRetry: boolean; +}; +export declare type BillingValidateAppleProductOptions = { + productId: string; + currency: string; +}; +export declare type BillingRedeemDigitalCodeOptions = { + redemptionCode: string; +}; +export declare type BillingRedeemGameCardOptions = { + pinCode: string; + captchaToken: string; + captchaProvider: string; +}; +export declare type BillingReverseGameCardOptions = { + PinCode: number; + UserId: number; +}; +export declare type BillingPurchaseGoogleProductOptions = { + packageName: string; + productId: string; + token: string; + isRetry: boolean; + orderId: string; +}; +export declare type BillingValidateGoogleProductOptions = { + productId: string; + currency: string; +}; +export declare type BillingGetXsollaIFrameTokenOptions = { + mainProductId: number; + upsellProductId: number; + paymentProviderType: string; + verifiedEmailOrPhone: boolean; +}; +export declare type BillingIncrementCounterByAgentOptions = { + counterPrefix: string; +}; +export declare type BillingRedeemPromoCodeOptions = { + code: string; +}; +export declare class BillingAPI extends BaseAPI { + constructor(client: Client); + getDeveloperExchangeRate(): Promise; + submitDeveloperExchange(options: BillingSubmitDeveloperExchangeOptions): Promise; + getLuobuDeveloperExchangeBalance(): Promise; + getLuobuDeveloperExchangeEligibility(): Promise; + getLuobuDeveloperExchangeLatestRequestStatus(): Promise; + submitLuobuDeveloperExchange(options: BillingSubmitLuobuDeveloperExchangeOptions): Promise; + getUserPaymentsHistory(options: BillingGetUserPaymentsHistoryOptions): Promise; + purchaseAmazonProduct(options: BillingPurchaseAmazonProductOptions): Promise; + validateAmazonProduct(options: BillingValidateAmazonProductOptions): Promise; + purchaseAppleProduct(options: BillingPurchaseAppleProductOptions): Promise; + validateAppleProduct(options: BillingValidateAppleProductOptions): Promise; + redeemDigitalCode(options: BillingRedeemDigitalCodeOptions): Promise; + redeemGameCard(options: BillingRedeemGameCardOptions): Promise; + reverseGameCard(options: BillingReverseGameCardOptions): Promise; + purchaseGoogleProduct(options: BillingPurchaseGoogleProductOptions): Promise; + validateGoogleProduct(options: BillingValidateGoogleProductOptions): Promise; + sendXsollaWebhook(options: unknown): Promise; + getXsollaIFrameToken(options: BillingGetXsollaIFrameTokenOptions): Promise; + incrementCounterByAgent(options: BillingIncrementCounterByAgentOptions): Promise; + redeemPromoCode(options: BillingRedeemPromoCodeOptions): Promise; +} diff --git a/dist/client/apis/BillingAPI.js b/dist/client/apis/BillingAPI.js new file mode 100644 index 000000000..f149aacd4 --- /dev/null +++ b/dist/client/apis/BillingAPI.js @@ -0,0 +1,224 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BillingAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class BillingAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://billing.roblox.com/" + }); + } + getDeveloperExchangeRate() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-exchange-rate` + }, + json: true + }).then((response) => response.body); + } + submitDeveloperExchange(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange-rate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getLuobuDeveloperExchangeBalance() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/balance` + }, + json: true + }).then((response) => response.body); + } + getLuobuDeveloperExchangeEligibility() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/eligibility` + }, + json: true + }).then((response) => response.body); + } + getLuobuDeveloperExchangeLatestRequestStatus() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/latest-request-status` + }, + json: true + }).then((response) => response.body); + } + submitLuobuDeveloperExchange(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-exchange-rate/request`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getUserPaymentsHistory(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/payments`, + qs: options + }, + json: true + }).then((response) => response.body); + } + purchaseAmazonProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/amazon/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + validateAmazonProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/amazon/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + purchaseAppleProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/apple/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + validateAppleProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/apple/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + redeemDigitalCode(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/digital-codes/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + redeemGameCard(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gamecard/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + reverseGameCard(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gamecard/reverse`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + purchaseGoogleProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/google/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + validateGoogleProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/google/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + sendXsollaWebhook(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/notifications/xsolla`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getXsollaIFrameToken(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/payments/xsolla/iframe-token`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + incrementCounterByAgent(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/payments/xsolla/incrementcounterbyagent`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + redeemPromoCode(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/promocodes/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.BillingAPI = BillingAPI; diff --git a/dist/client/apis/CaptchaAPI.d.ts b/dist/client/apis/CaptchaAPI.d.ts new file mode 100644 index 000000000..5db41bd5c --- /dev/null +++ b/dist/client/apis/CaptchaAPI.d.ts @@ -0,0 +1,16 @@ +import BaseAPI from "./BaseAPI"; +import Client from "../Client"; +export declare type GetCaptchaMetadata = { + funCaptchaPublicKeys: { + type: string; + value: string; + }[]; +}; +export declare type GetLanguageResources = { + languageResources: unknown; +}; +export default class CaptchaAPI extends BaseAPI { + constructor(client: Client); + getCaptchaMetaData(): Promise; + getLanguageResources(): Promise; +} diff --git a/src/client/apis/CaptchaAPI.ts b/dist/client/apis/CaptchaAPI.js similarity index 55% rename from src/client/apis/CaptchaAPI.ts rename to dist/client/apis/CaptchaAPI.js index 230ec0abe..f4d39f2bb 100644 --- a/src/client/apis/CaptchaAPI.ts +++ b/dist/client/apis/CaptchaAPI.js @@ -1,27 +1,15 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; - - -export type GetCaptchaMetadata = { - funCaptchaPublicKeys: { - type: string; - value: string; - }[]; -} -export type GetLanguageResources = { - languageResources: unknown; -} - - -export default class CaptchaAPI extends BaseAPI { - constructor (client: Client) { +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +const BaseAPI_1 = (0, tslib_1.__importDefault)(require("./BaseAPI")); +class CaptchaAPI extends BaseAPI_1.default { + constructor(client) { super({ client, baseUrl: "https://captcha.roblox.com/" }); } - - getCaptchaMetaData (): Promise { + getCaptchaMetaData() { return this.request({ requiresAuth: false, request: { @@ -31,8 +19,7 @@ export default class CaptchaAPI extends BaseAPI { }) .then(response => response.body); } - - getLanguageResources (): Promise { + getLanguageResources() { return this.request({ requiresAuth: false, request: { @@ -43,3 +30,4 @@ export default class CaptchaAPI extends BaseAPI { .then(response => response.body); } } +exports.default = CaptchaAPI; diff --git a/dist/client/apis/CatalogAPI.d.ts b/dist/client/apis/CatalogAPI.d.ts new file mode 100644 index 000000000..ec19dd37c --- /dev/null +++ b/dist/client/apis/CatalogAPI.d.ts @@ -0,0 +1,122 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { AssetIdOption, SortOption, UserIdOption } from "../.."; +export declare type CatalogProductDetails = { + id: number; + type: string; + isPublicDomain: boolean; + isForSale: boolean; + priceInRobux: number; + premiumPricing: { + premiumDiscountPercentage: number; + premiumPriceInRobux: number; + }; +}; +export declare type CatalogGetAssetBundles = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creator: { + id: number; + name: string; + type: string; + }; + creatorType: number; + product: CatalogProductDetails; + }[]; +}; +export declare type CatalogGetBundleDetails = CatalogGetAssetBundles["data"][0]; +export declare type CatalogGetBundleRecommendationsByBundleId = { + data: CatalogGetAssetBundles["data"]; +}; +export declare type CatalogGetMultiBundleDetails = CatalogGetAssetBundles["data"]; +export declare type CatalogUnpackBundle = unknown; +export declare type CatalogGetAssetToCategory = Record; +export declare type CatalogGetAppStoreExclusiveBundles = { + data: CatalogProductDetails[]; +}; +export declare type CatalogGetAssetFavoriteCountOptions = { + assetId: number; +}; +export declare type CatalogGetFavoriteCount = number; +export declare type CatalogRemoveSelfAssetFavorite = unknown; +export declare type CatalogGetUserFavoriteAsset = { + assetId: number; + userId: number; + created: string; +}; +export declare type CatalogFavoriteAsset = unknown; +export declare type CatalogRemoveFavoriteBundle = unknown; +export declare type CatalogGetSelfFavoriteBundle = { + bundleId: number; + userId: number; + created: string; +}; +export declare type CatalogFavoriteBundle = unknown; +export declare type CatalogGetAssetBundlesOptions = SortOption & AssetIdOption; +export declare type CatalogGetBundleDetailsOptions = { + bundleId: number; +}; +export declare type CatalogGetBundleRecommendationsByBundleIdOptions = { + bundleId: number; + numItems?: number; +}; +export declare type CatalogGetMultiBundleDetailsOptions = { + bundleIds: number[]; +}; +export declare type CatalogGetUserBundlesOptions = SortOption & UserIdOption; +export declare type CatalogGetUserBundlesByTypeOptions = CatalogGetUserBundlesOptions & { + bundleType: string; +}; +export declare type CatalogUnpackBundleOptions = { + bundleId: number; +}; +export declare type CatalogGetAppStoreExclusiveBundlesOptions = { + appStoreType: "iOS" | "GooglePlay" | "Xbox" | "Amazon"; +}; +export declare type CatalogGetBundleFavoriteCount = CatalogUnpackBundleOptions; +export declare type CatalogRemoveAssetFavoriteOptions = AssetIdOption & UserIdOption; +export declare type CatalogGetUserFavoriteAssetOptions = AssetIdOption & UserIdOption; +export declare type CatalogFavoriteAssetOptions = AssetIdOption & UserIdOption; +export declare type CatalogRemoveBundleFavoriteOptions = UserIdOption & { + bundleId: number; +}; +export declare type CatalogGetUserFavoriteBundleOptions = UserIdOption & { + bundleId: number; +}; +export declare type CatalogFavoriteBundleOptions = UserIdOption & { + bundleId: number; +}; +export declare class CatalogAPI extends BaseAPI { + constructor(client: Client); + getAssetBundles(options: CatalogGetAssetBundlesOptions): Promise; + getBundleDetails(options: CatalogGetBundleDetailsOptions): Promise; + getBundleRecommendationsByBundleId(options: CatalogGetBundleRecommendationsByBundleIdOptions): Promise; + getMultiBundleDetails(options: CatalogGetMultiBundleDetailsOptions): Promise; + getUserBundles(options: CatalogGetUserBundlesOptions): Promise; + getUserBundlesByType(options: CatalogGetUserBundlesByTypeOptions): Promise; + unpackBundle(options: CatalogUnpackBundleOptions): Promise; + getAssetToCategory(): Promise; + getAssetToSubCategory(): Promise; + getCategories(): Promise; + getSubCategories(): Promise; + getAppStoreExclusiveBundles(options: CatalogGetAppStoreExclusiveBundlesOptions): Promise; + getAssetFavoriteCount(options: AssetIdOption): Promise; + getBundleFavoriteCount(options: CatalogGetBundleFavoriteCount): Promise; + removeAssetFavorite(options: CatalogRemoveAssetFavoriteOptions): Promise; + getUserFavoriteAsset(options: CatalogGetUserFavoriteAssetOptions): Promise; + favoriteAsset(options: CatalogFavoriteAssetOptions): Promise; + removeBundleFavorite(options: CatalogRemoveBundleFavoriteOptions): Promise; + getUserFavoriteBundle(options: CatalogGetUserFavoriteBundleOptions): Promise; + favoriteBundle(options: CatalogFavoriteBundleOptions): Promise; +} diff --git a/dist/client/apis/CatalogAPI.js b/dist/client/apis/CatalogAPI.js new file mode 100644 index 000000000..35e39ca27 --- /dev/null +++ b/dist/client/apis/CatalogAPI.js @@ -0,0 +1,205 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatalogAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class CatalogAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://catalog.roblox.com/" + }); + } + getAssetBundles(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/bundles`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getBundleDetails(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/${options.bundleId}/details`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getBundleRecommendationsByBundleId(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.bundleId}/recommendations`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getMultiBundleDetails(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/details`, + qs: { + bundleIds: options.bundleIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getUserBundles(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/bundles`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserBundlesByType(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/bundles/${options.bundleType}` + }, + json: true + }).then((response) => response.body); + } + unpackBundle(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/${options.bundleId}/unpack`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getAssetToCategory() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/asset-to-category` + }, + json: true + }).then((response) => response.body); + } + getAssetToSubCategory() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/asset-to-subcategory` + }, + json: true + }).then((response) => response.body); + } + getCategories() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/categories` + }, + json: true + }).then((response) => response.body); + } + getSubCategories() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/subcategories` + }, + json: true + }).then((response) => response.body); + } + getAppStoreExclusiveBundles(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/exclusive-items/${options.appStoreType}/bundles` + }, + json: true + }).then((response) => response.body); + } + getAssetFavoriteCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/assets/${options.assetId}/count` + }, + json: true + }).then((response) => response.body); + } + getBundleFavoriteCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/bundles/${options.bundleId}/count` + }, + json: true + }).then((response) => response.body); + } + removeAssetFavorite(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getUserFavoriteAsset(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite` + }, + json: true + }).then((response) => response.body); + } + favoriteAsset(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + removeBundleFavorite(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getUserFavoriteBundle(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite` + }, + json: true + }).then((response) => response.body); + } + favoriteBundle(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } +} +exports.CatalogAPI = CatalogAPI; diff --git a/dist/client/apis/ChatAPI.d.ts b/dist/client/apis/ChatAPI.d.ts new file mode 100644 index 000000000..21cbfbe4c --- /dev/null +++ b/dist/client/apis/ChatAPI.d.ts @@ -0,0 +1,266 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type ChatPartialConversationData = { + id: number; + title?: string; +}; +export declare type ChatMessageSentData = { + content: string; + filteredForReceivers: boolean; + messageId: string; + sent: string; + messageType: "PlainText" | string; + resultType: "Success" | string; + statusMessage: string; +}; +export declare type ChatMessageData = { + id: string; + senderType: string; + sent: string; + read: boolean; + messageType: "PlainText" | string; + decorators: string[]; + senderTargetId: number; + content: string; + link?: { + type: "Game"; + game: { + universeId: number; + }; + }; + eventBased?: { + type: "SetConversationUniverse"; + setConversationUniverse: { + actorUserId: number; + universeId: number; + }; + }; +}; +export declare type ChatGetChatSettings = { + chatEnabled: boolean; +}; +export declare type ChatGetConversationMessages = ChatMessageData[]; +export declare type ChatGetRolloutSettings = { + rolloutFeatures: { + featureName: string; + isRolloutEnabled: boolean; + }[]; +}; +export declare type ChatGetUnreadConversationCount = { + count: number; +}; +export declare type ChatGetUnreadMessagesInConversations = { + conversationId: number; + chatMessages: ChatMessageData[]; +}[]; +export declare type ChatConversationData = { + id: number; + title: string; + initiator: { + type: "User" | string; + targetId: number; + name: string | null; + displayName: string | null; + }; + hasUnreadMessages: boolean; + participants: { + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + conversationType: "OneToOneConversation" | string; + conversationTitle: { + titleForViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: string; + conversationUniverse: number | null; +}; +export declare type ChatGetMetaData = { + isChatEnabledByPrivacySetting: string; + languageForPrivacySettingUnavailable: string; + maxConversationTitleLength: number; + numberOfMembersForPartyChrome: number; + partyChromeDisplayTimeStampInterval: number; + signalRDisconnectionResponseInMilliseconds: number; + typingInChatFromSenderThrottleMs: number; + typingInChatForReceiverExpirationMs: number; + relativeValueToRecordUiPerformance: number; + isChatDataFromLocalStorageEnabled: boolean; + chatDataFromLocalStorageExpirationSeconds: number; + isUsingCacheToLoadFriendsInfoEnabled: boolean; + cachedDataFromLocalStorageExpirationMS: number; + senderTypesForUnknownMessageTypeError: string[]; + isInvalidMessageTypeFallbackEnabled: boolean; + isRespectingMessageTypeEnabled: boolean; + validMessageTypesWhiteList: string[]; + shouldRespectConversationHasUnreadMessageToMarkAsRead: boolean; + isVoiceChatForClientSideEnabled: boolean; + isAliasChatForClientSideEnabled: boolean; + isPlayTogetherForGameCardsEnabled: boolean; + isRoactChatEnabled: boolean; +}; +export declare type ChatGetMultiLatestConversationMessages = ChatGetUnreadMessagesInConversations; +export declare type ChatAddUsersToConversation = { + conversationId: number; + rejectedParticipants: { + rejectedReason: string; + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + resultType: "Success" | string; + statusMessage: string; +}; +export declare type ChatMarkMessageInConversationAsReadOptions = { + conversationId: number; + endMessageId: string; +}; +export declare type ChatMarkConversationMessagesRead = { + resultType: "Success" | string; +}; +export declare type ChatMarkConversationsAsSeenOptions = { + conversationsToMarkSeen: number[]; +}; +export declare type ChatMarkConversationsSeen = { + resultType: "Success" | string; +}; +export declare type ChatRemoveUserFromConversation = { + conversation: ChatPartialConversationData; + resultType: "Success" | string; + statusMessage: string; +}; +export declare type ChatRenameGroupConversation = { + conversationTitle: string; + statusMessage: string; + resultType: "Success" | string; + title: { + titleForViewer: string; + isDefaultTitle: boolean; + }; +}; +export declare type ChatResetConversationUniverse = { + statusMessage: string; +}; +export declare type ChatSendGameLinkMessage = ChatMessageSentData; +export declare type ChatSendMessage = ChatMessageSentData; +export declare type ChatSetConversationUniverse = { + statusMessage: string; +}; +export declare type ChatStartCloudEditConversation = { + conversation: ChatConversationData; + rejectedParticipants: { + rejectedReason: string; + type: "User"; + targetId: number; + name: string; + displayName: string; + }[]; + resultType: "Success" | string; + statusMessage: string; +}; +export declare type ChatStartGroupConversation = ChatStartCloudEditConversation; +export declare type ChatStartOneToOneConversation = ChatStartCloudEditConversation; +export declare type ChatUpdateUserTypingStatus = { + statusMessage: string; +}; +export declare type ChatGetConversationsOptions = { + conversationIds: number[]; +}; +export declare type ChatGetConversationMessagesOptions = { + conversationId: number; + pageSize: number; + exclusiveStartMessageId?: string; +}; +export declare type ChatGetRolloutSettingsOptions = { + featureNames: string[]; +}; +export declare type ChatGetUnreadMessagesInConversationsOptions = { + conversationIds: number[]; + pageSize?: number; +}; +export declare type ChatGetUserConversationsOptions = { + pageNumber: number; + pageSize: number; +}; +export declare type ChatGetMultiLatestConversationMessagesOptions = { + conversationIds: number[]; + pageSize: number; +}; +export declare type ChatAddUsersToConversationOptions = { + participantUserIds: number[]; + conversationId: number; +}; +export declare type ChatMarkConversationMessagesReadOptions = { + conversationId: number; + endMessageId: string; +}; +export declare type ChatMarkConversationsSeenOptions = { + conversationsToMarkSeen: number[]; +}; +export declare type ChatRemoveUserFromConversationOptions = { + participantUserId: number; + conversationId: number; +}; +export declare type ChatRenameGroupConversationOptions = { + conversationId: number; + newTitle: string; +}; +export declare type ChatResetConversationUniverseOptions = { + conversationId: number; +}; +export declare type ChatSendMessageOptions = { + message: string; + conversationId: number; + decorators: string[]; +}; +export declare type ChatSetConversationUniverseOptions = { + conversationId: number; + universeId: number; +}; +export declare type ChatStartCloudEditConversationOptions = { + placeId: number; +}; +export declare type ChatStartGroupConversationOptions = { + participantUserIds: number[]; + title: string; +}; +export declare type ChatStartOneToOneConversationOptions = { + participantUserId: number; +}; +export declare type ChatUpdateUserTypingStatusOptions = { + conversationId: number; + isTyping: boolean; +}; +export declare type ChatSendGameLinkMessageOptions = { + universeId: number; + conversationId: number; + decorators: string[]; +}; +export declare class ChatAPI extends BaseAPI { + constructor(client: Client); + getChatSettings(): Promise; + getConversations(options: ChatGetConversationsOptions): Promise; + getConversationMessages(options: ChatGetConversationMessagesOptions): Promise; + getRolloutSettings(options: ChatGetRolloutSettingsOptions): Promise; + getUnreadConversationCount(): Promise; + getUnreadMessagesInConversations(options: ChatGetUnreadMessagesInConversationsOptions): Promise; + getUserConversations(options: ChatGetUserConversationsOptions): Promise; + getMetaData(): Promise; + getMultiLatestConversationMessages(options: ChatGetMultiLatestConversationMessagesOptions): Promise; + addUsersToConversation(options: ChatAddUsersToConversationOptions): Promise; + markConversationMessagesRead(options: ChatMarkConversationMessagesReadOptions): Promise; + markConversationsSeen(options: ChatMarkConversationsSeenOptions): Promise; + removeUserFromConversation(options: ChatRemoveUserFromConversationOptions): Promise; + renameGroupConversation(options: ChatRenameGroupConversationOptions): Promise; + resetConversationUniverse(options: ChatResetConversationUniverseOptions): Promise; + sendGameLinkMessage(options: ChatSendGameLinkMessageOptions): Promise; + sendMessage(options: ChatSendMessageOptions): Promise; + setConversationUniverse(options: ChatSetConversationUniverseOptions): Promise; + startCloudEditConversation(options: ChatStartCloudEditConversationOptions): Promise; + startGroupConversation(options: ChatStartGroupConversationOptions): Promise; + startOneToOneConversation(options: ChatStartOneToOneConversationOptions): Promise; + updateUserTypingStatus(options: ChatUpdateUserTypingStatusOptions): Promise; +} diff --git a/dist/client/apis/ChatAPI.js b/dist/client/apis/ChatAPI.js new file mode 100644 index 000000000..81b209bdb --- /dev/null +++ b/dist/client/apis/ChatAPI.js @@ -0,0 +1,250 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChatAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class ChatAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://chat.roblox.com/" + }); + } + getChatSettings() { + return this.request({ + requiresAuth: true, + request: { + path: `v2/chat-settings` + }, + json: true + }).then((response) => response.body); + } + getConversations(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-conversations`, + qs: { + conversationIds: options.conversationIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getConversationMessages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getRolloutSettings(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-rollout-settings`, + qs: { + featureNames: options.featureNames.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getUnreadConversationCount() { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-conversation-count` + }, + json: true + }).then((response) => response.body); + } + getUnreadMessagesInConversations(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-unread-messages`, + qs: { + conversationIds: options.conversationIds.join(","), + pageSize: options.pageSize + } + }, + json: true + }).then((response) => response.body); + } + getUserConversations(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-user-conversations`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: `v2/metadata` + }, + json: true + }).then((response) => response.body); + } + getMultiLatestConversationMessages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/multi-get-latest-messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } + addUsersToConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/add-to-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markConversationMessagesRead(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/mark-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markConversationsSeen(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/mark-as-seen`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + removeUserFromConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/remove-from-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + renameGroupConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/rename-group-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + resetConversationUniverse(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/reset-conversation-universe`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + sendGameLinkMessage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/send-game-link-message`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + sendMessage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/send-message`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setConversationUniverse(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/set-conversation-universe`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + startCloudEditConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/start-cloud-edit-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + startGroupConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-user-conversations`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + startOneToOneConversation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/start-one-to-one-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + updateUserTypingStatus(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v2/update-user-typing-status`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.ChatAPI = ChatAPI; diff --git a/dist/client/apis/ContactsAPI.d.ts b/dist/client/apis/ContactsAPI.d.ts new file mode 100644 index 000000000..10a69a519 --- /dev/null +++ b/dist/client/apis/ContactsAPI.d.ts @@ -0,0 +1,34 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type ContactsGetContactsMetaData = { + multiGetContactsMaxSize: number; + multiGetContactsCacheTTLinMS: number; +}; +export declare type ContactsGetUsersTagsOptions = { + targetUserIds: number[]; +}; +export declare type ContactsGetUsersTags = { + targetUserId: number; + targetUserTag: string; +}[]; +export declare type ContactsSetPendingUserTagOptions = { + targetUserId: number; + userTag: string; +}; +export declare type ContactsSetPendingUserTag = { + status: "Success" | string; +}; +export declare type ContactsSetUserTagOptions = { + targetUserId: number; + userTag: string; +}; +export declare type ContactsSetUserTag = { + status: "Success" | string; +}; +export declare class ContactsAPI extends BaseAPI { + constructor(client: Client); + getContactsMetaData(): Promise; + getUsersTags(options: ContactsGetUsersTagsOptions): Promise; + setPendingUserTag(options: ContactsSetPendingUserTagOptions): Promise; + setUserTag(options: ContactsSetUserTagOptions): Promise; +} diff --git a/dist/client/apis/ContactsAPI.js b/dist/client/apis/ContactsAPI.js new file mode 100644 index 000000000..1b18c86e6 --- /dev/null +++ b/dist/client/apis/ContactsAPI.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ContactsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class ContactsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://contacts.roblox.com/" + }); + } + getContactsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/contacts/metadata` + }, + json: true + }).then((response) => response.body); + } + getUsersTags(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/get-tags`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setPendingUserTag(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/set-pending-tag`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + setUserTag(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/tag`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.ContactsAPI = ContactsAPI; diff --git a/dist/client/apis/DataAPI.d.ts b/dist/client/apis/DataAPI.d.ts new file mode 100644 index 000000000..c11ecf2d2 --- /dev/null +++ b/dist/client/apis/DataAPI.d.ts @@ -0,0 +1,11 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type DataUploadDataOptions = { + assetId: number; + data: unknown; +}; +export declare type DataUploadDataResult = unknown; +export declare class DataAPI extends BaseAPI { + constructor(client: Client); + uploadData(options: DataUploadDataOptions): Promise; +} diff --git a/dist/client/apis/DataAPI.js b/dist/client/apis/DataAPI.js new file mode 100644 index 000000000..43b77a198 --- /dev/null +++ b/dist/client/apis/DataAPI.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DataAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class DataAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://data.roblox.com/" + }); + } + uploadData(options) { + return this.request({ + requiresAuth: true, + json: true, + request: { + path: `Data/Upload.ashx?assetid=${options.assetId}`, + method: "POST", + headers: { + "User-Agent": "Roblox/WinInet", + Requester: "Client", + "Content-Type": "application/xml", + Accept: "application/json" + } + } + }).then((response) => response.body); + } +} +exports.DataAPI = DataAPI; diff --git a/dist/client/apis/DevelopAPI.d.ts b/dist/client/apis/DevelopAPI.d.ts new file mode 100644 index 000000000..89e894ce9 --- /dev/null +++ b/dist/client/apis/DevelopAPI.d.ts @@ -0,0 +1,604 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { PartialGroupOptions } from "../../old_structures/Group"; +import { ISOString } from "../../types/GenericTypes"; +export declare type DevelopGameUniverseOptions = { + id: number; + rootPlaceId: number; + name: string; + description: string; + creatorType: string; + creator: { + id: number; + name: string; + }; + price: number; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: string; + updated: string; + studioAccessToApisAllowed: boolean; + createVipServersAllowed: boolean; + universeAvatarType: string; + genre: string; +}; +export declare type DevelopAgeDataAvailable = { + isAgeDataAvailable: boolean; +}; +export declare type DevelopProductAggregation = { + developerProductName: string; + revenueAmount: number; +}; +export declare type DevelopProductAggregations = { + allDevicesDeveloperProductRevenue: DevelopProductAggregation[]; + developerProductRevenueByDevice: { + Computer: DevelopProductAggregation[]; + Phone: DevelopProductAggregation[]; + Tablet: DevelopProductAggregation[]; + Console: DevelopProductAggregation[]; + }; +}; +export declare type DevelopTeamCreateSessionMember = { + id: number; + name: string; + displayName: string; +}; +export declare type DevelopTeamCreateSessionMembers = { + data: DevelopTeamCreateSessionMember[]; +}; +export declare type DevelopTeamCreateEnabled = { + isEnabled: boolean; +}; +export declare type DevelopTeamCreateMember = { + buildersClubMembershipType: "None" | "RobloxPremium"; + userId: number; + username: string; + displayName: string; +}; +export declare type DevelopTeamCreateMembers = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopTeamCreateMember[]; +}; +export declare type DevelopInvitedTeamCreatePlace = { + id: number; + name: string; + description: string; + isArchived: boolean; + rootPlaceId: number; + isActive: boolean; + privacyType: "Public" | "FriendsOnly" | "Private"; + creatorType: "User" | "Group"; + creatorTargetId: number; + creatorName: string; + created: ISOString; + updated: ISOString; +}; +export declare type DevelopInvitedTeamCreatePlaces = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopInvitedTeamCreatePlace[]; +}; +export declare type DevelopGetUniverseLiveStatsOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseLiveStats = { + totalPlayerCount: number; + playerCountsByDeviceType: Record; + gameCount: number; +}; +export declare type DevelopGetUniverseRevenueReportsOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseRevenueReport = { + month: number; + year: number; + RevenueReportStatus: "NotGenerated" | "ReadyForDownload"; +}; +export declare type DevelopGetUniverseRevenueReports = { + monthlyRevenueReportStatusList: DevelopGetUniverseRevenueReport[]; +}; +export declare type DevelopGetUniverseRevenueReportOptions = { + universeId: number; + yearDashMonth: `${number}-${number}`; +}; +export declare type DevelopCreatorDashboardMetadata = { + isPlayFabDataSourceChartsEnabled: boolean; + playFabDataSourceChartsAvailableByKPITypes: string[]; +}; +export declare type DevelopGetAssetsVoteInformationOptions = { + assetIds: number[]; +}; +export declare type DevelopGetAssetsVoteInformation = { + data: { + assetId: number; + hasUserVoted: number; + canUserVote: number; + shouldShowVote: boolean; + upVotes: number; + downVotes: number; + reasonForNotAbleToVote: string; + }[]; +}; +export declare type DevelopGetGameTemplates = { + gameTemplateType: string; + hasTutorials: boolean; + universe: DevelopGameUniverseOptions; +}[]; +export declare type DevelopGetGameUpdatesHistoryOptions = { + universeId: number; +}; +export declare type DevelopGetGameUpdatesHistory = { + universeId: number; + createdOn: string; + createdOnKey: string; + creatorType: string; + creatorId: number; + creatorName: string; + expiredOn: string; + content: string; + impressions: number; + plays: number; + unfollows: number; +}[]; +export declare type DevelopPublishGameNotificationOptions = { + universeId: number; + gameUpdateText: unknown; +}; +export declare type DevelopPublishGameNotification = DevelopGetGameUpdatesHistory; +export declare type DevelopFilterPublishGameNotificationOptions = { + text: string; +}; +export declare type DevelopFilterPublishGameNotification = { + filteredGameUpdateText: string; + isFiltered: boolean; + moderationLevel: number; +}; +export declare type DevelopGetGroupUniversesOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopGetGroupUniverses = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + name: string; + description: string; + isArchived: boolean; + rootPlaceId: number | null; + isActive: boolean; + privacyType: "Private" | string; + creatorType: "Group" | string; + creatorTargetId: null; + creatorName: string; + created: string; + updated: string; + }[]; +}; +export declare type DevelopGetPlaceCompatibilitiesOptions = { + placeId: number; +}; +export declare type DevelopGetPlaceCompatibilities = { + Compatibilities: { + status: "Good" | string; + platformName: string; + crashRatePercentage: number; + }[]; +}; +export declare type DevelopUpdatePlaceConfigurationOptions = { + placeId: number; + name: string; + description: string; +}; +export declare type DevelopUpdatePlaceConfiguration = { + id: number; + universeId: number; + name: string; + description: string; +}; +export declare type DevelopGetPlaceStatisticsByTypeOptions = { + placeId: number; + type: "Revenue" | "RevenuePerVisit" | "AverageVisitLength" | "Visits"; + granularity?: "Hourly" | "Daily" | "Monthly"; + divisionType?: "Device" | "Age"; + startTime?: string; + endTime?: string; +}; +export declare type DevelopGetPlaceStatisticsByType = { + placeId: number; + dataType: DevelopGetPlaceStatisticsByTypeOptions["type"]; + dataGranularity: DevelopGetPlaceStatisticsByTypeOptions["granularity"]; + startTime: string; + endTime: string; + data: unknown; +}; +export declare type DevelopGetPluginsByIdOptions = { + pluginIds: number[]; +}; +export declare type DevelopGetPluginsById = { + data: { + id: number; + name: string; + description: string; + commentsEnabled: boolean; + versionId: number; + created: string; + updated: string; + }[]; +}; +export declare type DevelopUpdatePluginOptions = { + pluginId: number; + name: string; + description: string; + commentsEnabled: boolean; +}; +export declare type DevelopUpdatePlugin = unknown; +export declare type DevelopSearchUniversesOptions = { + q: { + creator: "user" | "group" | "team"; + archived?: boolean; + active?: boolean; + groups?: unknown[]; + search?: string; + }; + sort?: ("+GameCreated" | "-GameCreated" | "+GameName" | "-GameName" | "+RootPlaceName" | "-RootPlaceName" | "+RootPlaceUpdated" | "-RootPlaceUpdated" | "+LastUpdated" | "-LastUpdated")[]; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopSearchUniverseData = { + id: number; + name: string; + description: string; + isArchived: boolean; + rootPlaceId: number; + isActive: boolean; + privacyType: "Public" | "Private"; + creatorType: "User" | "Group"; + creatorTargetId: number; + creatorName: string; + created: string; + updated: string; +}; +export declare type DevelopSearchUniverses = { + previousPageCursor: string | null; + nextPageCursor: string | null; + data: DevelopSearchUniverseData[]; +}; +export declare type DevelopSearchToolboxOptions = { + category: string; + keyword?: string; + sort?: string; + creatorId?: number; + num?: number; + page?: number; + groupId?: number; + cacheMode?: "Normal" | "Bypass" | "ForceUpdate"; +}; +export declare type DevelopSearchToolbox = { + TotalResults: number; + Results: { + Asset: { + Id: number; + Name: string; + TypeId: number; + AssetGenres: string[]; + IsEndorsed: boolean; + Description: string; + Duration: number; + Created: string; + Updated: string; + CreatedRaw: string; + UpdatedRaw: string; + }; + Creator: { + Id: number; + Name: string; + Type: number; + }; + Thumbnail: { + Final: boolean; + Url: string; + RetryUrl: string; + UserId: number; + EndpointType: string; + }; + Voting: { + ShowVotes: boolean; + UpVotes: number; + DownVotes: number; + CanVote: boolean; + UserVote: boolean; + HasVoted: number; + ReasonForNotVoteable: string; + Product: { + ProductId: number; + Price: number; + }; + }; + }[]; +}; +export declare type DevelopGetUniverseOptions = { + universeId: number; +}; +export declare type DevelopGetUniverse = DevelopGameUniverseOptions; +export declare type DevelopGetUniversePermissionsOptions = { + universeId: number; +}; +export declare type DevelopGetUniversePermissions = { + canManage: boolean; + canCloudEdit: boolean; +}; +export declare type DevelopGetUniversePlacesOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopGetUniversePlaces = { + previousPageCursor: string; + nextPageCursor: string; + data: unknown[]; +}; +export declare type DevelopGetUniverseStatisticsReportsOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseStatisticsReports = { + reports: { + universeId: number; + yearDashMonth: string; + status: "NotGenerated" | string; + spreadsheetId: string; + }[]; +}; +export declare type DevelopGetUniverseStatisticsReportsByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export declare type DevelopGetUniverseStatisticsReportByTime = { + universeId: number; + yearDashMonth: string; + status: "NotGenerated" | string; + spreadsheetId: string; +}; +export declare type DevelopDownloadUniverseStatisticsReportByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export declare type DevelopDownloadUniverseStatisticsReportByTime = unknown; +export declare type DevelopMultiGetUniversesOptions = { + ids: number[]; +}; +export declare type DevelopMultiGetUniverses = DevelopGameUniverseOptions[]; +export declare type DevelopMultiGetUniversesPermissionsOptions = { + ids: number[]; +}; +export declare type DevelopMultiGetUniversesPermissions = { + data: { + universeId: number; + canManage: boolean; + canCloudEdit: boolean; + }[]; +}; +export declare type DevelopActivateUniverseOptions = { + universeId: number; +}; +export declare type DevelopActivateUniverse = unknown; +export declare type DevelopDeactivateUniverseOptions = { + universeId: number; +}; +export declare type DevelopDeactivateUniverse = unknown; +export declare type DevelopGenerateUniverseStatisticReportsByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export declare type DevelopGenerateUniverseStatisticReportsByTime = unknown; +export declare type DevelopGetUniverseConfigurationOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseConfiguration = { + id: number; + name: string; + universeAvatarType: "MorphToR6" | "MorphToR15"; + universeScaleType: "NoScales" | string; + universeAnimationType: "Standard" | string; + universeCollisionType: "InnerBox" | string; + universeBodyType: "Standard" | string; + universeJointPositioningType: "Standard" | string; + isArchived: boolean; + isFriendsOnly: boolean; + genre: "All" | string; + playableDevices: ("Computer" | string)[]; + isForSale: boolean; + price: number; +}; +export declare type DevelopUpdateUniverseConfigurationOptions = Omit & { + universeId: number; +}; +export declare type DevelopUpdateUniverseConfiguration = DevelopGetUniverseConfiguration; +export declare type DevelopGetUniverseVIPServersConfigurationOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseVIPServersConfiguration = { + isEnabled: boolean; + price: number; + activeServersCount: number; + activeSubscriptionsCount: number; +}; +export declare type DevelopGetUniverseTeamCreateSettingsOptions = { + universeId: number; +}; +export declare type DevelopGetUniverseTeamCreateSettings = { + isEnabled: boolean; +}; +export declare type DevelopUpdateUniverseTeamCreateSettingsOptions = DevelopGetUniverseTeamCreateSettingsOptions; +export declare type DevelopUpdateUniverseTeamCreateSettings = unknown; +export declare type DevelopRemoveUserFromUniverseTeamCreateOptions = { + universeId: number; + userId: number; +}; +export declare type DevelopRemoveUserFromUniverseTeamCreate = unknown; +export declare type DevelopGetUsersInUniverseTeamCreateOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopGetUsersInUniverseTeamCreate = { + previousPageCursor: string; + nextPageCursor: string; + data: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }[]; +}; +export declare type DevelopGetSelfTeamCreateUniversesAccessOptions = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopGetSelfTeamCreateUniversesAccess = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopGameUniverseOptions[]; +}; +export declare type DevelopGetSelfGroupsAccess = { + data: PartialGroupOptions[]; +}; +export declare type DevelopGetNotificationsStatisticReports = { + data: { + UserId: number; + UniverseId: number; + Expires: number; + RootPlaceId: number; + GameName: string; + }[]; +}; +export declare type DevelopGetStudioDataOptions = { + clientKey: string; +}; +export declare type DevelopGetStudioData = unknown; +export declare type DevelopSetStudioDataOptions = { + clientKey: string; + data: unknown; +}; +export declare type DevelopSetStudioData = { + success: boolean; +}; +export declare type DevelopGetSelfUniversesOptions = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type DevelopGetSelfUniverses = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopGameUniverseOptions[]; +}; +export declare type DevelopCreateUniverseAliasOptions = { + name: string; + type: "Asset" | string; + targetId: number; +}; +export declare type DevelopCreateUniverseAlias = unknown; +export declare type DevelopDeleteUniverseAliasOptions = { + universeId: number; + name: string; +}; +export declare type DevelopDeleteUniverseAlias = unknown; +export declare type DevelopUpdateUniverseAliasOptions = DevelopCreateUniverseAliasOptions; +export declare type DevelopUpdateUniverseAlias = unknown; +export declare type DevelopCreateDeveloperProductOptions = { + universeId: number; + name: string; + description: string; + priceInRobux: number; + iconImageAssetId?: number; +}; +export declare type DevelopCreateDeveloperProduct = { + id: number; + name: string; + Description: string; + shopId: number; + iconImageAssetId: number; +}; +export declare type DevelopUpdateDeveloperProductOptions = { + universeId: number; + developerProductId: number; + Name: string; + Description: string; + IconImageAssetId?: number; + PriceInRobux: number; +}; +export declare type DevelopUpdateDeveloperProduct = unknown; +export declare class DevelopAPI extends BaseAPI { + constructor(client: Client); + getGameTemplates(): Promise; + getGameUpdatesHistory(options: DevelopGetGameUpdatesHistoryOptions): Promise; + publishGameUpdateNotification(options: DevelopPublishGameNotificationOptions): Promise; + filterGameUpdateNotificationText(options: DevelopFilterPublishGameNotificationOptions): Promise; + getGroupUniverses(options: DevelopGetGroupUniversesOptions): Promise; + getPlaceCompatibilities(options: DevelopGetPlaceCompatibilitiesOptions): Promise; + updatePlaceConfiguration(options: DevelopUpdatePlaceConfigurationOptions): Promise; + getPlaceStatistics(options: DevelopGetPlaceStatisticsByTypeOptions): Promise; + isPlaceAgeDataAvailable(options: { + placeId: number; + }): Promise; + getDeveloperProductAggregation(options: { + placeId: number; + timeFrame: "Hourly" | "Daily" | "Monthly"; + }): Promise; + getCreatorDashboardMetadata(): Promise; + getTeamCreateSessionMembers(options: { + placeId: number; + limit?: 10 | 25 | 50 | 100; + cursor?: string; + }): Promise; + setTeamCreateEnabled(options: { + universeId: number; + } & DevelopTeamCreateEnabled): Promise; + getMultiPlugins(options: DevelopGetPluginsByIdOptions): Promise; + updatePlugin(options: DevelopUpdatePluginOptions): Promise; + searchUniverses(options: DevelopSearchUniversesOptions): Promise; + searchToolbox(options: DevelopSearchToolboxOptions): Promise; + getUniverse(options: DevelopGetUniverseOptions): Promise; + getUniverseLiveStats(options: DevelopGetUniverseLiveStatsOptions): Promise; + getSelfUniversePermissions(options: DevelopGetUniversePermissionsOptions): Promise; + getPlacesInUniverse(options: DevelopGetUniversePlacesOptions): Promise; + getUniverseRevenueReports(options: DevelopGetUniverseRevenueReportsOptions): Promise; + getUniverseRevenueReport(options: DevelopGetUniverseRevenueReportOptions): Promise; + downloadUniverseRevenueReport(options: DevelopGetUniverseRevenueReportOptions): Promise; + getUniverseStatisticReports(options: DevelopGetUniverseStatisticsReportsOptions): Promise; + getUniverseStatisticReportsByTime(options: DevelopGetUniverseStatisticsReportsByTimeOptions): Promise; + downloadUniverseStatisticReportsByTime(options: DevelopDownloadUniverseStatisticsReportByTimeOptions): Promise; + getMultiUniverses(options: DevelopMultiGetUniversesOptions): Promise; + getMultiUniversesPermissions(options: DevelopMultiGetUniversesPermissionsOptions): Promise; + activateUniverse(options: DevelopActivateUniverseOptions): Promise; + deactivateUniverse(options: DevelopDeactivateUniverseOptions): Promise; + generateUniverseStatisticReportsByTime(options: DevelopGenerateUniverseStatisticReportsByTimeOptions): Promise; + getUniverseConfiguration(options: DevelopGetUniverseConfigurationOptions): Promise; + updateUniverseConfiguration(options: DevelopUpdateUniverseConfigurationOptions): Promise; + getUniverseVIPServersConfiguration(options: DevelopGetUniverseVIPServersConfigurationOptions): Promise; + getUniverseTeamCreateSettings(options: DevelopGetUniverseTeamCreateSettingsOptions): Promise; + removeUserFromUniverseTeamCreate(options: DevelopRemoveUserFromUniverseTeamCreateOptions): Promise; + getUniverseTeamCreateMembers(options: DevelopGetUsersInUniverseTeamCreateOptions): Promise; + getSelfUniversesTeamCreateAccess(options: DevelopGetSelfTeamCreateUniversesAccessOptions): Promise; + getSelfManageableGroups(): Promise; + getSelfNotificationStatisticReports(): Promise; + getStudioData(options: DevelopGetStudioDataOptions): Promise; + setStudioData(options: DevelopSetStudioDataOptions): Promise; + getSelfUniverses(options: DevelopGetSelfUniversesOptions): Promise; + createUniverseAlias(options: DevelopCreateUniverseAliasOptions): Promise; + deleteUniverseAlias(options: DevelopDeleteUniverseAliasOptions): Promise; + updateUniverseAlias(options: DevelopUpdateUniverseAliasOptions): Promise; + createDeveloperProduct(options: DevelopCreateDeveloperProductOptions): Promise; + updateDeveloperProduct(options: DevelopUpdateDeveloperProductOptions): Promise; +} diff --git a/dist/client/apis/DevelopAPI.js b/dist/client/apis/DevelopAPI.js new file mode 100644 index 000000000..0577d3025 --- /dev/null +++ b/dist/client/apis/DevelopAPI.js @@ -0,0 +1,516 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DevelopAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class DevelopAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://develop.roblox.com/" + }); + } + getGameTemplates() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gametemplates` + }, + json: true + }).then((response) => response.body.data); + } + getGameUpdatesHistory(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/${options.universeId}` + }, + json: true + }).then((response) => response.body); + } + publishGameUpdateNotification(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/${options.universeId}`, + method: "POST", + json: `"${options.gameUpdateText}"` + }, + json: true + }).then((response) => response.body); + } + filterGameUpdateNotificationText(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/filter`, + method: "POST", + json: `"${options.text}"` + }, + json: true + }).then((response) => response.body); + } + getGroupUniverses(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/universes`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getPlaceCompatibilities(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/compatibilities` + }, + json: true + }).then((response) => response.body); + } + updatePlaceConfiguration(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getPlaceStatistics(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/stats/${options.type}`, + qs: options + }, + json: true + }).then((response) => response.body); + } + isPlaceAgeDataAvailable(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/is-age-data-available`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } + getDeveloperProductAggregation(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/developer-product-aggregation`, + method: "GET", + qs: options + }, + json: true + }).then((response) => response.body); + } + getCreatorDashboardMetadata() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creator-dashboard-metadata` + }, + json: true + }).then((response) => response.body); + } + getTeamCreateSessionMembers(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/places/${options.placeId}/teamcreate/active_session/members`, + qs: { + limit: options.limit || 10, + cursor: options.cursor + } + }, + json: true + }).then((response) => response.body); + } + setTeamCreateEnabled(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/teamcreate`, + method: "PATCH", + json: { isEnabled: options.isEnabled } + }, + json: true + }).then(() => true); + } + getMultiPlugins(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins`, + qs: { + pluginIds: options.pluginIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + updatePlugin(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins/${options.pluginId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + searchUniverses(options) { + const encodedQuery = `${options.q.search || ""} creator:${options.q.creator.slice(0, 1).toUpperCase() + options.q.creator.slice(1)} ${typeof options.q.active !== "undefined" + ? `active:${options.q.active ? "True" : "False"}` + : ""} ${options.q.archived + ? `archived:${options.q.archived ? "True" : "False"}` + : ""} ${options.q.groups ? `groups:${options.q.groups.join(",")}` : ""}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/search/universes`, + qs: Object.assign(Object.assign({}, options), { sort: (options.sort || []).join(","), + // End me, please... + q: encodedQuery }) + }, + json: true + }).then((response) => response.body); + } + searchToolbox(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/toolbox/items`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUniverse(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}` + }, + json: true + }).then((response) => response.body); + } + getUniverseLiveStats(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/live-stats` + }, + json: true + }).then((response) => response.body); + } + getSelfUniversePermissions(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/permissions` + }, + json: true + }).then((response) => response.body); + } + getPlacesInUniverse(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/places`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUniverseRevenueReports(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUniverseRevenueReport(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports/${options.yearDashMonth}` + }, + json: true + }).then((response) => response.body); + } + downloadUniverseRevenueReport(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports/${options.yearDashMonth}/download`, + method: "GET" + } + }).then((response) => response.body); + } + getUniverseStatisticReports(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports` + }, + json: true + }).then((response) => response.body); + } + getUniverseStatisticReportsByTime(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}` + }, + json: true + }).then((response) => response.body); + } + downloadUniverseStatisticReportsByTime(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/download` + }, + json: true + }).then((response) => response.body); + } + getMultiUniverses(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/multiget`, + qs: { + ids: options.ids.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getMultiUniversesPermissions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/multiget/permissions`, + qs: { + ids: options.ids.join(",") + } + }, + json: true + }).then((response) => response.body); + } + activateUniverse(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/activate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + deactivateUniverse(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/deactivate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + generateUniverseStatisticReportsByTime(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/generate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getUniverseConfiguration(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration` + }, + json: true + }).then((response) => response.body); + } + updateUniverseConfiguration(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getUniverseVIPServersConfiguration(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration/vip-servers` + }, + json: true + }).then((response) => response.body); + } + getUniverseTeamCreateSettings(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate` + }, + json: true + }).then((response) => response.body); + } + removeUserFromUniverseTeamCreate(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate/memberships`, + method: "DELETE", + json: options + }, + json: true + }).then((response) => response.body); + } + getUniverseTeamCreateMembers(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate/memberships`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfUniversesTeamCreateAccess(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/teamcreate/memberships`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfManageableGroups() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/groups/canmanage` + }, + json: true + }).then((response) => response.body); + } + getSelfNotificationStatisticReports() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/notifications/statistic-reports` + }, + json: true + }).then((response) => response.body); + } + getStudioData(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/studiodata`, + qs: options + }, + json: true + }).then((response) => response.body); + } + setStudioData(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/studiodata`, + method: "POST", + json: options, + qs: { + clientKey: options.clientKey + } + }, + json: true + }).then((response) => response.body); + } + getSelfUniverses(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/universes`, + qs: options + }, + json: true + }).then((response) => response.body); + } + createUniverseAlias(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.targetId}/aliases` + }, + json: true + }).then((response) => response.body); + } + deleteUniverseAlias(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/aliases/${options.name}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + updateUniverseAlias(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.targetId}/aliases/${options.name}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + createDeveloperProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/developerproducts`, + method: "POST", + qs: options + }, + json: true + }).then((response) => response.body); + } + updateDeveloperProduct(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/developerproducts/${options.developerProductId}/update`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.DevelopAPI = DevelopAPI; diff --git a/dist/client/apis/EconomyAPI.d.ts b/dist/client/apis/EconomyAPI.d.ts new file mode 100644 index 000000000..a8d5db4dd --- /dev/null +++ b/dist/client/apis/EconomyAPI.d.ts @@ -0,0 +1,174 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { BillingSubmitDeveloperExchangeOptions } from "./BillingAPI"; +export declare type EconomyGetAssetResaleDataOptions = { + assetId: number; +}; +export declare type EconomyGetAssetResaleData = { + assetStock: number; + sales: number; + numberRemaining: number; + recentAveragePrice: number; + originalPrice: number; + priceDataPoints: { + value: number; + date: string; + }[]; + volumeDataPoints: { + value: number; + date: string; + }[]; +}; +export declare type EconomyGetAssetResellersOptions = { + assetId: number; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type EconomyGetAssetResellers = { + previousPageCursor: string; + nextPageCursor: string; + data: { + userAssetId: number; + seller: { + id: number; + type: "User" | "Group"; + name: string; + }; + price: number; + serialNumber: number; + }[]; +}; +export declare type EconomyGetUserResellableAssetCopiesOptions = { + userId: number; + assetId: number; +}; +export declare type EconomyGetUserResellableAssetCopies = { + data: EconomyGetAssetResellers["data"]; +}; +export declare type EconomyGetResaleTaxRate = { + taxRate: number; + minimumFee: number; +}; +export declare type EconomySetAssetCopiesOptions = { + assetId: number; + userAssetId: number; + price: number; +}; +export declare type EconomySetAssetCopies = unknown; +export declare type EconomyGetDeveloperExchangeAbility = { + canCashOut: boolean; + meetsPremiumRequirement: boolean; + hasVerifiedEmail: boolean; + isUserBlackListed: boolean; + meetsMinimumCashOutBalance: boolean; + hasCashedOutThisMonth: boolean; + lastImbursementStatusIsValid: boolean; +}; +export declare type EconomyGetDeveloperExchangeHelp = unknown; +export declare type EconomyGetDeveloperExchangeInfoOptions = { + fromDevExPage: boolean; +}; +export declare type EconomyGetDeveloperExchangeInfo = { + hasCurrencyOperationError: boolean; + currencyOperationErrorMessage: string; + showOnlyExchangeRates: boolean; + meetsMembershipRequirements: boolean; + emailIsVerified: boolean; + isImbursementBlacklistUser: boolean; + canProceedToCashout: boolean; + showProgressBar: boolean; + percentRobux: number; + minRobuxToCashOut: number; + maxRobuxCanCashOut: number; + lastImbursementStatus: string; + lastImbursementSubmissionDate: string; + conversionPercent: number; +}; +export declare type EconomySubmitDeveloperExchangeOptions = BillingSubmitDeveloperExchangeOptions; +export declare type EconomySubmitDeveloperExchange = { + submitted: boolean; + cashOutAbility: { + canCashOut: boolean; + meetsPremiumRequirement: boolean; + hasVerifiedEmail: boolean; + isUserBlcakListed: boolean; + meetsMinimumCashOutBalance: boolean; + hasCashedOutThisMonth: boolean; + lastImbursementStatusIsValid: boolean; + }; + errors: unknown; +}; +export declare type EconomyGetGroupCurrencyOptions = { + groupId: number; +}; +export declare type EconomyGetGroupCurrency = { + robux: number; +}; +export declare type EconomyGetSelfCurrencyOptions = { + userId: number; +}; +export declare type EconomyGetSelfCurrency = { + robux: number; +}; +export declare type EconomyGetGroupRevenueSummaryInTimeFrameOptions = { + groupId: number; + timeFrame: "Day" | "Week" | "Month" | "Year"; +}; +export declare type EconomyGetGroupRevenueSummaryInTimeFrame = { + recurringRobuxStipend: number; + itemSaleRobux: number; + purchasedRoblox: number; + tradeSystemRobux: number; + pendingRobux: number; + groupPayoutRobux: number; +}; +export declare type EconomyGetSelfRevenueSummaryInTimeFrameOptions = Omit & { + userId: number; +}; +export declare type EconomyGetSelfRevenueSummaryInTimeFrame = EconomyGetGroupRevenueSummaryInTimeFrame; +export declare type EconomyGetGroupTransactionsOptions = { + groupId: number; + transactionType: "Sale" | "Purchase" | "AffiliateSale" | "DevEx" | "GroupPayout" | "AdImpressionPayout"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type EconomyGetGroupTransactions = { + previousPageCursor: string; + nextPageCursor: string; + data: { + created: string; + isPending: boolean; + agent: { + id: number; + type: "User" | "Group"; + name: string; + }; + details: unknown; + currency: { + amount: number; + type: "Robux" | string; + }; + }[]; +}; +export declare type EconomyGetSelfTransactionsOptions = Omit & { + userId: number; +}; +export declare type EconomyGetSelfTransactions = EconomyGetGroupTransactions; +export declare class EconomyAPI extends BaseAPI { + constructor(client: Client); + getAssetResaleData(options: EconomyGetAssetResaleDataOptions): Promise; + getAssetResellers(options: EconomyGetAssetResellersOptions): Promise; + getUserResellableAssetCopies(options: EconomyGetUserResellableAssetCopiesOptions): Promise; + getResaleTaxRate(): Promise; + setAssetCopiesForSale(options: EconomySetAssetCopiesOptions): Promise; + getDeveloperExchangeAbility(): Promise; + getDeveloperExchangeHelp(): Promise; + getDeveloperExchangeInfo(options: EconomyGetDeveloperExchangeInfoOptions): Promise; + submitDeveloperExchange(options: EconomySubmitDeveloperExchangeOptions): Promise; + getGroupCurrency(options: EconomyGetGroupCurrencyOptions): Promise; + getSelfCurrency(options: EconomyGetSelfCurrencyOptions): Promise; + getGroupRevenueByTime(options: EconomyGetGroupRevenueSummaryInTimeFrameOptions): Promise; + getSelfRevenueSummaryByTIme(options: EconomyGetSelfRevenueSummaryInTimeFrameOptions): Promise; + getGroupTransactions(options: EconomyGetGroupTransactionsOptions): Promise; + getSelfTransactions(options: EconomyGetSelfTransactionsOptions): Promise; +} diff --git a/dist/client/apis/EconomyAPI.js b/dist/client/apis/EconomyAPI.js new file mode 100644 index 000000000..ec7112ddb --- /dev/null +++ b/dist/client/apis/EconomyAPI.js @@ -0,0 +1,158 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EconomyAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class EconomyAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://economy.roblox.com/" + }); + } + getAssetResaleData(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/resale-data` + }, + json: true + }).then((response) => response.body); + } + getAssetResellers(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/resellers`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserResellableAssetCopies(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/users/${options.userId}/resellable-copies` + }, + json: true + }).then((response) => response.body); + } + getResaleTaxRate() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/resale-tax-rate` + }, + json: true + }).then((response) => response.body); + } + setAssetCopiesForSale(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/assets/${options.assetId}/resellable-copies/${options.userAssetId}`, + method: "PATCH", + json: { + price: options.price + } + }, + json: true + }).then((response) => response.body); + } + getDeveloperExchangeAbility() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/cashoutAbility` + }, + json: true + }).then((response) => response.body); + } + getDeveloperExchangeHelp() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/help` + }, + json: true + }).then((response) => response.body); + } + getDeveloperExchangeInfo(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/info`, + qs: options + }, + json: true + }).then((response) => response.body); + } + submitDeveloperExchange(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/submit`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getGroupCurrency(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/currency` + }, + json: true + }).then((response) => response.body); + } + getSelfCurrency(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/currency` + }, + json: true + }).then((response) => response.body); + } + getGroupRevenueByTime(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/revenue/summary/${options.timeFrame}` + }, + json: true + }).then((response) => response.body); + } + getSelfRevenueSummaryByTIme(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/revenue/summary/${options.timeFrame}` + }, + json: true + }).then((response) => response.body); + } + getGroupTransactions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/transactions`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfTransactions(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/transactions`, + qs: options + }, + json: true + }).then((response) => response.body); + } +} +exports.EconomyAPI = EconomyAPI; diff --git a/dist/client/apis/EconomyCreatorStatsAPI.d.ts b/dist/client/apis/EconomyCreatorStatsAPI.d.ts new file mode 100644 index 000000000..56131c1fd --- /dev/null +++ b/dist/client/apis/EconomyCreatorStatsAPI.d.ts @@ -0,0 +1,16 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type EconomyCreatorStatsGetUniverseStatsOptions = { + universeId: number; + type: "PremiumUpsells" | "PremiumVisits"; + startTime: string; + endTime: string; +}; +export declare type EconomyCreatorStatsGetUniverseStats = { + dataGranularity: "Hourly" | string; + data: unknown; +}; +export declare class EconomyCreatorStatsAPI extends BaseAPI { + constructor(client: Client); + getUniverseStats(options: EconomyCreatorStatsGetUniverseStatsOptions): Promise; +} diff --git a/dist/client/apis/EconomyCreatorStatsAPI.js b/dist/client/apis/EconomyCreatorStatsAPI.js new file mode 100644 index 000000000..b3bc65d32 --- /dev/null +++ b/dist/client/apis/EconomyCreatorStatsAPI.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EconomyCreatorStatsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class EconomyCreatorStatsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://economycreatorstats.roblox.com/" + }); + } + getUniverseStats(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/stats`, + qs: { + "request.type": options.type, + "request.startTime": options.startTime, + "request.endTime": options.endTime + } + }, + json: true + }).then((response) => response.body); + } +} +exports.EconomyCreatorStatsAPI = EconomyCreatorStatsAPI; diff --git a/dist/client/apis/EngagementPayoutsAPI.d.ts b/dist/client/apis/EngagementPayoutsAPI.d.ts new file mode 100644 index 000000000..864be93cd --- /dev/null +++ b/dist/client/apis/EngagementPayoutsAPI.d.ts @@ -0,0 +1,12 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type EngagementPayoutsGetUniversePayoutHistoryOptions = { + universeId: number; + startDate: string; + endDate: string; +}; +export declare type EngagementPayoutsGetUniversePayoutHistory = unknown; +export declare class EngagementPayoutsAPI extends BaseAPI { + constructor(client: Client); + getUniversePayoutHistory(options: EngagementPayoutsGetUniversePayoutHistoryOptions): Promise; +} diff --git a/dist/client/apis/EngagementPayoutsAPI.js b/dist/client/apis/EngagementPayoutsAPI.js new file mode 100644 index 000000000..da58518fc --- /dev/null +++ b/dist/client/apis/EngagementPayoutsAPI.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EngagementPayoutsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class EngagementPayoutsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://engagementpayouts.roblox.com/" + }); + } + getUniversePayoutHistory(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universe-payout-history`, + qs: options + }, + json: true + }).then((response) => response.body); + } +} +exports.EngagementPayoutsAPI = EngagementPayoutsAPI; diff --git a/dist/client/apis/FollowingsAPI.d.ts b/dist/client/apis/FollowingsAPI.d.ts new file mode 100644 index 000000000..fad88680e --- /dev/null +++ b/dist/client/apis/FollowingsAPI.d.ts @@ -0,0 +1,38 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type FollowingsGetUserFollowedUniversesOptions = { + userId: number; +}; +export declare type FollowingsGetUserFollowedUniverses = { + universeId: number; + userId: number; +}[]; +export declare type FollowingsGetUserFollowingUniverseStatusOptions = { + userId: number; + universeId: number; +}; +export declare type FollowingsGetUserFollowingUniverseStatus = { + UniverseId: number; + UserId: number; + CanFollow: boolean; + IsFollowing: boolean; + FollowingCountByType: number; + FollowingLimitByType: number; +}; +export declare type FollowingsUnFollowUniverseOptions = { + userId: number; + universeId: number; +}; +export declare type FollowingsUnFollowUniverse = { + universeId: number; + userId: number; +}; +export declare type FollowingsFollowUniverseOptions = FollowingsUnFollowUniverseOptions; +export declare type FollowingsFollowUniverse = FollowingsUnFollowUniverse; +export declare class FollowingsAPI extends BaseAPI { + constructor(client: Client); + getUserFollowedUniverses(options: FollowingsGetUserFollowedUniversesOptions): Promise; + getUserFollowingUniverseStatus(options: FollowingsGetUserFollowingUniverseStatusOptions): Promise; + unFollowUniverse(options: FollowingsUnFollowUniverseOptions): Promise; + followUniverse(options: FollowingsFollowUniverseOptions): Promise; +} diff --git a/dist/client/apis/FollowingsAPI.js b/dist/client/apis/FollowingsAPI.js new file mode 100644 index 000000000..482a68032 --- /dev/null +++ b/dist/client/apis/FollowingsAPI.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FollowingsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class FollowingsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://followings.roblox.com/" + }); + } + getUserFollowedUniverses(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes` + }, + json: true + }).then((response) => response.body); + } + getUserFollowingUniverseStatus(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}/status` + }, + json: true + }).then((response) => response.body); + } + unFollowUniverse(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + followUniverse(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } +} +exports.FollowingsAPI = FollowingsAPI; diff --git a/dist/client/apis/FriendsAPI.d.ts b/dist/client/apis/FriendsAPI.d.ts new file mode 100644 index 000000000..fd6dac3df --- /dev/null +++ b/dist/client/apis/FriendsAPI.d.ts @@ -0,0 +1,199 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { GeneralGetUserFriendsCount, GeneralGetUserFriendsCountOptions } from "./GeneralAPI"; +import { PartialUser } from "../../old_structures/User"; +import { EnumUserPresence, UserPresence } from "../../interfaces/GeneralInterfaces"; +export declare type FriendsFindFriendByCodeOptions = { + code: string; +}; +export declare type FriendsFindFriendByCode = { + userId: number; + username: string; + friendshipStatus: "NoFriendship" | string; +}; +export declare type FriendsCheckSessionHealth = unknown; +export declare type FriendsRedeemNearbyFriendCodeOptions = { + code: string; +}; +export declare type FriendsRedeemNearbyFriendCode = unknown; +export declare type FriendsDeleteSession = unknown; +export declare type FriendsGetOrCreateNearbySession = { + code: string; + expires: number; +}; +export declare type FriendsRedeemQRCodeOptions = { + code: string; +}; +export declare type FriendsRedeemQRCode = { + userId: number; + username: string; +}; +export declare type FriendsDeleteQRCodeSession = unknown; +export declare type FriendsGetOrCreateQRCodeSession = FriendsGetOrCreateNearbySession; +export declare type FriendsGetMetaDataOptions = { + targetUserId: number; +}; +export declare type FriendsGetMetaData = { + isFriendFinderEnabled: boolean; + isNearbyUpsellEnabled: boolean; + isFriendsUserDataStoreCacheEnabled: boolean; + userName: string; +}; +export declare type FriendsGetSelfFriendsCount = { + count: number; +}; +export declare type FriendsGetSelfFriendRequestsOptions = { + sortOrder?: "Desc" | "Asc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type FriendsGetSelfFriendRequests = { + previousPageCursor: string; + nextPageCursor: string; + data: { + description: string; + created: string; + isBanned: boolean; + userId: number; + username: string; + }[]; +}; +export declare type FriendsGetSelfFriendRequestsCount = { + count: number; +}; +export declare type FriendsGetUserFollowersOptions = { + userId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type FriendsGetUserFollowers = { + previousPageCursor: string; + nextPageCursor: string; + data: { + isOnline: boolean; + isDeleted: boolean; + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + }[]; +}; +export declare type FriendsGetUserFollowersCountOptions = { + userId: number; +}; +export declare type FriendsGetUserFollowersCount = { + count: number; +}; +export declare type FriendsGetUserFollowingOptions = FriendsGetUserFollowersOptions; +export declare type FriendsGetUserFollowing = FriendsGetUserFollowers; +export declare type FriendsGetUserFollowingCountOptions = FriendsGetUserFollowersCountOptions; +export declare type FriendsGetUserFollowingCount = FriendsGetUserFollowersCount; +export declare type FriendsGetUserFriendsOptions = { + userSort?: "Alphabetical" | "StatusAlphabetical" | "StatusFrequents"; + userId: number; +}; +export declare type FriendsGetUserFriends = { + data: { + isOnline: boolean; + isDeleted: boolean; + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + }[]; +}; +export declare type FriendsGetUserOnlineFriendsOptions = { + userId: number; +}; +export declare type FriendsGetUserOnlineFriends = { + data: { + userId: number; + username: string; + presence: { + placeId: number | null; + universeId: number | null; + UserPresenceType: UserPresence | null; + UserLocationType: string | null; + lastLocation: string | null; + gameInstanceId: string | null; + lastOnline: string | null; + }; + }[]; +}; +export declare type FriendsGetUserFriendsWithStatusesOptions = { + userId: number; + withUserIds: number[]; +}; +export declare type FriendsGetUserFriendsWithStatuses = { + data: { + id: number; + status: "NotFriends" | string; + }[]; +}; +export declare type FriendsDeclineAllFriendRequests = unknown; +export declare type FriendsAcceptFriendRequestOptions = { + userId: number; +}; +export declare type FriendsAcceptFriendRequest = unknown; +export declare type FriendsDeclineFriendRequestOptions = FriendsAcceptFriendRequestOptions; +export declare type FriendsDeclineFriendRequest = unknown; +export declare type FriendsFollowUserOptions = { + userId: number; +}; +export declare type FriendsFollowUser = { + success: boolean; + isCaptchaRequired: boolean; +}; +export declare type FriendsSendFriendRequestOptions = { + userId: number; + source?: "Unknown" | string; +}; +export declare type FriendsSendFriendRequest = { + success: boolean; + isCaptchaRequired: boolean; +}; +export declare type FriendsUnFollowUserOptions = FriendsFollowUserOptions; +export declare type FriendsUnFollowUser = FriendsFollowUser; +export declare type FriendsUnfriendUserOptions = { + userId: number; +}; +export declare type FriendsUnfriendUser = unknown; +export declare type FriendsGetSelfRecommendedUsers = { + user: PartialUser; + profileUrl: string; + presenceType: EnumUserPresence; +}[]; +export declare class FriendsAPI extends BaseAPI { + constructor(client: Client); + findFriendByCode(options: FriendsFindFriendByCodeOptions): Promise; + checkSessionHealth(): Promise; + redeemFriendCode(options: FriendsRedeemNearbyFriendCodeOptions): Promise; + deleteFriendSession(): Promise; + getSession(): Promise; + redeemFriendQRCode(options: FriendsRedeemQRCodeOptions): Promise; + deleteFriendQRSession(): Promise; + getFriendQRSession(): Promise; + getMetaData(options: FriendsGetMetaDataOptions): Promise; + getSelfFriendsCount(): Promise; + getSelfFriendRequests(options: FriendsGetSelfFriendRequestsOptions): Promise; + getSelfFriendRequestsCount(): Promise; + getUserFollowers(options: FriendsGetUserFollowersOptions): Promise; + getUserFollowersCount(options: FriendsGetUserFollowersCountOptions): Promise; + getUserFollowing(options: FriendsGetUserFollowingOptions): Promise; + getUserFollowingCount(options: FriendsGetUserFollowingCountOptions): Promise; + getUserFriends(options: FriendsGetUserFriendsOptions): Promise; + getUserFriendsCount(options: GeneralGetUserFriendsCountOptions): Promise; + getUserFriendsOnline(options: FriendsGetUserOnlineFriendsOptions): Promise; + getUserFriendsWithStatuses(options: FriendsGetUserFriendsWithStatusesOptions): Promise; + declineAllFriendRequests(): Promise; + acceptFriendRequest(options: FriendsAcceptFriendRequestOptions): Promise; + declineFriendRequest(options: FriendsDeclineFriendRequestOptions): Promise; + followUser(options: FriendsFollowUserOptions): Promise; + sendFriendRequest(options: FriendsSendFriendRequestOptions): Promise; + unFollowUser(options: FriendsUnFollowUserOptions): Promise; + unfriendUser(options: FriendsUnfriendUserOptions): Promise; + getRecommendedUsers(): Promise; +} diff --git a/dist/client/apis/FriendsAPI.js b/dist/client/apis/FriendsAPI.js new file mode 100644 index 000000000..1d6341a33 --- /dev/null +++ b/dist/client/apis/FriendsAPI.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FriendsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class FriendsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://friends.roblox.com/" + }); + } + findFriendByCode(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/code/${options.code}` + }, + json: true + }).then((response) => response.body); + } + checkSessionHealth() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/health` + }, + json: true + }).then((response) => response.body); + } + redeemFriendCode(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/code/${options.code}/redeem`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + deleteFriendSession() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/session`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getSession() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/session`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + redeemFriendQRCode(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/${options.code}/redeem`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + deleteFriendQRSession() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/session`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getFriendQRSession() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/session`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getMetaData(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/metadata`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfFriendsCount() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/my/friends/count` + }, + json: true + }).then((response) => response.body); + } + getSelfFriendRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/my/friends/requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfFriendRequestsCount() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/friend-requests/count` + }, + json: true + }).then((response) => response.body); + } + getUserFollowers(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followers`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserFollowersCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followers/count` + }, + json: true + }).then((response) => response.body); + } + getUserFollowing(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followings`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserFollowingCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followings/count` + }, + json: true + }).then((response) => response.body); + } + getUserFriends(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserFriendsCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends/count` + }, + json: true + }).then((response) => response.body); + } + getUserFriendsOnline(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/friends/online` + }, + json: true + }).then((response) => response.body); + } + getUserFriendsWithStatuses(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends/statuses`, + qs: { + userIds: options.withUserIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + declineAllFriendRequests() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/friend-requests/decline-all`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + acceptFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/accept-friend-request`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + declineFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/decline-friend-request`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + followUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/follow`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + sendFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/request-friendship`, + method: "POST", + json: { + friendshipOriginSourceType: options.source || "Unknown" + } + }, + json: true + }).then((response) => response.body); + } + unFollowUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unfollow`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + unfriendUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unfriend`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getRecommendedUsers() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/recommended-users` + }, + json: true + }).then((response) => response.body); + } +} +exports.FriendsAPI = FriendsAPI; diff --git a/dist/client/apis/GameInternationalizationAPI.d.ts b/dist/client/apis/GameInternationalizationAPI.d.ts new file mode 100644 index 000000000..8a56273ad --- /dev/null +++ b/dist/client/apis/GameInternationalizationAPI.d.ts @@ -0,0 +1,119 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type GameInternationalizationGetGameInfoOptions = { + gameId: number; +}; +export declare type GameInternationalizationGetGameInfo = { + data: { + name: string; + description: string; + languageCode: string; + }[]; +}; +export declare type GameInternationalizationUpdateGameInfoOptions = { + gameId: number; + data: GameInternationalizationGetGameInfo; +}; +export declare type GameInternationalizationUpdateGameInfo = { + successOperations: GameInternationalizationGetGameInfo["data"]; + failedOperations: { + languageCode: string; + errorCode: number; + }[]; +}; +export declare type GameInternationalizationGetNameDescriptionMetaData = { + isNameDescriptionMigrationEnabled: boolean; +}; +export declare type GameInternationalizationGetGameInfoHistoryOptions = { + gameId: number; + requestType: string; + languageCode: string; + cursor: string; + count: number; + sortOrder: "Asc" | "Desc" | string; +}; +export declare type GameInternationalizationGetGameInfoHistory = { + history: { + translationText: string; + translator: { + id: number; + agentType: "User" | string; + }; + created: Date; + }[]; + lastEvaluatedId: string; +}; +export declare type GameInternationalizationGetGameSourceLanguageOptions = { + gameId: number; +}; +export declare type GameInternationalizationGetGameSourceLanguage = { + name: string; + nativeName: string; + languageCode: string; +}; +export declare type GameInternationalizationUpdateGameSourceLanguageOptions = { + gameId: number; + languageCode: string; +}; +export declare type GameInternationalizationUpdateGameSourceLanguage = unknown; +export declare type GameInternationalizationGetGameSupportedLanguagesOptions = { + gameId: number; +}; +export declare type GameInternationalizationGetGameSupportedLanguages = { + data: { + name: string; + languageCodeType: string; + languageCode: string; + }[]; +}; +export declare type GameInternationalizationModifyGameSupportedLanguagesOptions = { + data: { + languageCodeType: string; + languageCode: string; + delete: boolean; + }[]; + gameId: number; +}; +export declare type GameInternationalizationModifyGameSupportedLanguages = unknown; +export declare type GameInternationalizationGetGameAutomaticTranslationResultsOptions = { + gameId: number; +}; +export declare type GameInternationalizationGetGameAutomaticTranslationResults = { + data: { + languageCodeType: string; + languageCode: string; + isAutomaticTranslationEnabled: boolean; + }[]; +}; +export declare type GameInternationalizationGetSupportedLanguagesMetaData = { + isFeatureEnabled: boolean; + areAllLanguagesEnabled: boolean; + minimumUniverseIdForFeature: number; + isHumanTranslationProgressUIEnabled: boolean; + isAutomaticTranslationProgressUIEnabled: boolean; + isSupportedLanguagesChildLocalesUIEnabled: boolean; +}; +export declare type GameInternationalizationToggleAutomaticGameTranslationOptions = { + gameId: number; + languageCode: string; + enableAutomaticTranslation: boolean; +}; +export declare type GameInternationalizationToggleAutomaticGameTranslation = { + gameId: number; + languageCode: string; + isAutomaticTranslationEnabled: boolean; +}; +export declare class GameInternationalizationAPI extends BaseAPI { + constructor(client: Client); + getGameInfo(options: GameInternationalizationGetGameInfoOptions): Promise; + updateGameInfo(options: GameInternationalizationUpdateGameInfoOptions): Promise; + getNameDescriptionMetaData(): Promise; + getGameInfoHistory(options: GameInternationalizationGetGameInfoHistoryOptions): Promise; + getGameSourceLanguage(options: GameInternationalizationGetGameSourceLanguageOptions): Promise; + updateGameSourceLanguage(options: GameInternationalizationUpdateGameSourceLanguageOptions): Promise; + getGameSupportedLanguages(options: GameInternationalizationGetGameSupportedLanguagesOptions): Promise; + modifyGameSupportedLanguages(options: GameInternationalizationModifyGameSupportedLanguagesOptions): Promise; + getGameAutomaticTranslationStatus(options: GameInternationalizationGetGameAutomaticTranslationResultsOptions): Promise; + getSupportedLanguagesMetaData(): Promise; + toggleGameAutomaticTranslation(options: GameInternationalizationToggleAutomaticGameTranslationOptions): Promise; +} diff --git a/dist/client/apis/GameInternationalizationAPI.js b/dist/client/apis/GameInternationalizationAPI.js new file mode 100644 index 000000000..033687db5 --- /dev/null +++ b/dist/client/apis/GameInternationalizationAPI.js @@ -0,0 +1,126 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameInternationalizationAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class GameInternationalizationAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://gameinternationalization.roblox.com/" + }); + } + getGameInfo(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } + updateGameInfo(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}`, + method: "PATCH", + json: { + data: options.data + } + }, + json: true + }).then((response) => response.body); + } + getNameDescriptionMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/metadata` + }, + json: true + }).then((response) => response.body); + } + getGameInfoHistory(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}/history`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getGameSourceLanguage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/source-language/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } + updateGameSourceLanguage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/source-language/games/${options.gameId}`, + method: "PATCH", + qs: { + languageCode: options.languageCode + } + }, + json: true + }).then((response) => response.body); + } + getGameSupportedLanguages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } + modifyGameSupportedLanguages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}`, + method: "PATCH", + json: options.data + }, + json: true + }).then((response) => response.body); + } + getGameAutomaticTranslationStatus(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}/automatic-translation-status` + }, + json: true + }).then((response) => response.body); + } + getSupportedLanguagesMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/metadata` + }, + json: true + }).then((response) => response.body); + } + toggleGameAutomaticTranslation(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}/languages/${options.languageCode}/automatic-translation-status`, + method: "PATCH", + json: String(options.enableAutomaticTranslation).toString() + }, + json: true + }).then((response) => response.body); + } +} +exports.GameInternationalizationAPI = GameInternationalizationAPI; diff --git a/dist/client/apis/GamesAPI.d.ts b/dist/client/apis/GamesAPI.d.ts new file mode 100644 index 000000000..0504f0564 --- /dev/null +++ b/dist/client/apis/GamesAPI.d.ts @@ -0,0 +1,285 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { GameUniverseOptions, PartialGameUniverse, PlaceOptions, VIPServerOptions } from "../../old_structures/Game"; +export declare type GamesGameServer = { + id: string; + maxPlayers: number; + playing: number; + fps: number; + ping: number; + name: string; + vipServerId: number; + accessCode: string; +}; +export declare type GamesGetGameUniversesOptions = { + universeIds: number[]; +}; +export declare type GamesGetGameUniverses = GameUniverseOptions[]; +export declare type GamesGetGameServersByTypeOptions = { + placeId: number; + serverType: "Public" | "Friend" | "VIP"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GamesGetGameServersByType = { + previousPageCursor: string; + nextPageCursor: string; + data: GamesGameServer[]; +}; +export declare type GamesGetGamesProductInfoOptions = { + universeIds: number[]; +}; +export declare type GamesGameGamesProductInfo = { + data: { + universeId: number; + isForSale: boolean; + price: number; + sellerId: number; + productId: number; + }[]; +}; +export declare type GamesListGamesOptions = { + sortToken?: string; + gameFilter?: string; + timeFilter?: string; + genreFilter?: string; + exclusiveStartId?: number; + sortOrder?: string; + gameSetTargetId?: number; + keyword?: string; + startRows?: number; + maxRows?: number; + isKeywordSuggestionEnabled?: boolean; + contextCountryRegionId?: number; + contextUniverseId?: number; + pageContextPageId?: number; + pageContextSeeAll?: boolean; + sortPosition?: number; +}; +export declare type GamesListGames = { + games: { + creatorId: number; + creatorName: string; + creatorType: "User" | "Group" | string; + upVotes: number; + downVotes: number; + universeId: number; + placeId: number; + playerCount: number; + imageToken: string; + users: { + userId: number; + gameId: string; + }[]; + isSponsored: boolean; + nativeAdData: string; + price: number; + analyticsIdentifier: string; + }[]; + suggestedKeyword: string; + correctedKeyword: string; + filteredKeyword: string; + hasMoreRows: boolean; + nextPageExclusiveStartId: number; + featuredSearchUniverseId: number; + emphasis: boolean; + cutOffIndex: number; + algorithm: string; + algorithmQueryType: string; + suggestionAlgorithm: string; +}; +export declare type GamesMultiGetPlacesOptions = { + placeIds: number[]; +}; +export declare type GamesMultiGetPlaces = PlaceOptions[]; +export declare type GamesMultiGetGameUniversesPlayabilityOptions = { + universeIds: number[]; +}; +export declare type GamesMultiGetGameUniversesPlayability = { + playabilityStatus: "UnplayableOtherReason" | string; + isPlayable: boolean; + universeId: number; +}[]; +export declare type GamesGetGameRecommendationsByAlgorithmOptions = { + algorithmName: string; + paginationKey?: string; + maxRows?: number; +}; +export declare type GamesGetGameRecommendationsByAlgorithm = { + games: GamesListGames["games"]; + nextPaginationKey: string | null; +}; +export declare type GamesGetGameRecommendationsByGameOptions = { + universeId: number; + paginationKey?: string; + maxRows?: number; +}; +export declare type GamesGetGameRecommendationsByGame = GamesGetGameRecommendationsByAlgorithm; +export declare type GamesGetGameSortsOptions = { + gameSortsContext?: "GamesDefaultSorts" | "GamesAllSorts" | "HomeSorts" | "ChatSorts" | "UnifiedHomeSorts" | "GamesPageAbTestSorts1" | "GamesPageAbTestSorts2"; +}; +export declare type GamesGetGameSorts = { + sorts: { + token: string; + name: string; + displayName: string; + gameSetTargetId: null; + timeOptionsAvailable: boolean; + genreOptionsAvailable: boolean; + numberOfRows: number; + numberOfGames: null; + isDefaultSort: boolean; + contextUniverseId: null; + contextCountryRegionId: number; + tokenExpiryInSeconds: number; + }[]; + timeFilters: { + token: string; + name: string; + tokenExpiryInSeconds: number; + }[]; + genreFilters: { + token: string; + name: string; + tokenExpiryInSeconds: number; + }[]; + pageContext: { + pageId: string; + isSeeAllPage: boolean; + }; +}; +export declare type GamesIsGameFavoritedOptions = { + universeId: number; +}; +export declare type GamesIsGameFavorited = { + isFavorited: boolean; +}; +export declare type GamesToggleGameFavoriteOptions = { + universeId: number; + favorite: boolean; +}; +export declare type GamesToggleGameFavorite = unknown; +export declare type GamesGetGameFavoriteCountOptions = { + universeId: number; +}; +export declare type GamesGetGameFavoriteCount = { + favoritesCount: number; +}; +export declare type GamesGetGameGamePassesOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GamesGetGameGamePasses = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + name: string; + displayName: string; + productId: number; + price: number; + }[]; +}; +export declare type GamesGetSelfUniverseVoteStatusOptions = { + universeId: number; +}; +export declare type GamesGetSelfUniverseVoteStatus = { + canVote: boolean; + userVote: boolean; + reasonForNotVoteable: string; +}; +export declare type GamesGetGamesVotesOptions = { + universeIds: number[]; +}; +export declare type GamesGetGamesVotes = { + data: { + number: PartialGameUniverse; + upVotes: number; + downVotes: number; + }[]; +}; +export declare type GamesSetSelfGameVoteOptions = { + universeId: number; + vote: boolean; +}; +export declare type GamesSetSelfGameVote = unknown; +export declare type GamesCanSelfInviteUserToVIPServerOptions = { + userId: number; +}; +export declare type GamesCanSelfInviteUserToVIPServer = { + canInvite: boolean; +}; +export declare type GamesGetVIPServerOptions = { + id: number; +}; +export declare type GamesGetVIPServer = VIPServerOptions; +export declare type GamesUpdateVIPServerOptions = { + id: number; + name: string; + newJoinCode: boolean; + active: boolean; +}; +export declare type GamesUpdateVIPServer = VIPServerOptions; +export declare type GamesCreateVIPServerOptions = { + universeId: number; + name: string; + expectedPrice: number; +}; +export declare type GamesCreateVIPServer = GamesGameServer; +export declare type GamesUpdateVIPServerPermissionsOptions = { + id: number; + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + usersToAdd: number[]; + usersToRemove: number[]; +}; +export declare type GamesUpdateVIPServerPermissions = { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: { + id: number; + name: string; + displayName: string; + }[]; +}; +export declare type GamesUpdateVIPServerSubscriptionOptions = { + id: number; + active: boolean; + price: number; +}; +export declare type GamesUpdateVIPServerSubscription = { + active: boolean; + expired: boolean; + expirationDate: string; + price: number; +}; +export declare class GamesAPI extends BaseAPI { + constructor(client: Client); + getGames(options: GamesGetGameUniversesOptions): Promise; + getGameServersByType(options: GamesGetGameServersByTypeOptions): Promise; + getGamesProductInfo(options: GamesGetGamesProductInfoOptions): Promise; + listGames(options: GamesListGamesOptions): Promise; + getMultiPlaces(options: GamesMultiGetPlacesOptions): Promise; + getMultiGamesPlayabilityStatus(options: GamesMultiGetGameUniversesPlayabilityOptions): Promise; + getGameRecommendationsByAlgorithm(options: GamesGetGameRecommendationsByAlgorithmOptions): Promise; + getGameRecommendationsByGame(options: GamesGetGameRecommendationsByGameOptions): Promise; + getGameSorts(options: GamesGetGameSortsOptions): Promise; + isGameFavorited(options: GamesIsGameFavoritedOptions): Promise; + toggleGameFavorite(options: GamesToggleGameFavoriteOptions): Promise; + getGameFavoriteCount(options: GamesGetGameFavoriteCountOptions): Promise; + getGameGamePasses(options: GamesGetGameGamePassesOptions): Promise; + getSelfGameVote(options: GamesGetSelfUniverseVoteStatusOptions): Promise; + getGamesVotes(options: GamesGetGamesVotesOptions): Promise; + setSelfGameVote(options: GamesSetSelfGameVoteOptions): Promise; + canSelfInviteUserToVIPServer(options: GamesCanSelfInviteUserToVIPServerOptions): Promise; + getVIPServer(options: GamesGetVIPServerOptions): Promise; + updateVIPServer(options: GamesUpdateVIPServerOptions): Promise; + createVIPServer(options: GamesCreateVIPServerOptions): Promise; + updateVIPServerPermissions(options: GamesUpdateVIPServerPermissionsOptions): Promise; + updateVIPServerSubscription(options: GamesUpdateVIPServerSubscriptionOptions): Promise; +} diff --git a/dist/client/apis/GamesAPI.js b/dist/client/apis/GamesAPI.js new file mode 100644 index 000000000..59502486a --- /dev/null +++ b/dist/client/apis/GamesAPI.js @@ -0,0 +1,264 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GamesAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class GamesAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://games.roblox.com/" + }); + } + getGames(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } + getGameServersByType(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.placeId}/servers/${options.serverType}`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getGamesProductInfo(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/games-product-info?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } + listGames(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/list`, + qs: { + "model.sortToken": options.sortToken, + "model.gameFilter": options.gameFilter, + "model.timeFilter": options.timeFilter, + "model.genreFilter": options.genreFilter, + "model.exclusiveStartId": options.exclusiveStartId, + "model.sortOrder": options.sortOrder, + "model.gameSetTargetId": options.gameSetTargetId, + "model.keyword": options.keyword, + "model.startRows": options.startRows, + "model.maxRows": options.maxRows, + "model.isKeywordSuggestionEnabled": options.isKeywordSuggestionEnabled, + "model.contextCountryRegionId": options.contextCountryRegionId, + "model.contextUniverseId": options.contextUniverseId, + "model.pageContext.pageId": options.pageContextPageId, + "model.pageContext.isSeeAllPage": options.pageContextSeeAll, + "model.sortPosition": options.sortPosition + } + }, + json: true + }).then((response) => response.body); + } + getMultiPlaces(options) { + const placeIdsQueryString = `placeIds=${options.placeIds.join("&placeIds=")}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/multiget-place-details?${placeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } + getMultiGamesPlayabilityStatus(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/multiget-playability-status?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } + getGameRecommendationsByAlgorithm(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/recommendations/algorithm/${options.algorithmName}`, + qs: { + "model.paginationKey": options.paginationKey, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } + getGameRecommendationsByGame(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/recommendations/game/${options.universeId}`, + qs: { + "model.paginationKey": options.paginationKey, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } + getGameSorts(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/sorts`, + qs: { + "model.gameSortsContext": options.gameSortsContext + } + }, + json: true + }).then((response) => response.body); + } + isGameFavorited(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites` + }, + json: true + }).then((response) => response.body); + } + toggleGameFavorite(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites`, + method: "POST", + json: { + isFavorited: options.favorite + } + }, + json: true + }).then((response) => response.body); + } + getGameFavoriteCount(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites/count` + }, + json: true + }).then((response) => response.body); + } + getGameGamePasses(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/game-passes`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSelfGameVote(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/votes/user` + }, + json: true + }).then((response) => response.body); + } + getGamesVotes(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/votes?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } + setSelfGameVote(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/user-votes`, + method: "PATCH", + json: { + vote: options.vote + } + }, + json: true + }).then((response) => response.body); + } + canSelfInviteUserToVIPServer(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-server/can-invite/${options.userId}` + }, + json: true + }).then((response) => response.body); + } + getVIPServer(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-servers/${options.id}`, + qs: options + }, + json: true + }).then((response) => response.body); + } + updateVIPServer(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-servers/${options.id}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + createVIPServer(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.universeId}`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + updateVIPServerPermissions(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.id}/permissions`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + updateVIPServerSubscription(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.id}/subscription`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.GamesAPI = GamesAPI; diff --git a/dist/client/apis/GeneralAPI.d.ts b/dist/client/apis/GeneralAPI.d.ts new file mode 100644 index 000000000..7e61a5c24 --- /dev/null +++ b/dist/client/apis/GeneralAPI.d.ts @@ -0,0 +1,180 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { AssetVersionOptions, ProductOptions } from "../../old_structures/Asset"; +export declare type GeneralGetAssetVersionOptions = number; +export declare type GeneralAwardBadgeOptions = { + userId: number; + badgeId: number; + placeId: number; +}; +export declare type GeneralGetUserFriendsOptions = { + userId: number; + page: number; +}; +export declare type GeneralAcceptFriendRequestOptions = { + userId: number; +}; +export declare type GeneralDeclineFriendRequestOptions = { + userId: number; +}; +export declare type GeneralSendFriendRequestOptions = { + userId: number; +}; +export declare type GeneralGetUserFriendsCountOptions = { + userId: number; +}; +export declare type GeneralUnfriendUserOptions = { + userId: number; +}; +export declare type GeneralIsUserFollowingOptions = { + userId: number; + followUserId: number; +}; +export declare type GeneralFollowUserOptions = { + userId: number; +}; +export declare type GeneralUnfollowUserOptions = { + userId: number; +}; +export declare type GeneralGetUserGroupsOptions = { + userId: number; +}; +export declare type GeneralGetGroupOptions = { + groupId: number; +}; +export declare type GeneralGetGroupAlliesOptions = { + groupId: number; + page: number; +}; +export declare type GeneralGetGroupEnemiesOptions = { + groupId: number; + page: number; +}; +export declare type GeneralGetProductInfoOptions = { + assetId: number; +}; +export declare type GeneralGetGamePassProductInfoOptions = { + gamePassId: number; +}; +export declare type GeneralUserOwnsAssetOptions = { + userId: number; + assetId: number; +}; +export declare type GeneralBlockUserOptions = { + userId: number; +}; +export declare type GeneralUnblockUserOptions = { + userId: number; +}; +export declare type GeneralGetUserByUsernameOptions = { + username: string; +}; +export declare type GeneralUserCanManageAssetOptions = { + userId: number; + assetId: number; +}; +export declare type GeneralGetUserByIdOptions = { + userId: number; +}; +export declare type GeneralGetAssetVersions = AssetVersionOptions[]; +export declare type GeneralAwardBadge = boolean; +export declare type GeneralGetBalance = { + robux: number; +}; +export declare type GeneralGetUserFriends = { + Id: number; + Username: string; + AvatarUri: string; + AvatarFinal: boolean; + IsOnline: boolean; +}[]; +export declare type GeneralAcceptFriendRequest = boolean; +export declare type GeneralDeclineFriendRequest = boolean; +export declare type GeneralSendFriendRequest = boolean; +export declare type GeneralGetUserFriendsCount = { + count: number; +}; +export declare type GeneralUnfriendUser = boolean; +export declare type GeneralIsUserFollowing = boolean; +export declare type GeneralFollowUser = boolean; +export declare type GeneralUnfollowUser = boolean; +export declare type GeneralGetUserGroups = { + id: number; + name: string; + emblemId: number | null; + emblemUrl: string | null; + role: { + rank: number; + name: string; + }; + inClan: boolean; + primary: boolean; +}[]; +export declare type GeneralGetGroup = { + Name: string; + Id: number; + Owner: { + Name: string; + Id: number; + }; + EmblemUrl: string; + Description: string; + Roles: { + Name: string; + Rank: number; + }[]; +}; +export declare type GeneralGetGroupAllies = { + Groups: GeneralGetGroup[]; + FinalPage: boolean; +}; +export declare type GeneralGetGroupEnemies = GeneralGetGroupAllies; +export declare type GeneralGetIncomingItems = { + unreadMessageCount: number; + friendRequestsCount: number; +}; +export declare type GeneralGetProductInfo = ProductOptions; +export declare type GeneralGetGamePassProductInfo = ProductOptions; +export declare type GeneralUserOwnsAsset = boolean; +export declare type GeneralGetDeviceInfo = { + platformType: string; + deviceType: string; + operatingSystemType: string; +}; +export declare type GeneralBlockUser = boolean; +export declare type GeneralUnblockUser = boolean; +export declare type GeneralGetUserById = { + id: number; + name: string; +}; +export declare type GeneralGetUserByUsername = GeneralGetUserById; +export declare type GeneralUserCanManageAsset = boolean; +export declare class GeneralAPI extends BaseAPI { + constructor(client: Client); + getAssetVersions(options: GeneralGetAssetVersionOptions): Promise; + awardBadge(options: GeneralAwardBadgeOptions): Promise; + getBalance(): Promise; + getUserFriends(options: GeneralGetUserFriendsOptions): Promise; + acceptFriendRequest(options: GeneralAcceptFriendRequestOptions): Promise; + declineFriendRequest(options: GeneralDeclineFriendRequestOptions): Promise; + sendFriendRequest(options: GeneralSendFriendRequestOptions): Promise; + getUserFriendsCount(options: GeneralGetUserFriendsCountOptions): Promise; + unfriendUser(options: GeneralUnfriendUserOptions): Promise; + isUserFollowing(options: GeneralIsUserFollowingOptions): Promise; + followUser(options: GeneralFollowUserOptions): Promise; + unfollowUser(options: GeneralUnfollowUserOptions): Promise; + getUserGroups(options: GeneralGetUserGroupsOptions): Promise; + getGroup(options: GeneralGetGroupOptions): Promise; + getGroupAllies(options: GeneralGetGroupAlliesOptions): Promise; + getGroupEnemies(options: GeneralGetGroupEnemiesOptions): Promise; + getIncomingItems(): Promise; + getProductInfo(options: GeneralGetProductInfoOptions): Promise; + getGamePassProductInfo(options: GeneralGetGamePassProductInfoOptions): Promise; + userOwnsAsset(options: GeneralUserOwnsAssetOptions): Promise; + getDeviceInfo(): Promise; + blockUser(options: GeneralBlockUserOptions): Promise; + unblockUser(options: GeneralUnblockUserOptions): Promise; + getUserById(options: GeneralGetUserByIdOptions): Promise; + getUserByUsername(options: GeneralGetUserByUsernameOptions): Promise; + userCanManageAsset(options: GeneralUserCanManageAssetOptions): Promise; +} diff --git a/dist/client/apis/GeneralAPI.js b/dist/client/apis/GeneralAPI.js new file mode 100644 index 000000000..c1a747c2d --- /dev/null +++ b/dist/client/apis/GeneralAPI.js @@ -0,0 +1,293 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GeneralAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class GeneralAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + baseUrl: "https://api.roblox.com/", + client + }); + } + getAssetVersions(options) { + return this.request({ + requiresAuth: true, + request: { + path: `assets/${options}/versions` + }, + json: true + }).then((response) => response.body); + } + awardBadge(options) { + return this.request({ + requiresAuth: true, + request: { + path: "assets/award-badge", + method: "POST", + qs: options + } + }).then(() => true); + } + getBalance() { + return this.request({ + requiresAuth: true, + request: { + path: "currency/balance" + } + }).then((response) => response.body); + } + getUserFriends(options) { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/friends`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } + acceptFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/accept-friend-request", + method: "POST", + qs: { + requesterUserId: options.userId + } + } + }).then(() => true); + } + declineFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/decline-friend-request", + method: "POST", + qs: { + requesterUserId: options.userId + } + } + }).then(() => true); + } + sendFriendRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/request-friendship", + method: "POST", + qs: { + recipientUserId: options.userId + } + } + }).then(() => true); + } + getUserFriendsCount(options) { + return this.request({ + requiresAuth: false, + request: { + path: "user/get-friendship-count", + qs: options + }, + json: true + }).then((response) => response.body.count); + } + unfriendUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/unfriend", + method: "POST", + qs: { + friendUserId: options.userId + } + } + }).then(() => true); + } + isUserFollowing(options) { + return this.request({ + requiresAuth: false, + request: { + path: "user/following-exists", + qs: options + } + }).then((response) => response.body.isFollowing); + } + followUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/follow", + method: "POST", + qs: { + followedUserId: options.userId + } + } + }).then(() => true); + } + unfollowUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: "user/unfollow", + method: "POST", + qs: { + followedUserId: options.userId + } + } + }).then(() => true); + } + getUserGroups(options) { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/groups` + } + }).then((response) => response.body); + } + getGroup(options) { + return this.request({ + requiresAuth: false, + request: { + path: `groups/${options.groupId}` + }, + json: true + }).then((response) => response.body); + } + getGroupAllies(options) { + return this.request({ + requiresAuth: true, + request: { + path: `groups/${options.groupId}/allies`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } + getGroupEnemies(options) { + return this.request({ + requiresAuth: true, + request: { + path: `groups/${options.groupId}/enemies`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } + getIncomingItems() { + return this.request({ + requiresAuth: true, + request: { + path: "incoming-items/counts" + }, + json: true + }).then((response) => ({ + friendRequestsCount: response.body.friendRequestsCount, + unreadMessageCount: response.body.unreadMessageCount + })); + } + getProductInfo(options) { + return this.request({ + requiresAuth: false, + request: { + path: "marketplace/productinfo", + qs: options + }, + json: true + }).then((response) => response.body); + } + getGamePassProductInfo(options) { + return this.request({ + requiresAuth: false, + request: { + path: "marketplace/game-pass-product-info", + qs: options + }, + json: true + }).then((response) => response.body); + } + userOwnsAsset(options) { + return this.request({ + requiresAuth: false, + request: { + path: "ownership/hasasset", + qs: options + } + }).then((response) => response.body.includes("true")); + } + getDeviceInfo() { + return this.request({ + requiresAuth: false, + request: { + path: "reference/deviceinfo" + } + }).then((response) => ({ + deviceType: response.body.DeviceType, + operatingSystemType: response.body.OperationSystemType, + platformType: response.body.PlatformType + })); + } + blockUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: "userblock/block", + qs: options, + method: "POST" + }, + json: true + }).then((response) => response.body.success === true); + } + unblockUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: "userblock/unblock", + qs: options, + method: "POST" + }, + json: true + }).then((response) => response.body.success === true); + } + getUserById(options) { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}` + }, + json: true + }).then((response) => ({ + id: response.body.Id, + name: response.body.Username + })); + } + getUserByUsername(options) { + return this.request({ + requiresAuth: false, + request: { + path: "users/get-by-username", + qs: options + }, + json: true + }).then((response) => ({ + id: response.body.Id, + name: response.body.Username + })); + } + userCanManageAsset(options) { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/canmanage/${options.assetId}` + }, + json: true + }).then((response) => response.body.CanManage === true); + } +} +exports.GeneralAPI = GeneralAPI; diff --git a/dist/client/apis/GroupsAPI.d.ts b/dist/client/apis/GroupsAPI.d.ts new file mode 100644 index 000000000..f0b588829 --- /dev/null +++ b/dist/client/apis/GroupsAPI.d.ts @@ -0,0 +1,665 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type GroupsGroupRolePermissionsOptions = { + groupId: number; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + permissions: { + groupPostsPermissions: { + viewWall: boolean; + postToWall: boolean; + deleteFromWall: boolean; + viewStatus: boolean; + postToStatus: boolean; + }; + groupMembershipPermissions: { + changeRank: boolean; + inviteMembers: boolean; + removeMembers: boolean; + }; + groupManagementPermissions: { + manageRelationships: boolean; + manageClan: boolean; + viewAuditLogs: boolean; + }; + groupEconomyPermissions: { + spendGroupFunds: boolean; + advertiseGroup: boolean; + createItems: boolean; + manageItems: boolean; + addGroupPlaces: boolean; + manageGroupGames: boolean; + viewGroupPayouts: boolean; + }; + }; +}; +export declare type GroupsGroupRoleOptions = { + id?: number; + name?: string; + rank?: number; + group: { + id: number; + name?: string; + }; +}; +export declare type GroupsGroupOptions = { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + } | null; + shout: { + body: string; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + } | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +}; +export declare type GroupsGetGroupOptions = { + groupId: number; +}; +export declare type GroupsGetGroup = { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + shout: { + body: string; + poster: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + }; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +}; +export declare type GroupsGetMultiGroupsOptions = { + groupIds: number[]; +}; +export declare type GroupsGetMultiGroups = { + data: GroupsGroupOptions[]; +}; +export declare type GroupsGetGroupAuditLogsOptions = { + groupId: number; + actionType: "DeletePost" | "RemoveMember" | "AcceptJoinRequest" | "DeclineJoinRequest" | "PostStatus" | "ChangeRank" | "BuyAd" | "SendAllyRequest" | "CreateEnemy" | "AcceptAllyRequest" | "DeclineAllyRequest" | "DeleteAlly" | "DeleteEnemy" | "AddGroupPlace" | "RemoveGroupPlace" | "CreateItems" | "ConfigureItems" | "SpendGroupFunds" | "ChangeOwner" | "Delete" | "AdjustCurrencyAmounts" | "Abandon" | "Claim" | "Rename" | "ChangeDescription" | "InviteToClan" | "KickFromClan" | "CancelCLanInvite" | "BuyClan" | "CreateGroupAsset" | "UpdateGroupAsset" | "ConfigureGroupAsset" | "RevertGroupAsset" | "CreateGroupDeveloperProduct" | "ConfigureGroupGame" | "Lock" | "Unlock" | "CreateGamePass" | "CreateBadge" | "ConfigureBadge" | "SavePlace" | "PublishPlace"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsGetGroupAuditLogs = { + previousPageCursor: string; + nextPageCursor: string; + data: { + actor: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + }; + actionType: string; + description: unknown; + created: string; + }[]; +}; +export declare type GroupsGetGroupSettingsOptions = { + groupId: number; +}; +export declare type GroupsGetGroupSettings = { + groupId: number; + isApprovalRequired: boolean; + isBuildersClubRequired: boolean; + areEnemiesAllowed: boolean; + areGroupFundsVisible: boolean; + areGroupGamesVisible: boolean; +}; +export declare type GroupsUpdateGroupSettingsOptions = GroupsGetGroupSettings; +export declare type GroupsUpdateGroupSettings = unknown; +export declare type GroupsGetGroupConfigurationMetaData = { + groupConfiguration: { + nameMaxLength: number; + descriptionMaxLength: number; + iconMaxFileSizeMb: number; + cost: number; + }; + recurringPayoutsConfiguration: { + maxPayoutPartners: number; + }; + roleConfiguration: { + nameMaxLength: number; + descriptionMaxLength: number; + limit: number; + cost: number; + minRank: number; + maxRank: number; + }; + isPremiumPayoutsEnabled: boolean; + isDefaultEmblemPolicyEnabled: boolean; +}; +export declare type GroupsGetGroupsMetaData = { + groupLimit: number; + currentGroupCount: number; + groupStatusMaxLength: number; + groupPostMaxLength: number; + isGroupWallNotificationsEnabled: boolean; + groupWallNotificationsSubscribeIntervalInMilliseconds: number; + areProfileGroupsHidden: boolean; + isGroupDetailsPolicyEnabled: boolean; + showPreviousGroupNames: boolean; +}; +export declare type GroupsCreateGroupOptions = { + name: string; + description: string; + publicGroup: boolean; + buildersClubMembersOnly: boolean; + files: unknown; +}; +export declare type GroupsCreateGroup = GroupsGroupOptions; +export declare type GroupsUpdateGroupDescriptionOptions = { + groupId: number; + description: string; +}; +export declare type GroupsUpdateGroupDescription = { + newDescription: string; +}; +export declare type GroupsUpdateGroupStatusOptions = { + groupId: number; + message: string; +}; +export declare type GroupsUpdateGroupStatus = GroupsGroupOptions["shout"]; +export declare type GroupsUpdateGroupIconOptions = { + groupId: number; + files: unknown; +}; +export declare type GroupsUpdateGroupIcon = unknown; +export declare type GroupsDeclineJoinRequestsOptions = { + groupId: number; + userIds: number[]; +}; +export declare type GroupsDeclineJoinRequests = unknown; +export declare type GroupsGetJoinRequestsOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsGetJoinRequests = { + previousPageCursor: string; + nextPageCursor: string; + data: { + requester: { + userId: number; + username: string; + displayName: string; + }; + created: string; + }[]; +}; +export declare type GroupsAcceptJoinRequestsOptions = { + groupId: number; + userIds: number[]; +}; +export declare type GroupsAcceptJoinRequests = unknown; +export declare type GroupsDeclineJoinRequestOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsDeclineJoinRequest = unknown; +export declare type GroupsGetJoinRequestOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsGetJoinRequest = GroupsGetJoinRequests["data"][0]; +export declare type GroupsAcceptJoinRequestOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsAcceptJoinRequest = unknown; +export declare type GroupsGetSelfGroupMembershipOptions = { + groupId: number; +}; +export declare type GroupsGetSelfGroupMembership = { + groupId: number; + isPrimary: boolean; + isPendingJoin: boolean; + userRole: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + }; + permissions: GroupsGroupRolePermissionsOptions["permissions"]; +}; +export declare type GroupsGetGroupRolesOptions = { + groupId: number; +}; +export declare type GroupsGetGroupRoles = { + groupId: number; + roles: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }[]; +}; +export declare type GroupsGetMembersWithRoleOptions = { + groupId: number; + roleId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsGetMembersWithRole = { + previousPageCursor: string; + nextPageCursor: string; + data: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }[]; +}; +export declare type GroupsGetMembersOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsGetMembers = GroupsGetMembersWithRole; +export declare type GroupsJoinGroupOptions = { + groupId: number; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export declare type GroupsJoinGroup = unknown; +export declare type GroupsGetSelfPendingGroupJoins = { + data: GroupsGroupOptions[]; +}; +export declare type GroupsGetUserGroupsOptions = { + userId: number; +}; +export declare type GroupsGetUserGroups = { + data: { + group: GroupsGroupOptions; + role: GroupsGetGroupRoles["roles"][0]; + }[]; +}; +export declare type GroupsChangeOwnerOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsChangeOwner = unknown; +export declare type GroupsClaimGroupOptions = { + groupId: number; +}; +export declare type GroupsClaimGroup = unknown; +export declare type GroupsKickMemberOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsKickMember = unknown; +export declare type GroupsUpdateMemberOptions = { + groupId: number; + userId: number; + roleId: number; +}; +export declare type GroupsUpdateMember = unknown; +export declare type GroupsGetGroupPayoutsOptions = { + groupId: number; +}; +export declare type GroupsGetGroupPayouts = { + data: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + percentage: number; + }[]; +}; +export declare type GroupsPayoutMembersOptions = { + groupId: number; + users: { + userId: number; + amount: number; + }[]; + type: "FixedAmount" | "Percentage" | string; +}; +export declare type GroupsPayoutMembers = unknown; +export declare type GroupsUpdateRecurringPayoutsOptions = GroupsPayoutMembersOptions; +export declare type GroupsUpdateRecurringPayouts = unknown; +export declare type GroupsGetGroupRelationshipsOptions = { + groupId: number; + relationshipType: "enemies" | "allies"; + startRowIndex?: number; + maxRows?: number; +}; +export declare type GroupsGetGroupRelationships = { + groupId: number; + relationshipType: GroupsGetGroupRelationshipsOptions["relationshipType"]; + totalGroupCount: number; + relatedGroups: GroupsGroupOptions[]; + nextRowIndex: number; +}; +export declare type GroupsDeclineRelationshipRequestsOptions = { + groupId: number; + relationshipType: GroupsGetGroupRelationshipsOptions["relationshipType"]; + withGroups: number[]; +}; +export declare type GroupsDeclineRelationshipRequests = unknown; +export declare type GroupsGetRelationshipRequestsOptions = GroupsGetGroupRelationshipsOptions; +export declare type GroupsGetRelationshipRequests = GroupsGetGroupRelationships; +export declare type GroupsAcceptRelationshipRequestsOptions = GroupsDeclineRelationshipRequestsOptions; +export declare type GroupsAcceptRelationshipRequests = unknown; +export declare type GroupsDeleteRelationshipOptions = Omit & { + withGroup: number; +}; +export declare type GroupsDeleteRelationship = unknown; +export declare type GroupsCreateRelationshipOptions = Omit & { + withGroup: number; +}; +export declare type GroupsCreateRelationship = unknown; +export declare type GroupsDeclineRelationshipRequestOptions = Omit & { + withGroup: number; +}; +export declare type GroupsDeclineRelationshipRequest = unknown; +export declare type GroupsAcceptRelationshipRequestOptions = GroupsDeclineRelationshipRequestOptions; +export declare type GroupsAcceptRelationshipRequest = unknown; +export declare type GroupsGetRolePermissionsOptions = { + groupId: number; + roleId: number; +}; +export declare type GroupsGetRolePermissions = GroupsGroupRolePermissionsOptions; +export declare type GroupsUpdateRolePermissionsOptions = { + groupId: number; + roleId: number; + DeleteFromWall: boolean; + PostToWall: boolean; + InviteMembers: boolean; + PostToStatus: boolean; + RemoveMembers: boolean; + ViewStatus: boolean; + ViewWall: boolean; + ChangeRank: boolean; + AdvertiseGroup: boolean; + ManageRelationships: boolean; + AddGroupPlaces: boolean; + ViewAuditLogs: boolean; + CreateItems: boolean; + ManageItems: boolean; + SpendGroupFunds: boolean; + ManageClan: boolean; + ManageGroupGames: boolean; +}; +export declare type GroupsUpdateRolePermissions = unknown; +export declare type GroupsGetGuestPermissionsOptions = { + groupId: number; +}; +export declare type GroupsGetGuestPermissions = GroupsGroupRolePermissionsOptions; +export declare type GroupsGetAllRolesPermissionsOptions = { + groupId: number; +}; +export declare type GroupsGetAllRolesPermissions = { + data: GroupsGroupRolePermissionsOptions[]; +}; +export declare type GroupsGetSocialLinksOptions = { + groupId: number; +}; +export declare type GroupsGetSocialLinks = { + data: { + id: number; + type: "Facebook" | string; + url: string; + title: string; + }[]; +}; +export declare type GroupsPostSocialLinkOptions = { + groupId: number; + type: "Facebook" | string; + url: string; + title: string; +}; +export declare type GroupsPostSocialLink = GroupsGetSocialLinks["data"][0]; +export declare type GroupsDeleteSocialLinkOptions = { + groupId: number; + id: number; +}; +export declare type GroupsDeleteSocialLink = unknown; +export declare type GroupsUpdateSocialLinkOptions = { + groupId: number; + id: number; + type: "Facebook" | string; + url: string; + title: string; +}; +export declare type GroupsUpdateSocialLink = unknown; +export declare type GroupsGetWallPostsOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsGetWallPosts = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + body: string; + created: string; + updated: string; + poster: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + }[]; +}; +export declare type GroupsCreateWallPostOptions = { + groupId: number; + body: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export declare type GroupsCreateWallPost = GroupsGetWallPosts["data"][0]; +export declare type GroupsDeleteWallPostOptions = { + groupId: number; + id: number; +}; +export declare type GroupsDeleteWallPost = unknown; +export declare type GroupsDeleteWallPostsByUserOptions = { + groupId: number; + userId: number; +}; +export declare type GroupsDeleteWallPostsByUser = unknown; +export declare type GroupsSearchGroupsByKeywordOptions = { + keyword: string; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GroupsSearchGroupsByKeyword = { + keyword: string; + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + name: string; + description: string; + memberCount: number; + publicEntryAllowed: boolean; + created: string; + updated: string; + }[]; +}; +export declare type GroupsSearchGroupsOptions = { + groupName: string; +}; +export declare type GroupsSearchGroups = { + data: { + id: number; + name: string; + memberCount: number; + }[]; +}; +export declare type GroupsGetGroupSearchMetaData = { + SuggestedGroupKeywords: string[]; +}; +export declare type GroupsGetRolesByIdsOptions = { + roleIds: number[]; +}; +export declare type GroupsGetRolesByIds = { + data: { + groupId: number; + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }[]; +}; +export declare type GroupsGetUserPrimaryGroupOptions = { + userId: number; +}; +export declare type GroupsGetUserPrimaryGroup = { + group?: GroupsGroupOptions; + role?: GroupsGroupRoleOptions; + isPrimaryGroup?: boolean; +}; +export declare type GroupsRemovePrimaryGroup = unknown; +export declare type GroupsSetPrimaryGroupOptions = { + groupId: number; +}; +export declare type GroupsSetPrimaryGroup = unknown; +export declare type GroupsCreateRoleOptions = { + groupId: number; + name: string; + description: string; + rank: number; + usingGroupFunds: boolean; +}; +export declare type GroupsCreateRole = Omit; +export declare type GroupsDeleteRoleOptions = { + groupId: number; + roleId: number; +}; +export declare type GroupsDeleteRole = unknown; +export declare type GroupsUpdateRoleOptions = { + groupId: number; + roleId: number; + name: string; + description: string; + rank: number; +}; +export declare type GroupsUpdateRole = GroupsCreateRole; +export declare class GroupsAPI extends BaseAPI { + constructor(client: Client); + getGroup(options: GroupsGetGroupOptions): Promise; + getMultiGroups(options: GroupsGetMultiGroupsOptions): Promise; + getAuditLogs(options: GroupsGetGroupAuditLogsOptions): Promise; + getGroupSettings(options: GroupsGetGroupSettingsOptions): Promise; + updateGroupSettings(options: GroupsUpdateGroupSettingsOptions): Promise; + getGroupConfigurationMetaData(): Promise; + getGroupsMetaData(): Promise; + createGroup(options: GroupsCreateGroupOptions): Promise; + updateGroupDescription(options: GroupsUpdateGroupDescriptionOptions): Promise; + updateGroupStatus(options: GroupsUpdateGroupStatusOptions): Promise; + updateGroupIcon(options: GroupsUpdateGroupIconOptions): Promise; + declineJoinRequests(options: GroupsDeclineJoinRequestsOptions): Promise; + getJoinRequests(options: GroupsGetJoinRequestsOptions): Promise; + acceptJoinRequests(options: GroupsAcceptJoinRequestsOptions): Promise; + declineJoinRequest(options: GroupsDeclineJoinRequestOptions): Promise; + getJoinRequest(options: GroupsGetJoinRequestOptions): Promise; + acceptJoinRequest(options: GroupsAcceptJoinRequestOptions): Promise; + getSelfGroupMembership(options: GroupsGetSelfGroupMembershipOptions): Promise; + getGroupRoles(options: GroupsGetGroupRolesOptions): Promise; + getMembersWithRole(options: GroupsGetMembersWithRoleOptions): Promise; + getMembers(options: GroupsGetMembersOptions): Promise; + joinGroup(options: GroupsJoinGroupOptions): Promise; + getSelfPendingGroupJoins(): Promise; + getUserGroups(options: GroupsGetUserGroupsOptions): Promise; + changeGroupOwner(options: GroupsChangeOwnerOptions): Promise; + claimGroup(options: GroupsClaimGroupOptions): Promise; + kickMember(options: GroupsKickMemberOptions): Promise; + updateMember(options: GroupsUpdateMemberOptions): Promise; + getGroupPayouts(options: GroupsGetGroupPayoutsOptions): Promise; + payoutMembers(options: GroupsPayoutMembersOptions): Promise; + updateRecurringPayouts(options: GroupsUpdateRecurringPayoutsOptions): Promise; + getGroupRelationships(options: GroupsGetGroupRelationshipsOptions): Promise; + declineRelationshipRequests(options: GroupsDeclineRelationshipRequestsOptions): Promise; + getRelationshipRequests(options: GroupsGetRelationshipRequestsOptions): Promise; + acceptRelationshipRequests(options: GroupsAcceptRelationshipRequestsOptions): Promise; + deleteRelationship(options: GroupsDeleteRelationshipOptions): Promise; + createRelationship(options: GroupsCreateRelationshipOptions): Promise; + acceptRelationshipRequest(options: GroupsAcceptRelationshipRequestOptions): Promise; + declineRelationshipRequest(options: GroupsDeclineRelationshipRequestOptions): Promise; + getRolePermissions(options: GroupsGetRolePermissionsOptions): Promise; + updateRolePermissions(options: GroupsUpdateRolePermissionsOptions): Promise; + getGuestPermissions(options: GroupsGetGuestPermissionsOptions): Promise; + getAllRolesPermissions(options: GroupsGetAllRolesPermissionsOptions): Promise; + getSocialLinks(options: GroupsGetSocialLinksOptions): Promise; + createSocialLink(options: GroupsPostSocialLinkOptions): Promise; + deleteSocialLink(options: GroupsDeleteSocialLinkOptions): Promise; + updateSocialLink(options: GroupsUpdateSocialLinkOptions): Promise; + getWallPosts(options: GroupsGetWallPostsOptions): Promise; + createWallPost(options: GroupsCreateWallPostOptions): Promise; + deleteWallPost(options: GroupsDeleteWallPostOptions): Promise; + deleteUserWallPosts(options: GroupsDeleteWallPostsByUserOptions): Promise; + searchGroupsByKeyword(options: GroupsSearchGroupsByKeywordOptions): Promise; + searchGroups(options: GroupsSearchGroupsOptions): Promise; + getGroupSearchMetaData(): Promise; + getRolesByIds(options: GroupsGetRolesByIdsOptions): Promise; + getUserPrimaryGroup(options: GroupsGetUserPrimaryGroupOptions): Promise; + removePrimaryGroup(): Promise; + setPrimaryGroup(options: GroupsSetPrimaryGroupOptions): Promise; + createRole(options: GroupsCreateRoleOptions): Promise; + deleteRole(options: GroupsDeleteRoleOptions): Promise; + updateRole(options: GroupsUpdateRoleOptions): Promise; +} diff --git a/dist/client/apis/GroupsAPI.js b/dist/client/apis/GroupsAPI.js new file mode 100644 index 000000000..fcc9f0f18 --- /dev/null +++ b/dist/client/apis/GroupsAPI.js @@ -0,0 +1,663 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GroupsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class GroupsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://groups.roblox.com/" + }); + } + getGroup(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}` + }, + json: true + }).then((response) => response.body); + } + getMultiGroups(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/groups`, + qs: { + groupIds: options.groupIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getAuditLogs(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/audit-log`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getGroupSettings(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/settings` + }, + json: true + }).then((response) => response.body); + } + updateGroupSettings(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/settings`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getGroupConfigurationMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/configuration/metadata` + }, + json: true + }).then((response) => response.body); + } + getGroupsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/metadata` + }, + json: true + }).then((response) => response.body); + } + createGroup(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/create`, + method: "POST", + formData: { + "request.name": options.name, + "request.description": options.description, + "request.publicGroup": options.publicGroup, + "request.buildersClubMembersOnly": options.buildersClubMembersOnly, + "request.files": options.files + } + }, + json: true + }).then((response) => response.body); + } + updateGroupDescription(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/description`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + updateGroupStatus(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/status`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + updateGroupIcon(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/icon`, + method: "PATCH", + body: options.files + }, + json: true + }).then((response) => response.body); + } + declineJoinRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + method: "DELETE", + json: { + UserIds: options.userIds + } + }, + json: true + }).then((response) => response.body); + } + getJoinRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } + acceptJoinRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + method: "POST", + json: { + UserIds: options.userIds + } + }, + json: true + }).then((response) => response.body); + } + declineJoinRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getJoinRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}` + }, + json: true + }).then((response) => response.body); + } + acceptJoinRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + getSelfGroupMembership(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/membership` + }, + json: true + }).then((response) => response.body); + } + getGroupRoles(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/roles` + }, + json: true + }).then((response) => response.body); + } + getMembersWithRole(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/users`, + qs: Object.assign(Object.assign({}, options), { roleSetId: options.roleId }) + }, + json: true + }).then((response) => response.body); + } + getMembers(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/users`, + qs: options + }, + json: true + }).then((response) => response.body); + } + joinGroup(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getSelfPendingGroupJoins() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/pending` + }, + json: true + }).then((response) => response.body); + } + getUserGroups(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/groups/roles` + }, + json: true + }).then((response) => response.body); + } + changeGroupOwner(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/change-owner`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + claimGroup(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/claim-ownership`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + kickMember(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users/${options.userId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + updateMember(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users/${options.userId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getGroupPayouts(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts` + }, + json: true + }).then((response) => response.body); + } + payoutMembers(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts`, + method: "POST", + json: { + PayoutType: options.type, + Recipients: options.users.map((userData) => ({ + recipientId: userData.userId, + recipientType: "User", + amount: userData.amount + })) + } + }, + json: true + }).then((response) => response.body); + } + updateRecurringPayouts(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts/recurring`, + method: "POST", + json: { + PayoutType: options.type, + Recipients: options.users.map((userData) => ({ + recipientId: userData.userId, + recipientType: "User", + amount: userData.amount + })) + } + }, + json: true + }).then((response) => response.body); + } + getGroupRelationships(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}`, + qs: { + "model.startRowIndex": options.startRowIndex || 0, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } + declineRelationshipRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + method: "DELETE", + json: { + GroupIds: options.withGroups + } + }, + json: true + }).then((response) => response.body); + } + getRelationshipRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } + acceptRelationshipRequests(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + method: "DELETE", + json: { + GroupIds: options.withGroups + } + }, + json: true + }).then((response) => response.body); + } + deleteRelationship(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + createRelationship(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + acceptRelationshipRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}` + }, + json: true + }).then((response) => response.body); + } + declineRelationshipRequest(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getRolePermissions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions` + }, + json: true + }).then((response) => response.body); + } + updateRolePermissions(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getGuestPermissions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/guest/permissions` + }, + json: true + }).then((response) => response.body); + } + getAllRolesPermissions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/permissions` + }, + json: true + }).then((response) => response.body); + } + getSocialLinks(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/social-links` + }, + json: true + }).then((response) => response.body); + } + createSocialLink(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + deleteSocialLink(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links/${options.id}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + updateSocialLink(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links/${options.id}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getWallPosts(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/wall/posts`, + qs: options + }, + json: true + }).then((response) => response.body); + } + createWallPost(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/posts`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + deleteWallPost(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/posts/${options.id}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + deleteUserWallPosts(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/users/${options.userId}/posts`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + searchGroupsByKeyword(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search`, + qs: options + }, + json: true + }).then((response) => response.body); + } + searchGroups(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search/lookup`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getGroupSearchMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search/metadata` + }, + json: true + }).then((response) => response.body); + } + getRolesByIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/roles`, + qs: { + ids: options.roleIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + getUserPrimaryGroup(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/groups/primary/role` + }, + json: true + }).then((response) => response.body); + } + removePrimaryGroup() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/primary`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + setPrimaryGroup(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/primary`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + createRole(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/create`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + deleteRole(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + updateRole(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.GroupsAPI = GroupsAPI; diff --git a/dist/client/apis/InventoryAPI.d.ts b/dist/client/apis/InventoryAPI.d.ts new file mode 100644 index 000000000..c381ffb28 --- /dev/null +++ b/dist/client/apis/InventoryAPI.d.ts @@ -0,0 +1,140 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type InventoryCanViewInventory = { + canView: boolean; +}; +export declare type InventoryItem = { + name: string; + displayName: string; + filter: string; + id: number; + type: string; + categoryType: string; +}; +export declare type InventoryCategory = { + name: string; + displayName: string; + categoryType: string; + items: InventoryItem[]; +}; +export declare type InventoryCategories = { + categories: InventoryCategory[]; +}; +export declare type InventoryGetPackageAssetsOptions = { + packageId: number; +}; +export declare type InventoryGetPackageAssets = { + assetIds: number[]; +}; +export declare type InventoryGetUserCollectiblesOptions = { + userId: number; + assetType?: "Image" | "TShirt" | "Audio" | "Mesh" | "Lua" | "HTML" | "Text" | "Hat" | "Place" | "Model" | "Shirt" | "Pants" | "Decal" | "Avatar" | "Head" | "Face" | "Gear" | "Badge" | "GroupEmblem" | "Animation" | "Arms" | "Legs" | "Torso" | "RightArm" | "LeftArm" | "LeftLeg" | "RightLeg" | "Package" | "YouTubeVideo" | "GamePass" | "App" | "Code" | "Plugin" | "SolidModel" | "MeshPart" | "HairAccessory" | "NeckAccessory" | "ShoulderAccessory" | "FrontAccessory" | "BackAccessory" | "WaistAccessory" | "ClimbAnimation" | "DeathAnimation" | "FallAnimation" | "IdleAnimation" | "JumpAnimation" | "RunAnimation" | "SwimAnimation" | "WalkAnimation" | "PoseAnimation" | "LocalizationTableManifest" | "LocalizationTableTranslation" | "EmoteAnimation" | "Video" | "TexturePack"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type InventoryGetUserCollectibles = { + previousPageCursor: string; + nextPageCursor: string; + data: { + userAssetId: number; + serialNumber: number; + assetId: number; + name: string; + recentAveragePrice: number; + originalPrice: number; + assetStock: number; + buildersClubMembershipType: "None" | string; + }[]; +}; +export declare type InventoryGetUserItemsByTypeAndTargetIdOptions = { + userId: number; + itemType: "Asset" | "GamePass" | "Badge" | "Bundle"; + itemTargetId: number; +}; +export declare type InventoryGetUserItemsByTypeAndTargetId = { + previousPageCursor: string; + nextPageCursor: string; + data: { + Id: number; + Name: string; + Type: InventoryGetUserItemsByTypeAndTargetIdOptions["itemType"]; + InstanceId: number; + }[]; +}; +export declare type InventoryGetAssetOwnersOptions = { + assetId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type InventoryGetAssetOwners = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + serialNumber: number; + owner: { + id: number; + type: "User" | string; + name: string; + }; + created: string; + updated: string; + }; +}; +export declare type InventoryGetUserInventoryOptions = { + userId: number; + assetTypes: InventoryGetUserCollectiblesOptions["assetType"][]; + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; +}; +export declare type InventoryGetUserInventory = { + previousPageCursor: string; + nextPageCursor: string; + data: { + assetId: number; + name: string; + assetType: InventoryGetUserCollectiblesOptions["assetType"]; + created: string; + }[]; +}; +export declare type InventoryGetUserInventoryByAssetTypeIdOptions = Omit & { + assetTypeId: number; +}; +export declare type InventoryGetUserInventoryByAssetTypeId = { + previousPageCursor: string; + nextPageCursor: string; + data: { + assetName: string; + userAssetId: number; + assetId: number; + serialNumber: number; + owner: { + userId: number; + username: string; + buildersClubMembershipType: "None" | string; + }; + created: string; + updated: string; + }[]; +}; +export declare class InventoryAPI extends BaseAPI { + constructor(client: Client); + getPackageAssets(options: InventoryGetPackageAssetsOptions): Promise; + getUserCollectibles(options: InventoryGetUserCollectiblesOptions): Promise; + getUserItemsByTypeAndTargetId(options: InventoryGetUserItemsByTypeAndTargetIdOptions): Promise; + canViewInventory(options: { + userId: number; + }): Promise; + getCategories(options: { + userId: number; + }): Promise; + getCategoriesFavorites(options: { + userId: number; + }): Promise; + getAssetOwners(options: InventoryGetAssetOwnersOptions): Promise; + getUserInventory(options: InventoryGetUserInventoryOptions): Promise; + getUserInventoryByAssetTypeId(options: InventoryGetUserInventoryByAssetTypeIdOptions): Promise; +} diff --git a/dist/client/apis/InventoryAPI.js b/dist/client/apis/InventoryAPI.js new file mode 100644 index 000000000..9049356bc --- /dev/null +++ b/dist/client/apis/InventoryAPI.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InventoryAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class InventoryAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://inventory.roblox.com/" + }); + } + getPackageAssets(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/packages/${options.packageId}/assets` + }, + json: true + }).then((response) => response.body); + } + getUserCollectibles(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/assets/collectibles`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserItemsByTypeAndTargetId(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/items/${options.itemType}/${options.itemTargetId}` + }, + json: true + }).then((response) => response.body); + } + canViewInventory(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/can-view-inventory` + }, + json: true + }).then((response) => response.body); + } + getCategories(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/categories` + }, + json: true + }).then((response) => response.body); + } + getCategoriesFavorites(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/categories/favorites` + }, + json: true + }).then((response) => response.body); + } + getAssetOwners(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/assets/${options.assetId}/owners`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserInventory(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/users/${options.userId}/inventory`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUserInventoryByAssetTypeId(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/users/${options.userId}/inventory/${options.assetTypeId}`, + qs: options + }, + json: true + }).then((response) => response.body); + } +} +exports.InventoryAPI = InventoryAPI; diff --git a/dist/client/apis/ItemConfigurationAPI.d.ts b/dist/client/apis/ItemConfigurationAPI.d.ts new file mode 100644 index 000000000..8296ff054 --- /dev/null +++ b/dist/client/apis/ItemConfigurationAPI.d.ts @@ -0,0 +1,88 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type ItemConfigurationGetCreatedAssetsOptions = { + assetType: string; + isArchived?: boolean; + groupId?: number; + sortOrder?: "Asc" | "Desc"; +}; +export declare type ItemConfigurationGetCreatedAssets = { + previousPageCursor: string; + nextPageCursor: string; + data: { + assetId: number; + name: string; + }[]; +}; +export declare type ItemConfigurationGetMultiCreatedAssetDetailsOptions = { + assetIds: number[]; +}; +export declare type ItemConfigurationGetMultiCreatedAssetDetails = { + assetId: number; + name: string; + status: string; + description: string; + creatorType: string; + creatorTargetId: number; + price: number; + priceConfiguration: { + priceInRobux: number; + premiumDiscountPercentage: number; + premiumPriceInRobux: number; + }; + isArchived: boolean; + assetType: string; +}[]; +export declare type ItemConfigurationGetItemTagsByItemIdsOptions = { + itemIds: number[]; +}; +export declare type ItemConfigurationGetItemTagsByItemIds = { + data: { + id: string; + itemTags: { + id: string; + tag: { + tagId: string; + name: string; + localizedDisplayName: string; + status: "Success" | string; + }; + }[]; + }[]; +}; +export declare type ItemConfigurationCreateItemTagOptions = { + itemId: number; + tagId: string; +}; +export declare type ItemConfigurationCreateItemTag = ItemConfigurationGetItemTagsByItemIds["data"][0]["itemTags"][0]; +export declare type ItemConfigurationGetItemTagsMetaData = { + isItemTagsFeatureEnabled: boolean; + enabledAssetTypes: string[]; + maximumItemTagsPerItem: number; +}; +export declare type ItemConfigurationDeleteItemTagOptions = { + itemTagId: number; +}; +export declare type ItemConfigurationDeleteItemTag = unknown; +export declare type ItemConfigurationGetTagsByTagIdsOptions = { + tagIds: number[]; +}; +export declare type ItemConfigurationGetTagsByTagIds = { + data: Omit[]; +}; +export declare type ItemConfigurationSearchTagsOptions = { + prefix: string; + results: number; +}; +export declare type ItemConfigurationSearchTags = ItemConfigurationGetTagsByTagIds; +export declare class ItemConfigurationAPI extends BaseAPI { + constructor(client: Client); + getCreatedAssets(options: ItemConfigurationGetCreatedAssetsOptions): Promise; + getMultiCreatedAssets(options: ItemConfigurationGetMultiCreatedAssetDetailsOptions): Promise; + getItemTagsByItemIds(options: ItemConfigurationGetItemTagsByItemIdsOptions): Promise; + createItemTag(options: ItemConfigurationCreateItemTagOptions): Promise; + getItemTagsMetaData(): Promise; + deleteItemTag(options: ItemConfigurationDeleteItemTagOptions): Promise; + getTagsByTagIds(options: ItemConfigurationGetTagsByTagIdsOptions): Promise; + searchTags(options: ItemConfigurationSearchTagsOptions): Promise; +} diff --git a/dist/client/apis/ItemConfigurationAPI.js b/dist/client/apis/ItemConfigurationAPI.js new file mode 100644 index 000000000..df7055b97 --- /dev/null +++ b/dist/client/apis/ItemConfigurationAPI.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ItemConfigurationAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class ItemConfigurationAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://itemconfiguration.roblox.com/" + }); + } + getCreatedAssets(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creations/get-assets`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getMultiCreatedAssets(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creations/get-asset-details`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getItemTagsByItemIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags`, + qs: { + itemIds: options.itemIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + createItemTag(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getItemTagsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags/metadata` + }, + json: true + }).then((response) => response.body); + } + deleteItemTag(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags/${options.itemTagId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + getTagsByTagIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/tags`, + qs: { + tagIds: options.tagIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + searchTags(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/tags/prefix-search`, + qs: options + }, + json: true + }).then((response) => response.body); + } +} +exports.ItemConfigurationAPI = ItemConfigurationAPI; diff --git a/dist/client/apis/LocaleAPI.d.ts b/dist/client/apis/LocaleAPI.d.ts new file mode 100644 index 000000000..02ef1254b --- /dev/null +++ b/dist/client/apis/LocaleAPI.d.ts @@ -0,0 +1,61 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type LocaleGetCountryRegionsOptions = { + locale: string; +}; +export declare type LocaleGetCountryRegions = { + countryRegionList: { + code: string; + name: string; + displayName: string; + }[]; +}; +export declare type LocaleGetLocalesOptions = { + displayValueLocale?: string; +}; +export declare type LocaleGetLocales = { + data: { + locale: { + id: number; + locale: string; + name: string; + nativeName: string; + language: { + id: number; + name: string; + nativeName: string; + languageCode: string; + }; + }; + isEnabledForFullExperience: boolean; + isEnabledForSignupAndLogin: boolean; + isEnabledForInGameUgc: boolean; + }[]; +}; +export declare type LocaleGetSupportedLocales = { + supportedLocales: LocaleGetLocales["data"][0]["locale"][]; +}; +export declare type LocaleGetUserLocale = { + supportedLocale: LocaleGetLocales["data"][0]["locale"]; +}; +export declare type LocaleGetLocusSupportedLocales = { + signupAndLogin: LocaleGetLocales["data"][0]["locale"]; + generalExperience: LocaleGetLocales["data"][0]["locale"]; + ugc: LocaleGetLocales["data"][0]["locale"]; +}; +export declare type LocaleSetUserLocaleOptions = { + supportedLocaleCode: string; +}; +export declare type LocaleSetUserLocale = { + success: boolean; +}; +export declare class LocaleAPI extends BaseAPI { + constructor(client: Client); + getCountryRegions(options: LocaleGetCountryRegionsOptions): Promise; + getLocales(options: LocaleGetLocalesOptions): Promise; + getSupportedLocales(): Promise; + getSupportedLocalsForCreators(): Promise; + getUserLocale(): Promise; + getLocusSupportedLocales(): Promise; + setUserLocale(options: LocaleSetUserLocaleOptions): Promise; +} diff --git a/dist/client/apis/LocaleAPI.js b/dist/client/apis/LocaleAPI.js new file mode 100644 index 000000000..d28d07193 --- /dev/null +++ b/dist/client/apis/LocaleAPI.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocaleAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class LocaleAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://locale.roblox.com/" + }); + } + getCountryRegions(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/country-regions`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getLocales(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getSupportedLocales() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/supported-locales` + }, + json: true + }).then((response) => response.body); + } + getSupportedLocalsForCreators() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/supported-locales-for-creators` + }, + json: true + }).then((response) => response.body); + } + getUserLocale() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/locales/user-locale` + }, + json: true + }).then((response) => response.body); + } + getLocusSupportedLocales() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/user-localization-locus-supported-locales` + }, + json: true + }).then((response) => response.body); + } + setUserLocale(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/locales/set-user-supported-locale`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.LocaleAPI = LocaleAPI; diff --git a/dist/client/apis/MetricsAPI.d.ts b/dist/client/apis/MetricsAPI.d.ts new file mode 100644 index 000000000..1d2078aa6 --- /dev/null +++ b/dist/client/apis/MetricsAPI.d.ts @@ -0,0 +1,26 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type MetricsGetThumbnailsMetaData = { + logRatio: number; +}; +export declare type MetricsRecordThumbnailLoadOptions = { + duration: number; + loadState: string; + thumbnailType: string; +}; +export declare type MetricsRecordThumbnailLoad = unknown; +export declare type MetricsReportBundleLoadOptions = { + bundleUrl: string; + bundleName: string; + loadTimeInMilliseconds: number; + cdnProviderName: string; + loadState: string; + bundleContentType: string; +}; +export declare type MetricsReportBundleLoad = unknown; +export declare class MetricsAPI extends BaseAPI { + constructor(client: Client); + getThumbnailsMetaData(): Promise; + recordThumbnailLoad(options: MetricsRecordThumbnailLoadOptions): Promise; + recordBundleLoad(options: MetricsReportBundleLoadOptions): Promise; +} diff --git a/dist/client/apis/MetricsAPI.js b/dist/client/apis/MetricsAPI.js new file mode 100644 index 000000000..cb2d20454 --- /dev/null +++ b/dist/client/apis/MetricsAPI.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MetricsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class MetricsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://metrics.roblox.com/" + }); + } + getThumbnailsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/thumbnails/metadata` + }, + json: true + }).then((response) => response.body); + } + recordThumbnailLoad(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/thumbnails/load`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + recordBundleLoad(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundle-metrics/report`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.MetricsAPI = MetricsAPI; diff --git a/dist/client/apis/NotificationsAPI.d.ts b/dist/client/apis/NotificationsAPI.d.ts new file mode 100644 index 000000000..6c201d9f0 --- /dev/null +++ b/dist/client/apis/NotificationsAPI.d.ts @@ -0,0 +1,267 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type NotificationsGetNotificationsSettings = { + notificationBandSettings: { + notificationSourceType: string; + receiverDestinationType: string; + isEnabled: boolean; + isOverridable: boolean; + isSetByReceiver: boolean; + pushNotificationDestinationPreferences: [ + { + name: string; + platform: string; + destinationId: 0; + isEnabled: boolean; + isSetByReceiver: boolean; + } + ]; + }[]; + optedOutNotificationSourceTypes: string[]; + optedOutReceiverDestinationTypes: string[]; +}; +export declare type NotificationsGetRealtimeNotificationsSettings = { + primaryDomain: string; + fallbackDomain: string; +}; +export declare type NotificationsAllowNotificationSourceOptions = { + sourceType: string; +}; +export declare type NotificationsAllowNotificationSource = unknown; +export declare type NotificationsDisallowNotificationSourceOptions = NotificationsAllowNotificationSourceOptions; +export declare type NotificationsDisallowNotificationSource = unknown; +export declare type NotificationsAllowNotificationsDestinationOptions = { + destinationType: string; +}; +export declare type NotificationsAllowNotificationsDestination = unknown; +export declare type NotificationsDisallowNotificationsDestinationOptions = NotificationsAllowNotificationsDestinationOptions; +export declare type NotificationsDisallowNotificationsDestination = unknown; +export declare type NotificationsUpdateNotificationDestinationSettingsOptions = { + notificationSourceType: string; + destinationId: number; + isEnabled: boolean; +}; +export declare type NotificationsUpdateNotificationDestinationSettings = unknown; +export declare type NotificationsUpdateNotificationSettingsOptions = { + updatedSettings: { + notificationSourceType: string; + receiverDestination: string; + isEnabled: boolean; + }[]; +}; +export declare type NotificationsUpdateNotificationSettings = unknown; +export declare type NotificationsGetChromeNotificationsManifest = { + name: string; + gcm_sender_id: string; +}; +export declare type NotificationsGetCurrentNotificationDeviceDestination = { + destination: { + user: { + name: string; + userId: number; + }; + name: string; + notificationToken: string; + supportsUpdateNotifications: boolean; + userPushNotificationDestinationId: number; + application: string; + platform: string; + }; + statusMessage: string; +}; +export declare type NotificationsGetNotificationDestinations = { + destinations: NotificationsGetCurrentNotificationDeviceDestination["destination"][]; + statusMessage: string; +}; +export declare type NotificationsGetNotificationsMetaDataOptions = { + notificationToken: string; + notificationId: number; +}; +export declare type NotificationsGetNotificationsMetaData = { + metadata: { + notificationId: string; + type: string; + detail: unknown; + fallbackDelivered: boolean; + }; + statusMessage: string; +}; +export declare type NotificationsGetNotificationIdsOptions = { + notificationToken: string; + limit: number; + cursor?: string; +}; +export declare type NotificationsGetNotificationIds = { + ids: string[]; + statusMessage: string; +}; +export declare type NotificationsDeregisterAllDevices = { + statusMessage: string; +}; +export declare type NotificationsDeregisterCurrentDevice = { + statusMessage: string; +}; +export declare type NotificationsMarkNotificationReadOptions = { + platformType: string; + notificationId: string; +}; +export declare type NotificationsMarkNotificationRead = { + statusMessage: string; +}; +export declare type NotificationsMarkNotificationCategoryReadOptions = { + notificationType: string; + category: string; + latestNotificationId: string; +}; +export declare type NotificationsMarkNotificationCategoryRead = { + statusMessage: string; +}; +export declare type NotificationsMarkNotificationInteractionOptions = { + platformType: string; + notificationToken: string; + notificationId: number; + interactionType: string; +}; +export declare type NotificationsMarkNotificationInteraction = { + statusMessage: string; +}; +export declare type NotificationsRegisterAmazonAndroidOptions = { + notificationToken: string; + authorizeForUser: boolean; + oldNotificationToken: string; + deviceName: string; +}; +export declare type NotificationsRegisterAmazonAndroid = { + registration: { + userPushNotificationDestinationId: number; + name: string; + notificationToken: string; + application: string; + platform: string; + }; + statusMessage: string; +}; +export declare type NotificationsRegisterAndroidNativeOptions = NotificationsRegisterAmazonAndroidOptions; +export declare type NotificationsRegisterAndroidNative = NotificationsRegisterAmazonAndroid; +export declare type NotificationsRegisterAndroidTencentServiceOptions = NotificationsRegisterAmazonAndroidOptions; +export declare type NotificationsRegisterAndroidTencentService = NotificationsRegisterAmazonAndroid; +export declare type NotificationsRegisterChromeOptions = { + notificationToken: string; + initiatedByUser: boolean; +}; +export declare type NotificationsRegisterChrome = NotificationsRegisterAmazonAndroid; +export declare type NotificationsRegisterFirefoxOptions = NotificationsRegisterChromeOptions & { + notificationEndpoint: string; +}; +export declare type NotificationsRegisterFirefox = NotificationsRegisterAmazonAndroid; +export declare type NotificationsRegisterIOSNativeOptions = { + notificationToken: string; + destinationIdentifier: string; + authorizeForUser: boolean; + oldNotificationToken: string; + deviceName: string; +}; +export declare type NotificationsRegisterIOSNative = NotificationsRegisterAmazonAndroid; +export declare type NotificationsGetLatestUniversesUpdatesOptions = { + universeIds: number[]; + sinceDateTime?: string; +}; +export declare type NotificationsGetLatestUniverseUpdates = { + universeId: number; + rootPlaceId: number; + createdOn: string; + createdOnKey: string; + content: string; + universeName: string; +}[]; +export declare type NotificationsGetStreamNotificationsPromptSettings = { + hasUserInteractedWithNotificationsStream: boolean; + showNotificationStreamPrompt: boolean; +}; +export declare type NotificationsGetRecentStreamNotificationsOptions = { + startIndex?: number; + maxRows?: number; +}; +export declare type NotificationsGetRecentStreamNotifications = { + id: number; + notificationSourceType: string; + eventDate: string; + isInteracted: boolean; + metadataCollection: unknown[]; + eventCount: number; +}[]; +export declare type NotificationsGetStreamNotificationsMetaData = { + bannerDismissTimeSpan: number; + signalRDisconnectionResponseInMilliseconds: number; + canLaunchGameFromGameUpdate: boolean; + useFriendsApiForAjaxRequests: boolean; +}; +export declare type NotificationsGetStreamNotificationsUnreadCount = { + unreadNotifications: number; + statusMessage: string; +}; +export declare type NotificationsClearUnreadStreamNotifications = { + statusMessage: string; +}; +export declare type NotificationsSendGameUpdateNotificationInteractedOptions = { + universeId: number; + createdOnKey: string; + interactioNType: string; + currentUserId: number; +}; +export declare type NotificationsSendGameUpdateNotificationInteracted = { + statusMessage: string; +}; +export declare type NotificationsSendGameUpdateNotificationReadOptions = { + universeId: number; + createdOn: string; + currentUserId: number; +}; +export declare type NotificationsSendGameUpdateNotificationRead = { + statusMessage: string; +}; +export declare type NotificationsMarkStreamNotificationInteractedOptions = { + eventId: string; +}; +export declare type NotificationsMarkStreamNotificationInteracted = { + statusMessage: string; +}; +export declare type NotificationsSuppressStreamNotificationsPrompt = { + statusMessage: string; +}; +export declare class NotificationsAPI extends BaseAPI { + constructor(client: Client); + getNotificationsSettings(): Promise; + getRealtimeNotificationSettings(): Promise; + allowNotificationSource(options: NotificationsAllowNotificationSourceOptions): Promise; + disallowNotificationSource(options: NotificationsDisallowNotificationSourceOptions): Promise; + allowNotificationDestination(options: NotificationsAllowNotificationsDestinationOptions): Promise; + disallowNotificationDestination(options: NotificationsDisallowNotificationsDestinationOptions): Promise; + updateDestinationSetting(options: NotificationsUpdateNotificationDestinationSettingsOptions): Promise; + updateNotificationSettings(options: NotificationsUpdateNotificationSettingsOptions): Promise; + getChromeManifest(): Promise; + getCurrentDeviceDestination(): Promise; + getDestinations(): Promise; + getPushNotificationsMetaData(): Promise; + getNotificationIds(options: NotificationsGetNotificationIdsOptions): Promise; + deregisterAllDevices(): Promise; + deregisterCurrentDevice(): Promise; + markNotificationRead(options: NotificationsMarkNotificationReadOptions): Promise; + markNotificationCategoryRead(options: NotificationsMarkNotificationCategoryReadOptions): Promise; + markNotificationInteraction(options: NotificationsMarkNotificationInteractionOptions): Promise; + registerAndroidAmazon(options: NotificationsRegisterAmazonAndroidOptions): Promise; + registerAndroidNative(options: NotificationsRegisterAndroidNativeOptions): Promise; + registerAndroidTencentSerice(options: NotificationsRegisterAndroidTencentServiceOptions): Promise; + registerChrome(options: NotificationsRegisterChromeOptions): Promise; + registerFirefox(options: NotificationsRegisterFirefoxOptions): Promise; + registerIOSNative(options: NotificationsRegisterIOSNativeOptions): Promise; + getLatestUniversesUpdates(options: NotificationsGetLatestUniversesUpdatesOptions): Promise; + getStreamNotificationsPromptSettings(): Promise; + getRecentStreamNotifications(options: NotificationsGetRecentStreamNotificationsOptions): Promise; + getStreamNotificationsMetaData(): Promise; + getUnreadStreamNotificationsCount(): Promise; + clearUnreadStreamNotifications(): Promise; + markGameUpdateNotificationInteracted(options: NotificationsSendGameUpdateNotificationInteractedOptions): Promise; + markGameUpdateNotificationRead(options: NotificationsSendGameUpdateNotificationReadOptions): Promise; + suppressStreamNotificationsPrompt(): Promise; +} diff --git a/dist/client/apis/NotificationsAPI.js b/dist/client/apis/NotificationsAPI.js new file mode 100644 index 000000000..0cfc145f3 --- /dev/null +++ b/dist/client/apis/NotificationsAPI.js @@ -0,0 +1,350 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NotificationsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class NotificationsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://notifications.roblox.com/" + }); + } + getNotificationsSettings() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/get-settings` + }, + json: true + }).then((response) => response.body); + } + getRealtimeNotificationSettings() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/settings/realtime` + }, + json: true + }).then((response) => response.body); + } + allowNotificationSource(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/notification-source-types/allow`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + disallowNotificationSource(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/notification-source-types/opt-out`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + allowNotificationDestination(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/receiver-destination-types/allow`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + disallowNotificationDestination(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/receiver-destination-types/opt-out`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + updateDestinationSetting(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/update-destination-setting`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + updateNotificationSettings(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/update-notification-settings`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getChromeManifest() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/chrome-manifest` + }, + json: true + }).then((response) => response.body); + } + getCurrentDeviceDestination() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/get-current-device-destination` + }, + json: true + }).then((response) => response.body); + } + getDestinations() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/get-destinations` + }, + json: true + }).then((response) => response.body); + } + getPushNotificationsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/metadata` + }, + json: true + }).then((response) => response.body); + } + getNotificationIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/notification-ids`, + qs: options + }, + json: true + }).then((response) => response.body); + } + deregisterAllDevices() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/deregister-all-devices`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + deregisterCurrentDevice() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/deregister-current-device` + }, + json: true + }).then((response) => response.body); + } + markNotificationRead(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markNotificationCategoryRead(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-category-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markNotificationInteraction(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-interaction`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerAndroidAmazon(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-amazon`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerAndroidNative(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-native`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerAndroidTencentSerice(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-tencent-service`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerChrome(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-chrome`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerFirefox(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-firefox`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + registerIOSNative(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-ios-native`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getLatestUniversesUpdates(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-latest-game-updates`, + qs: Object.assign(Object.assign({}, options), { universeId: options.universeIds.join(",") }) + }, + json: true + }).then((response) => response.body); + } + getStreamNotificationsPromptSettings() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-prompt-settings` + }, + json: true + }).then((response) => response.body); + } + getRecentStreamNotifications(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-recent`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getStreamNotificationsMetaData() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/metadata` + }, + json: true + }).then((response) => response.body); + } + getUnreadStreamNotificationsCount() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/unread-count` + }, + json: true + }).then((response) => response.body); + } + clearUnreadStreamNotifications() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/clear-unread`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + markGameUpdateNotificationInteracted(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/game-update-notification-interacted`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markGameUpdateNotificationRead(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-latest-game-updates`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + suppressStreamNotificationsPrompt() { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/suppress-prompt`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } +} +exports.NotificationsAPI = NotificationsAPI; diff --git a/dist/client/apis/OtherAPI.d.ts b/dist/client/apis/OtherAPI.d.ts new file mode 100644 index 000000000..944b75318 --- /dev/null +++ b/dist/client/apis/OtherAPI.d.ts @@ -0,0 +1,49 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { EnumUserPresence } from "../../interfaces/GeneralInterfaces"; +export declare type OtherGetUserProfileHeaderOptions = { + userId: number; +}; +export declare type OtherGetUserProfileHeader = { + UserId: number; + ProfileUserId: number; + ProfileUserName: string; + ProfileDisplayName: string; + FriendsCount: number; + UserPresenceType: EnumUserPresence; + LastLocation: string | null; + UserStatus: string | null; + UserStatusDate: string | null; + UserPlaceId: number | null; + FollowersCount: number; + FollowingsCount: number; + IsVieweeBlocked: boolean; + IsViewerBlocked: boolean; + AreFriends: boolean; + IncomingFriendRequestPending: boolean; + MaySendFriendInvitation: boolean; + FriendRequestPending: boolean; + MayFollow: boolean; + IsFollowing: boolean; + CanMessage: boolean; + MessagesDisabled: boolean; + CanBeFollowed: boolean; + CanTrade: boolean; + CanSeeFavorites: boolean; + MayImpersonate: boolean; + MayEdit: boolean; + HeadShotImage: { + Final: boolean; + Url: string; + RetryUrl: string | null; + UserId: number; + EndpointType: "Avatar" | string; + }; + PreviousUserNames: string; + IsUserOnPhone: boolean; + CanSeeInventory: boolean; +}; +export declare class OtherAPI extends BaseAPI { + constructor(client: Client); + getUserProfileHeader(options: OtherGetUserProfileHeaderOptions): Promise; +} diff --git a/dist/client/apis/OtherAPI.js b/dist/client/apis/OtherAPI.js new file mode 100644 index 000000000..14e538266 --- /dev/null +++ b/dist/client/apis/OtherAPI.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OtherAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class OtherAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://roblox.com/" + }); + } + getUserProfileHeader(options) { + return this.request({ + requiresAuth: false, + request: { + url: `https://www.roblox.com/users/profile/profileheader-json?userId=${options.userId}` + }, + json: true + }).then((response) => response.body); + } +} +exports.OtherAPI = OtherAPI; diff --git a/dist/client/apis/PremiumFeaturesAPI.d.ts b/dist/client/apis/PremiumFeaturesAPI.d.ts new file mode 100644 index 000000000..0d4ab9a2c --- /dev/null +++ b/dist/client/apis/PremiumFeaturesAPI.d.ts @@ -0,0 +1,17 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type PremiumFeaturesUpsellCheckOptions = { + userId: number; + universeId: number; + placeId: number; +}; +export declare type PremiumFeaturesUpsellCheck = unknown; +export declare type PremiumFeaturesValidateUserMembershipOptions = { + userId: number; +}; +export declare type PremiumFeaturesValidateUserMembership = boolean; +export declare class PremiumFeaturesAPI extends BaseAPI { + constructor(client: Client); + premiumUpsellCheck(options: PremiumFeaturesUpsellCheckOptions): Promise; + validateUserMembership(options: PremiumFeaturesValidateUserMembershipOptions): Promise; +} diff --git a/dist/client/apis/PremiumFeaturesAPI.js b/dist/client/apis/PremiumFeaturesAPI.js new file mode 100644 index 000000000..a1ecde426 --- /dev/null +++ b/dist/client/apis/PremiumFeaturesAPI.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PremiumFeaturesAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class PremiumFeaturesAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://premiumfeatures.roblox.com/" + }); + } + premiumUpsellCheck(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/premium-upsell-check`, + qs: options + }, + json: true + }).then((response) => response.body); + } + validateUserMembership(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/validate-membership` + }, + json: true + }).then((response) => response.body); + } +} +exports.PremiumFeaturesAPI = PremiumFeaturesAPI; diff --git a/dist/client/apis/PresenceAPI.d.ts b/dist/client/apis/PresenceAPI.d.ts new file mode 100644 index 000000000..80966a2f1 --- /dev/null +++ b/dist/client/apis/PresenceAPI.d.ts @@ -0,0 +1,30 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { EnumUserPresence } from "../../interfaces/GeneralInterfaces"; +export declare type PresenceRegisterAppPresenceOptions = { + location: string; + placeId: number; + disconnect: boolean; +}; +export declare type PresenceRegisterAppPresence = unknown; +export declare type PresenceGetUsersPresencesOptions = { + userIds: number[]; +}; +export declare type PresenceGetUsersPresences = { + userPresences: PresenceGetUsersPresence[]; +}; +export declare type PresenceGetUsersPresence = { + userPresenceType: EnumUserPresence; + lastLocation: string; + placeId: number; + rootPlaceId: number; + gameId: string; + universeId: number; + userId: number; + lastOnline: string; +}; +export declare class PresenceAPI extends BaseAPI { + constructor(client: Client); + registerAppPresence(options: PresenceRegisterAppPresenceOptions): Promise; + getUsersPresences(options: PresenceGetUsersPresencesOptions): Promise; +} diff --git a/dist/client/apis/PresenceAPI.js b/dist/client/apis/PresenceAPI.js new file mode 100644 index 000000000..5b4ebda78 --- /dev/null +++ b/dist/client/apis/PresenceAPI.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PresenceAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class PresenceAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://presence.roblox.com/" + }); + } + registerAppPresence(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/presence/register-app-presence`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getUsersPresences(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/presence/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.PresenceAPI = PresenceAPI; diff --git a/dist/client/apis/PrivateMessagesAPI.d.ts b/dist/client/apis/PrivateMessagesAPI.d.ts new file mode 100644 index 000000000..8d248b7c0 --- /dev/null +++ b/dist/client/apis/PrivateMessagesAPI.d.ts @@ -0,0 +1,101 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type PrivateMessagesGetAnnouncements = { + collection: { + id: number; + sender: { + id: number; + name: string; + displayName: string; + }; + subject: string; + body: string; + created: string; + updated: string; + }; + totalCollectionSize: number; +}; +export declare type PrivateMessagesGetAnnouncementsMetaData = { + numOfAnnouncements: number; +}; +export declare type PrivateMessagesGetMessagesOptions = { + pageNumber?: number; + pageSize?: number; + messageTab?: "Inbox" | "Sent" | "Archive"; +}; +export declare type PrivateMessagesGetMessages = { + collection: { + id: number; + sender: { + id: number; + name: string; + displayName: string; + }; + recipient: { + id: number; + name: string; + displayName: string; + }; + subject: string; + body: string; + created: string; + updated: string; + isRead: boolean; + isSystemMessage: boolean; + isReportAbuseDisplayed: boolean; + }[]; + totalCollectionSize: number; + totalPages: number; + pageNumber: number; +}; +export declare type PrivateMessagesGetMessageOptions = { + messageId: number; +}; +export declare type PrivateMessagesGetMessage = PrivateMessagesGetMessages["collection"][0]; +export declare type PrivateMessagesGetUnreadMessagesCount = { + count: number; +}; +export declare type PrivateMessagesArchiveMessagesOptions = { + messageIds: number[]; +}; +export declare type PrivateMessagesArchiveMessages = { + failedMessages?: { + messageId: number; + errorMessage: string; + }[]; +}; +export declare type PrivateMessagesMarkMessagesReadOptions = PrivateMessagesArchiveMessagesOptions; +export declare type PrivateMessagesMarkMessagesRead = PrivateMessagesArchiveMessages; +export declare type PrivateMessagesMarkMessagesUnreadOptions = PrivateMessagesArchiveMessagesOptions; +export declare type PrivateMessagesMarkMessagesUnread = PrivateMessagesArchiveMessages; +export declare type PrivateMessagesSendMessageOptions = { + userId: number; + subject: string; + body: string; + recipientId: number; + replyMessageId?: number; + includePreviousMessage?: boolean; +}; +export declare type PrivateMessagesSendMessage = { + success: boolean; + shortMessage: string; + message: string; +}; +export declare type PrivateMessagesUnArchiveMessagesOptions = PrivateMessagesArchiveMessagesOptions; +export declare type PrivateMessagesUnArchiveMessages = PrivateMessagesArchiveMessages; +export declare class PrivateMessagesAPI extends BaseAPI { + constructor(client: Client); + getAnnouncements(): Promise; + getAnnouncementsMetaData(): Promise; + getMessages(options: PrivateMessagesGetMessagesOptions): Promise; + getMessage(options: PrivateMessagesGetMessageOptions): Promise; + canMessage(options: { + userId: number; + }): Promise; + getUnreadMessagesCount(): Promise; + archiveMessages(options: PrivateMessagesArchiveMessagesOptions): Promise; + markMessagesRead(options: PrivateMessagesMarkMessagesReadOptions): Promise; + markMessagesUnread(options: PrivateMessagesMarkMessagesUnreadOptions): Promise; + sendMessage(options: PrivateMessagesSendMessageOptions): Promise; + unArchiveMessages(options: PrivateMessagesUnArchiveMessagesOptions): Promise; +} diff --git a/dist/client/apis/PrivateMessagesAPI.js b/dist/client/apis/PrivateMessagesAPI.js new file mode 100644 index 000000000..ef77c97d1 --- /dev/null +++ b/dist/client/apis/PrivateMessagesAPI.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PrivateMessagesAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class PrivateMessagesAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://privatemessages.roblox.com/" + }); + } + getAnnouncements() { + return this.request({ + requiresAuth: false, + request: { + path: `v1/announcements` + }, + json: true + }).then((response) => response.body); + } + getAnnouncementsMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/announcements/metadata` + }, + json: true + }).then((response) => response.body); + } + getMessages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getMessage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/${options.messageId}` + }, + json: true + }).then((response) => response.body); + } + canMessage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/${options.userId}/can-message` + }, + json: true + }).then((response) => response.body.canMessage); + } + getUnreadMessagesCount() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/unread/count` + }, + json: true + }).then((response) => response.body); + } + archiveMessages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/archive`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markMessagesRead(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/mark-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + markMessagesUnread(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/mark-unread`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + sendMessage(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/send`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + unArchiveMessages(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/unarchive`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.PrivateMessagesAPI = PrivateMessagesAPI; diff --git a/dist/client/apis/PublishAPI.d.ts b/dist/client/apis/PublishAPI.d.ts new file mode 100644 index 000000000..51d8fb9a1 --- /dev/null +++ b/dist/client/apis/PublishAPI.d.ts @@ -0,0 +1,71 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type PublishUploadAssetsOptions = { + files: unknown; +}; +export declare type PublishUploadAssets = { + AssetDetails: { + assetId: number; + assetFileName: string; + uploadAssetError: "None" | string; + }[]; +}; +export declare type PublishAudioOptions = { + name: string; + file: unknown; + groupId?: number; + paymentSource: string; +}; +export declare type PublishAudio = { + Id: number; + Name: string; +}; +export declare type PublishVerifyAudioOptions = PublishAudioOptions; +export declare type PublishVerifyAudio = { + price: number; + canAfford: boolean; +}; +export declare type PublishBadgeIconOptions = { + badgeId: number; + files: unknown; +}; +export declare type PublishBadgeIcon = { + targetId: number; +}; +export declare type PublishGamePassIconOptions = { + gamePassId: number; + files: unknown; +}; +export declare type PublishGamePassIcon = { + targetId: number; +}; +export declare type PublishUploadGameThumbnailOptions = { + gameId: number; + files: unknown; +}; +export declare type PublishUploadGameThumbnail = { + targetId: number; +}; +export declare type PublishUploadPluginIconOptions = { + pluginId: number; + files: unknown; +}; +export declare type PublishUploadPluginIcon = { + targetId: number; +}; +export declare class PublishAPI extends BaseAPI { + constructor(client: Client); + /** + * @hidden + */ + uploadAssets(options: PublishUploadAssetsOptions): Promise; + publishAudio(options: PublishAudioOptions): Promise; + verifyAudio(options: PublishVerifyAudioOptions): Promise; + publishBadgeIcon(options: PublishBadgeIconOptions): Promise; + /** + * @hidden + */ + publishGamePassIcon(options: PublishGamePassIconOptions): Promise; + uploadGameThumbnail(options: PublishUploadGameThumbnailOptions): Promise; + uploadPluginIcon(options: PublishUploadPluginIconOptions): Promise; +} diff --git a/dist/client/apis/PublishAPI.js b/dist/client/apis/PublishAPI.js new file mode 100644 index 000000000..b00bb8fa8 --- /dev/null +++ b/dist/client/apis/PublishAPI.js @@ -0,0 +1,96 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PublishAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class PublishAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://publish.roblox.com/" + }); + } + /** + * @hidden + */ + uploadAssets(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/upload`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } + publishAudio(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/audio`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + verifyAudio(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/audio/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + publishBadgeIcon(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.badgeId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } + /** + * @hidden + */ + publishGamePassIcon(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/game-passes/${options.gamePassId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } + uploadGameThumbnail(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/${options.gameId}/thumbnail/image`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } + uploadPluginIcon(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins/${options.pluginId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } +} +exports.PublishAPI = PublishAPI; diff --git a/dist/client/apis/ThumbnailsAPI.d.ts b/dist/client/apis/ThumbnailsAPI.d.ts new file mode 100644 index 000000000..ace4b8653 --- /dev/null +++ b/dist/client/apis/ThumbnailsAPI.d.ts @@ -0,0 +1,154 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type ThumbnailsGetAssetsThumbnailsOptions = { + assetIds: number[]; + returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; + size?: "42x42" | "50x50" | "75x75" | "110x110" | "140x140" | "150x150" | "160x100" | "160x600" | "250x250" | "256x144" | "300x250" | "304x166" | "384x216" | "396x216" | "420x420" | "480x270" | "512x512" | "576x324" | "700x700" | "728x90" | "768x432"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetAssetsThumbnails = { + data: { + targetId: number; + state: "Error" | string; + imageUrl: string; + }[]; +}; +export declare type ThumbnailsGetBadgesIconsOptions = { + badgeIds: number[]; + size?: "150x150"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetBadgesIcons = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetBundlesThumbnailsOptions = { + bundleIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetBundlesThumbnails = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetDeveloperProductsIconsOptions = { + developerProductIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetDeveloperProductsIcons = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetGamePassesIconsOptions = { + gamePassIds: number[]; + size?: "150x150"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetGamePassesIcons = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUniverseThumbnailsOptions = { + universeId: number; + thumbnailIds: number[]; + size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUniverseThumbnails = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUniversesRootPlaceThumbnailsOptions = { + universeIds: number[]; + returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; + size?: "50x50" | "128x128" | "150x150" | "256x256" | "512x512"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUniversesRootPlaceThumbnails = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUniversesThumbnailsOptions = { + universeIds: number[]; + countPerUniverse?: number; + defaults?: boolean; + size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUniversesThumbnails = { + data: { + universeId: number; + error?: { + code: number; + message: string; + userFacingMessage: string; + field: string; + fieldData: unknown; + }; + thumbnails: { + targetId: number; + state: "Error" | string; + imageUrl: string; + }[]; + }[]; +}; +export declare type ThumbnailsGetGroupsIconsOptions = { + groupIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetGroupsIcons = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUsersFullBodyAvatarImagesOptions = { + userIds: number[]; + size?: "30x30" | "48x48" | "60x60" | "75x75" | "100x100" | "140x140" | "150x150" | "150x200" | "180x180" | "250x250" | "352x352" | "420x420" | "720x720"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUsersFullBodyAvatarImages = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUsersAvatarBustImagesOptions = { + userIds: number[]; + size?: "50x50" | "60x60" | "75x75"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUsersAvatarBustImages = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUsersAvatarHeadShotsImagesOptions = { + userIds: number[]; + size?: "48x48" | "50x50" | "60x60" | "75x75" | "110x110" | "150x150" | "180x180" | "352x352" | "420x420" | "720x720"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUsersAvatarHeadShotsImages = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetUsersOutfitsImagesOptions = { + userOutfitIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export declare type ThumbnailsGetUsersOutfitsImages = ThumbnailsGetAssetsThumbnails; +export declare type ThumbnailsGetBatchImagesOptions = { + requestId: string; + targetId: number; + type: "Avatar" | "AvatarHeadShot" | "GameIcon" | "BadgeIcon" | "GameThumbnail" | "GamePass" | "Asset" | "BundleThumbnail" | "Outfit" | "GroupIcon" | "DeveloperProduct" | "AutoGeneratedAsset"; + size: string; + isCircular: boolean; +}; +export declare type ThumbnailsGetBatchImages = { + data: { + requestId: string; + errorCode?: number; + errorMessage?: string; + targetId: number; + state: "Error" | string; + imageUrl: string; + }[]; +}; +export declare class ThumbnailsAPI extends BaseAPI { + constructor(client: Client); + getAssetsThumbnails(options: ThumbnailsGetAssetsThumbnailsOptions): Promise; + getBadgesIcons(options: ThumbnailsGetBadgesIconsOptions): Promise; + getBundlesThumbnails(options: ThumbnailsGetBundlesThumbnailsOptions): Promise; + getDeveloperProductIcons(options: ThumbnailsGetDeveloperProductsIconsOptions): Promise; + getGamePassesIcons(options: ThumbnailsGetGamePassesIconsOptions): Promise; + getUniverseThumbnailIds(options: ThumbnailsGetUniverseThumbnailsOptions): Promise; + getUniversesRootPlaceThumbnail(options: ThumbnailsGetUniversesRootPlaceThumbnailsOptions): Promise; + getUniversesThumbnailIds(options: ThumbnailsGetUniversesThumbnailsOptions): Promise; + getGroupsIcons(options: ThumbnailsGetGroupsIconsOptions): Promise; + getUsersFullBodyAvatarImages(options: ThumbnailsGetUsersFullBodyAvatarImagesOptions): Promise; + getUsersAvatarBustImages(options: ThumbnailsGetUsersAvatarBustImagesOptions): Promise; + getUsersAvatarHeadShotImages(options: ThumbnailsGetUsersAvatarHeadShotsImagesOptions): Promise; + getUsersOutfitsImages(options: ThumbnailsGetUsersOutfitsImagesOptions): Promise; + getBatchImages(options: ThumbnailsGetBatchImagesOptions): Promise; +} diff --git a/dist/client/apis/ThumbnailsAPI.js b/dist/client/apis/ThumbnailsAPI.js new file mode 100644 index 000000000..1952b5cff --- /dev/null +++ b/dist/client/apis/ThumbnailsAPI.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ThumbnailsAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class ThumbnailsAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://thumbnails.roblox.com/" + }); + } + getAssetsThumbnails(options) { + const assetIdsQueryString = `assetIds=${options.assetIds.join("&assetIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${assetIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getBadgesIcons(options) { + const badgeIdsQueryString = `badgeIds=${options.badgeIds.join("&badgeIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/icons?${badgeIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getBundlesThumbnails(options) { + const bundleIdsQueryString = `bundleIds=${options.bundleIds.join("&bundleIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/thumbnails?${bundleIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getDeveloperProductIcons(options) { + const developerProductIdsQueryString = `developerProductIds=${options.developerProductIds.join("&developerProductIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-products/icons?${developerProductIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getGamePassesIcons(options) { + const gamePassIdsQueryString = `gamePassIds=${options.gamePassIds.join("&gamePassIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${gamePassIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUniverseThumbnailIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/${options.universeId}/thumbnails`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getUniversesRootPlaceThumbnail(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/icons?${universeIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUniversesThumbnailIds(options) { + const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/multiget/thumbnails?${universeIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getGroupsIcons(options) { + const groupIdsQueryString = `groupIds=${options.groupIds.join("&groupIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/icons?${groupIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUsersFullBodyAvatarImages(options) { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar?${userIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUsersAvatarBustImages(options) { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar-bust?${userIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUsersAvatarHeadShotImages(options) { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar-headshot?${userIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getUsersOutfitsImages(options) { + const outfitIdsQueryString = `userOutfitIds=${options.userOutfitIds.join("&userOutfitIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${outfitIdsQueryString}`, + qs: Object.assign({}, options) + }, + json: true + }).then((response) => response.body); + } + getBatchImages(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/batch`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.ThumbnailsAPI = ThumbnailsAPI; diff --git a/dist/client/apis/TradesAPI.d.ts b/dist/client/apis/TradesAPI.d.ts new file mode 100644 index 000000000..6105df631 --- /dev/null +++ b/dist/client/apis/TradesAPI.d.ts @@ -0,0 +1,111 @@ +import BaseAPI from "./BaseAPI"; +import Client from "../Client"; +export declare type GetTradeOptions = { + tradeId: number; +}; +export declare type GetTrade = { + offers: { + user: { + id: number; + name: string; + displayName: string; + }; + userAssets: { + id: number; + serialNumber: number; + assetId: number; + name: string; + recentAveragePrice: number; + originalPrice: number; + assetStock: number; + membershipType: "None" | string; + }[]; + robux: number; + }[]; + id: number; + user: { + id: number; + name: string; + displayName: string; + }; + created: string; + expiration: string; + isActive: boolean; + status: string; +}; +export declare type GetTradesByStatusTypeOptions = { + tradeStatusType: "Inbound" | "Outbound" | "Completed" | "Inactive"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type GetTradesByStatusType = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + user: { + id: number; + name: string; + displayName: string; + }; + created: string; + expiration: string; + isActive: boolean; + status: string; + }[]; +}; +export declare type GetTradesCountByStatusTypeOptions = { + tradeStatusType: GetTradesByStatusTypeOptions["tradeStatusType"]; +}; +export declare type GetTradesCountByStatusType = { + count: number; +}; +export declare type GetTradesMetaData = { + maxItemsPerSide: number; + minValueRatio: number; + tradeSystemMaxRobuxPercent: number; + tradeSystemRobuxFee: number; +}; +export declare type CanSelfTradeWithUserOptions = { + userId: number; +}; +export declare type CanSelfTradeWithUser = { + canTrade: boolean; + status: string; +}; +export declare type AcceptTradeOptions = { + tradeId: number; +}; +export declare type AcceptTrade = unknown; +export declare type CounterTradeOptions = { + tradeId: number; + offers: { + userId: number; + userAssetIds: number[]; + robux: number; + }[]; +}; +export declare type CounterTrade = { + id: number; +}; +export declare type DeclineTradeOptions = { + tradeId: number; +}; +export declare type DeclineTrade = unknown; +export declare type SendTradeOptions = Omit; +export declare type SendTrade = { + id: number; +}; +export default class TradesAPI extends BaseAPI { + constructor(client: Client); + getTrade(options: GetTradeOptions): Promise; + getTradesByStatusType(options: GetTradesByStatusTypeOptions): Promise; + getTradesCountByStatusType(options: GetTradesCountByStatusTypeOptions): Promise; + getTradesMetaData(): Promise; + canTradeWith(options: CanSelfTradeWithUserOptions): Promise; + acceptTrade(options: AcceptTradeOptions): Promise; + counterTrade(options: CounterTradeOptions): Promise; + declineTrade(options: DeclineTradeOptions): Promise; + sendTrade(options: SendTradeOptions): Promise; +} diff --git a/dist/client/apis/TradesAPI.js b/dist/client/apis/TradesAPI.js new file mode 100644 index 000000000..7d67285a9 --- /dev/null +++ b/dist/client/apis/TradesAPI.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +const BaseAPI_1 = (0, tslib_1.__importDefault)(require("./BaseAPI")); +class TradesAPI extends BaseAPI_1.default { + constructor(client) { + super({ + client, + baseUrl: "https://trades.roblox.com/" + }); + } + getTrade(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeId}` + }, + json: true + }).then((response) => response.body); + } + getTradesByStatusType(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeStatusType}` + }, + json: true + }).then((response) => response.body); + } + getTradesCountByStatusType(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeStatusType}/count` + }, + json: true + }).then((response) => response.body); + } + getTradesMetaData() { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/metadata` + }, + json: true + }).then((response) => response.body); + } + canTradeWith(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/can-trade-with` + }, + json: true + }).then((response) => response.body); + } + acceptTrade(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeId}/accept`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + counterTrade(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeId}/counter`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + declineTrade(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/${options.tradeId}/decline`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + sendTrade(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/trades/send`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.default = TradesAPI; diff --git a/dist/client/apis/TranslationRolesAPI.d.ts b/dist/client/apis/TranslationRolesAPI.d.ts new file mode 100644 index 000000000..0605df1a6 --- /dev/null +++ b/dist/client/apis/TranslationRolesAPI.d.ts @@ -0,0 +1,47 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type TranslationRolesGetSelfGameRolesOptions = { + gameId: number; +}; +export declare type TranslationRolesGetSelfGameRoles = { + data: string[]; +}; +export declare type TranslationRolesGetGameRoleAssigneesOptions = { + gameId: number; + role: "translator"; +}; +export declare type TranslationRolesGetGameRoleAssignees = { + data: { + id: null; + name: string; + type: "user"; + }[]; +}; +export declare type TranslationRolesGetSelfGamesAccessByRoleOptions = { + role: "translator"; + exclusiveStartKey?: string; + pageSize?: number; +}; +export declare type TranslationRolesGetSelfGamesAccessByRole = { + games: { + gameId: number; + assignee: { + assigneeType: "user"; + id: number; + }; + }[]; +}; +export declare type TranslationRolesUpdateUserAccess = { + gameId: number; + userId: number; + role: "translator"; + revoke?: boolean; +}; +export declare type TranslationRolesUpdateUser = unknown; +export declare class TranslationRolesAPI extends BaseAPI { + constructor(client: Client); + getSelfGameRoles(options: TranslationRolesGetSelfGameRolesOptions): Promise; + getGameRoleAssignees(options: TranslationRolesGetGameRoleAssigneesOptions): Promise; + getSelfGamesAccessByRole(options: TranslationRolesGetSelfGamesAccessByRoleOptions): Promise; + updateUserAccess(options: TranslationRolesUpdateUserAccess): Promise; +} diff --git a/dist/client/apis/TranslationRolesAPI.js b/dist/client/apis/TranslationRolesAPI.js new file mode 100644 index 000000000..a955eecae --- /dev/null +++ b/dist/client/apis/TranslationRolesAPI.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TranslationRolesAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class TranslationRolesAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://translationroles.roblox.com/" + }); + } + getSelfGameRoles(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}/current-user/roles` + }, + json: true + }).then((response) => response.body); + } + getGameRoleAssignees(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}/roles/${options.role}/assignees` + }, + json: true + }).then((response) => response.body); + } + getSelfGamesAccessByRole(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/roles/${options.role}/current-user` + }, + json: true + }).then((response) => response.body); + } + updateUserAccess(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}`, + method: "PATCH", + json: { + assigneeId: options.userId, + assigneeType: "user", + role: "translator", + revoke: options.revoke !== undefined ? options.revoke : false + } + }, + json: true + }).then((response) => response.body); + } +} +exports.TranslationRolesAPI = TranslationRolesAPI; diff --git a/dist/client/apis/TwoStepVerificationAPI.d.ts b/dist/client/apis/TwoStepVerificationAPI.d.ts new file mode 100644 index 000000000..c6b1c229c --- /dev/null +++ b/dist/client/apis/TwoStepVerificationAPI.d.ts @@ -0,0 +1,85 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type TwoStepVerificationGetMetaDataOptions = { + userId: number; + challengeId: string; + actionType: string; +}; +export declare type TwoStepVerificationGetMetaData = { + twoStepVerificationEnabled: boolean; + authenticatorEnabled: boolean; + authenticatorQrCodeSize: string; + emailCodeLength: number; + authenticatorCodeLength: number; +}; +export declare type TwoStepVerificationGetConfigurationOptions = TwoStepVerificationGetMetaDataOptions; +export declare type TwoStepVerificationGetConfiguration = { + primaryMediaType: "Email" | string; + methods: { + mediaType: "Email" | string; + enabled: boolean; + updated: string; + }[]; +}; +export declare type TwoStepVerificationAuthenticatorVerifyOptions = { + challengeId: string; + actionType: string; + code: string; +}; +export declare type TwoStepVerificationAuthenticatorVerify = { + verificationToken: string; +}; +export declare type TwoStepVerificationAuthenticatorDisableOptions = { + password: string; +}; +export declare type TwoStepVerificationAuthenticatorDisable = unknown; +export declare type TwoStepVerificationAuthenticatorEnableOptions = { + userId: number; +}; +export declare type TwoStepVerificationAuthenticatorEnable = { + setupToken: string; + qrCodeImageUrl: string; + manualEntryKey: string; +}; +export declare type TwoStepVerificationAuthenticatorVerifySetupOptions = { + setupToken: string; + code: string; +}; +export declare type TwoStepVerificationAuthenticatorVerifySetup = unknown; +export declare type TwoStepVerificationEmailSendCodeOptions = { + challengeId: string; + actionType: string; +}; +export declare type TwoStepVerificationEmailSendCode = { + challengeId: string; + actionType: string; +}; +export declare type TwoStepVerificationEmailVerifyOptions = { + challengeId: string; + actionType: string; + code: string; +}; +export declare type TwoStepVerificationEmailVerify = { + verificationToken: string; +}; +export declare type TwoStepVerificationEmailDisableOptions = { + password: string; +}; +export declare type TwoStepVerificationEmailDisable = unknown; +export declare type TwoStepVerificationEmailEnableOptions = { + userId: number; +}; +export declare type TwoStepVerificationEmailEnable = unknown; +export declare class TwoStepVerificationAPI extends BaseAPI { + constructor(client: Client); + getMetaData(options: TwoStepVerificationGetMetaDataOptions): Promise; + getConfiguration(options?: TwoStepVerificationGetConfigurationOptions): Promise; + verifyWithAuthenticator(options: TwoStepVerificationAuthenticatorVerifyOptions): Promise; + disableAuthenticator(options: TwoStepVerificationAuthenticatorDisableOptions): Promise; + enableAuthenticator(options: TwoStepVerificationAuthenticatorEnableOptions): Promise; + verifyAuthenticatorSetup(options: TwoStepVerificationAuthenticatorVerifySetupOptions): Promise; + sendEmailCode(options: TwoStepVerificationEmailSendCodeOptions): Promise; + verifyEmail(options: TwoStepVerificationEmailVerifyOptions): Promise; + disableEmail(options: TwoStepVerificationEmailDisableOptions): Promise; + enableEmail(options: TwoStepVerificationEmailEnableOptions): Promise; +} diff --git a/dist/client/apis/TwoStepVerificationAPI.js b/dist/client/apis/TwoStepVerificationAPI.js new file mode 100644 index 000000000..d32ea1c21 --- /dev/null +++ b/dist/client/apis/TwoStepVerificationAPI.js @@ -0,0 +1,120 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TwoStepVerificationAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class TwoStepVerificationAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://twostepverification.roblox.com/" + }); + } + getMetaData(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/metadata`, + qs: options + }, + json: true + }).then((response) => response.body); + } + getConfiguration(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration`, + qs: options + }, + json: true + }).then((response) => response.body); + } + verifyWithAuthenticator(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/challenges/authenticator/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + disableAuthenticator(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration/authenticator/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + enableAuthenticator(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration/authenticator/enable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + verifyAuthenticatorSetup(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration/authenticator/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + sendEmailCode(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/challenges/email/send-code`, + json: options + }, + json: true + }).then((response) => response.body); + } + verifyEmail(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/challenges/email/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + disableEmail(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration/email/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + enableEmail(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user.id}/configuration/email/enable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } +} +exports.TwoStepVerificationAPI = TwoStepVerificationAPI; diff --git a/dist/client/apis/UsersAPI.d.ts b/dist/client/apis/UsersAPI.d.ts new file mode 100644 index 000000000..edb2a83c9 --- /dev/null +++ b/dist/client/apis/UsersAPI.d.ts @@ -0,0 +1,105 @@ +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export declare type UsersValidateDisplayNameNewUserOptions = { + displayName: string; + birthdate: string; +}; +export declare type UsersValidateDisplayNameNewUser = unknown; +export declare type UsersValidateDisplayNameExistingUserOptions = { + userId: number; + displayName: string; +}; +export declare type UsersValidateDisplayNameExistingUser = unknown; +export declare type UsersSetSelfDisplayNameOptions = { + userId: number; + newDisplayName: string; +}; +export declare type UsersSetSelfDisplayName = unknown; +export declare type UsersGetUserByIdOptions = { + userId: number; +}; +export declare type UsersGetUserById = { + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + displayName: string; + externalAppDisplayName: string; +}; +export declare type UsersGetSelfAuthenticatedUserInformation = { + id: number; + name: string; + displayName: string; +}; +export declare type UsersGetUsersByUsernamesOptions = { + usernames: string[]; + excludeBannedUsers?: boolean; +}; +export declare type UsersGetUsersByUsernames = { + data: { + requestedUsername: string; + id: number; + name: string; + displayName: string; + }[]; +}; +export declare type UsersGetUsersByUserIdsOptions = { + userIds: number[]; + excludeBannedUsers?: boolean; +}; +export declare type UsersGetUsersByUserIds = { + data: Omit[]; +}; +export declare type UsersGetUserStatusOptions = { + userId: number; +}; +export declare type UsersGetUserStatus = { + status: string; +}; +export declare type UsersUpdateSelfStatusOptions = { + userId: number; + status: string; +}; +export declare type UsersUpdateSelfStatus = { + status: string; +}; +export declare type UsersSearchUsersOptions = { + keyword: string; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type UsersSearchUsers = { + previousPageCursor: string; + nextPageCursor: string; + data: { + previousUsernames: string[]; + id: number; + name: string; + displayName: string; + }[]; +}; +export declare type UsersUserNameHistory = { + previousPageCursor: string; + nextPageCursor: string; + data: { + name: string; + }[]; +}; +export declare class UsersAPI extends BaseAPI { + constructor(client: Client); + validateDisplayNameNewUser(options: UsersValidateDisplayNameNewUserOptions): Promise; + validateDisplayNameExistingUser(options: UsersValidateDisplayNameExistingUserOptions): Promise; + setDisplayName(options: UsersSetSelfDisplayNameOptions): Promise; + getUserById(options: UsersGetUserByIdOptions): Promise; + getAuthenticatedUserInformation(): Promise; + getUsersByUsernames(options: UsersGetUsersByUsernamesOptions): Promise; + getUsersByIds(options: UsersGetUsersByUserIdsOptions): Promise; + getUserNameHistory(options: { + userId: number; + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; + }): Promise; + searchUsers(options: UsersSearchUsersOptions): Promise; +} diff --git a/dist/client/apis/UsersAPI.js b/dist/client/apis/UsersAPI.js new file mode 100644 index 000000000..3ffe34e18 --- /dev/null +++ b/dist/client/apis/UsersAPI.js @@ -0,0 +1,105 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UsersAPI = void 0; +const BaseAPI_1 = require("./BaseAPI"); +class UsersAPI extends BaseAPI_1.BaseAPI { + constructor(client) { + super({ + client, + baseUrl: "https://users.roblox.com/" + }); + } + validateDisplayNameNewUser(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/display-names/validate`, + qs: options + }, + json: true + }).then((response) => response.body); + } + validateDisplayNameExistingUser(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/display-names/validate`, + qs: options + }, + json: true + }).then((response) => response.body); + } + setDisplayName(options) { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/display-names`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + getUserById(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}` + }, + json: true + }).then((response) => response.body); + } + getAuthenticatedUserInformation() { + return this.request({ + // This should actually be "true", but as it's needed in client.login, it's set to false + requiresAuth: false, + request: { + path: `v1/users/authenticated` + }, + json: true + }).then((response) => response.body); + } + getUsersByUsernames(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/usernames/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getUsersByIds(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + getUserNameHistory(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/username-history`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } + searchUsers(options) { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/search`, + qs: options + }, + json: true + }).then((response) => response.body); + } +} +exports.UsersAPI = UsersAPI; diff --git a/dist/client/apis/index.d.ts b/dist/client/apis/index.d.ts new file mode 100644 index 000000000..fa11f9314 --- /dev/null +++ b/dist/client/apis/index.d.ts @@ -0,0 +1,79 @@ +import { Client } from "../Client"; +import { GeneralAPI } from "./GeneralAPI"; +import { AccountInformationAPI } from "./AccountInformationAPI"; +import { AccountSettingsAPI } from "./AccountSettingsAPI"; +import { AdConfigurationAPI } from "./AdConfigurationAPI"; +import { AssetDeliveryAPI } from "./AssetDeliveryAPI"; +import { AuthAPI } from "./AuthAPI"; +import { AvatarAPI } from "./AvatarAPI"; +import { BadgesAPI } from "./BadgesAPI"; +import { BillingAPI } from "./BillingAPI"; +import { CatalogAPI } from "./CatalogAPI"; +import { ChatAPI } from "./ChatAPI"; +import { ContactsAPI } from "./ContactsAPI"; +import { DevelopAPI } from "./DevelopAPI"; +import { EconomyAPI } from "./EconomyAPI"; +import { EconomyCreatorStatsAPI } from "./EconomyCreatorStatsAPI"; +import { EngagementPayoutsAPI } from "./EngagementPayoutsAPI"; +import { FollowingsAPI } from "./FollowingsAPI"; +import { FriendsAPI } from "./FriendsAPI"; +import { GamesAPI } from "./GamesAPI"; +import { GameInternationalizationAPI } from "./GameInternationalizationAPI"; +import { GroupsAPI } from "./GroupsAPI"; +import { InventoryAPI } from "./InventoryAPI"; +import { ItemConfigurationAPI } from "./ItemConfigurationAPI"; +import { LocaleAPI } from "./LocaleAPI"; +import { MetricsAPI } from "./MetricsAPI"; +import { NotificationsAPI } from "./NotificationsAPI"; +import { PremiumFeaturesAPI } from "./PremiumFeaturesAPI"; +import { PresenceAPI } from "./PresenceAPI"; +import { PrivateMessagesAPI } from "./PrivateMessagesAPI"; +import { PublishAPI } from "./PublishAPI"; +import { ThumbnailsAPI } from "./ThumbnailsAPI"; +import { TranslationRolesAPI } from "./TranslationRolesAPI"; +import { UsersAPI } from "./UsersAPI"; +import { OtherAPI } from "./OtherAPI"; +import { TwoStepVerificationAPI } from "./TwoStepVerificationAPI"; +import { DataAPI } from "./DataAPI"; +export declare type APIs = { + accountInformationAPI: AccountInformationAPI; + accountSettingsAPI: AccountSettingsAPI; + adConfigurationAPI: AdConfigurationAPI; + assetDeliveryAPI: AssetDeliveryAPI; + authAPI: AuthAPI; + avatarAPI: AvatarAPI; + badgesAPI: BadgesAPI; + billingAPI: BillingAPI; + catalogAPI: CatalogAPI; + chatAPI: ChatAPI; + contactsAPI: ContactsAPI; + dataAPI: DataAPI; + developAPI: DevelopAPI; + economyAPI: EconomyAPI; + economyCreatorStats: EconomyCreatorStatsAPI; + engagementPayouts: EngagementPayoutsAPI; + followingsAPI: FollowingsAPI; + friendsAPI: FriendsAPI; + gamesAPI: GamesAPI; + gameInternationalizationAPI: GameInternationalizationAPI; + groupsAPI: GroupsAPI; + inventoryAPI: InventoryAPI; + itemConfigurationAPI: ItemConfigurationAPI; + localeAPI: LocaleAPI; + metricsAPI: MetricsAPI; + notificationsAPI: NotificationsAPI; + otherAPI: OtherAPI; + premiumFeaturesAPI: PremiumFeaturesAPI; + presenceAPI: PresenceAPI; + privateMessagesAPI: PrivateMessagesAPI; + publishAPI: PublishAPI; + thumbnailsAPI: ThumbnailsAPI; + translationRolesAPI: TranslationRolesAPI; + usersAPI: UsersAPI; + generalApi: GeneralAPI; + twoStepVerification: TwoStepVerificationAPI; +}; +/** + * @hidden + */ +export declare function initAPIs(client: Client): APIs; diff --git a/dist/client/apis/index.js b/dist/client/apis/index.js new file mode 100644 index 000000000..08c0134ee --- /dev/null +++ b/dist/client/apis/index.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initAPIs = void 0; +const GeneralAPI_1 = require("./GeneralAPI"); +const AccountInformationAPI_1 = require("./AccountInformationAPI"); +const AccountSettingsAPI_1 = require("./AccountSettingsAPI"); +const AdConfigurationAPI_1 = require("./AdConfigurationAPI"); +const AssetDeliveryAPI_1 = require("./AssetDeliveryAPI"); +const AuthAPI_1 = require("./AuthAPI"); +const AvatarAPI_1 = require("./AvatarAPI"); +const BadgesAPI_1 = require("./BadgesAPI"); +const BillingAPI_1 = require("./BillingAPI"); +const CatalogAPI_1 = require("./CatalogAPI"); +const ChatAPI_1 = require("./ChatAPI"); +const ContactsAPI_1 = require("./ContactsAPI"); +const DevelopAPI_1 = require("./DevelopAPI"); +const EconomyAPI_1 = require("./EconomyAPI"); +const EconomyCreatorStatsAPI_1 = require("./EconomyCreatorStatsAPI"); +const EngagementPayoutsAPI_1 = require("./EngagementPayoutsAPI"); +const FollowingsAPI_1 = require("./FollowingsAPI"); +const FriendsAPI_1 = require("./FriendsAPI"); +const GamesAPI_1 = require("./GamesAPI"); +const GameInternationalizationAPI_1 = require("./GameInternationalizationAPI"); +const GroupsAPI_1 = require("./GroupsAPI"); +const InventoryAPI_1 = require("./InventoryAPI"); +const ItemConfigurationAPI_1 = require("./ItemConfigurationAPI"); +const LocaleAPI_1 = require("./LocaleAPI"); +const MetricsAPI_1 = require("./MetricsAPI"); +const NotificationsAPI_1 = require("./NotificationsAPI"); +const PremiumFeaturesAPI_1 = require("./PremiumFeaturesAPI"); +const PresenceAPI_1 = require("./PresenceAPI"); +const PrivateMessagesAPI_1 = require("./PrivateMessagesAPI"); +const PublishAPI_1 = require("./PublishAPI"); +const ThumbnailsAPI_1 = require("./ThumbnailsAPI"); +const TranslationRolesAPI_1 = require("./TranslationRolesAPI"); +const UsersAPI_1 = require("./UsersAPI"); +const OtherAPI_1 = require("./OtherAPI"); +const TwoStepVerificationAPI_1 = require("./TwoStepVerificationAPI"); +const DataAPI_1 = require("./DataAPI"); +/** + * @hidden + */ +function initAPIs(client) { + return { + accountInformationAPI: new AccountInformationAPI_1.AccountInformationAPI(client), + accountSettingsAPI: new AccountSettingsAPI_1.AccountSettingsAPI(client), + adConfigurationAPI: new AdConfigurationAPI_1.AdConfigurationAPI(client), + assetDeliveryAPI: new AssetDeliveryAPI_1.AssetDeliveryAPI(client), + authAPI: new AuthAPI_1.AuthAPI(client), + avatarAPI: new AvatarAPI_1.AvatarAPI(client), + badgesAPI: new BadgesAPI_1.BadgesAPI(client), + billingAPI: new BillingAPI_1.BillingAPI(client), + catalogAPI: new CatalogAPI_1.CatalogAPI(client), + chatAPI: new ChatAPI_1.ChatAPI(client), + contactsAPI: new ContactsAPI_1.ContactsAPI(client), + dataAPI: new DataAPI_1.DataAPI(client), + developAPI: new DevelopAPI_1.DevelopAPI(client), + economyAPI: new EconomyAPI_1.EconomyAPI(client), + economyCreatorStats: new EconomyCreatorStatsAPI_1.EconomyCreatorStatsAPI(client), + engagementPayouts: new EngagementPayoutsAPI_1.EngagementPayoutsAPI(client), + followingsAPI: new FollowingsAPI_1.FollowingsAPI(client), + friendsAPI: new FriendsAPI_1.FriendsAPI(client), + gamesAPI: new GamesAPI_1.GamesAPI(client), + gameInternationalizationAPI: new GameInternationalizationAPI_1.GameInternationalizationAPI(client), + groupsAPI: new GroupsAPI_1.GroupsAPI(client), + inventoryAPI: new InventoryAPI_1.InventoryAPI(client), + itemConfigurationAPI: new ItemConfigurationAPI_1.ItemConfigurationAPI(client), + localeAPI: new LocaleAPI_1.LocaleAPI(client), + metricsAPI: new MetricsAPI_1.MetricsAPI(client), + generalApi: new GeneralAPI_1.GeneralAPI(client), + notificationsAPI: new NotificationsAPI_1.NotificationsAPI(client), + otherAPI: new OtherAPI_1.OtherAPI(client), + premiumFeaturesAPI: new PremiumFeaturesAPI_1.PremiumFeaturesAPI(client), + presenceAPI: new PresenceAPI_1.PresenceAPI(client), + privateMessagesAPI: new PrivateMessagesAPI_1.PrivateMessagesAPI(client), + publishAPI: new PublishAPI_1.PublishAPI(client), + thumbnailsAPI: new ThumbnailsAPI_1.ThumbnailsAPI(client), + translationRolesAPI: new TranslationRolesAPI_1.TranslationRolesAPI(client), + usersAPI: new UsersAPI_1.UsersAPI(client), + twoStepVerification: new TwoStepVerificationAPI_1.TwoStepVerificationAPI(client) + }; +} +exports.initAPIs = initAPIs; diff --git a/dist/client/index.d.ts b/dist/client/index.d.ts new file mode 100644 index 000000000..eb79981a6 --- /dev/null +++ b/dist/client/index.d.ts @@ -0,0 +1 @@ +export { Client } from "./Client"; diff --git a/dist/client/index.js b/dist/client/index.js new file mode 100644 index 000000000..55e5910ec --- /dev/null +++ b/dist/client/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Client = void 0; +var Client_1 = require("./Client"); +Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } }); diff --git a/dist/client/lib/ChatManager/ChatManager.d.ts b/dist/client/lib/ChatManager/ChatManager.d.ts new file mode 100644 index 000000000..511b2c387 --- /dev/null +++ b/dist/client/lib/ChatManager/ChatManager.d.ts @@ -0,0 +1,27 @@ +import { Client } from "../../Client"; +import { ChatAddUsersToConversation, ChatGetChatSettings, ChatMarkConversationsSeen, ChatMarkConversationMessagesRead, ChatRemoveUserFromConversation, ChatRenameGroupConversation, ChatResetConversationUniverse, ChatSendGameLinkMessageOptions, ChatSendMessageOptions, ChatSetConversationUniverse, ChatStartCloudEditConversation, ChatStartGroupConversation, ChatStartOneToOneConversation, ChatUpdateUserTypingStatus } from "../../apis/ChatAPI"; +import { ChatConversation, ChatMessage, ChatMessageSent } from "../../../old_structures/Chat"; +export declare class ChatManager { + client: Client; + constructor(client: Client); + getSettings(): Promise; + getConversation(conversationId: number): Promise; + getConversationMessages(conversationId: number, amount?: number, startMessageId?: string): Promise; + getUnreadConversationsCount(): Promise; + getConversations(conversations: number[]): Promise; + addUsersToConversation(conversation: number, users: number[]): Promise; + markMessageRead(conversation: number, id: string): Promise; + markConversationsRead(conversations: number[]): Promise; + removeUserFromConversation(conversation: number, user: number): Promise; + renameGroupConversation(conversation: number, name: string): Promise; + getUnreadMessagesInConversations(conversations: number[], amount?: number): Promise; + getLatestMessagesInConversations(conversations: number[], amount?: number): Promise; + resetConversationUniverse(conversation: number): Promise; + sendGameLinkMessage(options: ChatSendGameLinkMessageOptions): Promise; + sendMessage(options: ChatSendMessageOptions): Promise; + setConversationUniverse(conversation: number, universe: number): Promise; + startCloudEditConversation(placeId: number): Promise; + startGroupConversation(title: string, users: number[]): Promise; + startOneToOneConversation(userId: number): Promise; + updateTypingStatus(conversation: number, isTyping?: boolean): Promise; +} diff --git a/dist/client/lib/ChatManager/ChatManager.js b/dist/client/lib/ChatManager/ChatManager.js new file mode 100644 index 000000000..4f91e192c --- /dev/null +++ b/dist/client/lib/ChatManager/ChatManager.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChatManager = void 0; +const Chat_1 = require("../../../old_structures/Chat"); +class ChatManager { + constructor(client) { + this.client = client; + } + getSettings() { + return this.client.apis.chatAPI.getChatSettings(); + } + getConversation(conversationId) { + return this.getConversations([conversationId]).then((data) => data[0] || null); + } + getConversationMessages(conversationId, amount = 100, startMessageId) { + return this.client.apis.chatAPI + .getConversationMessages({ + conversationId, + pageSize: amount, + exclusiveStartMessageId: startMessageId + }) + .then((response) => response.map((chatData) => new Chat_1.ChatMessage(chatData, this.client))); + } + getUnreadConversationsCount() { + return this.client.apis.chatAPI + .getUnreadConversationCount() + .then((response) => response.count); + } + getConversations(conversations) { + return this.client.apis.chatAPI + .getConversations({ + conversationIds: conversations + }) + .then((response) => response.map((conversationData) => new Chat_1.ChatConversation(conversationData, this.client))); + } + addUsersToConversation(conversation, users) { + return this.client.apis.chatAPI.addUsersToConversation({ + conversationId: conversation, + participantUserIds: users + }); + } + markMessageRead(conversation, id) { + return this.client.apis.chatAPI.markConversationMessagesRead({ + conversationId: conversation, + endMessageId: id + }); + } + markConversationsRead(conversations) { + return this.client.apis.chatAPI.markConversationsSeen({ + conversationsToMarkSeen: conversations + }); + } + removeUserFromConversation(conversation, user) { + return this.client.apis.chatAPI.removeUserFromConversation({ + conversationId: conversation, + participantUserId: user + }); + } + renameGroupConversation(conversation, name) { + return this.client.apis.chatAPI.renameGroupConversation({ + conversationId: conversation, + newTitle: name + }); + } + getUnreadMessagesInConversations(conversations, amount = 100) { + return this.client.apis.chatAPI + .getUnreadMessagesInConversations({ + conversationIds: conversations, + pageSize: amount + }) + .then((response) => Array.prototype.concat.apply([], response.map((conversationData) => conversationData.chatMessages.map((chatData) => new Chat_1.ChatMessage(chatData, this.client))))); + } + getLatestMessagesInConversations(conversations, amount = 100) { + return this.client.apis.chatAPI + .getMultiLatestConversationMessages({ + conversationIds: conversations, + pageSize: amount + }) + .then((response) => Array.prototype.concat.apply([], response.map((conversationData) => conversationData.chatMessages.map((chatData) => new Chat_1.ChatMessage(chatData, this.client))))); + } + resetConversationUniverse(conversation) { + return this.client.apis.chatAPI.resetConversationUniverse({ + conversationId: conversation + }); + } + sendGameLinkMessage(options) { + return this.client.apis.chatAPI + .sendGameLinkMessage(options) + .then((response) => new Chat_1.ChatMessageSent(response, this.client)); + } + sendMessage(options) { + return this.client.apis.chatAPI + .sendMessage(options) + .then((response) => new Chat_1.ChatMessageSent(response, this.client)); + } + setConversationUniverse(conversation, universe) { + return this.client.apis.chatAPI.setConversationUniverse({ + conversationId: conversation, + universeId: universe + }); + } + startCloudEditConversation(placeId) { + return this.client.apis.chatAPI.startCloudEditConversation({ + placeId + }); + } + startGroupConversation(title, users) { + return this.client.apis.chatAPI.startGroupConversation({ + participantUserIds: users, + title + }); + } + startOneToOneConversation(userId) { + return this.client.apis.chatAPI.startOneToOneConversation({ + participantUserId: userId + }); + } + updateTypingStatus(conversation, isTyping = true) { + return this.client.apis.chatAPI.updateUserTypingStatus({ + conversationId: conversation, + isTyping + }); + } +} +exports.ChatManager = ChatManager; diff --git a/dist/client/lib/ChatManager/index.d.ts b/dist/client/lib/ChatManager/index.d.ts new file mode 100644 index 000000000..f39bc233e --- /dev/null +++ b/dist/client/lib/ChatManager/index.d.ts @@ -0,0 +1 @@ +export * from "./ChatManager"; diff --git a/dist/client/lib/ChatManager/index.js b/dist/client/lib/ChatManager/index.js new file mode 100644 index 000000000..ded55471d --- /dev/null +++ b/dist/client/lib/ChatManager/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +(0, tslib_1.__exportStar)(require("./ChatManager"), exports); diff --git a/dist/client/lib/ClientSocket/ClientSocket.d.ts b/dist/client/lib/ClientSocket/ClientSocket.d.ts new file mode 100644 index 000000000..fe4fb976a --- /dev/null +++ b/dist/client/lib/ClientSocket/ClientSocket.d.ts @@ -0,0 +1,61 @@ +/// +import { Client } from "../../Client"; +import { EventEmitter } from "events"; +import { PartialChatConversation } from "../../../old_structures/Chat"; +import { PartialUser } from "../../../old_structures/User"; +export declare interface Socket extends EventEmitter { + on(event: "chatMessageSent", listener: (data: { + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatUserTyping", listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatUserTypingStopped", listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatMessage", listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatMessageSent", listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatConversationAdded", listener: (data: { + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatConversationRemoved", listener: (data: { + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatMemberAdded", listener: (data: { + conversation: PartialChatConversation; + }) => void): this; + on(event: "chatMemberLeft", listener: (data: { + conversation: PartialChatConversation; + }) => void): this; + on(event: "friendLost", listener: (data: { + user: PartialUser; + }) => void): this; + on(event: "friendRequest", listener: (data: { + user: PartialUser; + }) => void): this; + on(event: "friendAdded", listener: (data: { + user: PartialUser; + }) => void): this; + on(event: "userPresenceChanged", listener: (data: { + user: PartialUser; + }) => void): this; +} +export declare class Socket extends EventEmitter { + client: Client; + socket: any; + connected: boolean; + constructor(client: Client); + connect(): Promise; + /** + * This is called after the connection of the socket has successfully been established + */ + init(): void; +} diff --git a/dist/client/lib/ClientSocket/ClientSocket.js b/dist/client/lib/ClientSocket/ClientSocket.js new file mode 100644 index 000000000..08494ab67 --- /dev/null +++ b/dist/client/lib/ClientSocket/ClientSocket.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Socket = void 0; +const tslib_1 = require("tslib"); +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +const SignalR = (0, tslib_1.__importStar)(require("signalr-client")); +const handlers_1 = (0, tslib_1.__importDefault)(require("./handlers")); +const events_1 = require("events"); +class Socket extends events_1.EventEmitter { + constructor(client) { + super(); + this.client = client; + this.socket = null; + this.connected = false; + } + connect() { + return new Promise((resolve, reject) => { + const connectSocket = (retries = 0) => { + var _a, _b, _c; + this.socket = new SignalR.client("wss://realtime.roblox.com/notifications", ["usernotificationhub"], 3, true); + this.socket.headers.Cookie = + this.client.rest.cookieJar.getCookieStringSync("https://roblox.com"); + const maxRetries = (_c = (_b = (_a = this.client.options.setup) === null || _a === void 0 ? void 0 : _a.websocket) === null || _b === void 0 ? void 0 : _b.maxRetries) !== null && _c !== void 0 ? _c : 3; + const attemptReconnect = () => connectSocket(++retries); + const onError = (error) => { + this.emit("error", error); + attemptReconnect(); + }; + if (retries >= maxRetries) { + this.socket.close(); + reject(new Error(`Connection failed, attempted to establish a connection ${retries} times`)); + } + this.socket.serviceHandlers.connectFailed = (error) => onError(error); + this.socket.serviceHandlers.onerror = (error) => onError(error); + this.socket.serviceHandlers.connected = () => { + this.emit("ready"); + this.init(); + resolve(); + }; + this.socket.serviceHandlers.reconnecting = () => { + this.emit("reconnecting"); + }; + // Start the attempt of connection + this.socket.start(); + }; + connectSocket(); + }); + } + /** + * This is called after the connection of the socket has successfully been established + */ + init() { + this.socket.on("UserNotificationHub", "notification", (name, message) => { + this.emit("event", { + name, + message + }); + const parsedMessage = !(message instanceof Object) + ? JSON.parse(message) + : message; + const messageType = parsedMessage.Type + ? parsedMessage.Type.toLowerCase() + : null; + const socketHandler = handlers_1.default.get(name.toLowerCase()); + if (socketHandler) { + return socketHandler(this, messageType, parsedMessage); + } + }); + } +} +exports.Socket = Socket; diff --git a/dist/client/lib/ClientSocket/handlers/chatNotifications.d.ts b/dist/client/lib/ClientSocket/handlers/chatNotifications.d.ts new file mode 100644 index 000000000..b1eadb2b2 --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/chatNotifications.d.ts @@ -0,0 +1,2 @@ +import * as ClientSocket from "../ClientSocket"; +export default function handleChatNotifications(socket: ClientSocket.Socket, messageType: string, message: any): void; diff --git a/dist/client/lib/ClientSocket/handlers/chatNotifications.js b/dist/client/lib/ClientSocket/handlers/chatNotifications.js new file mode 100644 index 000000000..b1d6498ec --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/chatNotifications.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const Chat_1 = require("../../../../old_structures/Chat"); +const User_1 = require("../../../../old_structures/User"); +function handleChatNotifications(socket, messageType, message) { + switch (messageType) { + case "participanttyping": + socket.emit(message.IsTyping ? "chatUserTyping" : "chatUserTypingStopped", { + user: new User_1.PartialUser({ + id: message.UserId + }, socket.client), + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "newmessage": + socket.emit("chatMessage", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "newmessagebyself": + socket.emit("chatMessageSent", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "newconversation": + socket.emit("chatConversationAdded", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "conversationremoved": + socket.emit("chatConversationRemoved", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "participantadded": + socket.emit("chatMemberAdded", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + case "participantlefet": + socket.emit("chatMemberLeft", { + conversation: new Chat_1.PartialChatConversation({ + id: message.ConversationId + }, socket.client) + }); + break; + default: + break; + } +} +exports.default = handleChatNotifications; diff --git a/dist/client/lib/ClientSocket/handlers/friendShipnotifications.d.ts b/dist/client/lib/ClientSocket/handlers/friendShipnotifications.d.ts new file mode 100644 index 000000000..593bdfd4e --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/friendShipnotifications.d.ts @@ -0,0 +1,2 @@ +import * as ClientSocket from "../ClientSocket"; +export default function handleFriendshipNotifications(socket: ClientSocket.Socket, messageType: string, message: any): void; diff --git a/dist/client/lib/ClientSocket/handlers/friendShipnotifications.js b/dist/client/lib/ClientSocket/handlers/friendShipnotifications.js new file mode 100644 index 000000000..2138f745d --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/friendShipnotifications.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const User_1 = require("../../../../old_structures/User"); +function handleFriendshipNotifications(socket, messageType, message) { + switch (messageType) { + case "friendshipdestroyed": + socket.emit("friendLost", { + user: new User_1.PartialUser({ + id: [message.UserId1, message.UserId2].filter((id) => id !== socket.client.user.id)[0] + }, socket.client) + }); + break; + case "friendshiprequested": + socket.emit("friendRequest", { + user: new User_1.PartialUser({ + id: message.UserId1 + }, socket.client) + }); + break; + case "friendshipcreated": + socket.emit("friendAdded", { + user: new User_1.PartialUser({ + id: message.UserId1 + }, socket.client) + }); + break; + default: + break; + } +} +exports.default = handleFriendshipNotifications; diff --git a/dist/client/lib/ClientSocket/handlers/index.d.ts b/dist/client/lib/ClientSocket/handlers/index.d.ts new file mode 100644 index 000000000..6a0d04ab6 --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/index.d.ts @@ -0,0 +1,3 @@ +import { Socket as ClientSocket } from "../ClientSocket"; +declare const handlersMap: Map void>; +export default handlersMap; diff --git a/dist/client/lib/ClientSocket/handlers/index.js b/dist/client/lib/ClientSocket/handlers/index.js new file mode 100644 index 000000000..708452e22 --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +const chatNotifications_1 = (0, tslib_1.__importDefault)(require("./chatNotifications")); +const friendShipnotifications_1 = (0, tslib_1.__importDefault)(require("./friendShipnotifications")); +const messageNotifications_1 = (0, tslib_1.__importDefault)(require("./messageNotifications")); +const presenceBulkNotifications_1 = (0, tslib_1.__importDefault)(require("./presenceBulkNotifications")); +const handlersMap = new Map(); +handlersMap.set("chatnotifications", chatNotifications_1.default); +handlersMap.set("friendshipnotifications", friendShipnotifications_1.default); +handlersMap.set("messagenotifications", messageNotifications_1.default); +handlersMap.set("presencebulknotifications", presenceBulkNotifications_1.default); +exports.default = handlersMap; diff --git a/dist/client/lib/ClientSocket/handlers/messageNotifications.d.ts b/dist/client/lib/ClientSocket/handlers/messageNotifications.d.ts new file mode 100644 index 000000000..01109eada --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/messageNotifications.d.ts @@ -0,0 +1,2 @@ +import { Socket as ClientSocket } from "../ClientSocket"; +export default function handleChatNotifications(socket: ClientSocket, messageType: string, message: any): void; diff --git a/dist/client/lib/ClientSocket/handlers/messageNotifications.js b/dist/client/lib/ClientSocket/handlers/messageNotifications.js new file mode 100644 index 000000000..10c69c03b --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/messageNotifications.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function handleChatNotifications(socket, messageType, message) { + switch (messageType) { + case "created": + socket.emit("message", { + messageId: message.MessageId + }); + break; + case "markasread": + socket.emit("messageRead", { + messageId: message.MessageId + }); + break; + case "markasunread": + socket.emit("messageUnread", { + messageId: message.MessageId + }); + break; + case "archived": + socket.emit("messageArchived", { + messageId: message.MessageId + }); + break; + case "unarchived": + socket.emit("messageUnarchived", { + messageId: message.MessageId + }); + break; + default: + break; + } +} +exports.default = handleChatNotifications; diff --git a/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.d.ts b/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.d.ts new file mode 100644 index 000000000..b23fd5984 --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.d.ts @@ -0,0 +1,2 @@ +import { Socket as ClientSocket } from "../ClientSocket"; +export default function handlePresenceBulkNotifications(socket: ClientSocket, _messageType: string, message: any): void; diff --git a/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.js b/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.js new file mode 100644 index 000000000..d96ca86b9 --- /dev/null +++ b/dist/client/lib/ClientSocket/handlers/presenceBulkNotifications.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const User_1 = require("../../../../old_structures/User"); +function handlePresenceBulkNotifications(socket, _messageType, message) { + if (!Array.isArray(message)) { + throw new Error("Presence bulk notification message was not an array"); + } + message.forEach((presenceUpdated) => { + socket.emit("userPresenceChanged", new User_1.PartialUser({ + id: presenceUpdated.UserId + }, socket.client)); + }); +} +exports.default = handlePresenceBulkNotifications; diff --git a/dist/client/lib/ClientSocket/index.d.ts b/dist/client/lib/ClientSocket/index.d.ts new file mode 100644 index 000000000..8edceb2b7 --- /dev/null +++ b/dist/client/lib/ClientSocket/index.d.ts @@ -0,0 +1 @@ +export * from "./ClientSocket"; diff --git a/dist/client/lib/ClientSocket/index.js b/dist/client/lib/ClientSocket/index.js new file mode 100644 index 000000000..f3f0a4dda --- /dev/null +++ b/dist/client/lib/ClientSocket/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +(0, tslib_1.__exportStar)(require("./ClientSocket"), exports); diff --git a/dist/client/lib/DataStoreManager/DataStoreManager.d.ts b/dist/client/lib/DataStoreManager/DataStoreManager.d.ts new file mode 100644 index 000000000..e267addce --- /dev/null +++ b/dist/client/lib/DataStoreManager/DataStoreManager.d.ts @@ -0,0 +1,9 @@ +import { Client } from "../../Client"; +import { OrderedDataStore } from "./structures/OrderedDataStore"; +import { GlobalDataStore } from "./structures/GlobalDataStore"; +export declare class DataStoreManager { + client: Client; + constructor(client: Client); + getOrderedDataStore(placeId: number, name: string, scope?: string): OrderedDataStore; + getDataStore(placeId: number, name: string, scope?: string): GlobalDataStore; +} diff --git a/dist/client/lib/DataStoreManager/DataStoreManager.js b/dist/client/lib/DataStoreManager/DataStoreManager.js new file mode 100644 index 000000000..487d6750f --- /dev/null +++ b/dist/client/lib/DataStoreManager/DataStoreManager.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DataStoreManager = void 0; +const OrderedDataStore_1 = require("./structures/OrderedDataStore"); +const GlobalDataStore_1 = require("./structures/GlobalDataStore"); +class DataStoreManager { + constructor(client) { + this.client = client; + } + getOrderedDataStore(placeId, name, scope) { + if (!this.client.isLoggedIn()) { + throw new Error(`You must be logged in to be able to use data stores!`); + } + return new OrderedDataStore_1.OrderedDataStore(this, placeId, name, scope, false); + } + getDataStore(placeId, name, scope) { + if (!this.client.isLoggedIn()) { + throw new Error(`You must be logged in to be able to use data stores!`); + } + return new GlobalDataStore_1.GlobalDataStore(this, placeId, name, scope, false); + } +} +exports.DataStoreManager = DataStoreManager; diff --git a/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.d.ts b/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.d.ts new file mode 100644 index 000000000..3adb4bc22 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.d.ts @@ -0,0 +1,15 @@ +import { DataStoreManager } from "../DataStoreManager"; +import { RESTRequestOptions, RESTResponseDataType } from "../../../../interfaces/RESTInterfaces"; +import { DataStoreRequestType } from "../util/constants"; +declare type DataStoreHttpRequestOptions = RESTRequestOptions & { + placeId: number; + requestType: DataStoreRequestType; + data: string; +}; +export declare class DataStoreHttpRequest { + initiator: DataStoreManager; + options: DataStoreHttpRequestOptions; + constructor(manager: DataStoreManager, options: DataStoreHttpRequestOptions); + send(): Promise; +} +export {}; diff --git a/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.js b/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.js new file mode 100644 index 000000000..ce2f1cf36 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/DataStoreHttpRequest.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DataStoreHttpRequest = void 0; +class DataStoreHttpRequest { + constructor(manager, options) { + this.initiator = manager; + this.options = options; + // Adjusting the body + this.options.body = + this.options.data.length === 0 ? " " : this.options.data; + // Always POST + this.options.method = this.options.method || "POST"; + this.options.headers = this.options.headers || {}; + this.options.headers = Object.assign(Object.assign({}, this.options.headers), { "Cache-Control": "no-cache", "Content-Type": "application/x-www-form-urlencoded", "Roblox-Place-Id": this.options.placeId, Cookie: this.initiator.client.rest.getCookies("https://www.roblox.com/") }); + } + send() { + return this.initiator.client.rest.request(this.options); + } +} +exports.DataStoreHttpRequest = DataStoreHttpRequest; diff --git a/dist/client/lib/DataStoreManager/structures/GenericDataStore.d.ts b/dist/client/lib/DataStoreManager/structures/GenericDataStore.d.ts new file mode 100644 index 000000000..5ec6174b4 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/GenericDataStore.d.ts @@ -0,0 +1,76 @@ +import { DataStoreManager } from "../DataStoreManager"; +import { RESTResponseDataType } from "../../../../interfaces/RESTInterfaces"; +declare type DataStoreType = "OrderedDataStore" | "GlobalDataStore"; +export declare class GenericDataStore { + manager: DataStoreManager; + name: string; + scope: string; + legacy: boolean; + baseAPIUrl: string; + placeId: number; + dataStoreType: DataStoreType; + advanced: { + parseData?: (data: string) => DataType; + serializeData?: (data: DataType) => string; + }; + constructor(manager: DataStoreManager, dataStoreType: DataStoreType, placeId: number, name: string, scope: string | null, legacy?: boolean); + /** + * When data is retrieved from data stores, it will be returned unmodified + * Using your own data converter will allow you to return it if you handle your data in a special way, such as + * JSON parsing it etc. + * @param {(data: string) => DataType} parseDataFunction + * @param {(data: DataType) => string} serializeDataFunction + */ + setDataConverters(parseDataFunction: (data: string) => DataType, serializeDataFunction: (data: DataType) => string): void; + buildPostDataForKey(key: string, index?: number): string; + buildGetUrl(): string; + buildSetUrl(key: string, valueLength: number): string; + buildSetIfUrl(key: string, valueLength: number, expectedValueLength: number): string; + buildIncrementUrl(key: string, delta: number): string; + buildRemoveUrl(key: string): string; + parseRetrievedData(data: string): [boolean, Result | any]; + /** + * Retrieves the value associated with the key (if any), otherwise returns null. + * Equivalent of DataStoreService:GetDataStore("name"):GetAsync("key"); + * @param {string} key + * @returns {Promise} + */ + getAsync(key: string): Promise; + /** + * Sets a value in data stores to the given key. + * Equivalent of DataStoreService:GetDataStore("name"):SetAsync("key", "value") + * @param {string} key + * @param {DataType} value + * @returns {Promise} + */ + setAsync(key: string, value: DataType): Promise; + incrementAsync(key: string, delta?: number): Promise; + removeAsync(key: string): Promise; + createQueryString(addition: Record): string; + /** + * This will (possibly) use a custom provided converter function that turns string into DataType. + * @param {string} data + * @returns {DataType} + * @private + */ + parseIncomingData(data: string): DataType; + /** + * This will (possibly) use a custom provided converter function that turns DataType into string so it can be saved + * to data stores + * @param {DataType} data + * @returns {string} + * @private + */ + serializeOutgoingData(data: DataType): string; + safeEncodeValue(input: string): string; + /** + * Performs various checks before sending any requests to make sure the requests are valid before sent + * @param {{key?: string, value?: DataType}} options + * @private + */ + performPreflightChecks(options: { + key?: string; + value?: string; + }): void; +} +export {}; diff --git a/dist/client/lib/DataStoreManager/structures/GenericDataStore.js b/dist/client/lib/DataStoreManager/structures/GenericDataStore.js new file mode 100644 index 000000000..560af0581 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/GenericDataStore.js @@ -0,0 +1,249 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GenericDataStore = void 0; +const tslib_1 = require("tslib"); +const querystring = (0, tslib_1.__importStar)(require("querystring")); +const DataStoreHttpRequest_1 = require("./DataStoreHttpRequest"); +const constants_1 = require("../util/constants"); +const checks_1 = require("../util/checks"); +class GenericDataStore { + constructor(manager, dataStoreType, placeId, name, scope, legacy = false) { + this.manager = manager; + this.dataStoreType = dataStoreType; + this.placeId = placeId; + this.name = name; + this.scope = scope || "global"; + this.legacy = legacy; + this.baseAPIUrl = "https://gamepersistence.roblox.com/persistence/"; + this.advanced = {}; + // Making sure we started off properly by checking all the set values + this.performPreflightChecks({}); + } + /** + * When data is retrieved from data stores, it will be returned unmodified + * Using your own data converter will allow you to return it if you handle your data in a special way, such as + * JSON parsing it etc. + * @param {(data: string) => DataType} parseDataFunction + * @param {(data: DataType) => string} serializeDataFunction + */ + setDataConverters(parseDataFunction, serializeDataFunction) { + this.advanced.parseData = parseDataFunction; + this.advanced.serializeData = serializeDataFunction; + } + buildPostDataForKey(key, index = 0) { + const encodedQueryString = querystring.encode({ + [`qkeys[${index}].scope`]: this.scope + ? this.safeEncodeValue(this.scope) + : "", + [`qkeys[${index}].target`]: this.legacy ? "" : this.safeEncodeValue(key), + [`qkeys[${index}].key`]: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name) + }); + return `&${encodedQueryString}`; + } + buildGetUrl() { + const encodedQueryString = this.createQueryString({}); + return `${this.baseAPIUrl}getV2?${encodedQueryString}`; + } + buildSetUrl(key, valueLength) { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + valueLength + }); + return `${this.baseAPIUrl}set?${encodedQueryString}`; + } + buildSetIfUrl(key, valueLength, expectedValueLength) { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + valueLength, + expectedValueLength + }); + return `${this.baseAPIUrl}set?${encodedQueryString}`; + } + buildIncrementUrl(key, delta) { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + value: delta + }); + return `${this.baseAPIUrl}increment?${encodedQueryString}`; + } + buildRemoveUrl(key) { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key) + }); + return `${this.baseAPIUrl}increment?${encodedQueryString}`; + } + parseRetrievedData(data) { + let result = ""; + if (data.length === 0) { + return [true, result]; + } + try { + result = JSON.parse(data); + } + catch (_a) { + return [false, result]; + } + return [true, result]; + } + /** + * Retrieves the value associated with the key (if any), otherwise returns null. + * Equivalent of DataStoreService:GetDataStore("name"):GetAsync("key"); + * @param {string} key + * @returns {Promise} + */ + getAsync(key) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + this.performPreflightChecks({ + key + }); + const createdRequest = new DataStoreHttpRequest_1.DataStoreHttpRequest(this.manager, { + url: this.buildGetUrl(), + placeId: this.placeId, + data: this.buildPostDataForKey(key), + requestType: constants_1.DataStoreRequestType.GET_ASYNC + }); + const response = yield createdRequest.send(); + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData(response.body); + if (!parsedResponseSuccess || !parsedResponse) { + throw new Error(`Failed to parse response from data stores!`); + } + if (parsedResponse.data && parsedResponse.data.length > 0) { + // Sending the returned data for internal processing + return this.parseIncomingData(parsedResponse.data[0].Value); + } + else { + return null; + } + }); + } + /** + * Sets a value in data stores to the given key. + * Equivalent of DataStoreService:GetDataStore("name"):SetAsync("key", "value") + * @param {string} key + * @param {DataType} value + * @returns {Promise} + */ + setAsync(key, value) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + const serializedValue = this.serializeOutgoingData(value); + this.performPreflightChecks({ + key, + value: serializedValue + }); + const createdRequest = new DataStoreHttpRequest_1.DataStoreHttpRequest(this.manager, { + url: this.buildSetUrl(key, serializedValue.length), + placeId: this.placeId, + data: `value=${this.safeEncodeValue(serializedValue)}`, + requestType: constants_1.DataStoreRequestType.SET_ASYNC + }); + const response = yield createdRequest.send(); + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData(response.body); + if (!parsedResponseSuccess || !parsedResponse) { + throw new Error(`Failed to parse response!`); + } + return this.parseIncomingData(parsedResponse.data); + }); + } + incrementAsync(key, delta = 1) { + this.performPreflightChecks({ + key + }); + const createdRequest = new DataStoreHttpRequest_1.DataStoreHttpRequest(this.manager, { + url: this.buildIncrementUrl(key, delta), + placeId: this.placeId, + data: "", + requestType: constants_1.DataStoreRequestType.INCREMENT_ASYNC + }); + return createdRequest.send(); + } + removeAsync(key) { + this.performPreflightChecks({ + key + }); + const createdRequest = new DataStoreHttpRequest_1.DataStoreHttpRequest(this.manager, { + url: this.buildRemoveUrl(key), + placeId: this.placeId, + data: "", + requestType: constants_1.DataStoreRequestType.SET_ASYNC + }); + return createdRequest.send(); + } + createQueryString(addition) { + return querystring.encode(Object.assign({ placeId: this.placeId, type: this.dataStoreType === "GlobalDataStore" ? "standard" : "sorted", scope: this.safeEncodeValue(this.scope) }, addition)); + } + /** + * This will (possibly) use a custom provided converter function that turns string into DataType. + * @param {string} data + * @returns {DataType} + * @private + */ + parseIncomingData(data) { + if (this.advanced.parseData) { + return this.advanced.parseData(data); + } + else { + return data; + } + } + /** + * This will (possibly) use a custom provided converter function that turns DataType into string so it can be saved + * to data stores + * @param {DataType} data + * @returns {string} + * @private + */ + serializeOutgoingData(data) { + let serializedStage1 = ""; + if (this.advanced.serializeData) { + serializedStage1 = this.advanced.serializeData(data); + } + else { + serializedStage1 = data; + } + let serializedFinal = ""; + try { + serializedFinal = JSON.stringify(serializedStage1); + } + catch (_a) { + serializedFinal = null; + } + if (!serializedFinal) { + throw new Error(`Failed to serialize the data using JSON.stringify`); + } + return serializedFinal; + } + safeEncodeValue(input) { + return encodeURIComponent(input); + } + /** + * Performs various checks before sending any requests to make sure the requests are valid before sent + * @param {{key?: string, value?: DataType}} options + * @private + */ + performPreflightChecks(options) { + (0, checks_1.checkScope)(this.scope); + (0, checks_1.checkName)(this.name); + (0, checks_1.checkPlaceId)(this.placeId); + if (options.key !== undefined) { + (0, checks_1.checkKey)(options.key); + } + if (options.value !== undefined) { + (0, checks_1.checkValue)(options.value); + } + } +} +exports.GenericDataStore = GenericDataStore; diff --git a/dist/client/lib/DataStoreManager/structures/GlobalDataStore.d.ts b/dist/client/lib/DataStoreManager/structures/GlobalDataStore.d.ts new file mode 100644 index 000000000..509402115 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/GlobalDataStore.d.ts @@ -0,0 +1,5 @@ +import { GenericDataStore } from "./GenericDataStore"; +import { DataStoreManager } from "../DataStoreManager"; +export declare class GlobalDataStore extends GenericDataStore { + constructor(manager: DataStoreManager, placeId: number, name: string, scope?: string, legacy?: boolean); +} diff --git a/dist/client/lib/DataStoreManager/structures/GlobalDataStore.js b/dist/client/lib/DataStoreManager/structures/GlobalDataStore.js new file mode 100644 index 000000000..59ac14164 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/GlobalDataStore.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalDataStore = void 0; +const GenericDataStore_1 = require("./GenericDataStore"); +class GlobalDataStore extends GenericDataStore_1.GenericDataStore { + constructor(manager, placeId, name, scope, legacy) { + super(manager, "GlobalDataStore", placeId, name, scope || null, legacy || false); + } +} +exports.GlobalDataStore = GlobalDataStore; diff --git a/dist/client/lib/DataStoreManager/structures/OrderedDataStore.d.ts b/dist/client/lib/DataStoreManager/structures/OrderedDataStore.d.ts new file mode 100644 index 000000000..51c2e0b3e --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/OrderedDataStore.d.ts @@ -0,0 +1,24 @@ +import { GenericDataStore } from "./GenericDataStore"; +import { DataStoreManager } from "../DataStoreManager"; +import { OrderedDataStorePage } from "./OrderedDataStorePage"; +export declare type GetSortedUrlOptions = { + ascending?: boolean; + pageSize?: number; + minValue?: number; + maxValue?: number; + startKey?: string; +}; +export declare type OrderedDataStoreResultType = { + data: { + Entries: { + Target: string; + Value: number; + }[]; + ExclusiveStartKey: string | null; + }; +}; +export declare class OrderedDataStore extends GenericDataStore { + constructor(manager: DataStoreManager, placeId: number, name: string, scope?: string, legacy?: boolean); + getSortedAsync(options: GetSortedUrlOptions): Promise>; + private buildGetSortedUrl; +} diff --git a/dist/client/lib/DataStoreManager/structures/OrderedDataStore.js b/dist/client/lib/DataStoreManager/structures/OrderedDataStore.js new file mode 100644 index 000000000..f6f7400c7 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/OrderedDataStore.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OrderedDataStore = void 0; +const tslib_1 = require("tslib"); +const GenericDataStore_1 = require("./GenericDataStore"); +const DataStoreHttpRequest_1 = require("./DataStoreHttpRequest"); +const constants_1 = require("../util/constants"); +const OrderedDataStorePage_1 = require("./OrderedDataStorePage"); +class OrderedDataStore extends GenericDataStore_1.GenericDataStore { + constructor(manager, placeId, name, scope, legacy) { + super(manager, "OrderedDataStore", placeId, name, scope || null, legacy || false); + } + getSortedAsync(options) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + this.performPreflightChecks({}); + const createdRequest = new DataStoreHttpRequest_1.DataStoreHttpRequest(this.manager, { + url: this.buildGetSortedUrl(options), + placeId: this.placeId, + data: "", + requestType: constants_1.DataStoreRequestType.GET_SORTED_ASYNC_PAGE + }); + const response = yield createdRequest.send(); + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData(response.body); + if (!parsedResponseSuccess) { + throw new Error(`Failed to parse response!`); + } + return new OrderedDataStorePage_1.OrderedDataStorePage(this, { + options, + result: parsedResponse + }); + }); + } + buildGetSortedUrl(options) { + const encodedQueryString = this.createQueryString({ + key: this.safeEncodeValue(this.name), + pageSize: options.pageSize || + constants_1.DataStoreManagerConstants.DFInt.DataStoreMaxPageSize, + ascending: options.ascending ? "True" : "False", + inclusiveMinValue: options.minValue, + inclusiveMaxValue: options.maxValue, + exclusiveStartKey: options.startKey + }); + return `${this.baseAPIUrl}getSortedValues?${encodedQueryString}`; + } +} +exports.OrderedDataStore = OrderedDataStore; diff --git a/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.d.ts b/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.d.ts new file mode 100644 index 000000000..470aeb1cf --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.d.ts @@ -0,0 +1,15 @@ +import { OrderedDataStore, GetSortedUrlOptions, OrderedDataStoreResultType } from "./OrderedDataStore"; +export declare class OrderedDataStorePage { + orderedDataStore: OrderedDataStore; + options: GetSortedUrlOptions; + data: { + key: string; + value: number; + }[]; + startKey: string | null; + constructor(orderedDataStore: OrderedDataStore, data: { + options: GetSortedUrlOptions; + result: OrderedDataStoreResultType; + }); + fetchNextPage(): Promise>; +} diff --git a/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.js b/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.js new file mode 100644 index 000000000..439e9c656 --- /dev/null +++ b/dist/client/lib/DataStoreManager/structures/OrderedDataStorePage.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OrderedDataStorePage = void 0; +class OrderedDataStorePage { + constructor(orderedDataStore, data) { + this.orderedDataStore = orderedDataStore; + this.options = data.options; + this.data = data.result.data.Entries.map((x) => ({ + key: x.Target, + value: x.Value + })); + this.startKey = data.result.data.ExclusiveStartKey; + } + fetchNextPage() { + if (!this.startKey) { + throw new Error(`There is no next page!`); + } + return this.orderedDataStore.getSortedAsync(Object.assign(Object.assign({}, this.options), { startKey: this.startKey })); + } +} +exports.OrderedDataStorePage = OrderedDataStorePage; diff --git a/dist/client/lib/DataStoreManager/util/checks.d.ts b/dist/client/lib/DataStoreManager/util/checks.d.ts new file mode 100644 index 000000000..373414136 --- /dev/null +++ b/dist/client/lib/DataStoreManager/util/checks.d.ts @@ -0,0 +1,5 @@ +export declare function checkKey(key: string): boolean; +export declare function checkPlaceId(placeId: number): boolean; +export declare function checkName(name: string): boolean; +export declare function checkScope(scope: string): boolean; +export declare function checkValue(value: string): boolean; diff --git a/dist/client/lib/DataStoreManager/util/checks.js b/dist/client/lib/DataStoreManager/util/checks.js new file mode 100644 index 000000000..ffefb89e5 --- /dev/null +++ b/dist/client/lib/DataStoreManager/util/checks.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkValue = exports.checkScope = exports.checkName = exports.checkPlaceId = exports.checkKey = void 0; +const constants_1 = require("./constants"); +function checkKey(key) { + if (key.length === 0 || + key.length > constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { + throw new Error(`Key cannot be blank or be more than ${constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); + } + return true; +} +exports.checkKey = checkKey; +function checkPlaceId(placeId) { + if (placeId < 1) { + throw new Error(`Place ID must be greater than 1`); + } + return true; +} +exports.checkPlaceId = checkPlaceId; +function checkName(name) { + if (name.length === 0 || + name.length > constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { + throw new Error(`DataStore name cannot be blank or be more than ${constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); + } + return true; +} +exports.checkName = checkName; +function checkScope(scope) { + if (scope.length === 0 || + scope.length > constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { + throw new Error(`DataStore scope cannot be blank or be more than ${constants_1.DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); + } + return true; +} +exports.checkScope = checkScope; +function checkValue(value) { + if (value.length === 0 || + value.length > constants_1.DataStoreManagerConstants.DFInt.DataStoreMaxValueSize) { + throw new Error(`DataStore values cannot be blank or be more than ${constants_1.DataStoreManagerConstants.DFInt.DataStoreMaxValueSize} characters!`); + } + return true; +} +exports.checkValue = checkValue; diff --git a/dist/client/lib/DataStoreManager/util/constants.d.ts b/dist/client/lib/DataStoreManager/util/constants.d.ts new file mode 100644 index 000000000..90ff33786 --- /dev/null +++ b/dist/client/lib/DataStoreManager/util/constants.d.ts @@ -0,0 +1,19 @@ +export declare enum DataStoreRequestType { + GET_ASYNC = 5, + UPDATE_ASYNC = 6, + SET_ASYNC = 7, + INCREMENT_ASYNC = 8, + GET_SORTED_ASYNC_PAGE = 9 +} +export declare const DataStoreManagerConstants: { + DFFlag: { + UseNewDataStoreRequestSetTimestampBehaviour: boolean; + GetGlobalDataStorePcallFix: boolean; + UseUnstableDevGetAsyncUrl: boolean; + }; + DFInt: { + DataStoreMaxValueSize: number; + DataStoreMaxPageSize: number; + DataStoreKeyLengthLimit: number; + }; +}; diff --git a/dist/client/lib/DataStoreManager/util/constants.js b/dist/client/lib/DataStoreManager/util/constants.js new file mode 100644 index 000000000..833c99aad --- /dev/null +++ b/dist/client/lib/DataStoreManager/util/constants.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DataStoreManagerConstants = exports.DataStoreRequestType = void 0; +var DataStoreRequestType; +(function (DataStoreRequestType) { + DataStoreRequestType[DataStoreRequestType["GET_ASYNC"] = 5] = "GET_ASYNC"; + DataStoreRequestType[DataStoreRequestType["UPDATE_ASYNC"] = 6] = "UPDATE_ASYNC"; + DataStoreRequestType[DataStoreRequestType["SET_ASYNC"] = 7] = "SET_ASYNC"; + DataStoreRequestType[DataStoreRequestType["INCREMENT_ASYNC"] = 8] = "INCREMENT_ASYNC"; + DataStoreRequestType[DataStoreRequestType["GET_SORTED_ASYNC_PAGE"] = 9] = "GET_SORTED_ASYNC_PAGE"; +})(DataStoreRequestType = exports.DataStoreRequestType || (exports.DataStoreRequestType = {})); +exports.DataStoreManagerConstants = { + DFFlag: { + UseNewDataStoreRequestSetTimestampBehaviour: false, + GetGlobalDataStorePcallFix: false, + UseUnstableDevGetAsyncUrl: false + }, + DFInt: { + DataStoreMaxValueSize: 64 * 1024, + DataStoreMaxPageSize: 100, + DataStoreKeyLengthLimit: 50 + } +}; diff --git a/dist/controllers/index.d.ts b/dist/controllers/index.d.ts new file mode 100644 index 000000000..a8736510e --- /dev/null +++ b/dist/controllers/index.d.ts @@ -0,0 +1,5 @@ +import { RESTController } from "./rest"; +declare const controllers: { + rest: typeof RESTController; +}; +export default controllers; diff --git a/dist/controllers/index.js b/dist/controllers/index.js new file mode 100644 index 000000000..f0d3fd046 --- /dev/null +++ b/dist/controllers/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const rest_1 = require("./rest"); +const controllers = { + rest: rest_1.RESTController +}; +exports.default = controllers; diff --git a/dist/controllers/rest/RESTController.d.ts b/dist/controllers/rest/RESTController.d.ts new file mode 100644 index 000000000..1ae101e92 --- /dev/null +++ b/dist/controllers/rest/RESTController.d.ts @@ -0,0 +1,110 @@ +import { Client } from "../../client/Client"; +import { Cookie, CookieJar } from "tough-cookie"; +import { RESTControllerOptions, RESTCreateCookieOptions, RESTRequester, RESTRequestHandler, RESTRequestOptions, RESTResponseDataType, RESTResponseHandler } from "../../interfaces/RESTInterfaces"; +export declare class RESTController { + client: Client; + options: RESTControllerOptions; + requester: RESTRequester; + cookieJar: CookieJar; + responseHandlers: RESTResponseHandler[]; + requestHandlers: RESTRequestHandler[]; + constructor(client: Client, options?: RESTControllerOptions); + /** + * Sends a request + * @param {RequestOptions} options The options + * @returns {Promise} + */ + request(options: RESTRequestOptions): Promise; + /** + * Fetches a new XCSRF token + */ + fetchXCSRFToken(): Promise; + /** + * Sets the XCSRF token + * @param {string} token The xcsrf token to use in future requets + */ + setXCSRFToken(token: string): void; + /** + * Gets the existing XCSRF token if it's not older than set refresh interval, + * otherwise, fetch a new one + */ + getXCSRFToken(): Promise; + /** + * Creates a new cookie and returns it, no side effects + * @param {RESTCreateCookieOptions} cookieOptions The options to use + * @returns {Cookie} + */ + createCookie(cookieOptions: RESTCreateCookieOptions): Cookie; + /** + * Adds a cookie to the cookie jar + * @param {Cookie} cookie The cookie to add + * @param {?string} domain The domain to add it for + * @param {Object} setCookieOptions Options for setting the cookie + * @returns {Cookie} + */ + addCookie(cookie: Cookie, domain?: string, setCookieOptions?: any): Cookie; + /** + * Gets the cookies for a given domain stored in the jar + * @param {string} domain The domain to retrieve the cookies for + * @returns {Cookie[]} + */ + getCookies(domain: string): Cookie[]; + /** + * Adds a response handler + * @param {Function} handler The response handler + */ + addResponseHandler(handler: RESTResponseHandler): void; + /** + * Adds a request handler + * @param {Function} handler The request handler + */ + addRequestHandler(handler: RESTRequestHandler): void; + /** + * Sets the proxy for the requests + * @param {string} proxyURL The proxy URL + */ + setProxy(proxyURL: string): void; + /** + * Gets the proxy used + * @returns {string | undefined} + */ + getProxy(): string | undefined; + /** + * Sets the user agents for future requests + * @param {string} userAgent The user agent to use + */ + setUserAgent(userAgent: string): void; + /** + * Gets the user agent + * @returns {string | undefined} + */ + getUserAgent(): string | undefined; + /** + * Sets the XCSRF token refresh interval + * @param {number} xcsrfRefreshInterval The time in ms to use + */ + setXCSRFTokenRefreshInterval(xcsrfRefreshInterval: number): void; + /** + * Gets the XCSRF token refresh interval + * @returns {number | undefined} + */ + getXCSRFTokenRefreshInterval(): number | undefined; + /** + * Sets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @param {number} xcsrfRefreshMaxRetries Number of retries + */ + setXCSRFTokenRefreshMaxRetries(xcsrfRefreshMaxRetries: number): void; + /** + * Gets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @returns {number | undefined} + */ + getXCSRFTokenRefreshMaxRetries(): number | undefined; + /** + * Sets the options for the RESTController + * @param {RESTControllerOptions} options The options to use + * @returns {RESTControllerOptions} + */ + setOptions(options?: RESTControllerOptions): RESTControllerOptions; +} diff --git a/dist/controllers/rest/RESTController.js b/dist/controllers/rest/RESTController.js new file mode 100644 index 000000000..c18e21fb8 --- /dev/null +++ b/dist/controllers/rest/RESTController.js @@ -0,0 +1,191 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTController = void 0; +const tslib_1 = require("tslib"); +const tough_cookie_1 = require("tough-cookie"); +const RESTInterfaces_1 = require("../../interfaces/RESTInterfaces"); +const updateXCSRFToken_1 = require("./lib/updateXCSRFToken"); +const request_1 = require("./request"); +const handlers_1 = require("./response/handlers"); +const getRequester_1 = require("./lib/getRequester"); +const utilFunctions_1 = require("../../util/utilFunctions"); +class RESTController { + constructor(client, options) { + /** + * The client + */ + this.client = client; + /** + * The options for this RESTController + */ + this.options = this.setOptions(options || this.client.options.rest); + /** + * The cookie jar + */ + this.cookieJar = new tough_cookie_1.CookieJar(); + /** + * Functions to go through to validate / modify the response + */ + this.responseHandlers = [...handlers_1.responseHandlers]; + /** + * Functions to go through to modify the request + */ + this.requestHandlers = []; + /** + * The function that's being used to perform the requests, can be modified + */ + this.requester = (0, getRequester_1.getRequester)(this, this.options.requester || undefined); + } + /** + * Sends a request + * @param {RequestOptions} options The options + * @returns {Promise} + */ + request(options) { + const request = new request_1.RESTRequest(this, options); + return request.send(); + } + /** + * Fetches a new XCSRF token + */ + fetchXCSRFToken() { + return (0, updateXCSRFToken_1.updateXCSRFToken)(this).then((xcsrfToken) => { + this.setXCSRFToken(xcsrfToken); + return xcsrfToken; + }); + } + /** + * Sets the XCSRF token + * @param {string} token The xcsrf token to use in future requets + */ + setXCSRFToken(token) { + this.options.xcsrf = token; + this.options.xcsrfSet = Date.now(); + } + /** + * Gets the existing XCSRF token if it's not older than set refresh interval, + * otherwise, fetch a new one + */ + getXCSRFToken() { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + if (!this.options.xcsrf || + Date.now() - (this.options.xcsrfSet || 0) >= + (this.options.xcsrfRefreshInterval || + RESTInterfaces_1.DefaultRESTControllerOptions.xcsrfRefreshInterval)) { + // Refresh token + yield this.fetchXCSRFToken().then((token) => { + this.setXCSRFToken(token); + }); + } + return this.options.xcsrf; + }); + } + /** + * Creates a new cookie and returns it, no side effects + * @param {RESTCreateCookieOptions} cookieOptions The options to use + * @returns {Cookie} + */ + createCookie(cookieOptions) { + return new tough_cookie_1.Cookie(Object.assign(Object.assign({}, RESTInterfaces_1.DefaultCreateCookieOptions), cookieOptions)); + } + /** + * Adds a cookie to the cookie jar + * @param {Cookie} cookie The cookie to add + * @param {?string} domain The domain to add it for + * @param {Object} setCookieOptions Options for setting the cookie + * @returns {Cookie} + */ + addCookie(cookie, domain, setCookieOptions) { + return this.cookieJar.setCookieSync(cookie, domain || "https://roblox.com", setCookieOptions || {}); + } + /** + * Gets the cookies for a given domain stored in the jar + * @param {string} domain The domain to retrieve the cookies for + * @returns {Cookie[]} + */ + getCookies(domain) { + return this.cookieJar.getCookiesSync(domain); + } + /** + * Adds a response handler + * @param {Function} handler The response handler + */ + addResponseHandler(handler) { + this.responseHandlers.push(handler); + } + /** + * Adds a request handler + * @param {Function} handler The request handler + */ + addRequestHandler(handler) { + this.requestHandlers.push(handler); + } + /** + * Sets the proxy for the requests + * @param {string} proxyURL The proxy URL + */ + setProxy(proxyURL) { + this.options.proxy = proxyURL; + } + /** + * Gets the proxy used + * @returns {string | undefined} + */ + getProxy() { + return this.options.proxy; + } + /** + * Sets the user agents for future requests + * @param {string} userAgent The user agent to use + */ + setUserAgent(userAgent) { + this.options.userAgent = userAgent; + } + /** + * Gets the user agent + * @returns {string | undefined} + */ + getUserAgent() { + return this.options.userAgent; + } + /** + * Sets the XCSRF token refresh interval + * @param {number} xcsrfRefreshInterval The time in ms to use + */ + setXCSRFTokenRefreshInterval(xcsrfRefreshInterval) { + this.options.xcsrfRefreshInterval = xcsrfRefreshInterval; + } + /** + * Gets the XCSRF token refresh interval + * @returns {number | undefined} + */ + getXCSRFTokenRefreshInterval() { + return this.options.xcsrfRefreshInterval; + } + /** + * Sets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @param {number} xcsrfRefreshMaxRetries Number of retries + */ + setXCSRFTokenRefreshMaxRetries(xcsrfRefreshMaxRetries) { + this.options.xcsrfRefreshMaxRetries = xcsrfRefreshMaxRetries; + } + /** + * Gets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @returns {number | undefined} + */ + getXCSRFTokenRefreshMaxRetries() { + return this.options.xcsrfRefreshMaxRetries; + } + /** + * Sets the options for the RESTController + * @param {RESTControllerOptions} options The options to use + * @returns {RESTControllerOptions} + */ + setOptions(options) { + this.options = (0, utilFunctions_1.utilMergeDeep)(RESTInterfaces_1.DefaultRESTControllerOptions, options || {}); + return this.options; + } +} +exports.RESTController = RESTController; diff --git a/dist/controllers/rest/index.d.ts b/dist/controllers/rest/index.d.ts new file mode 100644 index 000000000..67f3f39a4 --- /dev/null +++ b/dist/controllers/rest/index.d.ts @@ -0,0 +1 @@ +export { RESTController } from "./RESTController"; diff --git a/dist/controllers/rest/index.js b/dist/controllers/rest/index.js new file mode 100644 index 000000000..3863c9b65 --- /dev/null +++ b/dist/controllers/rest/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTController = void 0; +var RESTController_1 = require("./RESTController"); +Object.defineProperty(exports, "RESTController", { enumerable: true, get: function () { return RESTController_1.RESTController; } }); diff --git a/dist/controllers/rest/lib/getRequester.d.ts b/dist/controllers/rest/lib/getRequester.d.ts new file mode 100644 index 000000000..dc0223a06 --- /dev/null +++ b/dist/controllers/rest/lib/getRequester.d.ts @@ -0,0 +1,2 @@ +import { RESTController } from "../RESTController"; +export declare function getRequester(controller: RESTController, customRequester?: RESTController["requester"]): import("../../../interfaces/RESTInterfaces").RESTRequester; diff --git a/dist/controllers/rest/lib/getRequester.js b/dist/controllers/rest/lib/getRequester.js new file mode 100644 index 000000000..ad8fdb768 --- /dev/null +++ b/dist/controllers/rest/lib/getRequester.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRequester = void 0; +const tslib_1 = require("tslib"); +const got_1 = (0, tslib_1.__importDefault)(require("got")); +function getRequester(controller, customRequester) { + if (!controller.requester && + !controller.client.options.rest.requester && + customRequester === undefined) { + let requester; + try { + requester = got_1.default; + } + catch (e) { + throw new Error(`Failed to retrieve module "got" and no custom requester provided!`); + } + controller.requester = requester; + } + else { + controller.requester = customRequester; + } + return controller.requester; +} +exports.getRequester = getRequester; diff --git a/dist/controllers/rest/lib/updateXCSRFToken.d.ts b/dist/controllers/rest/lib/updateXCSRFToken.d.ts new file mode 100644 index 000000000..829a6ea32 --- /dev/null +++ b/dist/controllers/rest/lib/updateXCSRFToken.d.ts @@ -0,0 +1,2 @@ +import { RESTController } from "../RESTController"; +export declare function updateXCSRFToken(restController: RESTController): Promise; diff --git a/dist/controllers/rest/lib/updateXCSRFToken.js b/dist/controllers/rest/lib/updateXCSRFToken.js new file mode 100644 index 000000000..f2c83bd6a --- /dev/null +++ b/dist/controllers/rest/lib/updateXCSRFToken.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateXCSRFToken = void 0; +function updateXCSRFToken(restController) { + return restController + .request({ + url: "https://auth.roblox.com/v2/login", + method: "POST", + xcsrf: false, + checks: { + xcsrf: false + }, + responseOptions: { + allowedStatusCodes: [403] + } + }) + .then((response) => { + const foundXcsrfToken = response.headers["x-csrf-token"]; + if (!foundXcsrfToken) { + throw new Error(`x-csrf-token was not returned by Roblox. Unable to fetch the token!`); + } + else { + return foundXcsrfToken; + } + }); +} +exports.updateXCSRFToken = updateXCSRFToken; diff --git a/dist/controllers/rest/request/RESTRequest.d.ts b/dist/controllers/rest/request/RESTRequest.d.ts new file mode 100644 index 000000000..007db2c05 --- /dev/null +++ b/dist/controllers/rest/request/RESTRequest.d.ts @@ -0,0 +1,16 @@ +import { RESTRequestOptions, RESTResponseDataType } from "../../../interfaces/RESTInterfaces"; +import { RESTController } from "../RESTController"; +export declare class RESTRequest { + controller: RESTController; + /** + * The options that will be used for sending the request + */ + requestOptions: RESTRequestOptions; + /** + * The amount of times this request has been executed + */ + attempts: number; + constructor(controller: RESTController, options: RESTRequestOptions); + setOptions(options: RESTRequestOptions): RESTRequestOptions; + send(options?: RESTRequestOptions): Promise; +} diff --git a/dist/controllers/rest/request/RESTRequest.js b/dist/controllers/rest/request/RESTRequest.js new file mode 100644 index 000000000..d96ac63d9 --- /dev/null +++ b/dist/controllers/rest/request/RESTRequest.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTRequest = void 0; +const tslib_1 = require("tslib"); +const RESTInterfaces_1 = require("../../../interfaces/RESTInterfaces"); +const prepare_1 = require("./prepare"); +const response_1 = require("../response"); +const utilFunctions_1 = require("../../../util/utilFunctions"); +class RESTRequest { + constructor(controller, options) { + this.controller = controller; + this.requestOptions = options; + this.attempts = 0; + } + setOptions(options) { + // As lodash overwrites all entries that are provided with each other, it also mutates the default + // This way, it creates a clone of the default each time, so there's "new" default data each time + this.requestOptions = (0, utilFunctions_1.utilMergeDeep)(JSON.parse(JSON.stringify(RESTInterfaces_1.DefaultRESTRequestOptions)), options || {}); + return this.requestOptions; + } + send(options) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + yield (0, prepare_1.prepare)(this, options || this.requestOptions); + yield Promise.all(this.controller.requestHandlers.map((handler) => handler(this))); + const responseData = yield this.controller.requester(this.requestOptions); + this.attempts++; + const response = new response_1.RESTResponse(this.controller, this, responseData); + return response.process(); + }); + } +} +exports.RESTRequest = RESTRequest; diff --git a/dist/controllers/rest/request/index.d.ts b/dist/controllers/rest/request/index.d.ts new file mode 100644 index 000000000..c83b23eaf --- /dev/null +++ b/dist/controllers/rest/request/index.d.ts @@ -0,0 +1 @@ +export { RESTRequest } from "./RESTRequest"; diff --git a/dist/controllers/rest/request/index.js b/dist/controllers/rest/request/index.js new file mode 100644 index 000000000..52930c9c1 --- /dev/null +++ b/dist/controllers/rest/request/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTRequest = void 0; +var RESTRequest_1 = require("./RESTRequest"); +Object.defineProperty(exports, "RESTRequest", { enumerable: true, get: function () { return RESTRequest_1.RESTRequest; } }); diff --git a/dist/controllers/rest/request/prepare.d.ts b/dist/controllers/rest/request/prepare.d.ts new file mode 100644 index 000000000..d10b43647 --- /dev/null +++ b/dist/controllers/rest/request/prepare.d.ts @@ -0,0 +1,3 @@ +import { RESTRequestOptions } from "../../../interfaces/RESTInterfaces"; +import { RESTRequest } from "./"; +export declare function prepare(request: RESTRequest, options: RESTRequestOptions): Promise; diff --git a/dist/controllers/rest/request/prepare.js b/dist/controllers/rest/request/prepare.js new file mode 100644 index 000000000..c35339fee --- /dev/null +++ b/dist/controllers/rest/request/prepare.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.prepare = void 0; +const tslib_1 = require("tslib"); +const querystring_1 = (0, tslib_1.__importDefault)(require("querystring")); +function prepare(request, options) { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + request.setOptions(options); + if (!request.requestOptions.url) { + throw new Error("No url was provided when executing rest.request.prepare"); + } + if (!request.requestOptions.headers) { + request.requestOptions.headers = {}; + } + if (request.requestOptions.followAllRedirects !== false) { + request.requestOptions.followAllRedirects = true; + } + if (!request.requestOptions.method) { + request.requestOptions.method = "GET"; + } + if (request.requestOptions.qs) { + if (!request.requestOptions.url.includes("?")) { + request.requestOptions.url += `?${querystring_1.default.stringify(request.requestOptions.qs)}`; + } + else { + request.requestOptions.url += `&${querystring_1.default.stringify(request.requestOptions.qs)}`; + } + } + if ((request.requestOptions.xcsrf !== false && + request.requestOptions.method.toLowerCase() !== "get") || + request.requestOptions.xcsrf === true) { + request.requestOptions.headers = Object.assign(Object.assign({}, request.requestOptions.headers), { "X-CSRF-TOKEN": yield request.controller.getXCSRFToken() }); + if (!request.requestOptions.responseOptions) { + request.requestOptions.responseOptions = {}; + } + if (!request.requestOptions.responseOptions.disallowedStatusMessages) { + request.requestOptions.responseOptions.disallowedStatusMessages = []; + } + request.requestOptions.responseOptions.disallowedStatusMessages.push("Token Validation Failed"); + } + if (request.requestOptions.json) { + request.requestOptions.body = + typeof request.requestOptions.json === "string" + ? request.requestOptions.json + : JSON.stringify(request.requestOptions.json); + request.requestOptions.headers["content-type"] = "application/json"; + delete request.requestOptions.json; + } + if (!request.requestOptions.excludeCookies) { + request.requestOptions.headers.Cookie = + request.controller.cookieJar.getCookieStringSync(request.requestOptions.url); + } + // -- Utilities + // Making sure the library does not throw errors if the request fails for some reason + // We want to handle any issues ourselves + request.requestOptions.throwHttpErrors = false; + }); +} +exports.prepare = prepare; diff --git a/dist/controllers/rest/response/RESTResponse.d.ts b/dist/controllers/rest/response/RESTResponse.d.ts new file mode 100644 index 000000000..0d1f1f047 --- /dev/null +++ b/dist/controllers/rest/response/RESTResponse.d.ts @@ -0,0 +1,10 @@ +import { RESTController } from "../RESTController"; +import { RESTRequest } from "../request"; +import { RESTResponseDataType } from "../../../interfaces/RESTInterfaces"; +export declare class RESTResponse { + controller: RESTController; + request: RESTRequest; + responseData: RESTResponseDataType; + constructor(controller: RESTController, request: RESTRequest, responseData: RESTResponseDataType); + process(): Promise; +} diff --git a/dist/controllers/rest/response/RESTResponse.js b/dist/controllers/rest/response/RESTResponse.js new file mode 100644 index 000000000..9a5732f34 --- /dev/null +++ b/dist/controllers/rest/response/RESTResponse.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTResponse = void 0; +const tslib_1 = require("tslib"); +const errors_1 = require("../../../util/errors/errors"); +class RESTResponse { + // Public options: RESTResponseOptions; + constructor(controller, request, responseData) { + this.controller = controller; + this.request = request; + this.responseData = responseData; + } + // eslint-disable-next-line require-await + process() { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + const allProcessed = this.controller.responseHandlers.map((handler) => handler(this)); + if (allProcessed.every((processed) => processed === true)) { + return this.responseData; + } + else { + const error = allProcessed.find((err) => err instanceof errors_1.BloxyHttpError && + err.name === "BloxyHttpInvalidStatusMessageError" && + err.statusMessage.includes("Token Validation Failed")); + if (error) { + // 1 attempt = 0 retries + if (this.request.attempts - 1 === + this.controller.getXCSRFTokenRefreshMaxRetries()) { + throw error; + } + else { + this.controller.options.xcsrf = undefined; + return this.request.send(); + } + } + throw allProcessed.find((err) => err instanceof Error); + } + }); + } +} +exports.RESTResponse = RESTResponse; diff --git a/dist/controllers/rest/response/handlers/index.d.ts b/dist/controllers/rest/response/handlers/index.d.ts new file mode 100644 index 000000000..c101b4109 --- /dev/null +++ b/dist/controllers/rest/response/handlers/index.d.ts @@ -0,0 +1,2 @@ +import { validStatusCode } from "./validStatusCode"; +export declare const responseHandlers: (typeof validStatusCode)[]; diff --git a/dist/controllers/rest/response/handlers/index.js b/dist/controllers/rest/response/handlers/index.js new file mode 100644 index 000000000..a7ed5958f --- /dev/null +++ b/dist/controllers/rest/response/handlers/index.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.responseHandlers = void 0; +const validBody_1 = require("./validBody"); +const validStatusMessage_1 = require("./validStatusMessage"); +const validStatusCode_1 = require("./validStatusCode"); +const updateHeaders_1 = require("./updateHeaders"); +exports.responseHandlers = [ + updateHeaders_1.updateHeaders, + validStatusCode_1.validStatusCode, + validStatusMessage_1.validStatusMessage, + validBody_1.validBody +]; diff --git a/dist/controllers/rest/response/handlers/updateHeaders.d.ts b/dist/controllers/rest/response/handlers/updateHeaders.d.ts new file mode 100644 index 000000000..81ce62c8e --- /dev/null +++ b/dist/controllers/rest/response/handlers/updateHeaders.d.ts @@ -0,0 +1,2 @@ +import { RESTResponse } from "../RESTResponse"; +export declare function updateHeaders(response: RESTResponse): boolean; diff --git a/dist/controllers/rest/response/handlers/updateHeaders.js b/dist/controllers/rest/response/handlers/updateHeaders.js new file mode 100644 index 000000000..87395a4ab --- /dev/null +++ b/dist/controllers/rest/response/handlers/updateHeaders.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateHeaders = void 0; +const tough_cookie_1 = require("tough-cookie"); +function updateHeaders(response) { + if (response.responseData.headers["set-cookie"]) { + const setCookieHeader = response.responseData.headers["set-cookie"]; + if (Array.isArray(setCookieHeader)) { + setCookieHeader.forEach((toSetCookie) => { + const parsedCookie = tough_cookie_1.Cookie.parse(toSetCookie); + if (parsedCookie) { + response.controller.addCookie(parsedCookie); + } + }); + } + else { + const parsedCookie = tough_cookie_1.Cookie.parse(setCookieHeader); + if (parsedCookie) { + response.controller.addCookie(parsedCookie); + } + } + } + return true; +} +exports.updateHeaders = updateHeaders; diff --git a/dist/controllers/rest/response/handlers/validBody.d.ts b/dist/controllers/rest/response/handlers/validBody.d.ts new file mode 100644 index 000000000..822b5e3af --- /dev/null +++ b/dist/controllers/rest/response/handlers/validBody.d.ts @@ -0,0 +1 @@ +export declare function validBody(): boolean; diff --git a/dist/controllers/rest/response/handlers/validBody.js b/dist/controllers/rest/response/handlers/validBody.js new file mode 100644 index 000000000..5dfd47645 --- /dev/null +++ b/dist/controllers/rest/response/handlers/validBody.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validBody = void 0; +function validBody() { + return true; +} +exports.validBody = validBody; diff --git a/dist/controllers/rest/response/handlers/validStatusCode.d.ts b/dist/controllers/rest/response/handlers/validStatusCode.d.ts new file mode 100644 index 000000000..e740014c4 --- /dev/null +++ b/dist/controllers/rest/response/handlers/validStatusCode.d.ts @@ -0,0 +1,2 @@ +import { RESTResponse } from "../RESTResponse"; +export declare function validStatusCode(response: RESTResponse): boolean | Error; diff --git a/dist/controllers/rest/response/handlers/validStatusCode.js b/dist/controllers/rest/response/handlers/validStatusCode.js new file mode 100644 index 000000000..81e6d1827 --- /dev/null +++ b/dist/controllers/rest/response/handlers/validStatusCode.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validStatusCode = void 0; +const errors_1 = require("../../../../util/errors/errors"); +function validStatusCode(response) { + var _a; + const { request, responseData } = response; + let isValid = true; + const responseOptions = request.requestOptions.responseOptions || {}; + if (request.requestOptions.responseOptions && + ((_a = request.requestOptions.checks) === null || _a === void 0 ? void 0 : _a.statusCode)) { + const allowedStatusCodes = responseOptions.allowedStatusCodes || []; + const disallowedStatusCodes = responseOptions.disallowedStatusCodes || []; + const isAllowed = allowedStatusCodes.some((statusCode) => responseData.statusCode === statusCode); + const isDisallowed = disallowedStatusCodes.some((statusCode) => responseData.statusCode === statusCode); + if (allowedStatusCodes.length > 0) { + // Only these are allowed + if (!isAllowed) { + isValid = false; + } + } + else if (allowedStatusCodes.length === 0 && + disallowedStatusCodes.length > 0) { + // Only these are disallowed + if (isDisallowed) { + isValid = false; + } + } + else if (allowedStatusCodes.length === 0 && + disallowedStatusCodes.length === 0) { + // All status are allowed + } + } + return isValid + ? true + : new errors_1.BloxyHttpError({ + statusMessage: responseData.statusMessage, + statusCode: responseData.statusCode, + message: `Invalid status code in response. Body: ${responseData.body instanceof Object + ? JSON.stringify(responseData.body) + : responseData.body}`, + name: "BloxyHttpInvalidStatusCodeError", + possibleReasons: [] + }); +} +exports.validStatusCode = validStatusCode; diff --git a/dist/controllers/rest/response/handlers/validStatusMessage.d.ts b/dist/controllers/rest/response/handlers/validStatusMessage.d.ts new file mode 100644 index 000000000..1231c04f7 --- /dev/null +++ b/dist/controllers/rest/response/handlers/validStatusMessage.d.ts @@ -0,0 +1,2 @@ +import { RESTResponse } from "../RESTResponse"; +export declare function validStatusMessage(response: RESTResponse): boolean | Error; diff --git a/dist/controllers/rest/response/handlers/validStatusMessage.js b/dist/controllers/rest/response/handlers/validStatusMessage.js new file mode 100644 index 000000000..c7b208fc4 --- /dev/null +++ b/dist/controllers/rest/response/handlers/validStatusMessage.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validStatusMessage = void 0; +const errors_1 = require("../../../../util/errors/errors"); +function validStatusMessage(response) { + var _a; + const { request, responseData } = response; + const responseOptions = request.requestOptions.responseOptions || {}; + let isValid = true; + if (request.requestOptions.responseOptions && + ((_a = request.requestOptions.checks) === null || _a === void 0 ? void 0 : _a.statusMessage)) { + const allowedStatusMessages = responseOptions.allowedStatusMessages || []; + const disallowedStatusMessages = responseOptions.disallowedStatusMessages || []; + const isAllowed = allowedStatusMessages.some((statusMessage) => responseData.statusMessage.toLowerCase().includes(statusMessage)); + const isDisallowed = disallowedStatusMessages.some((statusMessage) => responseData.statusMessage.toLowerCase().includes(statusMessage)); + if (allowedStatusMessages.length > 0) { + // Only these are allowed + if (!isAllowed) { + isValid = false; + } + } + else if (allowedStatusMessages.length === 0 && + disallowedStatusMessages.length > 0) { + // Only these are disallowed + if (isDisallowed) { + isValid = false; + } + } + else if (allowedStatusMessages.length === 0 && + disallowedStatusMessages.length === 0) { + // All status are allowed + } + } + return isValid + ? true + : new errors_1.BloxyHttpError({ + statusCode: responseData.statusCode, + statusMessage: responseData.statusMessage, + message: `Invalid status message detected in response.`, + name: "BloxyHttpInvalidStatusMessageError", + possibleReasons: [] + }); +} +exports.validStatusMessage = validStatusMessage; diff --git a/dist/controllers/rest/response/index.d.ts b/dist/controllers/rest/response/index.d.ts new file mode 100644 index 000000000..fa4300af3 --- /dev/null +++ b/dist/controllers/rest/response/index.d.ts @@ -0,0 +1 @@ +export { RESTResponse } from "./RESTResponse"; diff --git a/dist/controllers/rest/response/index.js b/dist/controllers/rest/response/index.js new file mode 100644 index 000000000..106b1df0c --- /dev/null +++ b/dist/controllers/rest/response/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RESTResponse = void 0; +var RESTResponse_1 = require("./RESTResponse"); +Object.defineProperty(exports, "RESTResponse", { enumerable: true, get: function () { return RESTResponse_1.RESTResponse; } }); diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 000000000..d2b60d129 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,40 @@ +export { Client } from "./client"; +export * from "./types/GenericTypes"; +export * from "./types/GenericOptionTypes"; +export * from "./client/apis/AccountInformationAPI"; +export * from "./client/apis/AccountSettingsAPI"; +export * from "./client/apis/AdConfigurationAPI"; +export * from "./client/apis/AssetDeliveryAPI"; +export * from "./client/apis/AuthAPI"; +export * from "./client/apis/AvatarAPI"; +export * from "./client/apis/BadgesAPI"; +export * from "./client/apis/BaseAPI"; +export * from "./client/apis/BillingAPI"; +export * from "./client/apis/CatalogAPI"; +export * from "./client/apis/ChatAPI"; +export * from "./client/apis/ContactsAPI"; +export * from "./client/apis/DataAPI"; +export * from "./client/apis/DevelopAPI"; +export * from "./client/apis/EconomyAPI"; +export * from "./client/apis/EconomyCreatorStatsAPI"; +export * from "./client/apis/EngagementPayoutsAPI"; +export * from "./client/apis/FollowingsAPI"; +export * from "./client/apis/FriendsAPI"; +export * from "./client/apis/GameInternationalizationAPI"; +export * from "./client/apis/GamesAPI"; +export * from "./client/apis/GeneralAPI"; +export * from "./client/apis/GroupsAPI"; +export * from "./client/apis/InventoryAPI"; +export * from "./client/apis/ItemConfigurationAPI"; +export * from "./client/apis/LocaleAPI"; +export * from "./client/apis/MetricsAPI"; +export * from "./client/apis/NotificationsAPI"; +export * from "./client/apis/OtherAPI"; +export * from "./client/apis/PremiumFeaturesAPI"; +export * from "./client/apis/PresenceAPI"; +export * from "./client/apis/PrivateMessagesAPI"; +export * from "./client/apis/PublishAPI"; +export * from "./client/apis/ThumbnailsAPI"; +export * from "./client/apis/TranslationRolesAPI"; +export * from "./client/apis/TwoStepVerificationAPI"; +export * from "./client/apis/UsersAPI"; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 000000000..dd4e66f12 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Client = void 0; +const tslib_1 = require("tslib"); +var client_1 = require("./client"); +Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } }); +// Generic Types +(0, tslib_1.__exportStar)(require("./types/GenericTypes"), exports); +(0, tslib_1.__exportStar)(require("./types/GenericOptionTypes"), exports); +// APIs +(0, tslib_1.__exportStar)(require("./client/apis/AccountInformationAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/AccountSettingsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/AdConfigurationAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/AssetDeliveryAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/AuthAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/AvatarAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/BadgesAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/BaseAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/BillingAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/CatalogAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/ChatAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/ContactsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/DataAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/DevelopAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/EconomyAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/EconomyCreatorStatsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/EngagementPayoutsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/FollowingsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/FriendsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/GameInternationalizationAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/GamesAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/GeneralAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/GroupsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/InventoryAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/ItemConfigurationAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/LocaleAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/MetricsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/NotificationsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/OtherAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/PremiumFeaturesAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/PresenceAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/PrivateMessagesAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/PublishAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/ThumbnailsAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/TranslationRolesAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/TwoStepVerificationAPI"), exports); +(0, tslib_1.__exportStar)(require("./client/apis/UsersAPI"), exports); diff --git a/dist/interfaces/APIInterfaces.d.ts b/dist/interfaces/APIInterfaces.d.ts new file mode 100644 index 000000000..1fa20cc3b --- /dev/null +++ b/dist/interfaces/APIInterfaces.d.ts @@ -0,0 +1,5 @@ +import { Client } from "../index"; +export declare type BaseAPIOptions = { + baseUrl: string; + client: Client; +}; diff --git a/dist/interfaces/APIInterfaces.js b/dist/interfaces/APIInterfaces.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/dist/interfaces/APIInterfaces.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/interfaces/GeneralInterfaces.d.ts b/dist/interfaces/GeneralInterfaces.d.ts new file mode 100644 index 000000000..56e6095fc --- /dev/null +++ b/dist/interfaces/GeneralInterfaces.d.ts @@ -0,0 +1,19 @@ +import { ClientUser } from "../old_structures/ClientUser"; +export declare type AnyIdentifier = string | number; +export declare type UserIdentifier = ClientUser | AnyIdentifier; +export declare enum EnumUserPresence { + "Offline" = 0, + "Online" = 1, + "In Game" = 2, + "In Studio" = 3 +} +export interface UserPresence { + UserPresenceType: "InGame" | "InStudio" | "Online" | "Offline"; + UserLocationType: "Game"; + lastLocation?: string; + placeId?: number; + rootPlaceId?: number; + gameInstanceId?: string; + universeId?: number; + lastOnline?: string; +} diff --git a/dist/interfaces/GeneralInterfaces.js b/dist/interfaces/GeneralInterfaces.js new file mode 100644 index 000000000..dbb5a6ffa --- /dev/null +++ b/dist/interfaces/GeneralInterfaces.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EnumUserPresence = void 0; +var EnumUserPresence; +(function (EnumUserPresence) { + EnumUserPresence[EnumUserPresence["Offline"] = 0] = "Offline"; + EnumUserPresence[EnumUserPresence["Online"] = 1] = "Online"; + EnumUserPresence[EnumUserPresence["In Game"] = 2] = "In Game"; + EnumUserPresence[EnumUserPresence["In Studio"] = 3] = "In Studio"; +})(EnumUserPresence = exports.EnumUserPresence || (exports.EnumUserPresence = {})); diff --git a/dist/interfaces/RESTInterfaces.d.ts b/dist/interfaces/RESTInterfaces.d.ts new file mode 100644 index 000000000..0f1ff90b4 --- /dev/null +++ b/dist/interfaces/RESTInterfaces.d.ts @@ -0,0 +1,167 @@ +import { RESTRequest } from "../controllers/rest/request"; +import { RESTResponse } from "../controllers/rest/response"; +export declare type RESTRequester = (requestOptions: RESTRequestOptions) => Promise; +export declare type RESTRequestHandler = (request: RESTRequest) => boolean | Error; +export declare type RESTResponseHandler = (response: RESTResponse) => boolean | Error; +export declare type RESTControllerOptions = { + requester?: (requestOptions: RESTRequestOptions) => Promise; + /** + * If specified, the user agent that will be used for the requests + */ + userAgent?: string; + /** + * If specified, the url which the request will be proxied through + */ + proxy?: string; + /** + * The current XCSRF token + */ + xcsrf?: string; + /** + * The time in ms when the xcsrf was last set + */ + xcsrfSet?: number; + /** + * Refresh interval in ms for XCSRF token updating + */ + xcsrfRefreshInterval?: number; + /** + * The amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + */ + xcsrfRefreshMaxRetries?: number; +}; +export declare type RESTCreateCookieOptions = { + key: string; + value: string; + domain: string; + hostOnly: boolean; + httpOnly: boolean; +}; +export declare type RESTRequestOptions = { + /** + * The URL to send the request to + */ + url: string; + /** + * The request method to use + */ + method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | string; + /** + * The proxy to use + */ + proxy?: string; + /** + * If the request should follow all redirects + */ + followAllRedirects?: boolean; + /** + * Roblox's "old" verification system with general verification tokens + */ + verification?: string; + /** + * An "overriding" user agent for the request + */ + userAgent?: string; + /** + * Add some custom headers that will override / merge with the "base" headers + */ + headers?: { + [key: string]: unknown; + }; + /** + * The JSON body + */ + json?: unknown[] | { + [key: string]: unknown; + } | string | any; + body?: unknown; + /** + * The form body + */ + form?: { + [key: string]: unknown; + }; + /** + * The form data body + */ + formData?: { + [key: string]: unknown; + }; + /** + * Any query params? + */ + qs?: { + [key: string]: unknown; + }; + /** + * Sets the state of any checks + */ + checks?: RESTResponseOptions["checks"]; + /** + * If you want to use a "custom" xcsrf token + */ + xcsrf?: string | boolean; + /** + * The optional response options + */ + responseOptions?: RESTResponseOptions; + /** + * If it should throw http errors if the statuscode is != 200 + */ + throwHttpErrors?: boolean; + /** + * If it should exclude the cookies from being included in the requests + */ + excludeCookies?: boolean; +}; +export declare type RESTResponseOptions = { + allowedStatusCodes?: number[]; + disallowedStatusCodes?: number[]; + allowedStatusMessages?: string[]; + disallowedStatusMessages?: string[]; + onlyJSON?: boolean; + checks?: { + xcsrf?: boolean; + statusMessage?: boolean; + statusCode?: boolean; + body?: boolean; + captcha?: boolean; + }; +}; +export declare type RESTResponseDataType = { + body: any; + statusMessage: string; + statusCode: number; + headers: Record; +}; +export declare const DefaultRESTResponseOptions: { + allowedStatusCodes: number[]; +}; +export declare const DefaultRESTRequestOptions: { + checks: { + xcsrf: boolean; + statusMessage: boolean; + statusCode: boolean; + body: boolean; + captcha: boolean; + }; + headers: {}; + method: string; + responseOptions: { + allowedStatusCodes: number[]; + }; +}; +export declare const DefaultCreateCookieOptions: { + domain: string; + hostOnly: boolean; + httpOnly: boolean; +}; +export declare const DefaultRESTControllerOptions: { + userAgent: string; + proxy: undefined; + xcsrf: undefined; + xcsrfSet: undefined; + xcsrfRefreshInterval: number; + xcsrfRefreshMaxRetries: number; +}; diff --git a/dist/interfaces/RESTInterfaces.js b/dist/interfaces/RESTInterfaces.js new file mode 100644 index 000000000..077d9defb --- /dev/null +++ b/dist/interfaces/RESTInterfaces.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefaultRESTControllerOptions = exports.DefaultCreateCookieOptions = exports.DefaultRESTRequestOptions = exports.DefaultRESTResponseOptions = void 0; +exports.DefaultRESTResponseOptions = { + allowedStatusCodes: [200] +}; +exports.DefaultRESTRequestOptions = { + checks: { + xcsrf: true, + statusMessage: true, + statusCode: true, + body: true, + captcha: true + }, + headers: {}, + method: "GET", + responseOptions: exports.DefaultRESTResponseOptions +}; +exports.DefaultCreateCookieOptions = { + domain: ".roblox.com", + hostOnly: false, + httpOnly: false +}; +exports.DefaultRESTControllerOptions = { + userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", + proxy: undefined, + xcsrf: undefined, + xcsrfSet: undefined, + xcsrfRefreshInterval: 5 * 60 * 1000, + xcsrfRefreshMaxRetries: 4 +}; diff --git a/dist/old_structures/Asset.d.ts b/dist/old_structures/Asset.d.ts new file mode 100644 index 000000000..dc251898b --- /dev/null +++ b/dist/old_structures/Asset.d.ts @@ -0,0 +1,209 @@ +import { Client } from "../client"; +import { CreatorType } from "../util/constants"; +import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; +import { PartialUser, PartialUserOptions } from "./User"; +import { CatalogProductDetails } from "../client/apis/CatalogAPI"; +import { PartialGroup, PartialGroupOptions } from "./Group"; +export interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; + PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; +} +export interface AssetVersionOptions { + Id: number; + AssetId: number; + VersionNumber: number; + ParentAssetVersionId: number; + CreatorType: unknown; + CreatingUniverseId: number | null; + Created: string; + Updated: string; +} +export declare class AssetVersion { + client: Client; + id: number; + assetId: number; + versionNumber: number; + parentAssetVersionId: number | null; + creatorType: CreatorType; + createdForUniverse: PartialGameUniverse | null; + creator: PartialUser; + created: Date; + updated: Date; + constructor(data: any, client: Client); +} +export interface BundleOptions { + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creator: { + id: number; + name: string; + type: string; + }; + product: CatalogProductDetails; +} +export declare class Bundle { + client: Client; + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creatorType: CreatorType; + creator: PartialUser | PartialGroup; + product: { + id: number; + type: string; + publicDomain: boolean; + forSale: boolean; + price: number; + premiumPricing: { + discount: number; + price: number; + }; + }; + constructor(data: BundleOptions, client: Client); +} +export interface CollectibleAssetOptions { + userAssetId: number; + serialNumber: number | null; + assetId: number; + name: string; + recentAveragePrice: number | null; + originalPrice: number | null; + assetStock: number | null; + buildersClubMembershipType: number; +} +export declare class CollectibleAsset { + client: Client; + assetId: number; + userAssetId: number; + name: string; + recentAveragePrice: number | null; + originalPrice: number | null; + assetStock: number | null; + buildersClubMembershipType: number; + constructor(data: CollectibleAssetOptions, client: Client); +} +export declare type CursorPageOptions = { + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; +}; +declare type CursorPageResponse = { + data: unknown; + previousPageCursor: string | null; + nextPageCursor: string | null; +}; +export declare class CursorPage { + client: Client; + options: CursorPageOptions; + cursors: { + current: string | null; + next: string | null; + previous: string | null; + }; + data: T[]; + method: any; + constructor(client: Client, options: CursorPageOptions, response: CursorPageResponse, method: any); + getNext(newOptions?: CursorPageOptions): Promise>; + getPrevious(newOptions?: CursorPageOptions): Promise>; +} +export interface ProductOptions { + TargetId: number; + ProductType: string; + AssetId: number; + ProductId: number; + Name: string; + Description: string; + AssetTypeId: number; + Creator: { + Id: number; + Name: string; + }; + IconImageAssetId: number; + Created: string; + Updated: string; + PriceInRobux: number; + PriceInTickets: null; + Sales: number; + IsNew: boolean; + IsForSale: boolean; + IsPublicDomain: boolean; + IsLimited: boolean; + IsLimitedUnique: boolean; + Remaining: number | null; + MinimumMembershipLevel: number; +} +export declare class Product { + client: Client; + id: number; + type: string; + assetId: number; + productId: number; + name: string; + description: string; + assetTypeId: number; + creator: PartialUser; + iconImageAssetId: number; + created: Date; + updated: Date; + price: number; + sales: number; + isNew: boolean; + forSale: boolean; + publicDomain: boolean; + limited: boolean; + limitedUnique: boolean; + remaining: number | null; + minimumMembershipLevel: number; + constructor(data: ProductOptions, client: Client); +} +export interface TradeOptions { + id: number; + offers: { + user: { + id: number; + name: string; + displayName: string; + }; + userAssets: CollectibleAssetOptions[]; + robux: number; + }[]; + user: { + id: number; + name: string; + displayName: string; + }; + created: string; + isActive: boolean; + status: "Completed" | string; +} +export declare class Trade { + client: Client; + id: number; + offers: { + user: PartialUser; + assets: CollectibleAsset[]; + robux: number; + }[]; + sender: PartialUser; + created: Date; + active: boolean; + status: string; + constructor(data: TradeOptions, client: Client); +} +export {}; diff --git a/dist/old_structures/Asset.js b/dist/old_structures/Asset.js new file mode 100644 index 000000000..074550237 --- /dev/null +++ b/dist/old_structures/Asset.js @@ -0,0 +1,167 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Trade = exports.Product = exports.CursorPage = exports.CollectibleAsset = exports.Bundle = exports.AssetVersion = void 0; +const constants_1 = require("../util/constants"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); +class AssetVersion { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.Id; + this.assetId = data.AssetId; + this.versionNumber = data.VersionNumber; + this.parentAssetVersionId = data.ParentAssetVersionId; + this.creatorType = data.CreatorType; + this.creator = new structures.PartialUser({ + id: data.CreatorTargetId + }, this.client); + this.createdForUniverse = data.CreatingUniverseId + ? new structures.PartialGameUniverse({ + id: data.CreatingUniverseId + }, client) + : null; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + } +} +exports.AssetVersion = AssetVersion; +class Bundle { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.bundleType = data.bundleType; + this.items = data.items.map((itemData) => ({ + owned: itemData.owned, + id: itemData.id, + name: itemData.name, + type: itemData.type + })); + this.creatorType = + data.creator.type.toLowerCase() === "group" + ? constants_1.CreatorType.GROUP + : constants_1.CreatorType.USER; + this.creator = + this.creatorType === constants_1.CreatorType.USER + ? new structures.PartialUser({ + id: data.creator.id, + name: data.creator.name + }, client) + : new structures.PartialGroup({ + id: data.creator.id, + name: data.creator.name + }, client); + this.product = { + id: data.product.id, + type: data.product.type, + publicDomain: data.product.isPublicDomain, + forSale: data.product.isForSale, + price: data.product.priceInRobux, + premiumPricing: { + discount: data.product.premiumPricing.premiumDiscountPercentage, + price: data.product.premiumPricing.premiumPriceInRobux + } + }; + } +} +exports.Bundle = Bundle; +class CollectibleAsset { + constructor(data, client) { + this.client = client; + this.assetId = data.assetId; + this.userAssetId = data.userAssetId; + this.name = data.name; + this.recentAveragePrice = data.recentAveragePrice; + this.originalPrice = data.originalPrice; + this.assetStock = data.assetStock; + this.buildersClubMembershipType = data.buildersClubMembershipType; + } +} +exports.CollectibleAsset = CollectibleAsset; +class CursorPage { + constructor(client, options, response, method) { + this.client = client; + this.options = options; + this.cursors = { + current: options.cursor || null, + next: response.nextPageCursor || null, + previous: response.previousPageCursor || null + }; + this.data = response.data; + this.method = method; + } + getNext(newOptions) { + if (!this.cursors.next) { + throw new Error("Attempted to iterate to next page, but no cursor was presented for the next page"); + } + const options = Object.assign(Object.assign(Object.assign({}, this.options), { cursor: this.cursors.next }), newOptions); + return this.method(options); + } + getPrevious(newOptions) { + if (!this.cursors.previous) { + throw new Error("Attempted to iterate to previous page, but no cursor was presented for the previous page"); + } + const options = Object.assign(Object.assign(Object.assign({}, this.options), { cursor: this.cursors.previous }), newOptions); + return this.method(options); + } +} +exports.CursorPage = CursorPage; +class Product { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.TargetId; + this.type = data.ProductType; + this.assetId = data.AssetId; + this.productId = data.ProductId; + this.name = data.Name; + this.description = data.Description; + this.assetTypeId = data.AssetTypeId; + this.creator = new structures.PartialUser({ + id: data.Creator.Id, + name: data.Creator.Name + }, client); + this.iconImageAssetId = data.IconImageAssetId; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + this.price = data.PriceInRobux; + this.sales = data.Sales; + this.isNew = data.IsNew; + this.forSale = data.IsForSale; + this.publicDomain = data.IsPublicDomain; + this.limited = data.IsLimited; + this.limitedUnique = data.IsLimitedUnique; + this.remaining = data.Remaining || null; + this.minimumMembershipLevel = data.MinimumMembershipLevel; + } +} +exports.Product = Product; +class Trade { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser({ + id: data.user.id, + name: data.user.name + }, client); + this.created = new Date(data.created); + this.active = data.isActive; + this.status = data.status; + this.offers = data.offers.map((offerData) => ({ + robux: offerData.robux, + user: new structures.PartialUser({ + id: offerData.user.id, + name: offerData.user.name + }, client), + assets: offerData.userAssets.map((assetData) => new CollectibleAsset(assetData, client)) + })); + } +} +exports.Trade = Trade; diff --git a/dist/old_structures/Chat.d.ts b/dist/old_structures/Chat.d.ts new file mode 100644 index 000000000..e6a471dbf --- /dev/null +++ b/dist/old_structures/Chat.d.ts @@ -0,0 +1,118 @@ +import { Client } from "../client"; +import { PartialUser } from "./User"; +import { PartialGameUniverse } from "./Game"; +import { ChatSendGameLinkMessageOptions, ChatSendMessageOptions } from "../client/apis/ChatAPI"; +export interface ChatConversationOptions { + id: number; + title: string; + initiator: { + type: "User" | string; + targetId: number; + name: string | null; + displayName: string | null; + }; + hasUnreadMessages: boolean; + participants: { + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + conversationType: "OneToOneConversation" | string; + conversationTitle: { + titleForViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: string; + conversationUniverse: number | null; +} +export declare class ChatConversation { + client: Client; + id: number; + title: string; + initiator: PartialUser; + hasUnreadMessages: boolean; + members: PartialUser[]; + type: string; + conversationTitle: { + forViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: Date; + universe: PartialGameUniverse | null; + constructor(data: ChatConversationOptions, client: Client); + getMessages(amount?: number, startId?: string): Promise; + addUsers(users: number[]): Promise; + removeUser(userId: number): Promise; + markMessageRead(id: string): Promise; + markRead(): Promise; + rename(name: string): Promise; + getUnreadMessages(amount?: number): Promise; + getLatestMessages(amount?: number): Promise; + resetUniverse(): Promise; + sendGameLinkMessage(options: ChatSendGameLinkMessageOptions): Promise; + sendMessage(options: ChatSendMessageOptions): Promise; +} +export interface PartialChatConversationOptions { + id: number; + title?: string; +} +export declare class PartialChatConversation { + client: Client; + id: number; + title: string | null; + constructor(data: PartialChatConversationOptions, client: Client); +} +export interface ChatMessageOptions { + id: string; + senderType: string; + sent: string; + read: boolean; + messageType: "PlainText" | string; + decorators: string[]; + senderTargetId: number; + content: string; + link?: { + type: "Game"; + game: { + universeId: number; + }; + }; + eventBased?: { + type: "SetConversationUniverse"; + setConversationUniverse: { + actorUserId: number; + universeId: number; + }; + }; +} +export declare class ChatMessage { + client: Client; + id: string; + sender: PartialUser; + sentAt: Date; + type: "PlainText" | string; + decorators: string[]; + content: string; + constructor(data: ChatMessageOptions, client: Client); +} +export interface ChatMessageSentOptions { + content: string; + filteredForReceivers: boolean; + messageId: string; + sent: string; + messageType: "PlainText" | string; + resultType: "Success" | string; + statusMessage: string; +} +export declare class ChatMessageSent { + client: Client; + content: string; + filtered: boolean; + id: string; + sentAt: Date; + type: "PlainText" | string; + result: "Success" | string; + status: string; + constructor(data: ChatMessageSentOptions, client: Client); +} diff --git a/dist/old_structures/Chat.js b/dist/old_structures/Chat.js new file mode 100644 index 000000000..c59b762ce --- /dev/null +++ b/dist/old_structures/Chat.js @@ -0,0 +1,117 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChatMessageSent = exports.ChatMessage = exports.PartialChatConversation = exports.ChatConversation = void 0; +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); +class ChatConversation { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.title = data.title; + this.initiator = new structures.PartialUser({ + id: data.initiator.targetId, + name: data.initiator.name || undefined + }, client); + this.hasUnreadMessages = data.hasUnreadMessages; + this.members = data.participants.map((participantData) => new structures.PartialUser({ + id: participantData.targetId, + name: participantData.name + }, client)); + this.type = data.conversationType; + this.lastUpdated = new Date(data.lastUpdated); + this.universe = data.conversationUniverse + ? new structures.PartialGameUniverse({ + id: data.conversationUniverse + }, client) + : null; + this.conversationTitle = { + forViewer: data.conversationTitle.titleForViewer, + isDefaultTitle: data.conversationTitle.isDefaultTitle + }; + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getMessages(amount = 100, startId) { + return this.client.chat.getConversationMessages(this.id, amount, startId); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + addUsers(users) { + return this.client.chat.addUsersToConversation(this.id, users); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + removeUser(userId) { + return this.client.chat.removeUserFromConversation(this.id, userId); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markMessageRead(id) { + return this.client.chat.markMessageRead(this.id, id); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markRead() { + return this.client.chat.markConversationsRead([this.id]); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + rename(name) { + return this.client.chat.renameGroupConversation(this.id, name); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getUnreadMessages(amount = 100) { + return this.client.chat.getUnreadMessagesInConversations([this.id], amount); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getLatestMessages(amount = 100) { + return this.client.chat.getLatestMessagesInConversations([this.id], amount); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + resetUniverse() { + return this.client.chat.resetConversationUniverse(this.id); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendGameLinkMessage(options) { + return this.client.chat.sendGameLinkMessage(options); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendMessage(options) { + return this.client.chat.sendMessage(options); + } +} +exports.ChatConversation = ChatConversation; +class PartialChatConversation { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.title = data.title || null; + } +} +exports.PartialChatConversation = PartialChatConversation; +class ChatMessage { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser({ + id: data.senderTargetId + }, client); + this.sentAt = new Date(data.sent); + this.type = data.messageType; + this.decorators = data.decorators; + this.content = data.content; + } +} +exports.ChatMessage = ChatMessage; +class ChatMessageSent { + constructor(data, client) { + this.client = client; + this.id = data.messageId; + this.content = data.content; + this.filtered = data.filteredForReceivers; + this.sentAt = new Date(data.sent); + this.result = data.resultType; + this.status = data.statusMessage; + this.type = data.messageType; + } +} +exports.ChatMessageSent = ChatMessageSent; diff --git a/dist/old_structures/ClientUser.d.ts b/dist/old_structures/ClientUser.d.ts new file mode 100644 index 000000000..d9d60c0e9 --- /dev/null +++ b/dist/old_structures/ClientUser.d.ts @@ -0,0 +1,10 @@ +import { Client } from "../client"; +import { PartialUser } from "./User"; +export interface ClientUserOptions { + id: number; + name: string; +} +export declare class ClientUser extends PartialUser { + client: Client; + constructor(data: ClientUserOptions, client: Client); +} diff --git a/dist/old_structures/ClientUser.js b/dist/old_structures/ClientUser.js new file mode 100644 index 000000000..a131115a9 --- /dev/null +++ b/dist/old_structures/ClientUser.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientUser = void 0; +const User_1 = require("./User"); +class ClientUser extends User_1.PartialUser { + constructor(data, client) { + super(data, client); + this.client = client; + } +} +exports.ClientUser = ClientUser; diff --git a/dist/old_structures/Game.d.ts b/dist/old_structures/Game.d.ts new file mode 100644 index 000000000..6bb1c22d7 --- /dev/null +++ b/dist/old_structures/Game.d.ts @@ -0,0 +1,268 @@ +import { Client } from "../client"; +import { CreatorType, GameGenre, MorphAvatarType } from "../util/constants"; +import { PartialGroup } from "./Group"; +import { PartialUser } from "./User"; +import { DevelopGetPlaceStatisticsByTypeOptions } from "../client/apis/DevelopAPI"; +import { GamesGetGameServersByTypeOptions } from "../client/apis/GamesAPI"; +export interface GameBadgeBaseOptions { + id: number; + name?: string; +} +export declare class GameBadgeBase { + client: Client; + id: number; + name: string | null; + constructor(data: GameBadgeBaseOptions, client: Client); +} +export interface GameBadgeOptions { + id: number; + name: string; + description: string; + displayName: string; + displayDescription: string; + enabled: boolean; + iconImageId: number; + displayIconImageId: number; + created: string; + updated: string; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: { + id: number; + name: string; + rootPlaceId: number; + }; +} +export declare class GameBadge { + client: Client; + id: number; + name: string; + description: string; + displayedDescription: string; + displayedName: string; + enabled: boolean; + iconId: number; + displayedIconId: number; + created: Date; + updated: Date; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: PartialGameUniverse; + constructor(data: GameBadgeOptions, client: Client); +} +export declare type PartialGameBadgeOptions = GameBadgeBaseOptions; +export declare class PartialGameBadge extends GameBadgeBase { + constructor(data: PartialGameBadgeOptions, client: Client); +} +export interface GamePassOptions { + id: number; + name: string; + displayName: string; + productId: number; + price: number; +} +export declare class GamePass { + client: Client; + id: number; + name: string; + displayName: string; + productId: number; + price: number; + constructor(data: GamePassOptions, client: Client); +} +export interface BasePlaceOptions { + id: number; + name?: string; +} +export declare class BasePlace { + client: Client; + id: number; + name: string | null; + constructor(options: BasePlaceOptions, client: Client); + getCompatibilities(): Promise; + updatePlaceConfiguration(options: { + name: string; + description: string; + }): Promise; + getStatistics(options: Omit): Promise; + awardBadge(userId: number, badgeId: number): Promise; + getGameServers(options: Omit): Promise; +} +export interface PlaceOptions { + placeId: number; + name: string; + url: string; + description: string; + builder: string; + builderId: number; + isPlayable: boolean; + reasonProhibited: string; + universeId: number; + universeRootPlaceId: number; + price: number; + imageToken: string; +} +export declare class Place extends BasePlace { + description: string; + url: string; + creatorName: string; + creatorId: number; + playable: boolean; + prohibitedReason: string; + prohibited: boolean; + universe: PartialGameUniverse; + price: number; + imageToken: string; + constructor(data: PlaceOptions, client: Client); +} +interface PartialPlaceOptions { + id: number; + name?: string | null; +} +export declare class PartialPlace extends BasePlace { + constructor(data: PartialPlaceOptions, client: Client); +} +export interface PartialGameUniverseOptions { + id: number; + name?: string; + rootPlace?: { + id: number; + name?: string | null; + }; +} +export declare class PartialGameUniverse { + client: Client; + id: number; + name: string | null; + rootPlace: PartialPlace | null; + constructor(data: PartialGameUniverseOptions, client: Client); +} +export interface GameUniverseOptions { + id: number; + rootPlaceId: number; + name: string; + description: string; + creatorType: string; + creator: { + id: number; + name: string; + }; + price: number; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: string; + updated: string; + studioAccessToApisAllowed: boolean; + createVipServersAllowed: boolean; + universeAvatarType: string; + genre: string; +} +export declare class GameUniverse { + client: Client; + id: number; + rootPlace: PartialPlace | null; + name: string; + description: string; + creatorType: CreatorType; + creator: PartialGroup | PartialUser; + price: number | null; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: Date; + updated: Date; + studioAccessToAPIsEnabled: boolean; + createVIPServersEnabled: boolean; + avatarType: MorphAvatarType; + genre: GameGenre; + constructor(data: GameUniverseOptions, client: Client); +} +export interface PartialVIPServerOptions { + id: number; +} +export declare class PartialVIPServer { + client: Client; + id: number; + constructor(data: PartialVIPServerOptions, client: Client); +} +export interface VIPServerOptions { + id: number; + name: string; + game: { + id: number; + name: string; + rootPlace: { + id: number; + name: string; + }; + }; + joinCode: string; + active: boolean; + subscription: { + active: boolean; + expired: boolean; + expirationDate: string; + price: number; + }; + permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: { + id: number; + name: string; + displayName: string; + }[]; + }; +} +export declare class VIPServer { + client: Client; + id: number; + name: string; + game: PartialGameUniverse; + code: string; + active: boolean; + subscription: { + active: boolean; + expired: boolean; + expirationDate: Date; + price: number; + }; + permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: PartialUser[]; + }; + constructor(data: VIPServerOptions, client: Client); +} +export interface GameMediaDataOptions { + assetTypeId: number; + assetType: "Video" | "Image" | string; + imageId: number | null; + videoHash: string | null; + videoTitle: string | null; + approved: boolean; +} +export declare class GameMediaData { + client: Client; + assetTypeId: number; + assetType: "Video" | "Image" | string; + imageId: number | null; + videoHash: string | null; + videoTitle: string | null; + approved: boolean; + constructor(data: GameMediaDataOptions, client: Client); +} +export {}; diff --git a/dist/old_structures/Game.js b/dist/old_structures/Game.js new file mode 100644 index 000000000..c0196e162 --- /dev/null +++ b/dist/old_structures/Game.js @@ -0,0 +1,238 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameMediaData = exports.VIPServer = exports.PartialVIPServer = exports.GameUniverse = exports.PartialGameUniverse = exports.PartialPlace = exports.Place = exports.BasePlace = exports.GamePass = exports.PartialGameBadge = exports.GameBadge = exports.GameBadgeBase = void 0; +const constants_1 = require("../util/constants"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup, + PartialPlace: require("./Game").PartialPlace +}); +class GameBadgeBase { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } +} +exports.GameBadgeBase = GameBadgeBase; +class GameBadge { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.displayedName = data.displayName; + this.displayedDescription = data.displayDescription; + this.enabled = data.enabled; + this.iconId = data.iconImageId; + this.displayedIconId = data.displayIconImageId; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.statistics = { + pastDayAwardedCount: data.statistics.pastDayAwardedCount, + awardedCount: data.statistics.awardedCount, + winRatePercentage: data.statistics.winRatePercentage + }; + this.awardingUniverse = new structures.PartialGameUniverse({ + id: data.awardingUniverse.id, + rootPlace: { + id: data.awardingUniverse.rootPlaceId + }, + name: data.awardingUniverse.name + }, client); + } +} +exports.GameBadge = GameBadge; +class PartialGameBadge extends GameBadgeBase { + // Shut up eslint, it's not useless + // eslint-disable-next-line no-useless-constructor + constructor(data, client) { + super(data, client); + } +} +exports.PartialGameBadge = PartialGameBadge; +class GamePass { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name; + this.displayName = data.displayName; + this.productId = data.productId; + this.price = data.price; + } +} +exports.GamePass = GamePass; +class BasePlace { + constructor(options, client) { + this.client = client; + this.id = options.id; + this.name = options.name || null; + } + getCompatibilities() { + return this.client.apis.developAPI.getPlaceCompatibilities({ + placeId: this.id + }); + } + updatePlaceConfiguration(options) { + return this.client.apis.developAPI.updatePlaceConfiguration(Object.assign({ placeId: this.id }, options)); + } + getStatistics(options) { + return this.client.apis.developAPI.getPlaceStatistics(Object.assign({ placeId: this.id }, options)); + } + awardBadge(userId, badgeId) { + return this.client.apis.generalApi.awardBadge({ + placeId: this.id, + badgeId, + userId + }); + } + getGameServers(options) { + return this.client.apis.gamesAPI.getGameServersByType(Object.assign({ placeId: this.id }, options)); + } +} +exports.BasePlace = BasePlace; +class Place extends BasePlace { + constructor(data, client) { + const structures = retrieveStructures(); + super({ + id: data.placeId, + name: data.name + }, client); + this.description = data.description; + this.url = data.url; + this.creatorName = data.builder; + this.creatorId = data.builderId; + this.playable = data.isPlayable; + this.prohibitedReason = data.reasonProhibited; + this.prohibited = this.prohibitedReason.toLowerCase() !== "none"; + this.universe = new structures.PartialGameUniverse({ + id: data.universeId, + rootPlace: { + id: data.universeRootPlaceId + } + }, client); + this.price = data.price; + this.imageToken = data.imageToken; + } +} +exports.Place = Place; +class PartialPlace extends BasePlace { + constructor(data, client) { + super({ + id: data.id, + name: data.name || undefined + }, client); + } +} +exports.PartialPlace = PartialPlace; +class PartialGameUniverse { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name || null; + this.rootPlace = data.rootPlace + ? new structures.PartialPlace({ + id: data.rootPlace.id, + name: data.rootPlace.name || null + }, client) + : null; + } +} +exports.PartialGameUniverse = PartialGameUniverse; +class GameUniverse { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.rootPlace = data.rootPlaceId + ? new structures.PartialPlace({ + id: data.rootPlaceId + }, client) + : null; + this.name = data.name; + this.description = data.description; + this.creatorType = + data.creatorType.toLowerCase() === "group" + ? constants_1.CreatorType.GROUP + : constants_1.CreatorType.USER; + this.creator = + this.creatorType === constants_1.CreatorType.GROUP + ? new structures.PartialGroup({ + id: data.creator.id, + name: data.creator.name + }, client) + : new structures.PartialUser({ + id: data.creator.id, + name: data.creator.name + }, client); + this.price = data.price; + this.allowedGearGenres = data.allowedGearGenres; + this.allowedGearCategories = data.allowedGearCategories; + this.playing = data.playing; + this.visits = data.visits; + this.maxPlayers = data.maxPlayers; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.studioAccessToAPIsEnabled = data.studioAccessToApisAllowed; + this.createVIPServersEnabled = data.createVipServersAllowed; + this.avatarType = + data.universeAvatarType.toLowerCase() === "morphtor6" + ? constants_1.MorphAvatarType.R6 + : constants_1.MorphAvatarType.R15; + this.genre = data.genre; + } +} +exports.GameUniverse = GameUniverse; +class PartialVIPServer { + constructor(data, client) { + this.client = client; + this.id = data.id; + } +} +exports.PartialVIPServer = PartialVIPServer; +class VIPServer { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.game = new structures.PartialGameUniverse({ + id: data.game.id, + name: data.game.name, + rootPlace: { + id: data.game.rootPlace.id, + name: data.game.rootPlace.name + } + }, client); + this.active = data.active; + this.code = data.joinCode; + this.subscription = { + active: data.subscription.active, + expired: data.subscription.expired, + expirationDate: new Date(data.subscription.expirationDate), + price: data.subscription.price + }; + this.permissions = { + clanAllowed: data.permissions.clanAllowed, + enemyClanId: data.permissions.enemyClanId, + friendsAllowed: data.permissions.friendsAllowed, + users: data.permissions.users.map((userData) => new structures.PartialUser(userData, client)) + }; + } +} +exports.VIPServer = VIPServer; +class GameMediaData { + constructor(data, client) { + this.client = client; + this.assetTypeId = data.assetTypeId; + this.assetType = data.assetType; + this.imageId = data.imageId; + this.videoHash = data.videoHash; + this.videoTitle = data.videoTitle; + this.approved = data.approved; + } +} +exports.GameMediaData = GameMediaData; diff --git a/dist/old_structures/Group.d.ts b/dist/old_structures/Group.d.ts new file mode 100644 index 000000000..9545d2058 --- /dev/null +++ b/dist/old_structures/Group.d.ts @@ -0,0 +1,272 @@ +import { Client } from "../client"; +import { DevelopGetGroupUniversesOptions } from "../client/apis/DevelopAPI"; +import { CursorPage } from "./Asset"; +import { PartialGameUniverse } from "./Game"; +import { EconomyGetGroupRevenueSummaryInTimeFrame, EconomyGetGroupRevenueSummaryInTimeFrameOptions, EconomyGetGroupTransactions, EconomyGetGroupTransactionsOptions } from "../client/apis/EconomyAPI"; +import { GroupsAcceptJoinRequest, GroupsAcceptJoinRequests, GroupsAcceptJoinRequestsOptions, GroupsAcceptRelationshipRequest, GroupsAcceptRelationshipRequests, GroupsAcceptRelationshipRequestsOptions, GroupsChangeOwner, GroupsClaimGroup, GroupsCreateRelationship, GroupsCreateRelationshipOptions, GroupsCreateRole, GroupsCreateRoleOptions, GroupsCreateWallPost, GroupsCreateWallPostOptions, GroupsDeclineJoinRequest, GroupsDeclineJoinRequests, GroupsDeclineRelationshipRequest, GroupsDeclineRelationshipRequests, GroupsDeclineRelationshipRequestsOptions, GroupsDeleteRelationship, GroupsDeleteRelationshipOptions, GroupsDeleteRole, GroupsDeleteSocialLink, GroupsDeleteWallPost, GroupsGetAllRolesPermissions, GroupsGetGroupPayouts, GroupsGetGroupRelationships, GroupsGetGroupRelationshipsOptions, GroupsGetGroupSettings, GroupsGetGuestPermissions, GroupsGetJoinRequest, GroupsGetJoinRequestsOptions, GroupsGetMembersOptions, GroupsGetMembersWithRoleOptions, GroupsGetRelationshipRequests, GroupsGetRelationshipRequestsOptions, GroupsGetRolePermissions, GroupsGetSelfGroupMembership, GroupsGetSocialLinks, GroupsGetWallPostsOptions, GroupsJoinGroup, GroupsJoinGroupOptions, GroupsKickMember, GroupsPayoutMembers, GroupsPayoutMembersOptions, GroupsPostSocialLink, GroupsPostSocialLinkOptions, GroupsRemovePrimaryGroup, GroupsSetPrimaryGroup, GroupsUpdateGroupDescription, GroupsUpdateGroupIcon, GroupsUpdateGroupSettings, GroupsUpdateGroupSettingsOptions, GroupsUpdateGroupStatus, GroupsUpdateMember, GroupsUpdateRecurringPayouts, GroupsUpdateRecurringPayoutsOptions, GroupsUpdateRole, GroupsUpdateRoleOptions, GroupsUpdateRolePermissions, GroupsUpdateRolePermissionsOptions, GroupsUpdateSocialLink, GroupsUpdateSocialLinkOptions } from "../client/apis/GroupsAPI"; +import { PartialUser, PartialUserOptions, UserBase } from "./User"; +declare type GroupRelationships = Omit & { + groupId: number; + relationshipType: T; + totalGroupCount: number; + groups: Group[]; + nextRowIndex: number; +}; +export interface GroupBaseOptions { + id: number; + name?: string; +} +export declare class GroupBase { + client: Client; + id: number; + name: string | null; + constructor(data: GroupBaseOptions, client: Client); + getUniverses(options?: Omit): Promise>; + /** + * Returns whether the authenticated user can manage the group or not + * @returns {Promise} + */ + canSelfManage(): Promise; + /** + * Gets the currently available funds in the group + * @returns {Promise} + */ + getFunds(): Promise; + getRevenueSummaryInTimeFrame(timeFrame: EconomyGetGroupRevenueSummaryInTimeFrameOptions["timeFrame"]): Promise; + getTransactions(options: Omit): Promise; + getAllies(maxItems?: number, startItem?: number): Promise>; + getEnemies(maxItems?: number, startItem?: number): Promise>; + getGroup(): Promise; + getMember(userId: number): Promise; + getIsMember(userId: number): Promise; + getSettings(): Promise; + updateSettings(options: Omit): Promise; + updateDescription(description: string): Promise; + updateShout(shout: string): Promise; + updateIcon(file: unknown): Promise; + declineJoinRequests(userIds: number[]): Promise; + getJoinRequests(options: Omit): Promise>; + acceptJoinRequests(options: Omit): Promise; + declineJoinRequest(userId: number): Promise; + getJoinRequest(userId: number): Promise; + acceptJoinRequest(userId: number): Promise; + getSelfMembership(): Promise; + getRoles(): Promise; + getMembersWithRole(options: Omit): Promise>; + getMembers(options: Omit): Promise>; + join(options: Omit): Promise; + getIsPendingJoin(): Promise; + changeOwner(userId: number): Promise; + claim(): Promise; + kickMember(userId: number): Promise; + updateMember(userId: number, roleId: number): Promise; + getPayouts(): Promise; + payoutMembers(options: Omit): Promise; + updateRecurringPayouts(options: Omit): Promise; + getRelationships(options: Omit): Promise; + declineRelationshipRequests(options: Omit): Promise; + getRelationshipRequests(options: Omit): Promise; + acceptRelationshipRequests(options: Omit): Promise; + deleteRelationship(options: Omit): Promise; + createRelationship(options: Omit): Promise; + acceptRelationshipRequest(type: "enemies" | "allies", withGroup: number): Promise; + declineRelationshipRequest(type: "enemies" | "allies", withGroup: number): Promise; + getRolePermissions(roleId: number): Promise; + updateRolePermissions(roleId: number, permissions: Omit): Promise; + getGuestPermissions(): Promise; + getAllRolesPermissions(): Promise; + getSocialLinks(): Promise; + createSocialLink(options: Omit): Promise; + deleteSocialLink(id: number): Promise; + updateSocialLink(options: Omit): Promise; + getWallPosts(options: Omit): Promise>; + createWallPost(options: Omit): Promise; + deleteWallPost(id: number): Promise; + getIsUserPrimaryGroup(userId: number): Promise; + removeAsPrimary(): Promise; + setAsPrimary(): Promise; + createRole(options: Omit): Promise; + deleteRole(roleId: number): Promise; + updateRole(roleId: number, options: Omit): Promise; +} +export interface PartialGroupOptions { + id: number; + name?: string; +} +export declare class PartialGroup extends GroupBase { + constructor(data: PartialGroupOptions, client: Client); +} +export interface GroupMemberOptions { + group: PartialGroupOptions; + name?: string | null; + /** + * The user id + */ + id: number; + role?: { + id: number; + name: string; + rank: number; + }; +} +export declare class GroupMember extends UserBase { + group: PartialGroup; + role: GroupRole | null; + constructor(data: GroupMemberOptions, client: Client); +} +export interface GroupOptions { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + } | null; + shout: { + body: string; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + } | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +} +export declare class Group extends GroupBase { + description: string; + name: string; + owner: GroupMember | null; + shout: GroupShout | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; + constructor(data: GroupOptions, client: Client); +} +export interface GroupJoinRequestOptions { + id?: number; + user: PartialUserOptions; + group: PartialGroupOptions; + created: string; +} +export declare class GroupJoinRequest { + client: Client; + id: number | null; + user: PartialUser; + group: PartialGroup; + created: Date; + constructor(data: GroupJoinRequestOptions, client: Client); +} +export interface GroupRoleOptions { + id?: number; + name?: string; + rank?: number; + group: { + id: number; + name?: string; + }; +} +export declare class GroupRole { + client: Client; + id: number | null; + name: string | null; + rank: number | null; + group: PartialGroup; + constructor(data: GroupRoleOptions, client: Client); +} +export interface GroupRolePermissionsOptions { + groupId: number; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + permissions: { + groupPostsPermissions: { + viewWall: boolean; + postToWall: boolean; + deleteFromWall: boolean; + viewStatus: boolean; + postToStatus: boolean; + }; + groupMembershipPermissions: { + changeRank: boolean; + inviteMembers: boolean; + removeMembers: boolean; + }; + groupManagementPermissions: { + manageRelationships: boolean; + manageClan: boolean; + viewAuditLogs: boolean; + }; + groupEconomyPermissions: { + spendGroupFunds: boolean; + advertiseGroup: boolean; + createItems: boolean; + manageItems: boolean; + addGroupPlaces: boolean; + manageGroupGames: boolean; + viewGroupPayouts: boolean; + }; + }; +} +export declare class GroupRolePermissions { + client: Client; + group: PartialGroup; + role: GroupRole; + permissions: GroupRolePermissionsOptions["permissions"]; + constructor(data: GroupRolePermissionsOptions, client: Client); +} +export interface GroupShoutOptions { + content: string; + creator: { + id: number; + username: string; + }; + group: { + id: number; + name?: string; + }; +} +export declare class GroupShout { + client: Client; + content: string; + creator: PartialUser; + group: PartialGroup; + constructor(data: GroupShoutOptions, client: Client); +} +export interface GroupWallPostOptions { + id: number; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + group: { + id: number; + name?: string; + }; + body: string; + created: string; + updated: string; +} +export declare class GroupWallPost { + client: Client; + id: number; + creator: GroupMember; + content: string; + created: Date; + constructor(data: GroupWallPostOptions, client: Client); +} +export {}; diff --git a/dist/old_structures/Group.js b/dist/old_structures/Group.js new file mode 100644 index 000000000..8e61a3e13 --- /dev/null +++ b/dist/old_structures/Group.js @@ -0,0 +1,495 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GroupWallPost = exports.GroupShout = exports.GroupRolePermissions = exports.GroupRole = exports.GroupJoinRequest = exports.Group = exports.GroupMember = exports.PartialGroup = exports.GroupBase = void 0; +const User_1 = require("./User"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse +}); +class GroupBase { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } + getUniverses(options) { + return this.client.apis.developAPI + .getGroupUniverses(Object.assign(Object.assign({}, options), { groupId: this.id })) + .then((response) => { + const CursorPageClass = require("./Asset").CursorPage; + const structures = retrieveStructures(); + return new CursorPageClass(this.client, options || {}, Object.assign(Object.assign({}, response), { data: response.data.map((universeData) => new structures.PartialGameUniverse({ + id: universeData.id, + name: universeData.name, + rootPlace: universeData.rootPlaceId + ? { + id: universeData.rootPlaceId + } + : undefined + }, this.client)) }), this.getUniverses); + }); + } + /** + * Returns whether the authenticated user can manage the group or not + * @returns {Promise} + */ + canSelfManage() { + return this.client.apis.developAPI + .getSelfManageableGroups() + .then((response) => !!response.data.find((data) => data.id === this.id)); + } + /** + * Gets the currently available funds in the group + * @returns {Promise} + */ + getFunds() { + return this.client.apis.economyAPI + .getGroupCurrency({ + groupId: this.id + }) + .then((response) => response.robux); + } + getRevenueSummaryInTimeFrame(timeFrame) { + return this.client.apis.economyAPI.getGroupRevenueByTime({ + groupId: this.id, + timeFrame + }); + } + getTransactions(options) { + return this.client.apis.economyAPI.getGroupTransactions(Object.assign({ groupId: this.id }, options)); + } + getAllies(maxItems = 100, startItem) { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "allies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => (Object.assign(Object.assign({}, response), { relationshipType: "allies", groups: response.relatedGroups.map((groupData) => new Group(groupData, this.client)) }))); + } + getEnemies(maxItems = 100, startItem) { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "enemies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => (Object.assign(Object.assign({}, response), { relationshipType: "enemies", groups: response.relatedGroups.map((groupData) => new Group(groupData, this.client)) }))); + } + getGroup() { + return this.client.getGroup(this.id); + } + getMember(userId) { + return this.client.apis.groupsAPI + .getUserGroups({ + userId + }) + .then((response) => { + const foundGroup = response.data.find((groupData) => groupData.group.id === this.id); + if (foundGroup) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + return new GroupMember({ + id: userId, + role: foundGroup.role, + group: foundGroup.group + }, this.client); + } + else { + return null; + } + }); + } + getIsMember(userId) { + console.warn(`group.getIsMember() is deprecated and may be removed in the future. Please switch to group.getMember`); + return this.getMember(userId); + } + getSettings() { + return this.client.apis.groupsAPI.getGroupSettings({ + groupId: this.id + }); + } + updateSettings(options) { + return this.client.apis.groupsAPI.updateGroupSettings(Object.assign({ groupId: this.id }, options)); + } + updateDescription(description) { + return this.client.apis.groupsAPI.updateGroupDescription({ + description, + groupId: this.id + }); + } + updateShout(shout) { + return this.client.apis.groupsAPI.updateGroupStatus({ + groupId: this.id, + message: shout + }); + } + updateIcon(file) { + return this.client.apis.groupsAPI.updateGroupIcon({ + files: file, + groupId: this.id + }); + } + declineJoinRequests(userIds) { + return this.client.apis.groupsAPI.declineJoinRequests({ + groupId: this.id, + userIds + }); + } + getJoinRequests(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getJoinRequests(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getJoinRequests)); + } + acceptJoinRequests(options) { + return this.client.apis.groupsAPI.acceptJoinRequests(Object.assign({ groupId: this.id }, options)); + } + declineJoinRequest(userId) { + return this.client.apis.groupsAPI.declineJoinRequest({ + groupId: this.id, + userId + }); + } + getJoinRequest(userId) { + return this.client.apis.groupsAPI.getJoinRequest({ + groupId: this.id, + userId + }); + } + acceptJoinRequest(userId) { + return this.client.apis.groupsAPI.acceptJoinRequest({ + groupId: this.id, + userId + }); + } + getSelfMembership() { + return this.client.apis.groupsAPI.getSelfGroupMembership({ + groupId: this.id + }); + } + getRoles() { + return this.client.apis.groupsAPI + .getGroupRoles({ + groupId: this.id + }) + .then((response) => response.roles.map((roleData) => new GroupRole(Object.assign({ group: { + id: this.id, + name: this.name || undefined + } }, roleData), this.client))); + } + getMembersWithRole(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getMembersWithRole(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getMembersWithRole)); + } + getMembers(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getMembers(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getMembers)); + } + join(options) { + return this.client.apis.groupsAPI.joinGroup(Object.assign(Object.assign({ groupId: this.id }, options), { captchaProvider: options.captchaProvider || "PROVIDER_ARKOSELABS" })); + } + getIsPendingJoin() { + return this.client.apis.groupsAPI + .getSelfPendingGroupJoins() + .then((response) => (response.data.find((groupData) => groupData.id === this.id) && + true) || + false); + } + changeOwner(userId) { + return this.client.apis.groupsAPI.changeGroupOwner({ + groupId: this.id, + userId + }); + } + claim() { + return this.client.apis.groupsAPI.claimGroup({ + groupId: this.id + }); + } + kickMember(userId) { + return this.client.apis.groupsAPI.kickMember({ + groupId: this.id, + userId + }); + } + updateMember(userId, roleId) { + return this.client.apis.groupsAPI.updateMember({ + groupId: this.id, + roleId, + userId + }); + } + getPayouts() { + return this.client.apis.groupsAPI.getGroupPayouts({ + groupId: this.id + }); + } + payoutMembers(options) { + return this.client.apis.groupsAPI.payoutMembers(Object.assign({ groupId: this.id }, options)); + } + updateRecurringPayouts(options) { + return this.client.apis.groupsAPI.updateRecurringPayouts(Object.assign({ groupId: this.id }, options)); + } + getRelationships(options) { + return this.client.apis.groupsAPI.getGroupRelationships(Object.assign({ groupId: this.id }, options)); + } + declineRelationshipRequests(options) { + return this.client.apis.groupsAPI.declineRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + getRelationshipRequests(options) { + return this.client.apis.groupsAPI.getRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + acceptRelationshipRequests(options) { + return this.client.apis.groupsAPI.acceptRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + deleteRelationship(options) { + return this.client.apis.groupsAPI.deleteRelationship(Object.assign({ groupId: this.id }, options)); + } + createRelationship(options) { + return this.client.apis.groupsAPI.createRelationship(Object.assign({ groupId: this.id }, options)); + } + acceptRelationshipRequest(type, withGroup) { + return this.client.apis.groupsAPI.acceptRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + declineRelationshipRequest(type, withGroup) { + return this.client.apis.groupsAPI.declineRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + getRolePermissions(roleId) { + return this.client.apis.groupsAPI.getRolePermissions({ + groupId: this.id, + roleId + }); + } + updateRolePermissions(roleId, permissions) { + return this.client.apis.groupsAPI.updateRolePermissions(Object.assign({ groupId: this.id, roleId }, permissions)); + } + getGuestPermissions() { + return this.client.apis.groupsAPI.getGuestPermissions({ + groupId: this.id + }); + } + getAllRolesPermissions() { + return this.client.apis.groupsAPI.getAllRolesPermissions({ + groupId: this.id + }); + } + getSocialLinks() { + return this.client.apis.groupsAPI.getSocialLinks({ + groupId: this.id + }); + } + createSocialLink(options) { + return this.client.apis.groupsAPI.createSocialLink(Object.assign({ groupId: this.id }, options)); + } + deleteSocialLink(id) { + return this.client.apis.groupsAPI.deleteSocialLink({ + groupId: this.id, + id + }); + } + updateSocialLink(options) { + return this.client.apis.groupsAPI.updateSocialLink(Object.assign({ groupId: this.id }, options)); + } + getWallPosts(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getWallPosts(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getWallPosts)); + } + createWallPost(options) { + return this.client.apis.groupsAPI.createWallPost(Object.assign({ groupId: this.id }, options)); + } + deleteWallPost(id) { + return this.client.apis.groupsAPI.deleteWallPost({ + groupId: this.id, + id + }); + } + getIsUserPrimaryGroup(userId) { + return (this.client.apis.groupsAPI + .getUserPrimaryGroup({ + userId + }) + // eslint-disable-next-line @typescript-eslint/no-use-before-define + .then((response) => response && response.group && response.role + ? new GroupMember({ + group: response.group, + role: { + id: response.role.id, + name: response.role.name, + rank: response.role.rank + }, + id: userId + }, this.client) + : null)); + } + removeAsPrimary() { + return this.client.apis.groupsAPI.removePrimaryGroup(); + } + setAsPrimary() { + return this.client.apis.groupsAPI.setPrimaryGroup({ + groupId: this.id + }); + } + createRole(options) { + return this.client.apis.groupsAPI.createRole(Object.assign({ groupId: this.id }, options)); + } + deleteRole(roleId) { + return this.client.apis.groupsAPI.deleteRole({ + groupId: this.id, + roleId + }); + } + updateRole(roleId, options) { + return this.client.apis.groupsAPI.updateRole(Object.assign({ groupId: this.id, roleId }, options)); + } +} +exports.GroupBase = GroupBase; +class PartialGroup extends GroupBase { + // Shut up eslint, this is not useless either + // eslint-disable-next-line no-useless-constructor + constructor(data, client) { + super(data, client); + } +} +exports.PartialGroup = PartialGroup; +class GroupMember extends User_1.UserBase { + constructor(data, client) { + super({ + name: data.name, + id: data.id + }, client); + this.group = new PartialGroup(data.group, client); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.role = data.role + ? new GroupRole({ + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + name: this.name || undefined, + id: this.id + } + }, client) + : null; + } +} +exports.GroupMember = GroupMember; +class Group extends GroupBase { + constructor(data, client) { + super(data, client); + this.description = data.description; + this.name = data.name; + this.owner = data.owner + ? new GroupMember({ + id: data.owner.userId, + name: data.owner.username, + group: this + }, client) + : null; + this.shout = data.shout + ? new GroupShout({ + content: data.shout.body, + creator: { + id: data.shout.poster.userId, + username: data.shout.poster.username + }, + group: { + id: this.id, + name: this.name || undefined + } + }, client) + : null; + this.memberCount = data.memberCount; + this.isBuildersClubOnly = data.isBuildersClubOnly; + this.publicEntryAllowed = data.publicEntryAllowed; + this.isLocked = data.isLocked; + } +} +exports.Group = Group; +class GroupJoinRequest { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id || null; + this.user = new structures.PartialUser(data.user, client); + this.group = new PartialGroup(data.group, client); + this.created = new Date(data.created); + } +} +exports.GroupJoinRequest = GroupJoinRequest; +class GroupRole { + constructor(data, client) { + this.client = client; + this.id = data.id || null; + this.name = data.name || null; + this.rank = data.rank || null; + this.group = new PartialGroup({ + id: data.group.id, + name: data.group.name + }, client); + } +} +exports.GroupRole = GroupRole; +class GroupRolePermissions { + constructor(data, client) { + this.client = client; + this.group = new PartialGroup({ + id: data.groupId + }, client); + this.role = new GroupRole({ + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + id: this.group.id + } + }, client); + this.permissions = data.permissions; + } +} +exports.GroupRolePermissions = GroupRolePermissions; +class GroupShout { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.content = data.content; + this.creator = new structures.PartialUser(data.creator, client); + this.group = new PartialGroup({ + id: data.group.id, + name: data.group.name + }, client); + } +} +exports.GroupShout = GroupShout; +class GroupWallPost { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.content = data.body; + this.creator = new GroupMember({ + group: { + id: data.group.id, + name: data.group.name + }, + id: data.poster.userId, + name: data.poster.username + }, client); + this.created = new Date(data.created); + } +} +exports.GroupWallPost = GroupWallPost; diff --git a/dist/old_structures/User.d.ts b/dist/old_structures/User.d.ts new file mode 100644 index 000000000..3711a8f81 --- /dev/null +++ b/dist/old_structures/User.d.ts @@ -0,0 +1,118 @@ +import { Client } from "../client"; +import { EnumUserPresence } from "../interfaces/GeneralInterfaces"; +export interface UserBaseOptions { + id: number; + name?: string | null; + displayName?: string; + membership?: boolean; +} +export declare class UserBase { + client: Client; + id: number; + name: string | null; + displayName: string | null; + membership: unknown; + constructor(data: UserBaseOptions, client: Client); +} +export interface FriendRequestOptions { + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; +} +export declare class FriendRequest { + client: Client; + user: PartialUser; + isBanned: boolean; + created: Date; + description: string; + constructor(data: FriendRequestOptions, client: Client); +} +export interface PartialUserOptions { + id: number; + name?: string; + displayName?: string; +} +export declare class PartialUser extends UserBase { + constructor(data: PartialUserOptions, client: Client); +} +export interface UserOptions { + id: number; + name: string; + displayName: string; + friendsCount: number; + presenceType: EnumUserPresence; + lastLocation: string | null; + userStatus: string | null; + userStatusDate: string | null; + userPlaceId: number | null; + followersCount: number; + followingsCount: number; + isVieweeBlocked: boolean; + isViewerBlocked: boolean; + areFriends: boolean; + canFollow: boolean; + canMessage: boolean; + canFriend: boolean; + canTrade: boolean; + incomingFriendRequest: boolean; + sentFriendRequest: boolean; + canSeeFavorites: boolean; + messagesDisabled: boolean; + canSeeInventory: boolean; + headShotImage: { + final: boolean; + url: string; + retryUrl: string | null; + userId: number; + endpointType: "Avatar" | string; + }; + previousUsernames: string; +} +export declare class User extends PartialUser { + friendsCount: number; + presenceType: EnumUserPresence; + lastLocation: string | null; + status: string | null; + statusDate: Date | null; + placeId: number | null; + followersCount: number; + followingCount: number; + /** + * If the authenticated user has blocked the user + */ + isBlocked: boolean; + /** + * If the user has blocked the authenticated user + */ + hasBlocked: boolean; + /** + * If the authenticated user and the target user are friends + */ + areFriends: boolean; + canFollow: boolean; + canMessage: boolean; + canFriend: boolean; + /** + * If the authenticated user has sent a friend request to this user + */ + sentFriendRequest: boolean; + /** + * If the target user has sent a friend request to the authenticated user + */ + incomingFriendRequest: boolean; + messagesDisabled: boolean; + canSeeFavorites: boolean; + canTrade: boolean; + canSeeInventory: boolean; + previousNames: string[]; + headshotImage: { + final: boolean; + url: string | null; + retryUrl: string | null; + userId: number; + endpointType: "Avatar" | string; + }; + constructor(data: UserOptions, client: Client); +} diff --git a/dist/old_structures/User.js b/dist/old_structures/User.js new file mode 100644 index 000000000..297c18608 --- /dev/null +++ b/dist/old_structures/User.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.User = exports.PartialUser = exports.FriendRequest = exports.UserBase = void 0; +class UserBase { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + this.displayName = data.displayName || null; + this.membership = data.membership || null; + } +} +exports.UserBase = UserBase; +class FriendRequest { + constructor(data, client) { + this.client = client; + this.user = new PartialUser({ + id: data.id, + name: data.name + }, client); + this.created = new Date(data.created); + this.description = data.description; + this.isBanned = data.isBanned; + } +} +exports.FriendRequest = FriendRequest; +class PartialUser extends UserBase { + // Eslint, I'm getting tired of you complaining about useless constructors. + // You are useless + // eslint-disable-next-line no-useless-constructor + constructor(data, client) { + super(data, client); + } +} +exports.PartialUser = PartialUser; +class User extends PartialUser { + constructor(data, client) { + super(data, client); + this.friendsCount = data.friendsCount; + this.presenceType = data.presenceType; + this.lastLocation = data.lastLocation || null; + this.status = data.userStatus || null; + const matchedStatusTimestamp = data.userStatusDate + ? data.userStatusDate.match(/\((.*)\)/) + : null; + this.statusDate = matchedStatusTimestamp + ? new Date(parseInt(matchedStatusTimestamp[1])) + : null; + this.placeId = data.userPlaceId; + this.followersCount = data.followersCount; + this.followingCount = data.followingsCount; + this.isBlocked = data.isVieweeBlocked; + this.hasBlocked = data.isViewerBlocked; + this.areFriends = data.areFriends; + this.canFollow = data.canFollow; + this.canMessage = data.canMessage; + this.canFriend = data.canFriend; + this.sentFriendRequest = data.sentFriendRequest; + this.incomingFriendRequest = data.incomingFriendRequest; + this.messagesDisabled = data.messagesDisabled; + this.canSeeFavorites = data.canSeeFavorites; + this.canTrade = data.canTrade; + this.canSeeInventory = data.canSeeInventory; + this.previousNames = data.previousUsernames.split("\r\n"); + this.headshotImage = { + final: data.headShotImage.final, + url: data.headShotImage.url, + retryUrl: data.headShotImage.retryUrl, + userId: data.headShotImage.userId, + endpointType: data.headShotImage.endpointType + }; + } +} +exports.User = User; diff --git a/src/structures/index.ts b/dist/old_structures/index.d.ts similarity index 100% rename from src/structures/index.ts rename to dist/old_structures/index.d.ts diff --git a/dist/old_structures/index.js b/dist/old_structures/index.js new file mode 100644 index 000000000..693bf3bad --- /dev/null +++ b/dist/old_structures/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +(0, tslib_1.__exportStar)(require("./Asset"), exports); +(0, tslib_1.__exportStar)(require("./Chat"), exports); +(0, tslib_1.__exportStar)(require("./ClientUser"), exports); +(0, tslib_1.__exportStar)(require("./Game"), exports); +(0, tslib_1.__exportStar)(require("./Group"), exports); +(0, tslib_1.__exportStar)(require("./User"), exports); diff --git a/dist/structures/Asset.d.ts b/dist/structures/Asset.d.ts new file mode 100644 index 000000000..dc251898b --- /dev/null +++ b/dist/structures/Asset.d.ts @@ -0,0 +1,209 @@ +import { Client } from "../client"; +import { CreatorType } from "../util/constants"; +import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; +import { PartialUser, PartialUserOptions } from "./User"; +import { CatalogProductDetails } from "../client/apis/CatalogAPI"; +import { PartialGroup, PartialGroupOptions } from "./Group"; +export interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; + PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; +} +export interface AssetVersionOptions { + Id: number; + AssetId: number; + VersionNumber: number; + ParentAssetVersionId: number; + CreatorType: unknown; + CreatingUniverseId: number | null; + Created: string; + Updated: string; +} +export declare class AssetVersion { + client: Client; + id: number; + assetId: number; + versionNumber: number; + parentAssetVersionId: number | null; + creatorType: CreatorType; + createdForUniverse: PartialGameUniverse | null; + creator: PartialUser; + created: Date; + updated: Date; + constructor(data: any, client: Client); +} +export interface BundleOptions { + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creator: { + id: number; + name: string; + type: string; + }; + product: CatalogProductDetails; +} +export declare class Bundle { + client: Client; + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creatorType: CreatorType; + creator: PartialUser | PartialGroup; + product: { + id: number; + type: string; + publicDomain: boolean; + forSale: boolean; + price: number; + premiumPricing: { + discount: number; + price: number; + }; + }; + constructor(data: BundleOptions, client: Client); +} +export interface CollectibleAssetOptions { + userAssetId: number; + serialNumber: number | null; + assetId: number; + name: string; + recentAveragePrice: number | null; + originalPrice: number | null; + assetStock: number | null; + buildersClubMembershipType: number; +} +export declare class CollectibleAsset { + client: Client; + assetId: number; + userAssetId: number; + name: string; + recentAveragePrice: number | null; + originalPrice: number | null; + assetStock: number | null; + buildersClubMembershipType: number; + constructor(data: CollectibleAssetOptions, client: Client); +} +export declare type CursorPageOptions = { + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; +}; +declare type CursorPageResponse = { + data: unknown; + previousPageCursor: string | null; + nextPageCursor: string | null; +}; +export declare class CursorPage { + client: Client; + options: CursorPageOptions; + cursors: { + current: string | null; + next: string | null; + previous: string | null; + }; + data: T[]; + method: any; + constructor(client: Client, options: CursorPageOptions, response: CursorPageResponse, method: any); + getNext(newOptions?: CursorPageOptions): Promise>; + getPrevious(newOptions?: CursorPageOptions): Promise>; +} +export interface ProductOptions { + TargetId: number; + ProductType: string; + AssetId: number; + ProductId: number; + Name: string; + Description: string; + AssetTypeId: number; + Creator: { + Id: number; + Name: string; + }; + IconImageAssetId: number; + Created: string; + Updated: string; + PriceInRobux: number; + PriceInTickets: null; + Sales: number; + IsNew: boolean; + IsForSale: boolean; + IsPublicDomain: boolean; + IsLimited: boolean; + IsLimitedUnique: boolean; + Remaining: number | null; + MinimumMembershipLevel: number; +} +export declare class Product { + client: Client; + id: number; + type: string; + assetId: number; + productId: number; + name: string; + description: string; + assetTypeId: number; + creator: PartialUser; + iconImageAssetId: number; + created: Date; + updated: Date; + price: number; + sales: number; + isNew: boolean; + forSale: boolean; + publicDomain: boolean; + limited: boolean; + limitedUnique: boolean; + remaining: number | null; + minimumMembershipLevel: number; + constructor(data: ProductOptions, client: Client); +} +export interface TradeOptions { + id: number; + offers: { + user: { + id: number; + name: string; + displayName: string; + }; + userAssets: CollectibleAssetOptions[]; + robux: number; + }[]; + user: { + id: number; + name: string; + displayName: string; + }; + created: string; + isActive: boolean; + status: "Completed" | string; +} +export declare class Trade { + client: Client; + id: number; + offers: { + user: PartialUser; + assets: CollectibleAsset[]; + robux: number; + }[]; + sender: PartialUser; + created: Date; + active: boolean; + status: string; + constructor(data: TradeOptions, client: Client); +} +export {}; diff --git a/dist/structures/Asset.js b/dist/structures/Asset.js new file mode 100644 index 000000000..074550237 --- /dev/null +++ b/dist/structures/Asset.js @@ -0,0 +1,167 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Trade = exports.Product = exports.CursorPage = exports.CollectibleAsset = exports.Bundle = exports.AssetVersion = void 0; +const constants_1 = require("../util/constants"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); +class AssetVersion { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.Id; + this.assetId = data.AssetId; + this.versionNumber = data.VersionNumber; + this.parentAssetVersionId = data.ParentAssetVersionId; + this.creatorType = data.CreatorType; + this.creator = new structures.PartialUser({ + id: data.CreatorTargetId + }, this.client); + this.createdForUniverse = data.CreatingUniverseId + ? new structures.PartialGameUniverse({ + id: data.CreatingUniverseId + }, client) + : null; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + } +} +exports.AssetVersion = AssetVersion; +class Bundle { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.bundleType = data.bundleType; + this.items = data.items.map((itemData) => ({ + owned: itemData.owned, + id: itemData.id, + name: itemData.name, + type: itemData.type + })); + this.creatorType = + data.creator.type.toLowerCase() === "group" + ? constants_1.CreatorType.GROUP + : constants_1.CreatorType.USER; + this.creator = + this.creatorType === constants_1.CreatorType.USER + ? new structures.PartialUser({ + id: data.creator.id, + name: data.creator.name + }, client) + : new structures.PartialGroup({ + id: data.creator.id, + name: data.creator.name + }, client); + this.product = { + id: data.product.id, + type: data.product.type, + publicDomain: data.product.isPublicDomain, + forSale: data.product.isForSale, + price: data.product.priceInRobux, + premiumPricing: { + discount: data.product.premiumPricing.premiumDiscountPercentage, + price: data.product.premiumPricing.premiumPriceInRobux + } + }; + } +} +exports.Bundle = Bundle; +class CollectibleAsset { + constructor(data, client) { + this.client = client; + this.assetId = data.assetId; + this.userAssetId = data.userAssetId; + this.name = data.name; + this.recentAveragePrice = data.recentAveragePrice; + this.originalPrice = data.originalPrice; + this.assetStock = data.assetStock; + this.buildersClubMembershipType = data.buildersClubMembershipType; + } +} +exports.CollectibleAsset = CollectibleAsset; +class CursorPage { + constructor(client, options, response, method) { + this.client = client; + this.options = options; + this.cursors = { + current: options.cursor || null, + next: response.nextPageCursor || null, + previous: response.previousPageCursor || null + }; + this.data = response.data; + this.method = method; + } + getNext(newOptions) { + if (!this.cursors.next) { + throw new Error("Attempted to iterate to next page, but no cursor was presented for the next page"); + } + const options = Object.assign(Object.assign(Object.assign({}, this.options), { cursor: this.cursors.next }), newOptions); + return this.method(options); + } + getPrevious(newOptions) { + if (!this.cursors.previous) { + throw new Error("Attempted to iterate to previous page, but no cursor was presented for the previous page"); + } + const options = Object.assign(Object.assign(Object.assign({}, this.options), { cursor: this.cursors.previous }), newOptions); + return this.method(options); + } +} +exports.CursorPage = CursorPage; +class Product { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.TargetId; + this.type = data.ProductType; + this.assetId = data.AssetId; + this.productId = data.ProductId; + this.name = data.Name; + this.description = data.Description; + this.assetTypeId = data.AssetTypeId; + this.creator = new structures.PartialUser({ + id: data.Creator.Id, + name: data.Creator.Name + }, client); + this.iconImageAssetId = data.IconImageAssetId; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + this.price = data.PriceInRobux; + this.sales = data.Sales; + this.isNew = data.IsNew; + this.forSale = data.IsForSale; + this.publicDomain = data.IsPublicDomain; + this.limited = data.IsLimited; + this.limitedUnique = data.IsLimitedUnique; + this.remaining = data.Remaining || null; + this.minimumMembershipLevel = data.MinimumMembershipLevel; + } +} +exports.Product = Product; +class Trade { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser({ + id: data.user.id, + name: data.user.name + }, client); + this.created = new Date(data.created); + this.active = data.isActive; + this.status = data.status; + this.offers = data.offers.map((offerData) => ({ + robux: offerData.robux, + user: new structures.PartialUser({ + id: offerData.user.id, + name: offerData.user.name + }, client), + assets: offerData.userAssets.map((assetData) => new CollectibleAsset(assetData, client)) + })); + } +} +exports.Trade = Trade; diff --git a/dist/structures/BaseGroup.d.ts b/dist/structures/BaseGroup.d.ts new file mode 100644 index 000000000..a0a963810 --- /dev/null +++ b/dist/structures/BaseGroup.d.ts @@ -0,0 +1,16 @@ +import { Client } from ".."; +/** + * Represents a Roblox group ID and gives direct access to various group-related APIs. + */ +export declare class BaseGroup { + #private; + /** + * @param {Client} client The Bloxy Client + * @param {number} groupId The group ID + */ + constructor(client: Client, groupId: number); + get client(): Client; + get groupId(): number; + acceptUser(user: number): Promise; + declineUser(user: number): Promise; +} diff --git a/dist/structures/BaseGroup.js b/dist/structures/BaseGroup.js new file mode 100644 index 000000000..55bd3dae5 --- /dev/null +++ b/dist/structures/BaseGroup.js @@ -0,0 +1,42 @@ +"use strict"; +var _BaseGroup_client, _BaseGroup_groupId; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseGroup = void 0; +const tslib_1 = require("tslib"); +/** + * Represents a Roblox group ID and gives direct access to various group-related APIs. + */ +class BaseGroup { + /** + * @param {Client} client The Bloxy Client + * @param {number} groupId The group ID + */ + constructor(client, groupId) { + /** @private */ + _BaseGroup_client.set(this, void 0); + /** @private */ + _BaseGroup_groupId.set(this, void 0); + (0, tslib_1.__classPrivateFieldSet)(this, _BaseGroup_client, client, "f"); + (0, tslib_1.__classPrivateFieldSet)(this, _BaseGroup_groupId, groupId, "f"); + } + get client() { + return (0, tslib_1.__classPrivateFieldGet)(this, _BaseGroup_client, "f"); + } + get groupId() { + return (0, tslib_1.__classPrivateFieldGet)(this, _BaseGroup_groupId, "f"); + } + acceptUser(user) { + return this.client.apis.groupsAPI.acceptJoinRequest({ + groupId: this.groupId, + userId: user + }); + } + declineUser(user) { + return this.client.apis.groupsAPI.declineJoinRequest({ + groupId: this.groupId, + userId: user + }); + } +} +exports.BaseGroup = BaseGroup; +_BaseGroup_client = new WeakMap(), _BaseGroup_groupId = new WeakMap(); diff --git a/dist/structures/BaseUser.d.ts b/dist/structures/BaseUser.d.ts new file mode 100644 index 000000000..af5747626 --- /dev/null +++ b/dist/structures/BaseUser.d.ts @@ -0,0 +1,123 @@ +import { AccountInformationPromotionChannels, AccountInformationRobloxBadges, Client, EconomyGetSelfCurrency, FriendsGetUserFollowers, FriendsGetUserFriends, FriendsGetUserFriendsOptions, ItemType, PageSortLimit, PageSortOrder, PresenceGetUsersPresence, PrivateMessagesSendMessage, UsersUserNameHistory } from ".."; +import { CursorPage } from "./CursorPage"; +export declare type BaseUserOwnedBadge = { + badgeId: number; + awardedDate: Date; + awardedDateString: string; +}; +export declare type BaseUserGroupRole = { + groupId: number; + roleId: number; + rank: number; + roleName: string; +}; +/** + * Represents a Roblox user ID and gives direct access to various user-related APIs. + */ +export declare class BaseUser { + #private; + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client: Client, userId: number); + get client(): Client; + get userId(): number; + /** + * Return the username history of the user. + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getUsernameHistory(limit?: PageSortLimit, sortOrder?: PageSortOrder, cursor?: string): Promise>; + /** + * Returns the users current presence. + */ + getPresence(): Promise; + /** + * Returns the user's friends. + * @param limit The number of friends to return + * @param cursor The cursor to continue at + */ + getFriends(userSort?: FriendsGetUserFriendsOptions["userSort"]): Promise; + /** + * Returns the user's robux amount. The BaseUser must be the currently authenticated user, or else this function throws an error. + */ + getCurrency(): Promise; + /** + * Returns if the user has Roblox Premium or not. + */ + hasPremium(): Promise; + /** + * Returns if the user owns the specified item. + * @param {ItemType} itemType The type of item to check + * @param {number} itemId The ID of the item to check + */ + ownsItem(itemType: ItemType, itemId: number): Promise; + /** + * Returns if the user owns the specific asset. + * @param assetId The ID of the asset to check + */ + ownsAsset(assetId: number): Promise; + /** + * Returns if the user owns the specific gamepass. + * @param gamepassId The ID of the gamepass to check + */ + ownsGamepass(gamepassId: number): Promise; + /** + * Returns the date the specified badges got awarded to the user. + * @param badgeIds The badge IDs to check + */ + getBadgeAwardedDates(badgeIds: number[]): Promise; + /** + * Returns the role of the groups the user is in. + */ + getGroupRoles(): Promise; + /** + * Returns the roblox badges the user has. + */ + getRobloxBadges(): Promise; + /** + * Returns the user's promotion channels + */ + getPromotionChannels(): Promise; + /** + * Returns the user's friend count + */ + getFriendCount(): Promise; + /** + * Returns the user's follower count + */ + getFollowerCount(): Promise; + /** + * Returns the user's following count + */ + getFollowingCount(): Promise; + /** + * Returns the user's followers + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getFollowers(limit?: PageSortLimit, sortOrder?: PageSortOrder, cursor?: string): Promise>; + /** + * Returns the user's followings + * @param limit The number of followings to return + * @param sortOrder The sort order of the followings + * @param cursor The cursor to continue at + */ + getFollowings(limit?: PageSortLimit, sortOrder?: PageSortOrder, cursor?: string): Promise>; + /** + * Sends a private message to the user + * @param recipientId The user ID to send the message to + * @param subject The subject of the message + * @param body The body of the message + */ + sendMessage(recipientId: number, subject: string, body: string): Promise; +} diff --git a/dist/structures/BaseUser.js b/dist/structures/BaseUser.js new file mode 100644 index 000000000..a94ed6673 --- /dev/null +++ b/dist/structures/BaseUser.js @@ -0,0 +1,232 @@ +"use strict"; +var _BaseUser_client, _BaseUser_userId; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseUser = void 0; +const tslib_1 = require("tslib"); +const CursorPage_1 = require("./CursorPage"); +/** + * Represents a Roblox user ID and gives direct access to various user-related APIs. + */ +class BaseUser { + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client, userId) { + _BaseUser_client.set(this, void 0); + _BaseUser_userId.set(this, void 0); + (0, tslib_1.__classPrivateFieldSet)(this, _BaseUser_client, client, "f"); + (0, tslib_1.__classPrivateFieldSet)(this, _BaseUser_userId, userId, "f"); + } + get client() { + return (0, tslib_1.__classPrivateFieldGet)(this, _BaseUser_client, "f"); + } + get userId() { + return (0, tslib_1.__classPrivateFieldGet)(this, _BaseUser_userId, "f"); + } + /** + * Return the username history of the user. + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getUsernameHistory(limit = 10, sortOrder = "Asc", cursor) { + return this.client.apis.usersAPI + .getUserNameHistory({ + userId: this.userId + }) + .then((response) => new CursorPage_1.CursorPage({ limit, sortOrder, cursor }, { userId: this.userId }, response, (0, CursorPage_1.contextCall)(this.client.apis.usersAPI, this.client.apis.usersAPI.getUserNameHistory))); + } + /** + * Returns the users current presence. + */ + getPresence() { + return this.client.apis.presenceAPI + .getUsersPresences({ + userIds: [this.userId] + }) + .then((presence) => presence.userPresences[0]); + } + /** + * Returns the user's friends. + * @param limit The number of friends to return + * @param cursor The cursor to continue at + */ + getFriends(userSort) { + return this.client.apis.friendsAPI.getUserFriends({ + userId: this.userId, + userSort + }); + } + /** + * Returns the user's robux amount. The BaseUser must be the currently authenticated user, or else this function throws an error. + */ + getCurrency() { + var _a; + if (((_a = this.client.user) === null || _a === void 0 ? void 0 : _a.id) !== this.userId) { + throw new Error("This function can only be called with the currently authenticated user"); + } + return this.client.apis.economyAPI.getSelfCurrency({ userId: this.userId }); + } + /** + * Returns if the user has Roblox Premium or not. + */ + hasPremium() { + return this.client.apis.premiumFeaturesAPI.validateUserMembership({ + userId: this.userId + }); + } + /** + * Returns if the user owns the specified item. + * @param {ItemType} itemType The type of item to check + * @param {number} itemId The ID of the item to check + */ + ownsItem(itemType, itemId) { + return this.client.apis.inventoryAPI + .getUserItemsByTypeAndTargetId({ + userId: this.userId, + itemType, + itemTargetId: itemId + }) + .then((response) => response.data.length > 0); + } + /** + * Returns if the user owns the specific asset. + * @param assetId The ID of the asset to check + */ + ownsAsset(assetId) { + return this.ownsItem("Asset", assetId); + } + /** + * Returns if the user owns the specific gamepass. + * @param gamepassId The ID of the gamepass to check + */ + ownsGamepass(gamepassId) { + return this.ownsItem("GamePass", gamepassId); + } + /** + * Returns the date the specified badges got awarded to the user. + * @param badgeIds The badge IDs to check + */ + getBadgeAwardedDates(badgeIds) { + return this.client.apis.badgesAPI + .getUserBadgesAwardedDates({ + userId: this.userId, + badgeIds + }) + .then((response) => response.data.map((badge) => ({ + badgeId: badge.badgeId, + awardedDate: new Date(badge.awardedDate), + awardedDateString: badge.awardedDate + }))); + } + /** + * Returns the role of the groups the user is in. + */ + getGroupRoles() { + return this.client.apis.groupsAPI + .getUserGroups({ + userId: this.userId + }) + .then((response) => response.data.map((groupMembership) => ({ + groupId: groupMembership.group.id, + roleId: groupMembership.role.id, + rank: groupMembership.role.rank, + roleName: groupMembership.role.name + }))); + } + /** + * Returns the roblox badges the user has. + */ + getRobloxBadges() { + return this.client.apis.accountInformationAPI.getRobloxBadges({ + userId: this.userId + }); + } + /** + * Returns the user's promotion channels + */ + getPromotionChannels() { + return this.client.apis.accountInformationAPI.getUserPromotionChannels({ + userId: this.userId + }); + } + /** + * Returns the user's friend count + */ + getFriendCount() { + return this.client.apis.friendsAPI + .getUserFriendsCount({ + userId: this.userId + }) + .then((response) => response.count); + } + /** + * Returns the user's follower count + */ + getFollowerCount() { + return this.client.apis.friendsAPI + .getUserFollowersCount({ + userId: this.userId + }) + .then((response) => response.count); + } + /** + * Returns the user's following count + */ + getFollowingCount() { + return this.client.apis.friendsAPI + .getUserFollowingCount({ + userId: this.userId + }) + .then((response) => response.count); + } + /** + * Returns the user's followers + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getFollowers(limit = 10, sortOrder = "Asc", cursor) { + return this.client.apis.friendsAPI + .getUserFollowers({ + userId: this.userId, + limit, + sortOrder, + cursor + }) + .then((response) => new CursorPage_1.CursorPage({ limit, sortOrder, cursor }, { userId: this.userId }, response, (0, CursorPage_1.contextCall)(this.client.apis.friendsAPI, this.client.apis.friendsAPI.getUserFollowers))); + } + /** + * Returns the user's followings + * @param limit The number of followings to return + * @param sortOrder The sort order of the followings + * @param cursor The cursor to continue at + */ + getFollowings(limit = 10, sortOrder = "Asc", cursor) { + return this.client.apis.friendsAPI + .getUserFollowing({ + userId: this.userId, + limit, + sortOrder, + cursor + }) + .then((response) => new CursorPage_1.CursorPage({ limit, sortOrder, cursor }, { userId: this.userId }, response, (0, CursorPage_1.contextCall)(this.client.apis.friendsAPI, this.client.apis.friendsAPI.getUserFollowers))); + } + /** + * Sends a private message to the user + * @param recipientId The user ID to send the message to + * @param subject The subject of the message + * @param body The body of the message + */ + sendMessage(recipientId, subject, body) { + return this.client.apis.privateMessagesAPI.sendMessage({ + userId: this.userId, + recipientId, + subject, + body + }); + } +} +exports.BaseUser = BaseUser; +_BaseUser_client = new WeakMap(), _BaseUser_userId = new WeakMap(); diff --git a/dist/structures/Chat.d.ts b/dist/structures/Chat.d.ts new file mode 100644 index 000000000..e6a471dbf --- /dev/null +++ b/dist/structures/Chat.d.ts @@ -0,0 +1,118 @@ +import { Client } from "../client"; +import { PartialUser } from "./User"; +import { PartialGameUniverse } from "./Game"; +import { ChatSendGameLinkMessageOptions, ChatSendMessageOptions } from "../client/apis/ChatAPI"; +export interface ChatConversationOptions { + id: number; + title: string; + initiator: { + type: "User" | string; + targetId: number; + name: string | null; + displayName: string | null; + }; + hasUnreadMessages: boolean; + participants: { + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + conversationType: "OneToOneConversation" | string; + conversationTitle: { + titleForViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: string; + conversationUniverse: number | null; +} +export declare class ChatConversation { + client: Client; + id: number; + title: string; + initiator: PartialUser; + hasUnreadMessages: boolean; + members: PartialUser[]; + type: string; + conversationTitle: { + forViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: Date; + universe: PartialGameUniverse | null; + constructor(data: ChatConversationOptions, client: Client); + getMessages(amount?: number, startId?: string): Promise; + addUsers(users: number[]): Promise; + removeUser(userId: number): Promise; + markMessageRead(id: string): Promise; + markRead(): Promise; + rename(name: string): Promise; + getUnreadMessages(amount?: number): Promise; + getLatestMessages(amount?: number): Promise; + resetUniverse(): Promise; + sendGameLinkMessage(options: ChatSendGameLinkMessageOptions): Promise; + sendMessage(options: ChatSendMessageOptions): Promise; +} +export interface PartialChatConversationOptions { + id: number; + title?: string; +} +export declare class PartialChatConversation { + client: Client; + id: number; + title: string | null; + constructor(data: PartialChatConversationOptions, client: Client); +} +export interface ChatMessageOptions { + id: string; + senderType: string; + sent: string; + read: boolean; + messageType: "PlainText" | string; + decorators: string[]; + senderTargetId: number; + content: string; + link?: { + type: "Game"; + game: { + universeId: number; + }; + }; + eventBased?: { + type: "SetConversationUniverse"; + setConversationUniverse: { + actorUserId: number; + universeId: number; + }; + }; +} +export declare class ChatMessage { + client: Client; + id: string; + sender: PartialUser; + sentAt: Date; + type: "PlainText" | string; + decorators: string[]; + content: string; + constructor(data: ChatMessageOptions, client: Client); +} +export interface ChatMessageSentOptions { + content: string; + filteredForReceivers: boolean; + messageId: string; + sent: string; + messageType: "PlainText" | string; + resultType: "Success" | string; + statusMessage: string; +} +export declare class ChatMessageSent { + client: Client; + content: string; + filtered: boolean; + id: string; + sentAt: Date; + type: "PlainText" | string; + result: "Success" | string; + status: string; + constructor(data: ChatMessageSentOptions, client: Client); +} diff --git a/dist/structures/Chat.js b/dist/structures/Chat.js new file mode 100644 index 000000000..c59b762ce --- /dev/null +++ b/dist/structures/Chat.js @@ -0,0 +1,117 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChatMessageSent = exports.ChatMessage = exports.PartialChatConversation = exports.ChatConversation = void 0; +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); +class ChatConversation { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.title = data.title; + this.initiator = new structures.PartialUser({ + id: data.initiator.targetId, + name: data.initiator.name || undefined + }, client); + this.hasUnreadMessages = data.hasUnreadMessages; + this.members = data.participants.map((participantData) => new structures.PartialUser({ + id: participantData.targetId, + name: participantData.name + }, client)); + this.type = data.conversationType; + this.lastUpdated = new Date(data.lastUpdated); + this.universe = data.conversationUniverse + ? new structures.PartialGameUniverse({ + id: data.conversationUniverse + }, client) + : null; + this.conversationTitle = { + forViewer: data.conversationTitle.titleForViewer, + isDefaultTitle: data.conversationTitle.isDefaultTitle + }; + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getMessages(amount = 100, startId) { + return this.client.chat.getConversationMessages(this.id, amount, startId); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + addUsers(users) { + return this.client.chat.addUsersToConversation(this.id, users); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + removeUser(userId) { + return this.client.chat.removeUserFromConversation(this.id, userId); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markMessageRead(id) { + return this.client.chat.markMessageRead(this.id, id); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markRead() { + return this.client.chat.markConversationsRead([this.id]); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + rename(name) { + return this.client.chat.renameGroupConversation(this.id, name); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getUnreadMessages(amount = 100) { + return this.client.chat.getUnreadMessagesInConversations([this.id], amount); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getLatestMessages(amount = 100) { + return this.client.chat.getLatestMessagesInConversations([this.id], amount); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + resetUniverse() { + return this.client.chat.resetConversationUniverse(this.id); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendGameLinkMessage(options) { + return this.client.chat.sendGameLinkMessage(options); + } + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendMessage(options) { + return this.client.chat.sendMessage(options); + } +} +exports.ChatConversation = ChatConversation; +class PartialChatConversation { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.title = data.title || null; + } +} +exports.PartialChatConversation = PartialChatConversation; +class ChatMessage { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser({ + id: data.senderTargetId + }, client); + this.sentAt = new Date(data.sent); + this.type = data.messageType; + this.decorators = data.decorators; + this.content = data.content; + } +} +exports.ChatMessage = ChatMessage; +class ChatMessageSent { + constructor(data, client) { + this.client = client; + this.id = data.messageId; + this.content = data.content; + this.filtered = data.filteredForReceivers; + this.sentAt = new Date(data.sent); + this.result = data.resultType; + this.status = data.statusMessage; + this.type = data.messageType; + } +} +exports.ChatMessageSent = ChatMessageSent; diff --git a/dist/structures/ClientUser.d.ts b/dist/structures/ClientUser.d.ts new file mode 100644 index 000000000..d9d60c0e9 --- /dev/null +++ b/dist/structures/ClientUser.d.ts @@ -0,0 +1,10 @@ +import { Client } from "../client"; +import { PartialUser } from "./User"; +export interface ClientUserOptions { + id: number; + name: string; +} +export declare class ClientUser extends PartialUser { + client: Client; + constructor(data: ClientUserOptions, client: Client); +} diff --git a/dist/structures/ClientUser.js b/dist/structures/ClientUser.js new file mode 100644 index 000000000..a131115a9 --- /dev/null +++ b/dist/structures/ClientUser.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClientUser = void 0; +const User_1 = require("./User"); +class ClientUser extends User_1.PartialUser { + constructor(data, client) { + super(data, client); + this.client = client; + } +} +exports.ClientUser = ClientUser; diff --git a/dist/structures/CursorPage.d.ts b/dist/structures/CursorPage.d.ts new file mode 100644 index 000000000..4ea151bcf --- /dev/null +++ b/dist/structures/CursorPage.d.ts @@ -0,0 +1,29 @@ +export declare type CursorPageOptions = { + readonly limit?: 10 | 25 | 50 | 100; + cursor?: string; + readonly sortOrder?: "Asc" | "Desc"; +}; +declare type CursorPageResponse = { + data: T[]; + previousPageCursor: string | null; + nextPageCursor: string | null; +}; +declare type CursorPageState = { + previous: string | null; + current: string | null; + next: string | null; +}; +declare type CursorPageMethod = (options: CursorPageOptions & C) => Promise>; +export declare class CursorPage { + options: CursorPageOptions; + cursors: CursorPageState; + data: T[][]; + readonly method: CursorPageMethod; + readonly methodOptions: C; + private currentPage; + constructor(options: CursorPageOptions, methodOptions: C, response: CursorPageResponse, method: CursorPageMethod); + getNextPage(): Promise; + getPreviousPage(): Promise; +} +export declare function contextCall(context: any, method: CursorPageMethod): CursorPageMethod; +export {}; diff --git a/dist/structures/CursorPage.js b/dist/structures/CursorPage.js new file mode 100644 index 000000000..aea2e1b65 --- /dev/null +++ b/dist/structures/CursorPage.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.contextCall = exports.CursorPage = void 0; +const tslib_1 = require("tslib"); +class CursorPage { + constructor(options, methodOptions, response, method) { + this.data = []; + this.currentPage = 0; + this.options = options; + this.cursors = { + previous: response.previousPageCursor, + current: response.nextPageCursor, + next: response.nextPageCursor + }; + this.data[0] = response.data; + this.methodOptions = methodOptions; + this.method = method; + } + getNextPage() { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + if (!this.cursors.next) { + throw new Error("Attempted to iterate to next page, but no cursor was presented for the next page"); + } + this.currentPage++; + if (this.data[this.currentPage]) + return this.data[this.currentPage]; + this.options.cursor = this.cursors.next; + const result = yield this.method(Object.assign(Object.assign({}, this.options), this.methodOptions)); + this.cursors = { + previous: result.previousPageCursor, + current: this.cursors.next, + next: result.nextPageCursor + }; + this.data[this.currentPage] = result.data; + return result.data; + }); + } + getPreviousPage() { + return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { + if (!this.cursors.previous) { + throw new Error("Attempted to iterate to previous page, but no cursor was presented for the next page"); + } + this.currentPage--; + if (this.data[this.currentPage]) + return this.data[this.currentPage]; + this.options.cursor = this.cursors.previous; + const result = yield this.method(Object.assign(Object.assign({}, this.options), this.methodOptions)); + this.cursors = { + previous: result.previousPageCursor, + current: this.cursors.next, + next: result.nextPageCursor + }; + this.data[this.currentPage] = result.data; + return result.data; + }); + } +} +exports.CursorPage = CursorPage; +function contextCall(context, method) { + return (options) => method.call(context, options); +} +exports.contextCall = contextCall; diff --git a/dist/structures/Game.d.ts b/dist/structures/Game.d.ts new file mode 100644 index 000000000..6bb1c22d7 --- /dev/null +++ b/dist/structures/Game.d.ts @@ -0,0 +1,268 @@ +import { Client } from "../client"; +import { CreatorType, GameGenre, MorphAvatarType } from "../util/constants"; +import { PartialGroup } from "./Group"; +import { PartialUser } from "./User"; +import { DevelopGetPlaceStatisticsByTypeOptions } from "../client/apis/DevelopAPI"; +import { GamesGetGameServersByTypeOptions } from "../client/apis/GamesAPI"; +export interface GameBadgeBaseOptions { + id: number; + name?: string; +} +export declare class GameBadgeBase { + client: Client; + id: number; + name: string | null; + constructor(data: GameBadgeBaseOptions, client: Client); +} +export interface GameBadgeOptions { + id: number; + name: string; + description: string; + displayName: string; + displayDescription: string; + enabled: boolean; + iconImageId: number; + displayIconImageId: number; + created: string; + updated: string; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: { + id: number; + name: string; + rootPlaceId: number; + }; +} +export declare class GameBadge { + client: Client; + id: number; + name: string; + description: string; + displayedDescription: string; + displayedName: string; + enabled: boolean; + iconId: number; + displayedIconId: number; + created: Date; + updated: Date; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: PartialGameUniverse; + constructor(data: GameBadgeOptions, client: Client); +} +export declare type PartialGameBadgeOptions = GameBadgeBaseOptions; +export declare class PartialGameBadge extends GameBadgeBase { + constructor(data: PartialGameBadgeOptions, client: Client); +} +export interface GamePassOptions { + id: number; + name: string; + displayName: string; + productId: number; + price: number; +} +export declare class GamePass { + client: Client; + id: number; + name: string; + displayName: string; + productId: number; + price: number; + constructor(data: GamePassOptions, client: Client); +} +export interface BasePlaceOptions { + id: number; + name?: string; +} +export declare class BasePlace { + client: Client; + id: number; + name: string | null; + constructor(options: BasePlaceOptions, client: Client); + getCompatibilities(): Promise; + updatePlaceConfiguration(options: { + name: string; + description: string; + }): Promise; + getStatistics(options: Omit): Promise; + awardBadge(userId: number, badgeId: number): Promise; + getGameServers(options: Omit): Promise; +} +export interface PlaceOptions { + placeId: number; + name: string; + url: string; + description: string; + builder: string; + builderId: number; + isPlayable: boolean; + reasonProhibited: string; + universeId: number; + universeRootPlaceId: number; + price: number; + imageToken: string; +} +export declare class Place extends BasePlace { + description: string; + url: string; + creatorName: string; + creatorId: number; + playable: boolean; + prohibitedReason: string; + prohibited: boolean; + universe: PartialGameUniverse; + price: number; + imageToken: string; + constructor(data: PlaceOptions, client: Client); +} +interface PartialPlaceOptions { + id: number; + name?: string | null; +} +export declare class PartialPlace extends BasePlace { + constructor(data: PartialPlaceOptions, client: Client); +} +export interface PartialGameUniverseOptions { + id: number; + name?: string; + rootPlace?: { + id: number; + name?: string | null; + }; +} +export declare class PartialGameUniverse { + client: Client; + id: number; + name: string | null; + rootPlace: PartialPlace | null; + constructor(data: PartialGameUniverseOptions, client: Client); +} +export interface GameUniverseOptions { + id: number; + rootPlaceId: number; + name: string; + description: string; + creatorType: string; + creator: { + id: number; + name: string; + }; + price: number; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: string; + updated: string; + studioAccessToApisAllowed: boolean; + createVipServersAllowed: boolean; + universeAvatarType: string; + genre: string; +} +export declare class GameUniverse { + client: Client; + id: number; + rootPlace: PartialPlace | null; + name: string; + description: string; + creatorType: CreatorType; + creator: PartialGroup | PartialUser; + price: number | null; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: Date; + updated: Date; + studioAccessToAPIsEnabled: boolean; + createVIPServersEnabled: boolean; + avatarType: MorphAvatarType; + genre: GameGenre; + constructor(data: GameUniverseOptions, client: Client); +} +export interface PartialVIPServerOptions { + id: number; +} +export declare class PartialVIPServer { + client: Client; + id: number; + constructor(data: PartialVIPServerOptions, client: Client); +} +export interface VIPServerOptions { + id: number; + name: string; + game: { + id: number; + name: string; + rootPlace: { + id: number; + name: string; + }; + }; + joinCode: string; + active: boolean; + subscription: { + active: boolean; + expired: boolean; + expirationDate: string; + price: number; + }; + permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: { + id: number; + name: string; + displayName: string; + }[]; + }; +} +export declare class VIPServer { + client: Client; + id: number; + name: string; + game: PartialGameUniverse; + code: string; + active: boolean; + subscription: { + active: boolean; + expired: boolean; + expirationDate: Date; + price: number; + }; + permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: PartialUser[]; + }; + constructor(data: VIPServerOptions, client: Client); +} +export interface GameMediaDataOptions { + assetTypeId: number; + assetType: "Video" | "Image" | string; + imageId: number | null; + videoHash: string | null; + videoTitle: string | null; + approved: boolean; +} +export declare class GameMediaData { + client: Client; + assetTypeId: number; + assetType: "Video" | "Image" | string; + imageId: number | null; + videoHash: string | null; + videoTitle: string | null; + approved: boolean; + constructor(data: GameMediaDataOptions, client: Client); +} +export {}; diff --git a/dist/structures/Game.js b/dist/structures/Game.js new file mode 100644 index 000000000..c0196e162 --- /dev/null +++ b/dist/structures/Game.js @@ -0,0 +1,238 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameMediaData = exports.VIPServer = exports.PartialVIPServer = exports.GameUniverse = exports.PartialGameUniverse = exports.PartialPlace = exports.Place = exports.BasePlace = exports.GamePass = exports.PartialGameBadge = exports.GameBadge = exports.GameBadgeBase = void 0; +const constants_1 = require("../util/constants"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup, + PartialPlace: require("./Game").PartialPlace +}); +class GameBadgeBase { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } +} +exports.GameBadgeBase = GameBadgeBase; +class GameBadge { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.displayedName = data.displayName; + this.displayedDescription = data.displayDescription; + this.enabled = data.enabled; + this.iconId = data.iconImageId; + this.displayedIconId = data.displayIconImageId; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.statistics = { + pastDayAwardedCount: data.statistics.pastDayAwardedCount, + awardedCount: data.statistics.awardedCount, + winRatePercentage: data.statistics.winRatePercentage + }; + this.awardingUniverse = new structures.PartialGameUniverse({ + id: data.awardingUniverse.id, + rootPlace: { + id: data.awardingUniverse.rootPlaceId + }, + name: data.awardingUniverse.name + }, client); + } +} +exports.GameBadge = GameBadge; +class PartialGameBadge extends GameBadgeBase { + // Shut up eslint, it's not useless + // eslint-disable-next-line no-useless-constructor + constructor(data, client) { + super(data, client); + } +} +exports.PartialGameBadge = PartialGameBadge; +class GamePass { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name; + this.displayName = data.displayName; + this.productId = data.productId; + this.price = data.price; + } +} +exports.GamePass = GamePass; +class BasePlace { + constructor(options, client) { + this.client = client; + this.id = options.id; + this.name = options.name || null; + } + getCompatibilities() { + return this.client.apis.developAPI.getPlaceCompatibilities({ + placeId: this.id + }); + } + updatePlaceConfiguration(options) { + return this.client.apis.developAPI.updatePlaceConfiguration(Object.assign({ placeId: this.id }, options)); + } + getStatistics(options) { + return this.client.apis.developAPI.getPlaceStatistics(Object.assign({ placeId: this.id }, options)); + } + awardBadge(userId, badgeId) { + return this.client.apis.generalApi.awardBadge({ + placeId: this.id, + badgeId, + userId + }); + } + getGameServers(options) { + return this.client.apis.gamesAPI.getGameServersByType(Object.assign({ placeId: this.id }, options)); + } +} +exports.BasePlace = BasePlace; +class Place extends BasePlace { + constructor(data, client) { + const structures = retrieveStructures(); + super({ + id: data.placeId, + name: data.name + }, client); + this.description = data.description; + this.url = data.url; + this.creatorName = data.builder; + this.creatorId = data.builderId; + this.playable = data.isPlayable; + this.prohibitedReason = data.reasonProhibited; + this.prohibited = this.prohibitedReason.toLowerCase() !== "none"; + this.universe = new structures.PartialGameUniverse({ + id: data.universeId, + rootPlace: { + id: data.universeRootPlaceId + } + }, client); + this.price = data.price; + this.imageToken = data.imageToken; + } +} +exports.Place = Place; +class PartialPlace extends BasePlace { + constructor(data, client) { + super({ + id: data.id, + name: data.name || undefined + }, client); + } +} +exports.PartialPlace = PartialPlace; +class PartialGameUniverse { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name || null; + this.rootPlace = data.rootPlace + ? new structures.PartialPlace({ + id: data.rootPlace.id, + name: data.rootPlace.name || null + }, client) + : null; + } +} +exports.PartialGameUniverse = PartialGameUniverse; +class GameUniverse { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.rootPlace = data.rootPlaceId + ? new structures.PartialPlace({ + id: data.rootPlaceId + }, client) + : null; + this.name = data.name; + this.description = data.description; + this.creatorType = + data.creatorType.toLowerCase() === "group" + ? constants_1.CreatorType.GROUP + : constants_1.CreatorType.USER; + this.creator = + this.creatorType === constants_1.CreatorType.GROUP + ? new structures.PartialGroup({ + id: data.creator.id, + name: data.creator.name + }, client) + : new structures.PartialUser({ + id: data.creator.id, + name: data.creator.name + }, client); + this.price = data.price; + this.allowedGearGenres = data.allowedGearGenres; + this.allowedGearCategories = data.allowedGearCategories; + this.playing = data.playing; + this.visits = data.visits; + this.maxPlayers = data.maxPlayers; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.studioAccessToAPIsEnabled = data.studioAccessToApisAllowed; + this.createVIPServersEnabled = data.createVipServersAllowed; + this.avatarType = + data.universeAvatarType.toLowerCase() === "morphtor6" + ? constants_1.MorphAvatarType.R6 + : constants_1.MorphAvatarType.R15; + this.genre = data.genre; + } +} +exports.GameUniverse = GameUniverse; +class PartialVIPServer { + constructor(data, client) { + this.client = client; + this.id = data.id; + } +} +exports.PartialVIPServer = PartialVIPServer; +class VIPServer { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id; + this.name = data.name; + this.game = new structures.PartialGameUniverse({ + id: data.game.id, + name: data.game.name, + rootPlace: { + id: data.game.rootPlace.id, + name: data.game.rootPlace.name + } + }, client); + this.active = data.active; + this.code = data.joinCode; + this.subscription = { + active: data.subscription.active, + expired: data.subscription.expired, + expirationDate: new Date(data.subscription.expirationDate), + price: data.subscription.price + }; + this.permissions = { + clanAllowed: data.permissions.clanAllowed, + enemyClanId: data.permissions.enemyClanId, + friendsAllowed: data.permissions.friendsAllowed, + users: data.permissions.users.map((userData) => new structures.PartialUser(userData, client)) + }; + } +} +exports.VIPServer = VIPServer; +class GameMediaData { + constructor(data, client) { + this.client = client; + this.assetTypeId = data.assetTypeId; + this.assetType = data.assetType; + this.imageId = data.imageId; + this.videoHash = data.videoHash; + this.videoTitle = data.videoTitle; + this.approved = data.approved; + } +} +exports.GameMediaData = GameMediaData; diff --git a/dist/structures/Group.d.ts b/dist/structures/Group.d.ts new file mode 100644 index 000000000..9545d2058 --- /dev/null +++ b/dist/structures/Group.d.ts @@ -0,0 +1,272 @@ +import { Client } from "../client"; +import { DevelopGetGroupUniversesOptions } from "../client/apis/DevelopAPI"; +import { CursorPage } from "./Asset"; +import { PartialGameUniverse } from "./Game"; +import { EconomyGetGroupRevenueSummaryInTimeFrame, EconomyGetGroupRevenueSummaryInTimeFrameOptions, EconomyGetGroupTransactions, EconomyGetGroupTransactionsOptions } from "../client/apis/EconomyAPI"; +import { GroupsAcceptJoinRequest, GroupsAcceptJoinRequests, GroupsAcceptJoinRequestsOptions, GroupsAcceptRelationshipRequest, GroupsAcceptRelationshipRequests, GroupsAcceptRelationshipRequestsOptions, GroupsChangeOwner, GroupsClaimGroup, GroupsCreateRelationship, GroupsCreateRelationshipOptions, GroupsCreateRole, GroupsCreateRoleOptions, GroupsCreateWallPost, GroupsCreateWallPostOptions, GroupsDeclineJoinRequest, GroupsDeclineJoinRequests, GroupsDeclineRelationshipRequest, GroupsDeclineRelationshipRequests, GroupsDeclineRelationshipRequestsOptions, GroupsDeleteRelationship, GroupsDeleteRelationshipOptions, GroupsDeleteRole, GroupsDeleteSocialLink, GroupsDeleteWallPost, GroupsGetAllRolesPermissions, GroupsGetGroupPayouts, GroupsGetGroupRelationships, GroupsGetGroupRelationshipsOptions, GroupsGetGroupSettings, GroupsGetGuestPermissions, GroupsGetJoinRequest, GroupsGetJoinRequestsOptions, GroupsGetMembersOptions, GroupsGetMembersWithRoleOptions, GroupsGetRelationshipRequests, GroupsGetRelationshipRequestsOptions, GroupsGetRolePermissions, GroupsGetSelfGroupMembership, GroupsGetSocialLinks, GroupsGetWallPostsOptions, GroupsJoinGroup, GroupsJoinGroupOptions, GroupsKickMember, GroupsPayoutMembers, GroupsPayoutMembersOptions, GroupsPostSocialLink, GroupsPostSocialLinkOptions, GroupsRemovePrimaryGroup, GroupsSetPrimaryGroup, GroupsUpdateGroupDescription, GroupsUpdateGroupIcon, GroupsUpdateGroupSettings, GroupsUpdateGroupSettingsOptions, GroupsUpdateGroupStatus, GroupsUpdateMember, GroupsUpdateRecurringPayouts, GroupsUpdateRecurringPayoutsOptions, GroupsUpdateRole, GroupsUpdateRoleOptions, GroupsUpdateRolePermissions, GroupsUpdateRolePermissionsOptions, GroupsUpdateSocialLink, GroupsUpdateSocialLinkOptions } from "../client/apis/GroupsAPI"; +import { PartialUser, PartialUserOptions, UserBase } from "./User"; +declare type GroupRelationships = Omit & { + groupId: number; + relationshipType: T; + totalGroupCount: number; + groups: Group[]; + nextRowIndex: number; +}; +export interface GroupBaseOptions { + id: number; + name?: string; +} +export declare class GroupBase { + client: Client; + id: number; + name: string | null; + constructor(data: GroupBaseOptions, client: Client); + getUniverses(options?: Omit): Promise>; + /** + * Returns whether the authenticated user can manage the group or not + * @returns {Promise} + */ + canSelfManage(): Promise; + /** + * Gets the currently available funds in the group + * @returns {Promise} + */ + getFunds(): Promise; + getRevenueSummaryInTimeFrame(timeFrame: EconomyGetGroupRevenueSummaryInTimeFrameOptions["timeFrame"]): Promise; + getTransactions(options: Omit): Promise; + getAllies(maxItems?: number, startItem?: number): Promise>; + getEnemies(maxItems?: number, startItem?: number): Promise>; + getGroup(): Promise; + getMember(userId: number): Promise; + getIsMember(userId: number): Promise; + getSettings(): Promise; + updateSettings(options: Omit): Promise; + updateDescription(description: string): Promise; + updateShout(shout: string): Promise; + updateIcon(file: unknown): Promise; + declineJoinRequests(userIds: number[]): Promise; + getJoinRequests(options: Omit): Promise>; + acceptJoinRequests(options: Omit): Promise; + declineJoinRequest(userId: number): Promise; + getJoinRequest(userId: number): Promise; + acceptJoinRequest(userId: number): Promise; + getSelfMembership(): Promise; + getRoles(): Promise; + getMembersWithRole(options: Omit): Promise>; + getMembers(options: Omit): Promise>; + join(options: Omit): Promise; + getIsPendingJoin(): Promise; + changeOwner(userId: number): Promise; + claim(): Promise; + kickMember(userId: number): Promise; + updateMember(userId: number, roleId: number): Promise; + getPayouts(): Promise; + payoutMembers(options: Omit): Promise; + updateRecurringPayouts(options: Omit): Promise; + getRelationships(options: Omit): Promise; + declineRelationshipRequests(options: Omit): Promise; + getRelationshipRequests(options: Omit): Promise; + acceptRelationshipRequests(options: Omit): Promise; + deleteRelationship(options: Omit): Promise; + createRelationship(options: Omit): Promise; + acceptRelationshipRequest(type: "enemies" | "allies", withGroup: number): Promise; + declineRelationshipRequest(type: "enemies" | "allies", withGroup: number): Promise; + getRolePermissions(roleId: number): Promise; + updateRolePermissions(roleId: number, permissions: Omit): Promise; + getGuestPermissions(): Promise; + getAllRolesPermissions(): Promise; + getSocialLinks(): Promise; + createSocialLink(options: Omit): Promise; + deleteSocialLink(id: number): Promise; + updateSocialLink(options: Omit): Promise; + getWallPosts(options: Omit): Promise>; + createWallPost(options: Omit): Promise; + deleteWallPost(id: number): Promise; + getIsUserPrimaryGroup(userId: number): Promise; + removeAsPrimary(): Promise; + setAsPrimary(): Promise; + createRole(options: Omit): Promise; + deleteRole(roleId: number): Promise; + updateRole(roleId: number, options: Omit): Promise; +} +export interface PartialGroupOptions { + id: number; + name?: string; +} +export declare class PartialGroup extends GroupBase { + constructor(data: PartialGroupOptions, client: Client); +} +export interface GroupMemberOptions { + group: PartialGroupOptions; + name?: string | null; + /** + * The user id + */ + id: number; + role?: { + id: number; + name: string; + rank: number; + }; +} +export declare class GroupMember extends UserBase { + group: PartialGroup; + role: GroupRole | null; + constructor(data: GroupMemberOptions, client: Client); +} +export interface GroupOptions { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + } | null; + shout: { + body: string; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + } | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +} +export declare class Group extends GroupBase { + description: string; + name: string; + owner: GroupMember | null; + shout: GroupShout | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; + constructor(data: GroupOptions, client: Client); +} +export interface GroupJoinRequestOptions { + id?: number; + user: PartialUserOptions; + group: PartialGroupOptions; + created: string; +} +export declare class GroupJoinRequest { + client: Client; + id: number | null; + user: PartialUser; + group: PartialGroup; + created: Date; + constructor(data: GroupJoinRequestOptions, client: Client); +} +export interface GroupRoleOptions { + id?: number; + name?: string; + rank?: number; + group: { + id: number; + name?: string; + }; +} +export declare class GroupRole { + client: Client; + id: number | null; + name: string | null; + rank: number | null; + group: PartialGroup; + constructor(data: GroupRoleOptions, client: Client); +} +export interface GroupRolePermissionsOptions { + groupId: number; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + permissions: { + groupPostsPermissions: { + viewWall: boolean; + postToWall: boolean; + deleteFromWall: boolean; + viewStatus: boolean; + postToStatus: boolean; + }; + groupMembershipPermissions: { + changeRank: boolean; + inviteMembers: boolean; + removeMembers: boolean; + }; + groupManagementPermissions: { + manageRelationships: boolean; + manageClan: boolean; + viewAuditLogs: boolean; + }; + groupEconomyPermissions: { + spendGroupFunds: boolean; + advertiseGroup: boolean; + createItems: boolean; + manageItems: boolean; + addGroupPlaces: boolean; + manageGroupGames: boolean; + viewGroupPayouts: boolean; + }; + }; +} +export declare class GroupRolePermissions { + client: Client; + group: PartialGroup; + role: GroupRole; + permissions: GroupRolePermissionsOptions["permissions"]; + constructor(data: GroupRolePermissionsOptions, client: Client); +} +export interface GroupShoutOptions { + content: string; + creator: { + id: number; + username: string; + }; + group: { + id: number; + name?: string; + }; +} +export declare class GroupShout { + client: Client; + content: string; + creator: PartialUser; + group: PartialGroup; + constructor(data: GroupShoutOptions, client: Client); +} +export interface GroupWallPostOptions { + id: number; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + group: { + id: number; + name?: string; + }; + body: string; + created: string; + updated: string; +} +export declare class GroupWallPost { + client: Client; + id: number; + creator: GroupMember; + content: string; + created: Date; + constructor(data: GroupWallPostOptions, client: Client); +} +export {}; diff --git a/dist/structures/Group.js b/dist/structures/Group.js new file mode 100644 index 000000000..8e61a3e13 --- /dev/null +++ b/dist/structures/Group.js @@ -0,0 +1,495 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GroupWallPost = exports.GroupShout = exports.GroupRolePermissions = exports.GroupRole = exports.GroupJoinRequest = exports.Group = exports.GroupMember = exports.PartialGroup = exports.GroupBase = void 0; +const User_1 = require("./User"); +const retrieveStructures = () => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse +}); +class GroupBase { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } + getUniverses(options) { + return this.client.apis.developAPI + .getGroupUniverses(Object.assign(Object.assign({}, options), { groupId: this.id })) + .then((response) => { + const CursorPageClass = require("./Asset").CursorPage; + const structures = retrieveStructures(); + return new CursorPageClass(this.client, options || {}, Object.assign(Object.assign({}, response), { data: response.data.map((universeData) => new structures.PartialGameUniverse({ + id: universeData.id, + name: universeData.name, + rootPlace: universeData.rootPlaceId + ? { + id: universeData.rootPlaceId + } + : undefined + }, this.client)) }), this.getUniverses); + }); + } + /** + * Returns whether the authenticated user can manage the group or not + * @returns {Promise} + */ + canSelfManage() { + return this.client.apis.developAPI + .getSelfManageableGroups() + .then((response) => !!response.data.find((data) => data.id === this.id)); + } + /** + * Gets the currently available funds in the group + * @returns {Promise} + */ + getFunds() { + return this.client.apis.economyAPI + .getGroupCurrency({ + groupId: this.id + }) + .then((response) => response.robux); + } + getRevenueSummaryInTimeFrame(timeFrame) { + return this.client.apis.economyAPI.getGroupRevenueByTime({ + groupId: this.id, + timeFrame + }); + } + getTransactions(options) { + return this.client.apis.economyAPI.getGroupTransactions(Object.assign({ groupId: this.id }, options)); + } + getAllies(maxItems = 100, startItem) { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "allies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => (Object.assign(Object.assign({}, response), { relationshipType: "allies", groups: response.relatedGroups.map((groupData) => new Group(groupData, this.client)) }))); + } + getEnemies(maxItems = 100, startItem) { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "enemies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => (Object.assign(Object.assign({}, response), { relationshipType: "enemies", groups: response.relatedGroups.map((groupData) => new Group(groupData, this.client)) }))); + } + getGroup() { + return this.client.getGroup(this.id); + } + getMember(userId) { + return this.client.apis.groupsAPI + .getUserGroups({ + userId + }) + .then((response) => { + const foundGroup = response.data.find((groupData) => groupData.group.id === this.id); + if (foundGroup) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + return new GroupMember({ + id: userId, + role: foundGroup.role, + group: foundGroup.group + }, this.client); + } + else { + return null; + } + }); + } + getIsMember(userId) { + console.warn(`group.getIsMember() is deprecated and may be removed in the future. Please switch to group.getMember`); + return this.getMember(userId); + } + getSettings() { + return this.client.apis.groupsAPI.getGroupSettings({ + groupId: this.id + }); + } + updateSettings(options) { + return this.client.apis.groupsAPI.updateGroupSettings(Object.assign({ groupId: this.id }, options)); + } + updateDescription(description) { + return this.client.apis.groupsAPI.updateGroupDescription({ + description, + groupId: this.id + }); + } + updateShout(shout) { + return this.client.apis.groupsAPI.updateGroupStatus({ + groupId: this.id, + message: shout + }); + } + updateIcon(file) { + return this.client.apis.groupsAPI.updateGroupIcon({ + files: file, + groupId: this.id + }); + } + declineJoinRequests(userIds) { + return this.client.apis.groupsAPI.declineJoinRequests({ + groupId: this.id, + userIds + }); + } + getJoinRequests(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getJoinRequests(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getJoinRequests)); + } + acceptJoinRequests(options) { + return this.client.apis.groupsAPI.acceptJoinRequests(Object.assign({ groupId: this.id }, options)); + } + declineJoinRequest(userId) { + return this.client.apis.groupsAPI.declineJoinRequest({ + groupId: this.id, + userId + }); + } + getJoinRequest(userId) { + return this.client.apis.groupsAPI.getJoinRequest({ + groupId: this.id, + userId + }); + } + acceptJoinRequest(userId) { + return this.client.apis.groupsAPI.acceptJoinRequest({ + groupId: this.id, + userId + }); + } + getSelfMembership() { + return this.client.apis.groupsAPI.getSelfGroupMembership({ + groupId: this.id + }); + } + getRoles() { + return this.client.apis.groupsAPI + .getGroupRoles({ + groupId: this.id + }) + .then((response) => response.roles.map((roleData) => new GroupRole(Object.assign({ group: { + id: this.id, + name: this.name || undefined + } }, roleData), this.client))); + } + getMembersWithRole(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getMembersWithRole(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getMembersWithRole)); + } + getMembers(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getMembers(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getMembers)); + } + join(options) { + return this.client.apis.groupsAPI.joinGroup(Object.assign(Object.assign({ groupId: this.id }, options), { captchaProvider: options.captchaProvider || "PROVIDER_ARKOSELABS" })); + } + getIsPendingJoin() { + return this.client.apis.groupsAPI + .getSelfPendingGroupJoins() + .then((response) => (response.data.find((groupData) => groupData.id === this.id) && + true) || + false); + } + changeOwner(userId) { + return this.client.apis.groupsAPI.changeGroupOwner({ + groupId: this.id, + userId + }); + } + claim() { + return this.client.apis.groupsAPI.claimGroup({ + groupId: this.id + }); + } + kickMember(userId) { + return this.client.apis.groupsAPI.kickMember({ + groupId: this.id, + userId + }); + } + updateMember(userId, roleId) { + return this.client.apis.groupsAPI.updateMember({ + groupId: this.id, + roleId, + userId + }); + } + getPayouts() { + return this.client.apis.groupsAPI.getGroupPayouts({ + groupId: this.id + }); + } + payoutMembers(options) { + return this.client.apis.groupsAPI.payoutMembers(Object.assign({ groupId: this.id }, options)); + } + updateRecurringPayouts(options) { + return this.client.apis.groupsAPI.updateRecurringPayouts(Object.assign({ groupId: this.id }, options)); + } + getRelationships(options) { + return this.client.apis.groupsAPI.getGroupRelationships(Object.assign({ groupId: this.id }, options)); + } + declineRelationshipRequests(options) { + return this.client.apis.groupsAPI.declineRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + getRelationshipRequests(options) { + return this.client.apis.groupsAPI.getRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + acceptRelationshipRequests(options) { + return this.client.apis.groupsAPI.acceptRelationshipRequests(Object.assign({ groupId: this.id }, options)); + } + deleteRelationship(options) { + return this.client.apis.groupsAPI.deleteRelationship(Object.assign({ groupId: this.id }, options)); + } + createRelationship(options) { + return this.client.apis.groupsAPI.createRelationship(Object.assign({ groupId: this.id }, options)); + } + acceptRelationshipRequest(type, withGroup) { + return this.client.apis.groupsAPI.acceptRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + declineRelationshipRequest(type, withGroup) { + return this.client.apis.groupsAPI.declineRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + getRolePermissions(roleId) { + return this.client.apis.groupsAPI.getRolePermissions({ + groupId: this.id, + roleId + }); + } + updateRolePermissions(roleId, permissions) { + return this.client.apis.groupsAPI.updateRolePermissions(Object.assign({ groupId: this.id, roleId }, permissions)); + } + getGuestPermissions() { + return this.client.apis.groupsAPI.getGuestPermissions({ + groupId: this.id + }); + } + getAllRolesPermissions() { + return this.client.apis.groupsAPI.getAllRolesPermissions({ + groupId: this.id + }); + } + getSocialLinks() { + return this.client.apis.groupsAPI.getSocialLinks({ + groupId: this.id + }); + } + createSocialLink(options) { + return this.client.apis.groupsAPI.createSocialLink(Object.assign({ groupId: this.id }, options)); + } + deleteSocialLink(id) { + return this.client.apis.groupsAPI.deleteSocialLink({ + groupId: this.id, + id + }); + } + updateSocialLink(options) { + return this.client.apis.groupsAPI.updateSocialLink(Object.assign({ groupId: this.id }, options)); + } + getWallPosts(options) { + const CursorPageClass = require("./Asset").CursorPage; + return this.client.apis.groupsAPI + .getWallPosts(Object.assign({ groupId: this.id }, options)) + .then((response) => new CursorPageClass(this.client, options, response, this.getWallPosts)); + } + createWallPost(options) { + return this.client.apis.groupsAPI.createWallPost(Object.assign({ groupId: this.id }, options)); + } + deleteWallPost(id) { + return this.client.apis.groupsAPI.deleteWallPost({ + groupId: this.id, + id + }); + } + getIsUserPrimaryGroup(userId) { + return (this.client.apis.groupsAPI + .getUserPrimaryGroup({ + userId + }) + // eslint-disable-next-line @typescript-eslint/no-use-before-define + .then((response) => response && response.group && response.role + ? new GroupMember({ + group: response.group, + role: { + id: response.role.id, + name: response.role.name, + rank: response.role.rank + }, + id: userId + }, this.client) + : null)); + } + removeAsPrimary() { + return this.client.apis.groupsAPI.removePrimaryGroup(); + } + setAsPrimary() { + return this.client.apis.groupsAPI.setPrimaryGroup({ + groupId: this.id + }); + } + createRole(options) { + return this.client.apis.groupsAPI.createRole(Object.assign({ groupId: this.id }, options)); + } + deleteRole(roleId) { + return this.client.apis.groupsAPI.deleteRole({ + groupId: this.id, + roleId + }); + } + updateRole(roleId, options) { + return this.client.apis.groupsAPI.updateRole(Object.assign({ groupId: this.id, roleId }, options)); + } +} +exports.GroupBase = GroupBase; +class PartialGroup extends GroupBase { + // Shut up eslint, this is not useless either + // eslint-disable-next-line no-useless-constructor + constructor(data, client) { + super(data, client); + } +} +exports.PartialGroup = PartialGroup; +class GroupMember extends User_1.UserBase { + constructor(data, client) { + super({ + name: data.name, + id: data.id + }, client); + this.group = new PartialGroup(data.group, client); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.role = data.role + ? new GroupRole({ + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + name: this.name || undefined, + id: this.id + } + }, client) + : null; + } +} +exports.GroupMember = GroupMember; +class Group extends GroupBase { + constructor(data, client) { + super(data, client); + this.description = data.description; + this.name = data.name; + this.owner = data.owner + ? new GroupMember({ + id: data.owner.userId, + name: data.owner.username, + group: this + }, client) + : null; + this.shout = data.shout + ? new GroupShout({ + content: data.shout.body, + creator: { + id: data.shout.poster.userId, + username: data.shout.poster.username + }, + group: { + id: this.id, + name: this.name || undefined + } + }, client) + : null; + this.memberCount = data.memberCount; + this.isBuildersClubOnly = data.isBuildersClubOnly; + this.publicEntryAllowed = data.publicEntryAllowed; + this.isLocked = data.isLocked; + } +} +exports.Group = Group; +class GroupJoinRequest { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.id = data.id || null; + this.user = new structures.PartialUser(data.user, client); + this.group = new PartialGroup(data.group, client); + this.created = new Date(data.created); + } +} +exports.GroupJoinRequest = GroupJoinRequest; +class GroupRole { + constructor(data, client) { + this.client = client; + this.id = data.id || null; + this.name = data.name || null; + this.rank = data.rank || null; + this.group = new PartialGroup({ + id: data.group.id, + name: data.group.name + }, client); + } +} +exports.GroupRole = GroupRole; +class GroupRolePermissions { + constructor(data, client) { + this.client = client; + this.group = new PartialGroup({ + id: data.groupId + }, client); + this.role = new GroupRole({ + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + id: this.group.id + } + }, client); + this.permissions = data.permissions; + } +} +exports.GroupRolePermissions = GroupRolePermissions; +class GroupShout { + constructor(data, client) { + const structures = retrieveStructures(); + this.client = client; + this.content = data.content; + this.creator = new structures.PartialUser(data.creator, client); + this.group = new PartialGroup({ + id: data.group.id, + name: data.group.name + }, client); + } +} +exports.GroupShout = GroupShout; +class GroupWallPost { + constructor(data, client) { + this.client = client; + this.id = data.id; + this.content = data.body; + this.creator = new GroupMember({ + group: { + id: data.group.id, + name: data.group.name + }, + id: data.poster.userId, + name: data.poster.username + }, client); + this.created = new Date(data.created); + } +} +exports.GroupWallPost = GroupWallPost; diff --git a/dist/structures/User.d.ts b/dist/structures/User.d.ts new file mode 100644 index 000000000..01ab8d650 --- /dev/null +++ b/dist/structures/User.d.ts @@ -0,0 +1,20 @@ +import { Client, UsersGetUserById } from ".."; +import { BaseUser } from "./BaseUser"; +declare type UserConstructorData = UsersGetUserById; +/** + * Represents a roblox user + */ +export declare class User extends BaseUser { + readonly name: string; + readonly displayName: string; + readonly externalAppDisplayName: string; + readonly isBanned: boolean; + readonly description: string; + readonly created: Date; + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client: Client, data: UserConstructorData); +} +export {}; diff --git a/dist/structures/User.js b/dist/structures/User.js new file mode 100644 index 000000000..c222d4665 --- /dev/null +++ b/dist/structures/User.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.User = void 0; +const BaseUser_1 = require("./BaseUser"); +/** + * Represents a roblox user + */ +class User extends BaseUser_1.BaseUser { + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client, data) { + super(client, data.id); + this.name = data.name; + this.displayName = data.displayName; + this.externalAppDisplayName = data.externalAppDisplayName; + this.isBanned = data.isBanned; + this.description = data.description; + this.created = new Date(data.created); + } +} +exports.User = User; diff --git a/dist/structures/index.d.ts b/dist/structures/index.d.ts new file mode 100644 index 000000000..9f31e7296 --- /dev/null +++ b/dist/structures/index.d.ts @@ -0,0 +1,6 @@ +export * from "./Asset"; +export * from "./Chat"; +export * from "./ClientUser"; +export * from "./Game"; +export * from "./Group"; +export * from "./User"; diff --git a/dist/structures/index.js b/dist/structures/index.js new file mode 100644 index 000000000..693bf3bad --- /dev/null +++ b/dist/structures/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +(0, tslib_1.__exportStar)(require("./Asset"), exports); +(0, tslib_1.__exportStar)(require("./Chat"), exports); +(0, tslib_1.__exportStar)(require("./ClientUser"), exports); +(0, tslib_1.__exportStar)(require("./Game"), exports); +(0, tslib_1.__exportStar)(require("./Group"), exports); +(0, tslib_1.__exportStar)(require("./User"), exports); diff --git a/dist/types/GeneralTypes.d.ts b/dist/types/GeneralTypes.d.ts new file mode 100644 index 000000000..750d1a26f --- /dev/null +++ b/dist/types/GeneralTypes.d.ts @@ -0,0 +1,2 @@ +export declare type Privacy = "NoOne" | "Friends" | "Following" | "Followers" | "AllUsers"; +export declare type ISOString = string; diff --git a/dist/types/GeneralTypes.js b/dist/types/GeneralTypes.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/dist/types/GeneralTypes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/types/GenericOptionTypes.d.ts b/dist/types/GenericOptionTypes.d.ts new file mode 100644 index 000000000..255e1aba4 --- /dev/null +++ b/dist/types/GenericOptionTypes.d.ts @@ -0,0 +1,43 @@ +export declare type UserIdOption = { + userId: number; +}; +export declare type UserIdsOption = { + userIds: number[]; +}; +export declare type PlaceIdOption = { + placeId: number; +}; +export declare type PlaceIdsOption = { + placeIds: number[]; +}; +export declare type UniverseIdOption = { + universeId: number; +}; +export declare type UniverseIdsOption = { + universeIds: number[]; +}; +export declare type AssetIdOption = { + assetId: number; +}; +export declare type AssetIdsOption = { + assetIds: number[]; +}; +export declare type GroupIdOption = { + groupId: number; +}; +export declare type GroupIdsOption = { + groupIds: number[]; +}; +export declare type SortOption = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export declare type UsernamePasswordOption = { + username: string; + password: string; +}; +export declare type PageSortOrder = SortOption["sortOrder"]; +export declare type PageSortLimit = SortOption["limit"]; +export declare type PageSortCursor = SortOption["cursor"]; +export declare type ItemType = "Asset" | "GamePass" | "Badge" | "Bundle"; diff --git a/dist/types/GenericOptionTypes.js b/dist/types/GenericOptionTypes.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/dist/types/GenericOptionTypes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/types/GenericTypes.d.ts b/dist/types/GenericTypes.d.ts new file mode 100644 index 000000000..07128703c --- /dev/null +++ b/dist/types/GenericTypes.d.ts @@ -0,0 +1,10 @@ +export declare type Privacy = "NoOne" | "Friends" | "Following" | "Followers" | "AllUsers"; +export declare type ISOString = string; +export declare type CursorData = { + previousPageCursor?: string; + nextPageCursor?: string; + data: T; +}; +export declare type SuccessResponse = { + success: boolean; +}; diff --git a/dist/types/GenericTypes.js b/dist/types/GenericTypes.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/dist/types/GenericTypes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/util/constants.d.ts b/dist/util/constants.d.ts new file mode 100644 index 000000000..a29b75848 --- /dev/null +++ b/dist/util/constants.d.ts @@ -0,0 +1,26 @@ +export declare const identifierNames: { + userId: string[]; + groupId: string[]; + name: string[]; + username: string[]; + friendsCount: string[]; +}; +export declare const StatusCodeReasons: { + 400: string[]; + 401: string[]; + 403: string[]; + 404: string[]; + 429: string[]; + 500: string[]; +}; +export declare enum CreatorType { + USER = 1, + GROUP = 2 +} +export declare enum MorphAvatarType { + R6 = "MorphToR6", + R15 = "MorphToR15" +} +export declare enum GameGenre { + FPS = "FPS" +} diff --git a/dist/util/constants.js b/dist/util/constants.js new file mode 100644 index 000000000..9f5f2ece4 --- /dev/null +++ b/dist/util/constants.js @@ -0,0 +1,77 @@ +"use strict"; +// All naming conventions Roblox uses for identifier types (userId, groupId, etc.) +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameGenre = exports.MorphAvatarType = exports.CreatorType = exports.StatusCodeReasons = exports.identifierNames = void 0; +exports.identifierNames = { + userId: [ + "ProfileUserId", + "UserId", + "userId", + "userid", + "PlayerId", + "playerId", + "playerid", + "targetUserId", + "ID", + "id", + "Id", + "targetID" + ], + groupId: ["GroupId", "groupId", "Groupid", "Id", "ID", "id"], + name: ["Name", "name"], + username: [ + "ProfileUserName", + "Username", + "username", + "userName", + "UserName", + "Name", + "name" + ], + friendsCount: ["numFriends", "NumFriends", "numfriends", "FriendsCount"] +}; +exports.StatusCodeReasons = { + 400: [ + "Bad Request (invalid values provided)", + "Invalid body type (content-type) sent", + "Bloxy sent an invalid request (from faulty code, feel free to check it out and submit an issue / PR)", + "(Roblox's fault for not saying) All data provided was valid but you don't have access to view the response or the requested data" + ], + 401: [ + "You're not logged in (use .login on the client to log in)", + "The cookie was not provided in the request, or invalid cookie provided" + ], + 403: [ + "A captcha is required", + "You don't have the proper permissions", + "You're not authorized" + ], + 404: [ + "Invalid request method (i.e. POST instead of GET)", + "Resource removed / updated to another route", + "You're not logged in (use .login on the client to log in)" + ], + 429: [ + "You're sending too many requests. Roblox has rate limits in place to prevent abuse", + "Your IP has sent too many requests" + ], + 500: [ + "Roblox is down", + "There is an error in Roblox's API handler (causing a server error)", + "Invalid body provided which results in the API failing" + ] +}; +var CreatorType; +(function (CreatorType) { + CreatorType[CreatorType["USER"] = 1] = "USER"; + CreatorType[CreatorType["GROUP"] = 2] = "GROUP"; +})(CreatorType = exports.CreatorType || (exports.CreatorType = {})); +var MorphAvatarType; +(function (MorphAvatarType) { + MorphAvatarType["R6"] = "MorphToR6"; + MorphAvatarType["R15"] = "MorphToR15"; +})(MorphAvatarType = exports.MorphAvatarType || (exports.MorphAvatarType = {})); +var GameGenre; +(function (GameGenre) { + GameGenre["FPS"] = "FPS"; +})(GameGenre = exports.GameGenre || (exports.GameGenre = {})); diff --git a/dist/util/converter.d.ts b/dist/util/converter.d.ts new file mode 100644 index 000000000..cd18f92de --- /dev/null +++ b/dist/util/converter.d.ts @@ -0,0 +1,2 @@ +export declare function generalIdentifierToNumber(identifier: string | number): number; +export declare function convertObjectToValue(dataObject: Record, namingConventions: string[]): unknown; diff --git a/dist/util/converter.js b/dist/util/converter.js new file mode 100644 index 000000000..2c912c06e --- /dev/null +++ b/dist/util/converter.js @@ -0,0 +1,21 @@ +"use strict"; +// Misc. "type" converter +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertObjectToValue = exports.generalIdentifierToNumber = void 0; +function generalIdentifierToNumber(identifier) { + if (typeof identifier === "string") { + return Number(identifier); + } + else { + return identifier; + } +} +exports.generalIdentifierToNumber = generalIdentifierToNumber; +/* eslint-disable security/detect-object-injection */ +function convertObjectToValue(dataObject, namingConventions) { + // eslint-disable-next-line security/detect-object-injection + return namingConventions + .map((name) => dataObject[name] || null) + .find((value) => !!value); +} +exports.convertObjectToValue = convertObjectToValue; diff --git a/dist/util/errors/errors.d.ts b/dist/util/errors/errors.d.ts new file mode 100644 index 000000000..839686735 --- /dev/null +++ b/dist/util/errors/errors.d.ts @@ -0,0 +1,13 @@ +interface BloxyHttpErrorOptions { + message: string; + name?: string; + statusMessage: string; + statusCode: number; + possibleReasons: string[]; +} +export declare class BloxyHttpError extends Error { + statusCode: number; + statusMessage: string; + constructor(options: BloxyHttpErrorOptions); +} +export {}; diff --git a/dist/util/errors/errors.js b/dist/util/errors/errors.js new file mode 100644 index 000000000..86ae467ac --- /dev/null +++ b/dist/util/errors/errors.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BloxyHttpError = void 0; +const constants_1 = require("../constants"); +class BloxyHttpError extends Error { + constructor(options) { + const statusRelatedIssues = constants_1.StatusCodeReasons[options.statusCode] + || []; + options.possibleReasons = [ + ...options.possibleReasons, + ...statusRelatedIssues + ]; + const revisedMessage = `\n\n${options.message} | Status code: ${options.statusCode}, status message: ${options.statusMessage}. ${options.possibleReasons.length > 0 + ? `Possible reasons:\n${options.possibleReasons + .map((r) => `- ${r}`) + .join("\n")}\n\n` + : ""}`; + super(revisedMessage); + this.name = options.name || "BloxyHttpError"; + this.statusCode = options.statusCode; + this.statusMessage = options.statusMessage; + } +} +exports.BloxyHttpError = BloxyHttpError; diff --git a/dist/util/errors/index.d.ts b/dist/util/errors/index.d.ts new file mode 100644 index 000000000..e74c2e775 --- /dev/null +++ b/dist/util/errors/index.d.ts @@ -0,0 +1,8 @@ +import * as errors from "./errors"; +declare const _default: { + messages: { + hello: string; + }; + errors: typeof errors; +}; +export default _default; diff --git a/dist/util/errors/index.js b/dist/util/errors/index.js new file mode 100644 index 000000000..a5a897484 --- /dev/null +++ b/dist/util/errors/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +const messages_1 = (0, tslib_1.__importDefault)(require("./messages")); +const errors = (0, tslib_1.__importStar)(require("./errors")); +exports.default = { + messages: messages_1.default, + errors +}; diff --git a/dist/util/errors/messages.d.ts b/dist/util/errors/messages.d.ts new file mode 100644 index 000000000..ed723916f --- /dev/null +++ b/dist/util/errors/messages.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + hello: string; +}; +export default _default; diff --git a/dist/util/errors/messages.js b/dist/util/errors/messages.js new file mode 100644 index 000000000..280bb32d3 --- /dev/null +++ b/dist/util/errors/messages.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + hello: "world" +}; diff --git a/dist/util/utilFunctions.d.ts b/dist/util/utilFunctions.d.ts new file mode 100644 index 000000000..b5a66d650 --- /dev/null +++ b/dist/util/utilFunctions.d.ts @@ -0,0 +1 @@ +export declare function utilMergeDeep, N extends Record>(baseObject: B, newObject: N): B & N; diff --git a/dist/util/utilFunctions.js b/dist/util/utilFunctions.js new file mode 100644 index 000000000..94dfb86b2 --- /dev/null +++ b/dist/util/utilFunctions.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.utilMergeDeep = void 0; +/* eslint-disable security/detect-object-injection */ +function utilMergeDeep(baseObject, newObject) { + const target = {}; + // Merge the object into the target object + const internalMerger = (obj) => { + for (const prop in obj) { + // eslint-disable-next-line no-prototype-builtins + if (obj.hasOwnProperty(prop)) { + if (Object.prototype.toString.call(obj[prop]) === "[object Object]") { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + target[prop] = utilMergeDeep(target[prop], obj[prop]); + } + else { + // Otherwise, do a regular merge + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + target[prop] = obj[prop]; + } + } + } + }; + internalMerger(baseObject); + internalMerger(newObject); + return target; +} +exports.utilMergeDeep = utilMergeDeep; diff --git a/package-lock.json b/package-lock.json index 2e4668b29..c97860967 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,1673 +1,1458 @@ { "name": "bloxy", - "version": "5.7.1", - "lockfileVersion": 1, + "version": "6.0.0-alpha", + "lockfileVersion": 2, "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "packages": { + "": { + "name": "bloxy", + "version": "6.0.0-alpha", + "license": "MIT", + "dependencies": { + "debug": "^4.3.1", + "got": "^11.8.3", + "signalr": "^2.4.2", + "signalr-client": "0.0.20", + "tough-cookie": "^4.0.0", + "tslib": "^2.1.0" + }, + "devDependencies": { + "@types/chai": "^4.3.0", + "@types/debug": "^4.1.5", + "@types/lodash": "^4.14.167", + "@types/mocha": "^9.0.0", + "@types/node": "^16.11.19", + "@types/tough-cookie": "^4.0.0", + "@types/websocket": "^1.0.1", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "chai": "^4.3.4", + "codacy-coverage": "^3.4.0", + "eslint": "^8.6.0", + "eslint-plugin-security": "^1.4.0", + "faker": "^5.1.0", + "fast-check": "^2.13.0", + "joi": "^17.3.0", + "mocha": "^9.1.3", + "nyc": "^15.1.0", + "ts-node": "^10.4.0", + "typedoc": "^0.22.10", + "typedoc-plugin-markdown": "^3.5.0", + "typedoc-plugin-markdown-pages": "^0.3.0", + "typescript": "^4.5.4" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/core": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", + "node_modules/@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", + "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", + "semver": "^6.3.0", "source-map": "^0.5.0" }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, - "@babel/generator": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "requires": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } + "bin": { + "semver": "bin/semver.js" } }, - "@babel/helper-function-name": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", + "node_modules/@babel/core/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" + "engines": { + "node": ">=0.10.0" } }, - "@babel/helper-get-function-arity": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", + "node_modules/@babel/generator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", "dev": true, - "requires": { - "@babel/types": "^7.12.10" + "dependencies": { + "@babel/types": "^7.16.7", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true, - "requires": { - "@babel/types": "^7.12.7" + "engines": { + "node": ">=0.10.0" } }, - "@babel/helper-module-imports": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "node_modules/@babel/helper-compilation-targets": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", "dev": true, - "requires": { - "@babel/types": "^7.12.5" + "dependencies": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "@babel/helper-module-transforms": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" } }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, - "requires": { - "@babel/types": "^7.12.10" + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-plugin-utils": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", - "dev": true - }, - "@babel/helper-replace-supers": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", + "node_modules/@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" + "dependencies": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-simple-access": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, - "requires": { - "@babel/types": "^7.12.1" + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-split-export-declaration": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", + "node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, - "requires": { - "@babel/types": "^7.12.11" + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "@babel/helpers": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, - "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "node_modules/@babel/helper-module-transforms": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/parser": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", - "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", - "dev": true + "node_modules/@babel/helper-simple-access": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": ">=6.9.0" } }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", - "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "engines": { + "node": ">=6.9.0" } }, - "@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "node_modules/@babel/helpers": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "node_modules/@babel/highlight": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "dependencies": { + "color-name": "1.1.3" } }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": ">=0.8.0" } }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "engines": { + "node": ">=4" } }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", - "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "node_modules/@babel/parser": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" } }, - "@babel/template": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", - "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.12.7", - "@babel/types": "^7.12.7" + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" } }, - "@babel/traverse": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.10.tgz", - "integrity": "sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg==", + "node_modules/@babel/traverse": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.12.10", - "@babel/types": "^7.12.10", + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "engines": { + "node": ">=6.9.0" } }, - "@babel/types": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.11.tgz", - "integrity": "sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA==", + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "engines": { + "node": ">= 12" + } }, - "@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", "dev": true, - "requires": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" } }, - "@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "node_modules/@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", "dev": true, - "requires": { + "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "lodash": "^4.17.20", + "js-yaml": "^4.1.0", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "@hapi/hoek": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.1.1.tgz", - "integrity": "sha512-CAEbWH7OIur6jEOzaai83jq3FmKmv4PmX1JYfs9IrYcGEVI/lyL1EXJGCj7eFVJ0bg5QR8LMxBlEtA+xKiLpFw==", + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@hapi/hoek": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", + "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==", "dev": true }, - "@hapi/topo": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz", - "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==", + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", "dev": true, - "requires": { + "dependencies": { "@hapi/hoek": "^9.0.0" } }, - "@istanbuljs/load-nyc-config": { + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, - "requires": { + "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, - "dependencies": { - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } + "engines": { + "node": ">=8" } }, - "@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true - }, - "@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", - "slash": "^3.0.0" - } - }, - "@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", - "dev": true, - "requires": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2" - } - }, - "@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", - "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - } - }, - "@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" - } - }, - "@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", - "dev": true, - "requires": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", - "slash": "^3.0.0", - "source-map": "^0.6.0", - "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" - } - }, - "@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", - "dev": true, - "requires": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" + "dependencies": { + "sprintf-js": "~1.0.2" } }, - "@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "requires": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" + "engines": { + "node": ">=8" } }, - "@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", - "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", - "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" + "engines": { + "node": ">=8" } }, - "@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" } }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" + "engines": { + "node": ">= 8" } }, - "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.4", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" } }, - "@sideway/address": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.1.tgz", - "integrity": "sha512-+I5aaQr3m0OAmMr7RQ3fR9zx55sejEYR2BFJaxL+zT3VM2611X0SHvPWIbAUBZVTn/YzYKbV8gJ2oT/QELknfQ==", + "node_modules/@sideway/address": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", + "integrity": "sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==", "dev": true, - "requires": { + "dependencies": { "@hapi/hoek": "^9.0.0" } }, - "@sideway/formula": { + "node_modules/@sideway/formula": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", "dev": true }, - "@sideway/pinpoint": { + "node_modules/@sideway/pinpoint": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", "dev": true }, - "@sindresorhus/is": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.0.tgz", - "integrity": "sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ==", - "dev": true - }, - "@sinonjs/commons": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.1.tgz", - "integrity": "sha512-892K+kWUUi3cl+LlqEWIDrhvLgdL79tECi8JZUyq6IviKy/DNhuzCRlbHUjxK89f4ypPMMaFnFuR9Ie6DoIMsw==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" + "node_modules/@sindresorhus/is": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", + "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "@szmarczak/http-timer": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz", - "integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==", - "dev": true, - "requires": { + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dependencies": { "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, - "@types/babel__core": { - "version": "7.1.12", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", - "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true }, - "@types/babel__generator": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", - "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true }, - "@types/babel__template": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", - "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true }, - "@types/babel__traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.0.tgz", - "integrity": "sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0" - } + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true }, - "@types/cacheable-request": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz", - "integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==", - "dev": true, - "requires": { + "node_modules/@types/cacheable-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", + "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "dependencies": { "@types/http-cache-semantics": "*", "@types/keyv": "*", "@types/node": "*", "@types/responselike": "*" } }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", - "dev": true - }, - "@types/graceful-fs": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", - "integrity": "sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/http-cache-semantics": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", - "integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==", - "dev": true - }, - "@types/istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "node_modules/@types/chai": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", "dev": true }, - "@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "node_modules/@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*" + "dependencies": { + "@types/ms": "*" } }, - "@types/istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", - "dev": true, - "requires": { - "@types/istanbul-lib-report": "*" - } + "node_modules/@types/http-cache-semantics": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, - "@types/keyv": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz", - "integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==", - "dev": true, - "requires": { + "node_modules/@types/keyv": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", + "integrity": "sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==", + "dependencies": { "@types/node": "*" } }, - "@types/lodash": { - "version": "4.14.168", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", - "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "node_modules/@types/lodash": { + "version": "4.14.178", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", + "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==", "dev": true }, - "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==", + "node_modules/@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", "dev": true }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "node_modules/@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", "dev": true }, - "@types/prettier": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", - "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", - "dev": true + "node_modules/@types/node": { + "version": "16.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz", + "integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng==" }, - "@types/responselike": { + "node_modules/@types/responselike": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "dev": true, - "requires": { + "dependencies": { "@types/node": "*" } }, - "@types/stack-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", - "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", - "dev": true - }, - "@types/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==", + "node_modules/@types/tough-cookie": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.1.tgz", + "integrity": "sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg==", "dev": true }, - "@types/websocket": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.1.tgz", - "integrity": "sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q==", + "node_modules/@types/websocket": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.4.tgz", + "integrity": "sha512-qn1LkcFEKK8RPp459jkjzsfpbsx36BBt3oC3pITYtkoBw/aVX+EZFa5j3ThCRTNpLFvIMr5dSTD4RaMdilIOpA==", "dev": true, - "requires": { + "dependencies": { "@types/node": "*" } }, - "@types/yargs": { - "version": "15.0.12", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.12.tgz", - "integrity": "sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz", + "integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==", "dev": true, - "requires": { - "@types/yargs-parser": "*" + "dependencies": { + "@typescript-eslint/experimental-utils": "5.9.0", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/type-utils": "5.9.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "@types/yargs-parser": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", - "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.15.2.tgz", - "integrity": "sha512-uiQQeu9tWl3f1+oK0yoAv9lt/KXO24iafxgQTkIYO/kitruILGx3uH+QtIAHqxFV+yIsdnJH+alel9KuE3J15Q==", + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz", + "integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==", "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.15.2", - "@typescript-eslint/scope-manager": "4.15.2", - "debug": "^4.1.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "@typescript-eslint/experimental-utils": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.15.2.tgz", - "integrity": "sha512-Fxoshw8+R5X3/Vmqwsjc8nRO/7iTysRtDqx6rlfLZ7HbT8TZhPeQqbPjTyk2RheH3L8afumecTQnUc9EeXxohQ==", + "node_modules/@typescript-eslint/parser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz", + "integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==", "dev": true, - "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.15.2", - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/typescript-estree": "4.15.2", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "dependencies": { + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "@typescript-eslint/parser": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.15.2.tgz", - "integrity": "sha512-SHeF8xbsC6z2FKXsaTb1tBCf0QZsjJ94H6Bo51Y1aVEZ4XAefaw5ZAilMoDPlGghe+qtq7XdTiDlGfVTOmvA+Q==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz", + "integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==", "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "4.15.2", - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/typescript-estree": "4.15.2", - "debug": "^4.1.1" + "dependencies": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "@typescript-eslint/scope-manager": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.15.2.tgz", - "integrity": "sha512-Zm0tf/MSKuX6aeJmuXexgdVyxT9/oJJhaCkijv0DvJVT3ui4zY6XYd6iwIo/8GEZGy43cd7w1rFMiCLHbRzAPQ==", + "node_modules/@typescript-eslint/type-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz", + "integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/visitor-keys": "4.15.2" + "dependencies": { + "@typescript-eslint/experimental-utils": "5.9.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "@typescript-eslint/types": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.15.2.tgz", - "integrity": "sha512-r7lW7HFkAarfUylJ2tKndyO9njwSyoy6cpfDKWPX6/ctZA+QyaYscAHXVAfJqtnY6aaTwDYrOhp+ginlbc7HfQ==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.2.tgz", - "integrity": "sha512-cGR8C2g5SPtHTQvAymEODeqx90pJHadWsgTtx6GbnTWKqsg7yp6Eaya9nFzUd4KrKhxdYTTFBiYeTPQaz/l8bw==", + "node_modules/@typescript-eslint/types": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz", + "integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/visitor-keys": "4.15.2", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "@typescript-eslint/visitor-keys": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.2.tgz", - "integrity": "sha512-TME1VgSb7wTwgENN5KVj4Nqg25hP8DisXxNBojM4Nn31rYaNDIocNm5cmjOFfh42n7NVERxWrDFoETO/76ePyg==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz", + "integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "eslint-visitor-keys": "^2.0.0" + "dependencies": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "@typescript-eslint/scope-manager": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.15.2.tgz", - "integrity": "sha512-Zm0tf/MSKuX6aeJmuXexgdVyxT9/oJJhaCkijv0DvJVT3ui4zY6XYd6iwIo/8GEZGy43cd7w1rFMiCLHbRzAPQ==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz", + "integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/visitor-keys": "4.15.2" + "dependencies": { + "@typescript-eslint/types": "5.9.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "@typescript-eslint/types": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.15.2.tgz", - "integrity": "sha512-r7lW7HFkAarfUylJ2tKndyO9njwSyoy6cpfDKWPX6/ctZA+QyaYscAHXVAfJqtnY6aaTwDYrOhp+ginlbc7HfQ==", + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, - "@typescript-eslint/typescript-estree": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.15.2.tgz", - "integrity": "sha512-cGR8C2g5SPtHTQvAymEODeqx90pJHadWsgTtx6GbnTWKqsg7yp6Eaya9nFzUd4KrKhxdYTTFBiYeTPQaz/l8bw==", + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "@typescript-eslint/visitor-keys": "4.15.2", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, - "@typescript-eslint/visitor-keys": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.15.2.tgz", - "integrity": "sha512-TME1VgSb7wTwgENN5KVj4Nqg25hP8DisXxNBojM4Nn31rYaNDIocNm5cmjOFfh42n7NVERxWrDFoETO/76ePyg==", + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "requires": { - "@typescript-eslint/types": "4.15.2", - "eslint-visitor-keys": "^2.0.0" + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true - }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true - }, - "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true - }, - "ajv": { + "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "requires": { + "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "ansi-colors": { + "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", "dev": true, - "requires": { - "type-fest": "^0.11.0" - }, - "dependencies": { - "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", - "dev": true - } + "engines": { + "node": ">=6" } }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "requires": { - "color-convert": "^1.9.0" + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, - "requires": { + "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" } }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, - "requires": { - "sprintf-js": "~1.0.2" + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "array-union": { + "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, - "requires": { + "dependencies": { "safer-buffer": "~2.1.0" } }, - "assert-plus": { + "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8" + } }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } }, - "asynckit": { + "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { + "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true + "dev": true, + "engines": { + "node": "*" + } }, - "aws4": { + "node_modules/aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, - "babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", - "dev": true, - "requires": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "slash": "^3.0.0" - } - }, - "babel-plugin-istanbul": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", - "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^4.0.0", - "test-exclude": "^6.0.0" - } - }, - "babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", - "dev": true, - "requires": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", - "@types/babel__traverse": "^7.0.6" - } - }, - "babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "requires": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - } - }, - "babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", - "dev": true, - "requires": { - "babel-plugin-jest-hoist": "^26.6.2", - "babel-preset-current-node-syntax": "^1.0.0" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "bcrypt-pbkdf": { + "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "requires": { + "dependencies": { "tweetnacl": "^0.14.3" } }, - "bluebird": { + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, - "brace-expansion": { + "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "requires": { + "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "braces": { + "node_modules/braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "requires": { + "dependencies": { "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" } }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "browser-stdout": { + "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "node_modules/browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", "dev": true, - "requires": { - "node-int64": "^0.4.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "bufferutil": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", - "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", - "requires": { - "node-gyp-build": "^4.2.0" + "dependencies": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" } }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "node_modules/bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" } }, - "cacheable-lookup": { + "node_modules/cacheable-lookup": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true + "engines": { + "node": ">=10.6.0" + } }, - "cacheable-request": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz", - "integrity": "sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw==", - "dev": true, - "requires": { + "node_modules/cacheable-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "dependencies": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", "http-cache-semantics": "^4.0.0", "keyv": "^4.0.0", "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", + "normalize-url": "^6.0.1", "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" } }, - "callsites": { + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "dependencies": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=6" + } }, - "camelcase": { + "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "dev": true, + "engines": { + "node": ">=6" + } }, - "capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "node_modules/caniuse-lite": { + "version": "1.0.30001296", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001296.tgz", + "integrity": "sha512-WfrtPEoNSoeATDlf4y3QvkwiELl9GyPLISV5GejTbbQRtQx4LhsXmc9IQ6XCL2d7UxCyEzToEZNMeqR79OUw8Q==", "dev": true, - "requires": { - "rsvp": "^4.8.4" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" } }, - "caseless": { + "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "node_modules/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", "dev": true, - "requires": { + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "char-regex": { + "node_modules/check-error": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } + "engines": { + "node": "*" } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - } + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" } }, - "clone-response": { + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, - "requires": { + "dependencies": { "mimic-response": "^1.0.0" } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "codacy-coverage": { + "node_modules/codacy-coverage": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/codacy-coverage/-/codacy-coverage-3.4.0.tgz", "integrity": "sha512-A0ats3/gZtOw76muu++HZ6QrInztWjjLefkLJmmBpjPfyn6nNwNLoApmGmj3F3dfgl2+o6u5GwPnUBkKdfKXTQ==", + "deprecated": "Package being deprecated in favor of https://github.com/codacy/codacy-coverage-reporter", "dev": true, - "requires": { + "dependencies": { "bluebird": "^3.5.x", "commander": "^2.x", "jacoco-parse": "^2.x", @@ -1678,2565 +1463,6110 @@ "request": "^2.88.0", "request-promise": "^4.x" }, - "dependencies": { - "joi": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz", - "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==", - "dev": true, - "requires": { - "hoek": "5.x.x", - "isemail": "3.x.x", - "topo": "3.x.x" - } - } + "bin": { + "codacy-coverage": "bin/codacy-coverage.js" + }, + "engines": { + "node": ">= 8.12.0" } }, - "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "node_modules/codacy-coverage/node_modules/joi": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz", + "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" + "dependencies": { + "hoek": "5.x.x", + "isemail": "3.x.x", + "topo": "3.x.x" + }, + "engines": { + "node": ">=8.9.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "requires": { - "color-name": "1.1.3" + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "combined-stream": { + "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, - "requires": { + "dependencies": { "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "commander": { + "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, - "requires": { + "dependencies": { "safe-buffer": "~5.1.1" } }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { + "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "cross-spawn": { + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "requires": { + "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" - } - }, - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, - "requires": { - "cssom": "~0.3.6" }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - } + "engines": { + "node": ">= 8" } }, - "d": { + "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "requires": { + "dependencies": { "es5-ext": "^0.10.50", "type": "^1.0.1" } }, - "dashdash": { + "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "dev": true, - "requires": { + "dependencies": { "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" } }, - "data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { + "node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dependencies": { "ms": "2.1.2" }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decimal.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", - "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "decompress-response": { + "node_modules/decompress-response": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "requires": { + "dependencies": { "mimic-response": "^3.1.0" }, - "dependencies": { - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true - } + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } }, - "defer-to-connect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz", - "integrity": "sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg==", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "node_modules/default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "delayed-stream": { + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "engines": { + "node": ">=10" + } + }, + "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.4.0" + } }, - "diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } }, - "dir-glob": { + "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, - "requires": { + "dependencies": { "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "doctrine": { + "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "requires": { + "dependencies": { "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, - "requires": { - "webidl-conversions": "^5.0.0" }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } + "engines": { + "node": ">=6.0.0" } }, - "ecc-jsbn": { + "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "requires": { + "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, - "emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "node_modules/electron-to-chromium": { + "version": "1.4.37", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.37.tgz", + "integrity": "sha512-XIvFB1omSAxYgHYX48sC+HR8i/p7lx7R+0cX9faElg1g++h9IilCrJ12+bQuY+d96Wp7zkBiJwMOv+AhLtLrTg==", "dev": true }, - "emoji-regex": { + "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "end-of-stream": { + "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { + "dependencies": { "once": "^1.4.0" } }, - "enquirer": { + "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", "dev": true, - "requires": { + "dependencies": { "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es5-ext": { + "node_modules/es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", - "requires": { + "dependencies": { "es6-iterator": "~2.0.3", "es6-symbol": "~3.1.3", "next-tick": "~1.0.0" } }, - "es6-iterator": { + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "node_modules/es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "requires": { + "dependencies": { "d": "1", "es5-ext": "^0.10.35", "es6-symbol": "^3.1.1" } }, - "es6-symbol": { + "node_modules/es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "requires": { + "dependencies": { "d": "^1.0.1", "ext": "^1.1.2" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "engines": { + "node": ">=10" }, - "dependencies": { - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "eslint": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.20.0.tgz", - "integrity": "sha512-qGi0CTcOGP2OtCQBgWZlQjcTuP0XkIpYFj25XtRTQSHC+umNnp7UMshr2G8SLsRFYDdAPFeHOsiteadmMH02Yw==", + "node_modules/eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.3.0", + "dependencies": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^6.0.0", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^3.1.0", + "regexpp": "^3.2.0", "semver": "^7.2.1", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, - "dependencies": { - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "eslint-plugin-security": { + "node_modules/eslint-plugin-security": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz", "integrity": "sha512-xlS7P2PLMXeqfhyf3NpqbvbnW04kN8M9NtmhpR3XGyOvt/vNKS7XPXT5EDbwKW9vCjWH4PpfQvgD/+JgN0VJKA==", "dev": true, - "requires": { + "dependencies": { "safe-regex": "^1.1.0" } }, - "eslint-scope": { + "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, - "requires": { + "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" } }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, - "requires": { - "acorn": "^7.4.0", + "engines": { + "node": ">= 4" + } + }, + "node_modules/espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "dependencies": { + "acorn": "^8.7.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "eslint-visitor-keys": "^3.1.0" }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "esprima": { + "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, - "esquery": { + "node_modules/esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, - "requires": { + "dependencies": { "estraverse": "^5.1.0" }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } + "engines": { + "node": ">=0.10" } }, - "esrecurse": { + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "requires": { + "dependencies": { "estraverse": "^5.2.0" }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } + "engines": { + "node": ">=4.0" } }, - "estraverse": { + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "dev": true, + "engines": { + "node": ">=4.0" + } }, - "esutils": { + "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "dependencies": { + "type": "^2.5.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, - "exec-sh": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", - "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==", + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/faker": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/faker/-/faker-5.5.3.tgz", + "integrity": "sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g==", "dev": true }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "node_modules/fast-check": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.20.0.tgz", + "integrity": "sha512-tFNjLyPnOUg6iimVxOtoWMJOIyybCo7B8gUGm1yv43jDCQ0hlPUn0fmna/XO/n1yPxn/dxQw3+IygPSbMDiiog==", "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } + "pure-rand": "^5.0.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" } }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" } }, - "expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" - }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", - "requires": { - "type": "^2.0.0" + "is-glob": "^4.0.1" }, - "dependencies": { - "type": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==" - } + "engines": { + "node": ">= 6" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } + "reusify": "^1.0.4" } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" + "dependencies": { + "flat-cache": "^3.0.4" }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "faker": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/faker/-/faker-5.4.0.tgz", - "integrity": "sha512-Y9n/Ky/xZx/Bj8DePvXspUYRtHl/rGQytoIT5LaxmNwSe3wWyOeOXb3lT6Dpipq240PVpeFaGKzScz/5fvff2g==", - "dev": true - }, - "fast-check": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.13.0.tgz", - "integrity": "sha512-IOfzKm/SCA+jpUEgAfqAuxHYPmgtmpnnwljQmYPRGrqYczcTKApXKHza/SNxFxYkecWfZilYa0DJdBvqz1bcSw==", - "dev": true, - "requires": { - "pure-rand": "^4.1.1" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastq": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", - "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", - "dev": true, - "requires": { - "bser": "2.1.1" - } - }, - "file-entry-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", - "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, - "requires": { - "to-regex-range": "^5.0.1" + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "find-up": { + "node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "requires": { + "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "flat-cache": { + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, - "requires": { + "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" } }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "node_modules/flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", "dev": true }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true + "node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } }, - "forever-agent": { + "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, - "requires": { - "map-cache": "^0.2.2" + "engines": { + "node": "*" } }, - "fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "dependencies": { - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } - } + ] }, - "fs.realpath": { + "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.2.1.tgz", - "integrity": "sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA==", + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } }, - "functional-red-black-tree": { + "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "gensync": { + "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, - "get-caller-file": { + "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } }, - "get-package-type": { + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, - "requires": { - "pump": "^3.0.0" + "engines": { + "node": ">=8.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { + "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "dev": true, - "requires": { + "dependencies": { "assert-plus": "^1.0.0" } }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, - "requires": { + "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "requires": { - "is-glob": "^4.0.1" + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" } }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, - "requires": { - "type-fest": "^0.8.1" + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, - "requires": { + "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.1.1", "ignore": "^5.1.4", "merge2": "^1.3.0", "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "got": { - "version": "11.8.1", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.1.tgz", - "integrity": "sha512-9aYdZL+6nHmvJwHALLwKSUZ0hMwGaJGYv3hoPLPgnT8BoBXm1SjnZeky+91tfwJaDzun2s4RsBRy48IEYv2q2Q==", - "dev": true, - "requires": { + "node_modules/got": { + "version": "11.8.3", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.3.tgz", + "integrity": "sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg==", + "dependencies": { "@sindresorhus/is": "^4.0.0", "@szmarczak/http-timer": "^4.0.5", "@types/cacheable-request": "^6.0.1", "@types/responselike": "^1.0.0", "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.1", + "cacheable-request": "^7.0.2", "decompress-response": "^6.0.0", "http2-wrapper": "^1.0.0-beta.5.2", "lowercase-keys": "^2.0.0", "p-cancelable": "^2.0.0", "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, - "growl": { + "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", "dev": true, - "optional": true + "engines": { + "node": ">=4.x" + } }, - "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, - "requires": { + "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.0", "source-map": "^0.6.1", - "uglify-js": "^3.1.4", "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, - "har-schema": { + "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "har-validator": { + "node_modules/har-validator": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", "dev": true, - "requires": { + "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "requires": { - "function-bind": "^1.1.1" + "engines": { + "node": ">=8" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "node_modules/hasha/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "engines": { + "node": ">=8" } }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } }, - "hoek": { + "node_modules/hoek": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz", "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==", - "dev": true - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", "dev": true, - "requires": { - "whatwg-encoding": "^1.0.5" + "engines": { + "node": ">=8.9.0" } }, - "html-escaper": { + "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "http-cache-semantics": { + "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" }, - "http-signature": { + "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, - "requires": { + "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" } }, - "http2-wrapper": { - "version": "1.0.0-beta.5.2", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz", - "integrity": "sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ==", - "dev": true, - "requires": { + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dependencies": { "quick-lru": "^5.1.1", "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" } }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "engines": { + "node": ">= 4" } }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - }, - "import-fresh": { + "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "requires": { + "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "imurmurhash": { + "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.19" + } }, - "inflight": { + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "requires": { + "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, - "ip-regex": { + "node_modules/is-binary-path": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-core-module": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", - "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "binary-extensions": "^2.0.0" }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } + "engines": { + "node": ">=8" } }, - "is-docker": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", - "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", - "dev": true, - "optional": true - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { + "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "is-fullwidth-code-point": { + "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=8" + } }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "requires": { + "dependencies": { "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "is-number": { + "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, - "requires": { - "isobject": "^3.0.1" + "engines": { + "node": ">=0.12.0" } }, - "is-potential-custom-element-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", - "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", - "dev": true + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "is-typedarray": { + "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "is-windows": { + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, - "optional": true, - "requires": { - "is-docker": "^2.0.0" + "engines": { + "node": ">=0.10.0" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isemail": { + "node_modules/isemail": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", "dev": true, - "requires": { + "dependencies": { "punycode": "2.x.x" + }, + "engines": { + "node": ">=4.0.0" } }, - "isexe": { + "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { + "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "dependencies": { + "append-transform": "^2.0.0" }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "engines": { + "node": ">=8" } }, - "istanbul-lib-report": { + "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, - "requires": { + "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "engines": { + "node": ">=8" } }, - "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, - "requires": { + "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "engines": { + "node": ">=10" } }, - "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "node_modules/istanbul-reports": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", "dev": true, - "requires": { + "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "jacoco-parse": { + "node_modules/jacoco-parse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/jacoco-parse/-/jacoco-parse-2.0.1.tgz", "integrity": "sha512-YGhIb2iXuQ4/zNh2zgHd6Z6dqlYwLYH1wfsxtTNQ+jnHH9PhhuMwqOFihXymSI41trxok48LdKkSeDIWs28tYg==", "dev": true, - "requires": { + "dependencies": { "mocha": "^5.2.0", "xml2js": "^0.4.9" } }, - "jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", - "dev": true, - "requires": { - "@jest/core": "^26.6.3", - "import-local": "^3.0.2", - "jest-cli": "^26.6.3" - }, - "dependencies": { - "jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", - "dev": true, - "requires": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" - } - } - } + "node_modules/jacoco-parse/node_modules/commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true }, - "jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "node_modules/jacoco-parse/node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" - }, "dependencies": { - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - } + "ms": "2.0.0" } }, - "jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", - "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" - } - }, - "jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "node_modules/jacoco-parse/node_modules/diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "engines": { + "node": ">=0.3.1" } }, - "jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", + "node_modules/jacoco-parse/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true, - "requires": { - "detect-newline": "^3.0.0" + "engines": { + "node": ">=0.8.0" } }, - "jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "node_modules/jacoco-parse/node_modules/glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" - } - }, - "jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" - } - }, - "jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - } - }, - "jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", - "dev": true - }, - "jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" - } - }, - "jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", - "dev": true, - "requires": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" - } - }, - "jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", - "dev": true, - "requires": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" } }, - "jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "node_modules/jacoco-parse/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, - "requires": { - "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" + "engines": { + "node": ">=4" } }, - "jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "node_modules/jacoco-parse/node_modules/he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.2" + "bin": { + "he": "bin/he" } }, - "jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "node_modules/jacoco-parse/node_modules/mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*" + "dependencies": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 4.0.0" } }, - "jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true - }, - "jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "node_modules/jacoco-parse/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", - "slash": "^3.0.0" - } - }, - "jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" - } - }, - "jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" - } - }, - "jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" - } - }, - "jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", - "dev": true, - "requires": { - "@types/node": "*", - "graceful-fs": "^4.2.4" - } - }, - "jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", - "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" - } - }, - "jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" - } - }, - "jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "node_modules/jacoco-parse/node_modules/supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "leven": "^3.1.0", - "pretty-format": "^26.6.2" - }, "dependencies": { - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - } - } - }, - "jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", - "dev": true, - "requires": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "jest-util": "^26.6.2", - "string-length": "^4.0.1" - } - }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" + "has-flag": "^3.0.0" }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "engines": { + "node": ">=4" } }, - "joi": { - "version": "17.4.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz", - "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==", + "node_modules/joi": { + "version": "17.5.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.5.0.tgz", + "integrity": "sha512-R7hR50COp7StzLnDi4ywOXHrBrgNXuUUfJWIR5lPY5Bm/pOD3jZaTwpluUXVLRWcoWZxkrHBBJ5hLxgnlehbdw==", "dev": true, - "requires": { + "dependencies": { "@hapi/hoek": "^9.0.0", "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.0", + "@sideway/address": "^4.1.3", "@sideway/formula": "^3.0.0", "@sideway/pinpoint": "^2.0.0" } }, - "js-tokens": { + "node_modules/jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, + "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "jsbn": { + "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, - "jsdom": { - "version": "16.4.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz", - "integrity": "sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "acorn": "^7.1.1", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.2.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.0", - "domexception": "^2.0.1", - "escodegen": "^1.14.1", - "html-encoding-sniffer": "^2.0.1", - "is-potential-custom-element-name": "^1.0.0", - "nwsapi": "^2.2.0", - "parse5": "5.1.1", - "request": "^2.88.2", - "request-promise-native": "^1.0.8", - "saxes": "^5.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^3.0.1", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0", - "ws": "^7.2.3", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "tough-cookie": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", - "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", - "dev": true, - "requires": { - "ip-regex": "^2.1.0", - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, - "jsesc": { + "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } }, - "json-buffer": { + "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, - "json-schema-traverse": { + "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "json-stable-stringify-without-jsonify": { + "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { + "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "node_modules/json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, - "requires": { + "dependencies": { "minimist": "^1.2.5" - } - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" }, - "dependencies": { - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - } + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, - "requires": { + "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" } }, - "keyv": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz", - "integrity": "sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA==", - "dev": true, - "requires": { + "node_modules/keyv": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", + "integrity": "sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==", + "dependencies": { "json-buffer": "3.0.1" } }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true - }, - "lcov-parse": { + "node_modules/lcov-parse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", - "dev": true - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true + "dev": true, + "bin": { + "lcov-parse": "bin/cli.js" + } }, - "levn": { + "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "requires": { + "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "locate-path": { + "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "requires": { + "dependencies": { "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, - "log-driver": { + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true + "dev": true, + "engines": { + "node": ">=0.8.6" + } }, - "lowercase-keys": { + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true + "engines": { + "node": ">=8" + } }, - "lru-cache": { + "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, - "requires": { + "dependencies": { "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "lunr": { + "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, - "make-dir": { + "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, - "requires": { + "dependencies": { "semver": "^6.0.0" }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "requires": { - "tmpl": "1.0.x" + "bin": { + "semver": "bin/semver.js" } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "node_modules/marked": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", "dev": true, - "requires": { - "object-visit": "^1.0.0" + "bin": { + "marked": "bin/marked" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true, + "dependencies": { + "minimist": "0.0.8" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mkdirp/node_modules/minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "node_modules/mocha": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "node_modules/node-gyp-build": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=8.9" + } + }, + "node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/nyc/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nyc/node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "dependencies": { + "fromentries": "^1.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.0.tgz", + "integrity": "sha512-lD2/y78q+7HqBx2SaT6OT4UcwtvXNRfEpzYEzl0EQ+9gZq2Qi3fa0HDnYPeqQwhlHJFBUhT7AO3mLU3+8bynHA==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + }, + "node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "dependencies": { + "es6-error": "^4.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.6.tgz", + "integrity": "sha512-HCHI3DJJUakkOr8fNoCc73E5nU5bqITjOYFMDrKHYOXWXrgD/SBaC7LjwuPymUprRyuF06UK7hd/lMHkmUXglQ==", + "deprecated": "request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "bluebird": "^3.5.0", + "request-promise-core": "1.1.4", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/request-promise-core": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.19" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/request-promise/node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/request/node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/responselike": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", + "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", + "dependencies": { + "lowercase-keys": "^2.0.0" + } + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shiki": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", + "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "5.2.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "node_modules/signalr": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/signalr/-/signalr-2.4.2.tgz", + "integrity": "sha512-XqFRQRbRr8Ce1GYq3/aWwnQKPHWEOTjmRT32196sZEmZQmsEEpu5LzjvxrpxxedUoI/oWu9YlqkqK8KrbSYw/w==", + "dependencies": { + "jquery": ">=1.6.4" + } + }, + "node_modules/signalr-client": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/signalr-client/-/signalr-client-0.0.20.tgz", + "integrity": "sha512-4gscZW3jcrbwXb2dZJL0N40qHQyK08ejH6JYE35nNm+aM2eUu56vKtcEq44zTGIdwoRGJ/SO4TO3nwfZ0LFj3A==", + "deprecated": "This is no longer active", + "dependencies": { + "websocket": "^1.0.28" + }, + "engines": { + "node": "*" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/topo": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", + "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==", + "deprecated": "This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.", + "dev": true, + "dependencies": { + "hoek": "6.x.x" + } + }, + "node_modules/topo/node_modules/hoek": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz", + "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==", + "deprecated": "This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.", + "dev": true + }, + "node_modules/tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typedoc": { + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", + "dev": true, + "dependencies": { + "glob": "^7.2.0", + "lunr": "^2.3.9", + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 12.10.0" + }, + "peerDependencies": { + "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "3.11.9", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.9.tgz", + "integrity": "sha512-wgJWPfq2wXMktfeBBx1ZObQw2a02Qz0F67juYt6urCY9PYpAX38XcB2d2Nb4grymn95X/ThwtU5PaK2eWyq7AQ==", + "dev": true, + "dependencies": { + "handlebars": "^4.7.7" + }, + "peerDependencies": { + "typedoc": ">=0.22.0" + } + }, + "node_modules/typedoc-plugin-markdown-pages": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown-pages/-/typedoc-plugin-markdown-pages-0.3.0.tgz", + "integrity": "sha512-QVWs6eL0BEOiRgJm6wRRgE8kESFv85HlefLv14ZbMM2VQ1HqErVeT9ukbhkYMznsD/juAsX3Xc5M+Ju7/ZDq4Q==", + "dev": true + }, + "node_modules/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uglify-js": { + "version": "3.14.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", + "integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.8.tgz", + "integrity": "sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/vscode-oniguruma": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", + "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "dev": true + }, + "node_modules/vscode-textmate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", + "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", + "dev": true + }, + "node_modules/websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "dependencies": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/websocket/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/websocket/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "node_modules/workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dev": true, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "engines": { + "node": ">=0.10.32" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true + }, + "@babel/core": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-compilation-targets": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-module-transforms": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-simple-access": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true + }, + "@babel/helpers": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", + "dev": true, + "requires": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/highlight": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==", + "dev": true + }, + "@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/traverse": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + } + }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@hapi/hoek": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.1.tgz", + "integrity": "sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==", + "dev": true + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@sideway/address": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.3.tgz", + "integrity": "sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@sideway/formula": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", + "dev": true + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "dev": true + }, + "@sindresorhus/is": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", + "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==" + }, + "@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "requires": { + "defer-to-connect": "^2.0.0" + } + }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "@types/cacheable-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", + "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "requires": { + "@types/http-cache-semantics": "*", + "@types/keyv": "*", + "@types/node": "*", + "@types/responselike": "*" + } + }, + "@types/chai": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "dev": true + }, + "@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "dev": true, + "requires": { + "@types/ms": "*" + } + }, + "@types/http-cache-semantics": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", + "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "@types/keyv": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.3.tgz", + "integrity": "sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==", + "requires": { + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.178", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", + "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==", + "dev": true + }, + "@types/mocha": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", + "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "dev": true + }, + "@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==", + "dev": true + }, + "@types/node": { + "version": "16.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.19.tgz", + "integrity": "sha512-BPAcfDPoHlRQNKktbsbnpACGdypPFBuX4xQlsWDE7B8XXcfII+SpOLay3/qZmCLb39kV5S1RTYwXdkx2lwLYng==" + }, + "@types/responselike": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", + "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "requires": { + "@types/node": "*" + } + }, + "@types/tough-cookie": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.1.tgz", + "integrity": "sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg==", + "dev": true + }, + "@types/websocket": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.4.tgz", + "integrity": "sha512-qn1LkcFEKK8RPp459jkjzsfpbsx36BBt3oC3pITYtkoBw/aVX+EZFa5j3ThCRTNpLFvIMr5dSTD4RaMdilIOpA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz", + "integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.0", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/type-utils": "5.9.0", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz", + "integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz", + "integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.9.0", + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/typescript-estree": "5.9.0", + "debug": "^4.3.2" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz", + "integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz", + "integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.9.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz", + "integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz", + "integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "@typescript-eslint/visitor-keys": "5.9.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz", + "integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.9.0", + "eslint-visitor-keys": "^3.0.0" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + } + }, + "bufferutil": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", + "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, + "cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==" + }, + "cacheable-request": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", + "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "requires": { + "pump": "^3.0.0" + } + } + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001296", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001296.tgz", + "integrity": "sha512-WfrtPEoNSoeATDlf4y3QvkwiELl9GyPLISV5GejTbbQRtQx4LhsXmc9IQ6XCL2d7UxCyEzToEZNMeqR79OUw8Q==", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "requires": { + "mimic-response": "^1.0.0" + } + }, + "codacy-coverage": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/codacy-coverage/-/codacy-coverage-3.4.0.tgz", + "integrity": "sha512-A0ats3/gZtOw76muu++HZ6QrInztWjjLefkLJmmBpjPfyn6nNwNLoApmGmj3F3dfgl2+o6u5GwPnUBkKdfKXTQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.x", + "commander": "^2.x", + "jacoco-parse": "^2.x", + "joi": "^13.x", + "lcov-parse": "^1.x", + "lodash": "^4.17.4", + "log-driver": "^1.x", + "request": "^2.88.0", + "request-promise": "^4.x" + }, + "dependencies": { + "joi": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz", + "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==", + "dev": true, + "requires": { + "hoek": "5.x.x", + "isemail": "3.x.x", + "topo": "3.x.x" + } + } + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "requires": { + "mimic-response": "^3.1.0" + }, + "dependencies": { + "mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" + } + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.4.37", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.37.tgz", + "integrity": "sha512-XIvFB1omSAxYgHYX48sC+HR8i/p7lx7R+0cX9faElg1g++h9IilCrJ12+bQuY+d96Wp7zkBiJwMOv+AhLtLrTg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "eslint-plugin-security": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz", + "integrity": "sha512-xlS7P2PLMXeqfhyf3NpqbvbnW04kN8M9NtmhpR3XGyOvt/vNKS7XPXT5EDbwKW9vCjWH4PpfQvgD/+JgN0VJKA==", + "dev": true, + "requires": { + "safe-regex": "^1.1.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true + }, + "espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "ext": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", + "requires": { + "type": "^2.5.0" + }, + "dependencies": { + "type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "faker": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/faker/-/faker-5.5.3.tgz", + "integrity": "sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g==", + "dev": true + }, + "fast-check": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-2.20.0.tgz", + "integrity": "sha512-tFNjLyPnOUg6iimVxOtoWMJOIyybCo7B8gUGm1yv43jDCQ0hlPUn0fmna/XO/n1yPxn/dxQw3+IygPSbMDiiog==", + "dev": true, + "requires": { + "pure-rand": "^5.0.0" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "got": { + "version": "11.8.3", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.3.tgz", + "integrity": "sha512-7gtQ5KiPh1RtGS9/Jbv1ofDpBFuq42gyfEib+ejaRBJuj/3tQFeR5+gw57e4ipaU8c/rCjvX6fkQz2lyDlGAOg==", + "requires": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hoek": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz", + "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "requires": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isemail": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz", + "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", + "dev": true, + "requires": { + "punycode": "2.x.x" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, + "istanbul-reports": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jacoco-parse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jacoco-parse/-/jacoco-parse-2.0.1.tgz", + "integrity": "sha512-YGhIb2iXuQ4/zNh2zgHd6Z6dqlYwLYH1wfsxtTNQ+jnHH9PhhuMwqOFihXymSI41trxok48LdKkSeDIWs28tYg==", + "dev": true, + "requires": { + "mocha": "^5.2.0", + "xml2js": "^0.4.9" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "joi": { + "version": "17.5.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.5.0.tgz", + "integrity": "sha512-R7hR50COp7StzLnDi4ywOXHrBrgNXuUUfJWIR5lPY5Bm/pOD3jZaTwpluUXVLRWcoWZxkrHBBJ5hLxgnlehbdw==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, + "jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "keyv": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", + "integrity": "sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==", + "requires": { + "json-buffer": "3.0.1" + } + }, + "lcov-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", + "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" } }, - "marked": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.0.tgz", - "integrity": "sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q==", + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true }, - "merge-stream": { + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lowercase-keys": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "marked": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", + "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", "dev": true }, "merge2": { @@ -4246,41 +7576,34 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", "dev": true, "requires": { "braces": "^3.0.1", - "picomatch": "^2.0.5" + "picomatch": "^2.2.3" } }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "dev": true }, "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "dev": true, "requires": { - "mime-db": "1.44.0" + "mime-db": "1.51.0" } }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" }, "minimatch": { "version": "3.0.4", @@ -4297,27 +7620,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -4336,43 +7638,68 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "chokidar": "3.5.2", + "debug": "4.3.2", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.3", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4383,40 +7710,66 @@ "path-is-absolute": "^1.0.0" } }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } + "nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true }, "natural-compare": { "version": "1.4.0", @@ -4435,63 +7788,25 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" }, - "node-notifier": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz", - "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==", + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, - "optional": true, "requires": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" + "process-on-spawn": "^1.0.0" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } + "node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true }, "normalize-path": { "version": "3.0.0", @@ -4500,131 +7815,146 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", - "dev": true + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", + "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==" }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { - "path-key": "^2.0.0" + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" }, "dependencies": { - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true - } - } - }, - "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { - "is-descriptor": "^0.1.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { - "is-buffer": "^1.1.5" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "onigasm": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", - "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", - "dev": true, "requires": { - "lru-cache": "^5.1.1" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } + "wrappy": "1" } }, "optionator": { @@ -4642,22 +7972,9 @@ } }, "p-cancelable": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz", - "integrity": "sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg==", - "dev": true - }, - "p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==" }, "p-limit": { "version": "2.3.0", @@ -4677,12 +7994,33 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4692,30 +8030,6 @@ "callsites": "^3.0.0" } }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4734,38 +8048,35 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, "pkg-dir": { "version": "4.2.0", @@ -4776,54 +8087,19 @@ "find-up": "^4.0.0" } }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, - "pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "requires": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } + "fromentries": "^1.2.0" } }, "progress": { @@ -4832,16 +8108,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "prompts": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", - "integrity": "sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ==", - "dev": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -4851,7 +8117,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -4863,9 +8128,9 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "pure-rand": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-4.1.2.tgz", - "integrity": "sha512-uLzZpQWfroIqyFWmX/pl0OL2JHJdoU3dbh0dvZ25fChHFJJi56J5oQZhW6QgbT2Llwh1upki84LnTwlZvsungA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-5.0.0.tgz", + "integrity": "sha512-lD2/y78q+7HqBx2SaT6OT4UcwtvXNRfEpzYEzl0EQ+9gZq2Qi3fa0HDnYPeqQwhlHJFBUhT7AO3mLU3+8bynHA==", "dev": true }, "qs": { @@ -4874,92 +8139,50 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "quick-lru": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true - }, - "react-is": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", - "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", - "dev": true + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } + "safe-buffer": "^5.1.0" } }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "picomatch": "^2.2.1" } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" + "es6-error": "^4.0.1" } }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -5008,12 +8231,6 @@ "psl": "^1.1.28", "punycode": "^2.1.1" } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true } } }, @@ -5050,79 +8267,22 @@ "lodash": "^4.17.19" } }, - "request-promise-native": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", - "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", - "dev": true, - "requires": { - "request-promise-core": "1.1.4", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "dependencies": { - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, - "requires": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" - } - }, "resolve-alpn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.0.0.tgz", - "integrity": "sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA==", - "dev": true - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" }, "resolve-from": { "version": "4.0.0", @@ -5130,17 +8290,10 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, "responselike": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", - "dev": true, "requires": { "lowercase-keys": "^2.0.0" } @@ -5150,218 +8303,74 @@ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true - }, - "run-parallel": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", - "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "dev": true, - "requires": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, - "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { - "xmlchars": "^2.2.0" + "lru-cache": "^6.0.0" } }, - "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "randombytes": "^2.1.0" } }, "set-blocking": { @@ -5370,29 +8379,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5408,40 +8394,31 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, "shiki": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.2.tgz", - "integrity": "sha512-BjUCxVbxMnvjs8jC4b+BQ808vwjJ9Q8NtLqPwXShZ307HdXiDFYP968ORSVfaTNNSWYDBYdMnVKJ0fYNsoZUBA==", + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.15.tgz", + "integrity": "sha512-/Y0z9IzhJ8nD9nbceORCqu6NgT9X6I8Fk8c3SICHI5NbZRLdZYFaB233gwct9sU0vvSypyaL/qaKvzyQGJBZSw==", "dev": true, "requires": { - "onigasm": "^2.2.5", - "vscode-textmate": "^5.2.0" + "jsonc-parser": "^3.0.0", + "vscode-oniguruma": "^1.6.1", + "vscode-textmate": "5.2.0" } }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, + "signalr": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/signalr/-/signalr-2.4.2.tgz", + "integrity": "sha512-XqFRQRbRr8Ce1GYq3/aWwnQKPHWEOTjmRT32196sZEmZQmsEEpu5LzjvxrpxxedUoI/oWu9YlqkqK8KrbSYw/w==", + "requires": { + "jquery": ">=1.6.4" + } + }, "signalr-client": { "version": "0.0.20", "resolved": "https://registry.npmjs.org/signalr-client/-/signalr-client-0.0.20.tgz", @@ -5450,251 +8427,30 @@ "websocket": "^1.0.28" } }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", - "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { - "extend-shallow": "^3.0.0" + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" } }, "sprintf-js": { @@ -5720,186 +8476,51 @@ "tweetnacl": "~0.14.0" } }, - "stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "string-length": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", - "integrity": "sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw==", - "dev": true, - "requires": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - } - }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, - "supports-hyperlinks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz", - "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==", + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "ansi-regex": "^5.0.1" } }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, - "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", - "dev": true, - "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.0.tgz", - "integrity": "sha512-svS9uILze/cXbH0z2myCK2Brqprx/+JJYK5pHicT/GQiBfzzhUVAIT6MwqJg8y4xV/zoGsUeuPuwtoiKSGE15g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true }, - "terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" + "has-flag": "^4.0.0" } }, "test-exclude": { @@ -5919,56 +8540,12 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, - "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", - "dev": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6005,24 +8582,49 @@ "universalify": "^0.1.2" } }, - "tr46": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", - "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", - "dev": true, - "requires": { - "punycode": "^2.1.1" + "ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } } }, "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tsutils": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz", - "integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -6072,9 +8674,9 @@ "dev": true }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "typedarray-to-buffer": { @@ -6086,37 +8688,25 @@ } }, "typedoc": { - "version": "0.20.27", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.27.tgz", - "integrity": "sha512-Y61T2wEpBo6x0t0zeMNH6CH0n2Jt8E1IHObcK4fGT9nK9Zq6+Rurf0A9WqVbhRmkGpu1wBsGl+4kSJdIN+AOtg==", + "version": "0.22.10", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.10.tgz", + "integrity": "sha512-hQYZ4WtoMZ61wDC6w10kxA42+jclWngdmztNZsDvIz7BMJg7F2xnT+uYsUa7OluyKossdFj9E9Ye4QOZKTy8SA==", "dev": true, "requires": { - "colors": "^1.4.0", - "fs-extra": "^9.1.0", - "handlebars": "^4.7.6", - "lodash": "^4.17.20", + "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^2.0.0", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shelljs": "^0.8.4", - "shiki": "^0.9.2", - "typedoc-default-themes": "^0.12.7" + "marked": "^3.0.8", + "minimatch": "^3.0.4", + "shiki": "^0.9.12" } }, - "typedoc-default-themes": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.7.tgz", - "integrity": "sha512-0XAuGEqID+gon1+fhi4LycOEFM+5Mvm2PjwaiVZNAzU7pn3G2DEpsoXnFOPlLDnHY6ZW0BY0nO7ur9fHOFkBLQ==", - "dev": true - }, "typedoc-plugin-markdown": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.5.0.tgz", - "integrity": "sha512-UzSTK5RpQVbIrcxV1ypHt3Pqr4O3DObYZIhcAXBazitHnpdl500cggXFHmxH7F/j3P3P2IBvPKpfnU6lzRdk8w==", + "version": "3.11.9", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.9.tgz", + "integrity": "sha512-wgJWPfq2wXMktfeBBx1ZObQw2a02Qz0F67juYt6urCY9PYpAX38XcB2d2Nb4grymn95X/ThwtU5PaK2eWyq7AQ==", "dev": true, "requires": { - "handlebars": "^4.7.6" + "handlebars": "^4.7.7" } }, "typedoc-plugin-markdown-pages": { @@ -6126,146 +8716,52 @@ "dev": true }, "typescript": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz", - "integrity": "sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true }, "uglify-js": { - "version": "3.12.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.4.tgz", - "integrity": "sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A==", + "version": "3.14.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.5.tgz", + "integrity": "sha512-qZukoSxOG0urUTvjc2ERMTcAy+BiFh3weWAkeurLwjrCba73poHmG3E36XEjd/JGukMzwTL7uCxZiAexj8ppvQ==", "dev": true, "optional": true }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, "uri-js": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", - "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { "punycode": "^2.1.0" } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, "utf-8-validate": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", - "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.8.tgz", + "integrity": "sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA==", "requires": { - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.3.0" } }, "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "optional": true + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true }, "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, - "v8-to-istanbul": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz", - "integrity": "sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -6277,49 +8773,22 @@ "extsprintf": "^1.2.0" } }, + "vscode-oniguruma": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz", + "integrity": "sha512-vc4WhSIaVpgJ0jJIejjYxPvURJavX6QG41vu0mGhqywMkQqulezEqEQ3cO3gc8GvcOpX6ycmKGqRoROEMBNXTQ==", + "dev": true + }, "vscode-textmate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.2.0.tgz", "integrity": "sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==", "dev": true }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, - "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "requires": { - "xml-name-validator": "^3.0.0" - } - }, - "walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "requires": { - "makeerror": "1.0.x" - } - }, - "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true - }, "websocket": { - "version": "1.0.33", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.33.tgz", - "integrity": "sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA==", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", "requires": { "bufferutil": "^4.0.1", "debug": "^2.2.0", @@ -6336,35 +8805,14 @@ "requires": { "ms": "2.0.0" } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.4.0.tgz", - "integrity": "sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^2.0.2", - "webidl-conversions": "^6.1.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6392,71 +8840,27 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "workerpool": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "3.0.3", @@ -6470,18 +8874,6 @@ "typedarray-to-buffer": "^3.1.5" } }, - "ws": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz", - "integrity": "sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ==", - "dev": true - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, "xml2js": { "version": "0.4.23", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", @@ -6498,16 +8890,10 @@ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", "dev": true }, - "xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yaeti": { @@ -6522,58 +8908,57 @@ "dev": true }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - } + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + } } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 43fe984c4..ebef53834 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "bloxy", "private": false, - "version": "5.7.1", + "version": "6.0.0-alpha", "engines": { - "node": ">=12.0.0" + "node": ">=16.0.0" }, "main": "./dist/index.js", "description": "A Node.JS library for interacting with the Roblox website and its API.", @@ -17,13 +17,12 @@ }, "homepage": "https://bloxy.js.org/", "scripts": { - "test": "jest", - "test-with-coverage": "jest --coverage && cat ./coverage/lcov.info | codacy-coverage", + "test": "nyc mocha --require ts-node/register tests/**/*.spec.ts", + "test-with-coverage": "nyc report --reporter=text-lcov | codacy-coverage", "build": "tsc --skipLibCheck", "eslint": "eslint . --ext .ts", - "postinstall": "npm install got && echo \"\nThank you for installing bloxy! Dependency 'got' has been installed automatically, uninstall it if you plan to use bloxy in a browser-related project!\"", "prepublishOnly": "npm run build", - "create-docs": "typedoc --plugin typedoc-plugin-markdown --hideBreadcrumbs --namedAnchors --excludeExternals --out docs src && mkdocs build", + "create-docs": "typedoc ./src && mkdocs build", "prepare-windows": "npm install && npm run build && npm run create-docs && echo 'Finished'" }, "types": "./dist/index.d.ts", @@ -37,31 +36,37 @@ "roblox nodejs", "roblox module" ], - "author": "ScriptBased", + "author": "VisualizeMeme", "license": "MIT", "devDependencies": { + "@types/chai": "^4.3.0", "@types/debug": "^4.1.5", "@types/lodash": "^4.14.167", - "@types/node": "^14.14.31", + "@types/mocha": "^9.0.0", + "@types/node": "^16.11.19", "@types/tough-cookie": "^4.0.0", "@types/websocket": "^1.0.1", - "@typescript-eslint/eslint-plugin": "^4.15.2", - "@typescript-eslint/parser": "^4.15.2", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "chai": "^4.3.4", "codacy-coverage": "^3.4.0", - "eslint": "^7.20.0", + "eslint": "^8.6.0", "eslint-plugin-security": "^1.4.0", "faker": "^5.1.0", "fast-check": "^2.13.0", - "got": "^11.8.1", - "jest": "^26.6.3", "joi": "^17.3.0", - "typedoc": "^0.20.27", + "mocha": "^9.1.3", + "nyc": "^15.1.0", + "ts-node": "^10.4.0", + "typedoc": "^0.22.10", "typedoc-plugin-markdown": "^3.5.0", "typedoc-plugin-markdown-pages": "^0.3.0", - "typescript": "^4.1.3" + "typescript": "^4.5.4" }, "dependencies": { "debug": "^4.3.1", + "got": "^11.8.3", + "signalr": "^2.4.2", "signalr-client": "0.0.20", "tough-cookie": "^4.0.0", "tslib": "^2.1.0" @@ -69,6 +74,5 @@ "jest": { "collectCoverage": true, "coverageDirectory": "./coverage/" - }, - "optionalDependencies": {} + } } diff --git a/src/client/Client.ts b/src/client/Client.ts index f98d32666..6aa797d57 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -1,187 +1,181 @@ -import ClientBase, { ClientOptions } from "./ClientBase"; -import initAPIs, { APIs } from "./apis"; -import ClientUser from "../structures/ClientUser"; -import RESTController from "../controllers/rest"; -import { Group, PartialUser, User } from "../structures"; +import { ClientBase, ClientOptions } from "./ClientBase"; +import { initAPIs, APIs } from "./apis"; +import { ClientUser } from "../old_structures/ClientUser"; +import { RESTController } from "../controllers/rest"; +import { Group, PartialUser } from "../old_structures"; import * as ClientSocket from "./lib/ClientSocket/ClientSocket"; -import ChatManager from "./lib/ChatManager/ChatManager"; -import DataStoreManager from "./lib/DataStoreManager/DataStoreManager"; - - -export default class Client extends ClientBase { - public user: ClientUser | null; - public apis: APIs; - public rest: RESTController; - public socket: ClientSocket.Socket; - public dataStoreManager: DataStoreManager; - public chat: ChatManager; - - constructor (options?: ClientOptions) { - super(options); - - this.user = null; - this.apis = initAPIs(this); - this.rest = new RESTController(this, this.options.rest); - this.socket = new ClientSocket.Socket(this); - this.dataStoreManager = new DataStoreManager(this); - this.chat = new ChatManager(this); - - this.init(); +import { ChatManager } from "./lib/ChatManager/ChatManager"; +import { DataStoreManager } from "./lib/DataStoreManager/DataStoreManager"; +import { User } from "../structures/User"; +import { BaseUser } from "../structures/BaseUser"; + +export class Client extends ClientBase { + public user: ClientUser | null; + public apis: APIs; + public rest: RESTController; + public socket: ClientSocket.Socket; + public dataStoreManager: DataStoreManager; + public chat: ChatManager; + + constructor(options?: ClientOptions) { + super(options); + + this.user = null; + this.apis = initAPIs(this); + this.rest = new RESTController(this, this.options.rest); + this.socket = new ClientSocket.Socket(this); + this.dataStoreManager = new DataStoreManager(this); + this.chat = new ChatManager(this); + + this.init(); + } + + public isLoggedIn(): boolean { + return this.user !== null; + } + + init(): void { + if (this.options.rest) { + this.rest.setOptions(this.options.rest); } + } - public isLoggedIn (): boolean { - return this.user !== null; - } - - init (): void { - if (this.options.rest) { - this.rest.setOptions(this.options.rest); - } - } - - public async login (cookie?: string): Promise { - this.log("info", { - name: "Client.login", - description: `Started login process..` - }); - cookie = cookie || (this.options.credentials || {}).cookie || undefined; - - if (!cookie) { - throw new Error("Attempted to log in without a cookie!"); - } - this.options.credentials = { - ...this.options.credentials, - cookie - }; - - const createdCookie = this.rest.createCookie({ - key: ".ROBLOSECURITY", - value: cookie, - domain: "roblox.com", - hostOnly: false, - httpOnly: false - }); - - this.rest.addCookie(createdCookie); - - this.log("info", { - name: "Client.login", - description: `Added cookie to cookie jar, proceeding to fetching authenticated user information..` - }); - - const getAuthenticationData = await this.apis.usersAPI.getAuthenticatedUserInformation(); - this.user = new ClientUser({ - id: getAuthenticationData.id, - name: getAuthenticationData.name - }, this); - this.emit("loggedIn"); - - this.log("info", { - name: "Client.login", - description: `Successfully logged in as ${getAuthenticationData.name}` - }); - - return this.user; - } + public async login(cookie?: string): Promise { + this.log("info", { + name: "Client.login", + description: `Started login process..` + }); + cookie = cookie || (this.options.credentials || {}).cookie || undefined; - getGroup (groupId: number): Promise { - return this.apis.groupsAPI.getGroup({ - groupId - }) - .then(data => { - if (!data) { - throw new Error(`Group not found: ${groupId}`); - } else { - return new Group(data, this); - } - }); + if (!cookie) { + throw new Error("Attempted to log in without a cookie!"); } - - getUser (userId: number | string): Promise { - if (typeof userId === "string") { - userId = parseInt(userId); + this.options.credentials = { + ...this.options.credentials, + cookie + }; + + const createdCookie = this.rest.createCookie({ + key: ".ROBLOSECURITY", + value: cookie, + domain: "roblox.com", + hostOnly: false, + httpOnly: false + }); + + this.rest.addCookie(createdCookie); + + this.log("info", { + name: "Client.login", + description: `Added cookie to cookie jar, proceeding to fetching authenticated user information..` + }); + + const getAuthenticationData = + await this.apis.usersAPI.getAuthenticatedUserInformation(); + this.user = new ClientUser( + { + id: getAuthenticationData.id, + name: getAuthenticationData.name + }, + this + ); + this.emit("loggedIn"); + + this.log("info", { + name: "Client.login", + description: `Successfully logged in as ${getAuthenticationData.name}` + }); + + return this.user; + } + + getGroup(groupId: number): Promise { + return this.apis.groupsAPI + .getGroup({ + groupId + }) + .then((data) => { + if (!data) { + throw new Error(`Group not found: ${groupId}`); + } else { + return new Group(data, this); } - - return this.apis.otherAPI.getUserProfileHeader({ - userId - }) - .then(data => new User({ - id: data.ProfileUserId, - name: data.ProfileUserName, - displayName: data.ProfileDisplayName, - canFollow: data.CanBeFollowed, - canSeeInventory: data.CanSeeInventory, - canTrade: data.CanTrade, - incomingFriendRequest: data.IncomingFriendRequestPending, - sentFriendRequest: data.FriendRequestPending, - canMessage: data.CanMessage, - isViewerBlocked: data.IsViewerBlocked, - isVieweeBlocked: data.IsVieweeBlocked, - followingsCount: data.FollowingsCount, - followersCount: data.FollowersCount, - userPlaceId: data.UserPlaceId, - userStatusDate: data.UserStatusDate, - userStatus: data.UserStatus, - presenceType: data.UserPresenceType, - friendsCount: data.FriendsCount, - canFriend: data.MaySendFriendInvitation, - areFriends: data.AreFriends, - lastLocation: data.LastLocation, - canSeeFavorites: data.CanSeeFavorites, - headShotImage: { - final: data.HeadShotImage.Final, - endpointType: data.HeadShotImage.EndpointType, - retryUrl: data.HeadShotImage.RetryUrl, - url: data.HeadShotImage.Url, - userId: data.HeadShotImage.UserId - }, - messagesDisabled: data.MessagesDisabled, - previousUsernames: data.PreviousUserNames - }, this)); - } - - getUserIdFromUsername (username: string): Promise { - return this.apis.usersAPI.getUsersByUsernames({ - usernames: [username], - excludeBannedUsers: false - }) - .then(response => { - if (response.data && response.data[0]) { - return new PartialUser(response.data[0], this); - } else { - throw new Error("Got invalid response from getUserIdFromUsername"); - } - }); - } - - getUsernameFromUserId (userId: number | string): Promise { - if (typeof userId === "string") { - userId = parseInt(userId); + }); + } + + /** + * Returns a base user object from a user id. + * @param userId The user's ID + */ + getBaseUser(userId: number): BaseUser { + return new BaseUser(this, userId); + } + + /** + * Returns a user object from a user id. + * @param userId The user's ID + */ + async getUser(userId: number): Promise { + const data = await this.apis.usersAPI.getUserById({ userId }); + return new User(this, data); + } + + getUserIdFromUsername(username: string): Promise { + return this.apis.usersAPI + .getUsersByUsernames({ + usernames: [username], + excludeBannedUsers: false + }) + .then((response) => { + if (response.data && response.data[0]) { + return new PartialUser(response.data[0], this); + } else { + throw new Error("Got invalid response from getUserIdFromUsername"); } + }); + } - return this.apis.generalApi.getUserById({ - userId - }) - .then(data => new PartialUser(data, this)); + getUsernameFromUserId(userId: number | string): Promise { + if (typeof userId === "string") { + userId = parseInt(userId); } - getUsersByUserIds (userIds: number[] | string[], excludeBannedUsers = false): Promise { - if (typeof userIds[0] === "string") { - userIds = (userIds as string[]).map(userId => parseInt(userId)); - } - - return this.apis.usersAPI.getUsersByIds({ - excludeBannedUsers, - userIds: userIds as number[] - }) - .then(response => response.data.map(userData => new PartialUser(userData, this))); + return this.apis.generalApi + .getUserById({ + userId + }) + .then((data) => new PartialUser(data, this)); + } + + getUsersByUserIds( + userIds: number[] | string[], + excludeBannedUsers = false + ): Promise { + if (typeof userIds[0] === "string") { + userIds = (userIds as string[]).map((userId) => parseInt(userId)); } - getUsersByUsernames (usernames: string[], excludeBannedUsers = false): Promise { - return this.apis.usersAPI.getUsersByUsernames({ - excludeBannedUsers, - usernames - }) - .then(response => response.data.map(userData => new PartialUser(userData, this))); - } + return this.apis.usersAPI + .getUsersByIds({ + excludeBannedUsers, + userIds: userIds as number[] + }) + .then((response) => + response.data.map((userData) => new PartialUser(userData, this)) + ); + } + + getUsersByUsernames( + usernames: string[], + excludeBannedUsers = false + ): Promise { + return this.apis.usersAPI + .getUsersByUsernames({ + excludeBannedUsers, + usernames + }) + .then((response) => + response.data.map((userData) => new PartialUser(userData, this)) + ); + } } diff --git a/src/client/ClientBase.ts b/src/client/ClientBase.ts index f27862c24..b40a283f0 100644 --- a/src/client/ClientBase.ts +++ b/src/client/ClientBase.ts @@ -3,73 +3,79 @@ import { RESTControllerOptions } from "../interfaces/RESTInterfaces"; import debug, { Debugger } from "debug"; import { utilMergeDeep } from "../util/utilFunctions"; - export interface ClientCredentialsOptions { - cookie?: string; + cookie?: string; } - export interface ClientCallbacks { - getFunCaptchaToken?: (publicKey: string, targetUrl: string) => Promise; + getFunCaptchaToken?: ( + publicKey: string, + targetUrl: string + ) => Promise; } - export interface ClientSetup { - websocket?: { - maxRetries: number; - }; - debug: boolean; + websocket?: { + maxRetries: number; + }; + debug: boolean; } - export interface ClientOptions { - credentials?: ClientCredentialsOptions; - rest?: RESTControllerOptions; - callbacks?: ClientCallbacks; - setup?: ClientSetup; + credentials?: ClientCredentialsOptions; + rest?: RESTControllerOptions; + callbacks?: ClientCallbacks; + setup?: ClientSetup; } - interface DebugData { - name: string; - description: string; + name: string; + description: string; } - -export default class ClientBase extends EventEmitter { - public options: ClientOptions; - public debugger: { - info: Debugger; - warn: Debugger; - error: Debugger; +export class ClientBase extends EventEmitter { + public options: ClientOptions; + public debugger: { + info: Debugger; + warn: Debugger; + error: Debugger; + }; + + constructor(options?: ClientOptions) { + super(); + + this.options = this.updateOptions(options); + this.debugger = { + info: debug("bloxy:info"), + warn: debug("bloxy:warn"), + error: debug("bloxy:error") }; - - - constructor (options?: ClientOptions) { - super(); - - this.options = this.updateOptions(options); - this.debugger = { - info: debug("bloxy:info"), - warn: debug("bloxy:warn"), - error: debug("bloxy:error") - }; - } - - public updateOptions (options?: ClientOptions): ClientOptions { - this.options = utilMergeDeep({ - credentials: {}, - rest: {}, - setup: {}, - callbacks: {} - } as ClientOptions, options || {}) as ClientOptions; - - return this.options; - } - - public log (level: "info" | "warn" | "error", data: DebugData): void { - const loggerToUse = level === "info" ? this.debugger.info : level === "error" ? this.debugger.error : this.debugger.warn; - - loggerToUse(`[${new Date().toISOString()}] ${data.name}: ${data.description}`); - } + } + + public updateOptions(options?: ClientOptions): ClientOptions { + this.options = utilMergeDeep( + { + credentials: {}, + rest: {}, + setup: {}, + callbacks: {} + } as ClientOptions, + options || {} + ) as ClientOptions; + + return this.options; + } + + public log(level: "info" | "warn" | "error", data: DebugData): void { + const loggerToUse = + level === "info" + ? this.debugger.info + : level === "error" + ? this.debugger.error + : this.debugger.warn; + + loggerToUse( + `[${new Date().toISOString()}] ${data.name}: ${data.description}` + ); + } } diff --git a/src/client/apis/AccountInformationAPI.ts b/src/client/apis/AccountInformationAPI.ts index cb9c8456a..7490ba732 100644 --- a/src/client/apis/AccountInformationAPI.ts +++ b/src/client/apis/AccountInformationAPI.ts @@ -1,306 +1,250 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; - - -export declare type UpdateUserBirthdateOptions = GetUserBirthdate; -export declare type UpdateUserDescriptionOptions = { - description: string; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { UserIdOption, Privacy } from "../.."; + +// AccountInformation +export type AccountInformationBirthdate = { + birthDay: number; + birthMonth: number; + birthYear: number; }; -export declare type UpdateUserGenderOptions = { - gender: number; -} -export declare type SetPhoneNumberOptions = { - countryCode: string; - prefix: string; - phone: string; - password: string; +export type AccountInformationDescription = { + description: string; }; -export declare type DeletePhoneOptions = SetPhoneNumberOptions; -export declare type ResendPhoneCodeOptions = SetPhoneNumberOptions; -export declare type VerifyPhoneOptions = SetPhoneNumberOptions; -export declare type AddStarCodeAffiliateOptions = { - code: string; +export type AccountInformationGender = { + gender: number; }; -export declare type UpdateUserPromotionChannelsOptions = { - facebook: string; - twitter: string; - youtube: string; - twitch: string; - promotionChannelsVisibilityPrivacy: string; +export type AccountInformationXboxConsecutiveLoginDays = { + count: number; }; -export declare type GetUserBirthdate = { - birthMonth: number; - birthDay: number; - birthYear: number; +// Metadata +export type AccountInformationMetaData = { + isAllowedNotificationsEndpointDisabled: boolean; + isAccountSettingsPolicyEnabled: boolean; + isPhoneNumberEnabled: boolean; + MaxUserDescriptionLength: number; + isUserDescriptionEnabled: boolean; + isUserBlockEndpointsUpdated: boolean; + isIDVerificationEnabled: boolean; + isPasswordRequiredForAgingDown: boolean; + homePageUpsellCardVariation: string; }; -export declare type UpdateUserBirthdate = boolean; -export declare type GetUserDescription = { - description: string; + +// PromotionChannel +export type AccountInformationOwnPromotionChannels = { + promotionChannelsVisibilityPrivacy: Privacy; + facebook: string; + twitter: string; + youtube: string; + twitch: string; + guilded: string; }; -export declare type UpdateUserDescription = boolean; -export declare type GetUserGender = { - gender: number; -} -export declare type UpdateUserGender = unknown -export declare type GetConsecutiveXboxLoginDays = { - count: number; +export declare type AccountInformationPromotionChannels = Omit< + AccountInformationOwnPromotionChannels, + "promotionChannelsVisibilityPrivacy" +>; + +// StarCodeAffiliate +export type AccountInformationStarCodeAffiliate = { + userId: number; + name: string; + code: string; +}; +export type AccountInformationSetStarCodeAffiliate = { + code: string; +}; +export type AccountInformationAddStarCodeAffiliateOption = { + code: string; }; -export declare type GetMetaData = { - isAllowedNotificationsEndpointDisabled: boolean; - isAccountSettingsPolicyEnabled: boolean; - isPhoneNumberEnabled: boolean; -} -export declare type GetVerifiedPhoneNumber = SetPhoneNumberOptions; -export declare type SetPhoneNumber = unknown; -export declare type DeletePhone = unknown; -export declare type ResendPhoneCode = unknown; -export declare type VerifyPhone = unknown; -export declare type GetSelfPromotionChannels = UpdateUserPromotionChannelsOptions; -export declare type GetUserPromotionChannelsOptions = { userId: number } -export declare type GetUserPromotionChannels = Omit; -export declare type UpdateUserPromotionChannels = unknown -export declare type RemoveStarCodeAffiliate = unknown -export declare type GetStarCodeAffiliate = { - userId: number; - name: string; - code: string; -} -export declare type AddStarCodeAffiliate = GetStarCodeAffiliate; - -export default class AccountInformationAPI extends BaseAPI { - constructor (client: Client) { - super({ - baseUrl: "https://accountinformation.roblox.com/", - client - }); - } - - getUserBirthdate (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/birthdate" - }, - json: true - }) - .then(response => response.body as GetUserBirthdate); - } - - updateUserBirthdate (options: UpdateUserBirthdateOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/birthdate", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as UpdateUserBirthdate); - } - - getUserDescription (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/description" - }, - json: true - }) - .then(response => response.body as GetUserDescription); - } - - updateUserDescription (options: UpdateUserDescriptionOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/description", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as UpdateUserDescription); - } - - getUserGender (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/gender" - }, - json: true - }) - .then(response => response.body as GetUserGender); - } - - updateUserGender (options: UpdateUserGenderOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/gender", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as UpdateUserGender); - } - - getConsecutiveXboxLoginDays (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/xbox-live/consecutive-login-days" - }, - json: true - }) - .then(response => response.body as GetConsecutiveXboxLoginDays); - } - - getMetaData () { - return this.request({ - requiresAuth: false, - request: { - path: "v1/metadata" - }, - json: true - }) - .then(response => response.body as GetMetaData); - } - - getVerifiedPhoneNumber (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/phone" - }, - json: true - }) - .then(response => response.body as GetVerifiedPhoneNumber); - } - - setPhoneNumber (options: SetPhoneNumberOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/phone", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as SetPhoneNumber); - } - - deletePhone (options: DeletePhoneOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/phone/delete", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as DeletePhone); - } - - resendPhoneCode (options: ResendPhoneCodeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/phone/resend", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as ResendPhoneCode); - } - - verifyPhone (options: VerifyPhoneOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/phone/verify", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as VerifyPhone); - } - - getSelfPromotionChannels (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/promotion-channels" - }, - json: true - }) - .then(response => response.body as GetSelfPromotionChannels); - } - - getUserPromotionChannels (options: GetUserPromotionChannelsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/promotion-channels` - }, - json: true - }) - .then(response => response.body); - } - - updateUserPromotionChannels (options: UpdateUserPromotionChannelsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/promotion-channels", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body as UpdateUserPromotionChannels); - } - - removeStarCodeAffiliate (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/star-code-affiliates", - method: "DELETE" - }, - json: true - }) - .then(() => true as RemoveStarCodeAffiliate); - } - - getStarCodeAffiliate (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/star-code-affiliates" - }, - json: true - }) - .then(response => response.body as GetStarCodeAffiliate); - } - addStarCodeAffiliate (options: AddStarCodeAffiliateOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/star-code-affiliates", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body as AddStarCodeAffiliate); - } +// RobloxBadges +export type AccountInformationRobloxBadge = { + id: number; + name: string; + description: string; + imageUrl: string; +}; +export declare type AccountInformationRobloxBadges = + AccountInformationRobloxBadge[]; + +export class AccountInformationAPI extends BaseAPI { + constructor(client: Client) { + super({ + baseUrl: "https://accountinformation.roblox.com/", + client + }); + } + + getUserBirthdate(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/birthdate" + }, + json: true + }).then((response) => response.body); + } + + updateUserBirthdate(options: AccountInformationBirthdate): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/birthdate", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getUserDescription(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/description" + }, + json: true + }).then((response) => response.body); + } + + updateUserDescription( + options: AccountInformationDescription + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/description", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getUserGender(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/gender" + }, + json: true + }).then((response) => response.body); + } + + updateUserGender(options: AccountInformationGender): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/gender", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getConsecutiveXboxLoginDays(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/xbox-live/consecutive-login-days" + }, + json: true + }).then((response) => response.body); + } + + getMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "v1/metadata" + }, + json: true + }).then((response) => response.body); + } + + getSelfPromotionChannels(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/promotion-channels" + }, + json: true + }).then((response) => response.body); + } + + getUserPromotionChannels( + options: UserIdOption + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/promotion-channels` + }, + json: true + }).then((response) => response.body); + } + + updateUserPromotionChannels( + options: AccountInformationOwnPromotionChannels + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/promotion-channels", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + removeStarCodeAffiliate(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates", + method: "DELETE" + }, + json: true + }).then(() => true); + } + + getStarCodeAffiliate(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates" + }, + json: true + }).then((response) => response.body); + } + + addStarCodeAffiliate( + options: AccountInformationAddStarCodeAffiliateOption + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/star-code-affiliates", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + getRobloxBadges( + options: UserIdOption + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/roblox-badges`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/AccountSettingsAPI.ts b/src/client/apis/AccountSettingsAPI.ts index 7ebf942d4..98d622fe4 100644 --- a/src/client/apis/AccountSettingsAPI.ts +++ b/src/client/apis/AccountSettingsAPI.ts @@ -1,462 +1,235 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { UpdateUserPromotionChannelsOptions as AccountInformationUpdateUserPromotionChannelsOptions } from "./AccountInformationAPI"; - - -export type GetSettingsGroups = { - title: string; - url: string; - suffix: string; -}[]; -export type GetAppChatPrivacy = { - appChatPrivacy: string; -} -export type UpdateAppChatPrivacyOptions = { - appChatPrivacy: string; -}; -export type UpdateAppChatPrivacy = boolean; -export type GetGameChatPrivacy = { - gameChatPrivacy: string; -} -export type UpdateGameChatPrivacyOptions = { - gameChatPrivacy: string; -}; -export type UpdateGameChatPrivacy = boolean; -export type GetInventoryPrivacy = { - inventoryPrivacy: string; -} -export type UpdateInventoryPrivacyOptions = { - inventoryPrivacy: string; -}; -export type UpdateInventoryPrivacy = { - inventoryPrivacy: string; - tradePrivacy: string; - privacySettingResponse: string; -}; -export type GetUserPrivacy = { - phoneDiscovery: string; -} -export type UpdateUserPrivacyOptions = { - phoneDiscovery: string; -}; -export type UpdateUserPrivacy = { - phoneDiscovery: string; -} -export type GetUserPrivacySettingsInfo = { - isPhoneDiscoveryEnabled: boolean; -} -export type GetUserPrivateMessagePrivacy = { - privateMessagePrivacy: string; -} -export type UpdateUserPrivateMessagePrivacyOptions = { - privateMessagePrivacy: string; -}; -export type UpdateUserPrivateMessagePrivacy = boolean; -export type GetUserEmailStatus = { - email: string; - verified: boolean; -} -export type UpdateUserEmailOptions = { - password: string; - emailAddress: string; -}; -export type UpdateUserEmail = boolean; -export type SendEmailVerification = boolean; -export type GetWebsiteTheme = { - themeType: string; -} -export type UpdateWebsiteThemeOptions = { - themeType: string; -}; -export type UpdateWebsiteTheme = boolean; -export type GetWebsiteThemes = { - data: string[]; -}; -export type GetUserTradePrivacy = { - tradePrivacy: string; -}; -export type UpdateUserTradePrivacyOptions = { - tradePrivacy: string; -}; -export type UpdateUserTradePrivacy = { - tradePrivacy: string; - inventoryPrivacy: string; - privacySettingResponse: string; -}; -export type GetUserTradeQualityFilter = { - tradeValue: string; -} -export type UpdateUserTradeQualityFilterOptions = { - tradeValue: string; -}; -export type UpdateUserTradeQualityFilter = boolean; -export type UpdateTwoStepStatusOptions = { - enabled: boolean; - password: string; -}; -export type UpdateTwoStepStatus = { - enabled: boolean; - password: string; -} -export type GetContactUpsell = { - upsellScreenType: string; -} -export type UpdateContactUpsellSuppressionOptions = { - suppress: boolean; -}; -export type UpdateContactUpsellSuppression = boolean; -export type GetIsXboxUsernameValidOptions = { - authorization: string; - signature: string; - username: string; -}; -export type GetIsXboxUsernameValid = { - isValid: boolean; - errorMessage?: string; - errorCode?: string; -} -export type UpdateUserPromotionChannelsOptions = AccountInformationUpdateUserPromotionChannelsOptions; -export type UpdateUserPromotionChannels = boolean; - - -export default class AccountSettingsAPI extends BaseAPI { - constructor (client: Client) { - super({ - baseUrl: "https://accountsettings.roblox.com/", - client - }); - } - - getSettingsGroups (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "v1/account/settings/settings-groups" - }, - json: true - }) - .then(response => response.body.map((val: any) => ({ - title: val.Title, - url: val.Url, - suffix: val.Suffix - }))); - } - - getAppChatPrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/app-chat-privacy" - }, - json: true - }) - .then(response => response.body); - } - - updateAppChatPrivacy (options: UpdateAppChatPrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/app-chat-privacy", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getGameChatPrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/game-chat-privacy" - }, - json: true - }) - .then(response => response.body); - } - - updateGameChatPrivacy (options: UpdateGameChatPrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/game-chat-privacy", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getInventoryPrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/inventory-privacy" - }, - json: true - }) - .then(response => response.body); - } - - updateInventoryPrivacy (options: UpdateInventoryPrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/inventory-privacy", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getUserPrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/privacy" - }, - json: true - }) - .then(response => response.body); - } - - updateUserPrivacy (options: UpdateUserPrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/privacy", - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getUserPrivacySettingsInfo (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/privacy/info" - }, - json: true - }) - .then(response => response.body as GetUserPrivacySettingsInfo); - } - - getUserPrivateMessagePrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/private-message-privacy" - }, - json: true - }) - .then(response => response.body as GetUserPrivateMessagePrivacy); - } - - updateUserPrivateMessagePrivacy (options: UpdateUserPrivateMessagePrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/private-message-privacy", - method: "POST", - json: options - }, - json: true - }) - .then(() => true as UpdateUserPrivateMessagePrivacy); - } - - getUserEmailStatus (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/email" - }, - json: true - }) - .then(response => response.body as GetUserEmailStatus); - } - - updateUserEmail (options: UpdateUserEmailOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/email", - method: "PATCH", - json: options - }, - json: true - }) - .then(() => true); - } - - sendEmailVerification (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/email/verify", - method: "POST" - }, - json: true - }) - .then(() => true); - } - - getWebsiteTheme (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/themes/User/${this.client.user!.id}` - }, - json: true - }) - .then(response => response.body as GetWebsiteTheme); - } - - updateWebsiteTheme (options: UpdateWebsiteThemeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/themes/User/${this.client.user!.id}`, - method: "PATCH", - json: { - themeType: options.themeType - } - }, - json: true - }) - .then(() => true); - } - - getWebsiteThemes (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/themes/types" - }, - json: true - }) - .then(response => response.body as GetWebsiteThemes); - } - - getUserTradePrivacy (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/trade-privacy" - }, - json: true - }) - .then(response => response.body as GetUserTradePrivacy); - } - - updateUserTradePrivacy (options: UpdateUserTradePrivacyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/trade-privacy", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body as UpdateUserTradePrivacy); - } - - getUserTradeQualityFilter (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/trade-value" - }, - json: true - }) - .then(response => response.body as GetUserTradeQualityFilter); - } - - updateUserTradeQualityFilter (options: UpdateUserTradeQualityFilterOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/trade-value", - method: "POST", - json: options - }, - json: true - }) - .then(() => true); - } - - updateTwoStepStatus (options: UpdateTwoStepStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/email", - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body as UpdateTwoStepStatus); - } - - getContactUpsell (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/user/screens/contact-upsell" - }, - json: true - }) - .then(response => response.body as GetContactUpsell); - } - - updateContactUpsellSuppression (options: UpdateContactUpsellSuppressionOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - method: "POST", - path: "v1/user/screens/contact-upsell/suppress", - json: options - }, - json: true - }) - .then(() => true as UpdateContactUpsellSuppression); - } - - getIsXboxUsernameValid (options: GetIsXboxUsernameValidOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/xbox/is-username-valid", - qs: { - Authorization: options.authorization, - signature: options.signature, - "request.username": options.username - } - }, - json: true - }) - .then(response => response.body as GetIsXboxUsernameValid); - } - - updateUserPromotionChannels (options: UpdateUserPromotionChannelsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/promotion-channels", - method: "POST", - json: options - }, - json: true - }) - .then(() => true); - } +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { Privacy } from "../../types/GenericTypes"; +import { UserIdOption } from "../.."; + +// Accounts +export type AccountSettingsMetaData = { + isAccountsRestrictionsSpamBugFixEnabled: boolean; + maximumParentalControlsMonthlySpendLimitInUSD: number; + isParentalMonthlyLimitInUIEnabled: boolean; + isParentalNotificationSettingsInUIEnabled: boolean; +}; +export type AccountSettingsGroup = { + title: string; + url: string; + suffix: string; +}; +export type AccountSettingsGroups = AccountSettingsGroup[]; + +// PrivacySettings +export type AccountSettingsAppChatPrivacy = { + appChatPrivacy: Omit | "All"; +}; +export type AccountSettingsGameChatPrivacy = { + gameChatPrivacy: Omit; +}; +export type AccountSettingsInventoryPrivacy = { + inventoryPrivacy: Privacy; +}; +export type AccountSettingsPrivacy = { + phoneDiscovery: Omit; +}; +export type AccountSettingsPrivacyInfo = { + isPhoneDiscoveryEnabled: boolean; +}; +export type AccountSettingsPrivateMessagePrivacy = { + privateMessagePrivacy: Privacy; +}; +export type AccountSettingsVisibilityPrivacy = { + visibilityPrivacy: number; +}; + +export class AccountSettingsAPI extends BaseAPI { + constructor(client: Client) { + super({ + baseUrl: "https://accountsettings.roblox.com/", + client + }); + } + + getMetaData(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/settings/metadata" + }, + json: true + }).then((response) => ({ + isAccountsRestrictionsSpamBugFixEnabled: + response.body.IsAccountsRestrictionsSpamBugFixEnabled, + isParentalMonthlyLimitInUIEnabled: + response.body.IsParentalMonthlyLimitInUIEnabled, + isParentalNotificationSettingsInUIEnabled: + response.body.IsParentalNotificationSettingsInUIEnabled, + maximumParentalControlsMonthlySpendLimitInUSD: + response.body.MaximumParentalControlsMonthlySpendLimitInUSD + })); + } + + getSettingsGroups(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "v1/account/settings/settings-groups" + }, + json: true + }).then((response) => + response.body.map((val: any) => ({ + title: val.Title, + url: val.Url, + suffix: val.Suffix + })) + ); + } + + getAppChatPrivacy(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/app-chat-privacy" + }, + json: true + }).then((response) => response.body); + } + + updateAppChatPrivacy( + options: AccountSettingsAppChatPrivacy + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/app-chat-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getGameChatPrivacy(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/game-chat-privacy" + }, + json: true + }).then((response) => response.body); + } + + updateGameChatPrivacy( + options: AccountSettingsGameChatPrivacy + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/game-chat-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getInventoryPrivacy(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/inventory-privacy" + }, + json: true + }).then((response) => response.body); + } + + updateInventoryPrivacy( + options: AccountSettingsInventoryPrivacy + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/inventory-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + getUserPrivacy(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy" + }, + json: true + }).then((response) => response.body); + } + + updateUserPrivacy(options: AccountSettingsPrivacy): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy", + method: "PATCH", + json: options + }, + json: true + }).then(() => true); + } + + getUserPrivacySettingsInfo(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/privacy/info" + }, + json: true + }).then((response) => response.body); + } + + getUserPrivateMessagePrivacy(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/private-message-privacy" + }, + json: true + }).then((response) => response.body); + } + + updateUserPrivateMessagePrivacy( + options: AccountSettingsPrivateMessagePrivacy + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/private-message-privacy", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } + + blockUser(options: UserIdOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/block`, + method: "POST" + }, + json: true + }).then(() => true); + } + + unblockUser(options: UserIdOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unblock`, + method: "POST" + }, + json: true + }).then(() => true); + } } diff --git a/src/client/apis/AdConfigurationAPI.ts b/src/client/apis/AdConfigurationAPI.ts index 9d60ac121..535cce780 100644 --- a/src/client/apis/AdConfigurationAPI.ts +++ b/src/client/apis/AdConfigurationAPI.ts @@ -1,124 +1,141 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { ISOString } from "../../types/GenericTypes"; +import { GroupIdOption } from "../.."; +// Utility types +export type AdConfigurationTargetGender = unknown; +export type AdConfigurationTargetAgeBracket = unknown; +export type AdConfigurationTargetDeviceType = unknown; -export declare type GetSponsoredGamesOptions = { - groupId?: number; - startRowIndex?: number; - count?: number; +// SponsoredGames +export type AdConfigurationSponsoredGame = { + adId: number; + adSetId: number; + adName: string; + adStatus: unknown; + creativeType: unknown; + creativeTargetId: number; + creativeUrl: string; + bidAmountInRobux: number; + budgetInRobux: number; + adSetStatus: unknown; + startDate: ISOString; + endDate: ISOString; + targetGender: AdConfigurationTargetGender; + targetAgeBracket: AdConfigurationTargetAgeBracket; + targetDeviceType: AdConfigurationTargetDeviceType; + campaignTargetType: unknown; + campaignTargetId: number; + totalSpendInRobux: number; + totalImpressions: number; + totalClicks: number; + totalConversions: number; + impressionConversions: number; + clickConversions: number; +}; +export type AdConfigurationSponsoredGames = { + sponsoredGames: AdConfigurationSponsoredGame[]; + previousPageCursor: string; + nextPageCursor: string; }; -export declare type CreateAdOptions = unknown; -export declare type RunAdOptions = unknown; -export declare type StopAdOptions = unknown; - -export declare type GetCreateAdMetaData = { - universeId: number; - universeCreatorType: string; - universeCreatorTargetId: number; - areNativeAdsForPhoneEnabled: boolean; - areNativeAdsForTabletEnabled: boolean; - areNativeAdsForDesktopEnabled: boolean; - areNativeAdsForConsoleEnabled: boolean; -} -export declare type GetSponsoredGames = { - sponsoredGames: { - adId: number; - universeName: string; - universeRootPlaceId: number; - targetDeviceType: string; - totalBid: number; - totalImpressions: number; - totalClicks: number; - campaign: { - bid: number; - clicks: number; - impressions: 0; - isRunning: boolean; - }; - gameIconUrl: string; - costPerImpressionEstimate: number; - }; - nextPageStartRowIndex: number; - creatorType: "User" | "Group"; - isErroneous: boolean; - minimumBidAmount: number; -} -export declare type CreateAd = unknown; -export declare type RunAd = unknown; -export declare type StopAd = unknown; - -export default class AdConfigurationAPI extends BaseAPI { - constructor (client: Client) { - super({ - baseUrl: "https://adconfiguration.roblox.com/", - client - }); - } +export type AdConfigurationUniverse = { + id: number; + name: string; +}; +export type AdConfigurationUniverses = { + universes: AdConfigurationUniverse[]; +}; +export type AdConfigurationCreateSponsoredGameAdOptions = { + universeId: number; + targetGender: AdConfigurationTargetGender; + targetAgeBracket: AdConfigurationTargetAgeBracket; + targetDeviceType: AdConfigurationTargetDeviceType; + budgetInRobux: number; + startDate: ISOString; + endDate: ISOString; + adName: string; + bidAmountInRobux: number; +}; +export type AdConfigurationStopSponsoredGameAdOptions = { + adSetId: number; +}; +export type AdConfigurationGetSponsoredGamesOptions = { + universeId: number; + includeReportingStats?: boolean; + isArchived?: boolean; + pageCursor?: string; +}; - getCreateAdMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "/v1/sponsored-games/create-ad/metadata" - }, - json: true - }) - .then(response => response.body as GetCreateAdMetaData); - } +export class AdConfigurationAPI extends BaseAPI { + constructor(client: Client) { + super({ + baseUrl: "https://adconfiguration.roblox.com/", + client + }); + } - getSponsoredGames (options: GetSponsoredGamesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "/v1/sponsored-games/sponsored-games", - qs: { - groupId: options.groupId || null, - startRowIndex: options.startRowIndex || 0, - count: options.count || 50 - } - }, - json: true - }) - .then(response => response.body as GetSponsoredGames); - } + getSponsoredGames( + options: AdConfigurationGetSponsoredGamesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games", + method: "GET", + qs: { + universeId: options.universeId, + includeReportingStats: options.includeReportingStats, + isArchived: options.isArchived, + pageCursor: options.pageCursor + } + }, + json: true + }).then((response) => response.body); + } - createAd (options: CreateAdOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "/v1/sponsored-games/create-ad", - method: "POST", - json: options as any - }, - json: true - }) - .then(response => response.body as CreateAd); - } + getUniverses( + options: Partial + ): Promise { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/universes", + method: "GET", + qs: { + groupId: options.groupId + } + }, + json: true + }).then((response) => response.body); + } - runAd (options: RunAdOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "/v1/sponsored-games/run", - method: "POST", - json: options as any - }, - json: true - }) - .then(response => response.body as RunAd); - } + createSponsor( + options: AdConfigurationCreateSponsoredGameAdOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/create", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } - stopAd (options: StopAdOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "/v1/sponsored-games/stop", - method: "POST", - json: options as any - }, - json: true - }) - .then(response => response.body as StopAd); - } + stopSponsor( + options: AdConfigurationStopSponsoredGameAdOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + url: "v2/sponsored-games/stop", + method: "POST", + json: options + }, + json: true + }).then(() => true); + } } diff --git a/src/client/apis/AssetDeliveryAPI.ts b/src/client/apis/AssetDeliveryAPI.ts index 3dad6f1c4..bbb3b75eb 100644 --- a/src/client/apis/AssetDeliveryAPI.ts +++ b/src/client/apis/AssetDeliveryAPI.ts @@ -1,269 +1,319 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type BaseAssetDeliveryOptions = { - acceptEncoding: string; - robloxPlaceId: number; - assetType: string; - accept: string; - skipSigningScripts: boolean; - clientInsert: number; - scriptInsert: number; - modulePlaceId: number; - serverPlaceId: number; - expectedAssetType: string; +export type AssetDeliveryBaseOptions = { + acceptEncoding: string; + robloxPlaceId: number; + assetType: string; + accept: string; + skipSigningScripts: boolean; + clientInsert: number; + scriptInsert: number; + modulePlaceId: number; + serverPlaceId: number; + expectedAssetType: string; }; -export type BaseAsset = { - location?: string; - errors?: { code: number; message: string }[]; - requestId?: string; - isHashDynamic?: boolean; - isCopyrightProtected?: boolean; - isArchived?: boolean; +export type AssetDeliveryBaseAsset = { + location?: string; + errors?: { code: number; message: string }[]; + requestId?: string; + isHashDynamic?: boolean; + isCopyrightProtected?: boolean; + isArchived?: boolean; }; -export type BaseAssetRaw = { - Location?: string; - Errors?: { Code: number; Message: string }[]; - RequestId?: string; - IsHashDynamic?: boolean; - IsCopyrightProtected?: boolean; - IsArchived?: boolean; +export type AssetDeliveryBaseAssetRaw = { + Location?: string; + Errors?: { Code: number; Message: string }[]; + RequestId?: string; + IsHashDynamic?: boolean; + IsCopyrightProtected?: boolean; + IsArchived?: boolean; }; -const convertToBaseAsset = (options: BaseAssetRaw): BaseAsset => ({ - errors: typeof options.Errors !== "undefined" ? options.Errors.map(v => ({ - message: v.Message, - code: v.Code - })) : undefined, - isArchived: typeof options.IsArchived !== "undefined" ? options.IsArchived : undefined, - isCopyrightProtected: typeof options.IsCopyrightProtected !== "undefined" ? options.IsCopyrightProtected : undefined, - isHashDynamic: typeof options.IsHashDynamic !== "undefined" ? options.IsHashDynamic : undefined, - location: typeof options.Location !== "undefined" ? options.Location : undefined, - requestId: typeof options.RequestId !== "undefined" ? options.RequestId : undefined +const convertToBaseAsset = ( + options: AssetDeliveryBaseAssetRaw +): AssetDeliveryBaseAsset => ({ + errors: + typeof options.Errors !== "undefined" + ? options.Errors.map((v) => ({ + message: v.Message, + code: v.Code + })) + : undefined, + isArchived: + typeof options.IsArchived !== "undefined" ? options.IsArchived : undefined, + isCopyrightProtected: + typeof options.IsCopyrightProtected !== "undefined" + ? options.IsCopyrightProtected + : undefined, + isHashDynamic: + typeof options.IsHashDynamic !== "undefined" + ? options.IsHashDynamic + : undefined, + location: + typeof options.Location !== "undefined" ? options.Location : undefined, + requestId: + typeof options.RequestId !== "undefined" ? options.RequestId : undefined }); -const generateBaseDeliveryAssetOptions = (options: BaseAssetDeliveryOptions) => ({ - headers: { - "Accept-Encoding": options.acceptEncoding, - "Roblox-Place-Id": options.robloxPlaceId, - AssetType: options.assetType, - Accept: options.accept - }, - qs: { - skipSigningScripts: options.skipSigningScripts ? "true" : "false", - clientInsert: options.clientInsert, - scriptinsert: options.scriptInsert, - modulePlaceId: options.modulePlaceId, - serverplaceid: options.serverPlaceId, - expectedAssetType: options.expectedAssetType - } +const generateBaseDeliveryAssetOptions = ( + options: AssetDeliveryBaseOptions +) => ({ + headers: { + "Accept-Encoding": options.acceptEncoding, + "Roblox-Place-Id": options.robloxPlaceId, + AssetType: options.assetType, + Accept: options.accept + }, + qs: { + skipSigningScripts: options.skipSigningScripts ? "true" : "false", + clientInsert: options.clientInsert, + scriptinsert: options.scriptInsert, + modulePlaceId: options.modulePlaceId, + serverplaceid: options.serverPlaceId, + expectedAssetType: options.expectedAssetType + } }); -export type GetAssetByAliasOptions = BaseAssetDeliveryOptions & { alias: string }; -export type GetAssetByAlias = BaseAsset; -export type GetAssetByIdOptions = BaseAssetDeliveryOptions & { id: number }; -export type GetAssetById = { - location?: string; - request?: unknown; +export type AssetDeliveryGetAssetByAliasOptions = AssetDeliveryBaseOptions & { + alias: string; }; -export type GetAssetByHashOptions = BaseAssetDeliveryOptions & { hash: string }; -export type GetAssetByHash = unknown; -export type GetAssetByAssetIdOptions = BaseAssetDeliveryOptions & { assetId: number }; -export type GetAssetByAssetId = unknown; -export type GetAssetVersionByAssetIdOptions = BaseAssetDeliveryOptions & { assetId: number; version: number } -export type GetAssetVersionByAssetId = unknown; -export type GetAssetByAssetVersionIdOptions = BaseAssetDeliveryOptions & { assetVersionId: number } -export type GetAssetByAssetVersionId = unknown; -export type GetAssetByMarAssetHashOptions = BaseAssetDeliveryOptions & { marAssetHash: string; marCheckSum: string } -export type GetAssetByMarAssetHash = unknown; -export type GetAssetByUserAssetIdOptions = BaseAssetDeliveryOptions & { userAssetId: number } -export type GetAssetByUserAssetId = unknown -export type GetBatchAssetsOptions = { - assetName: string; - assetType: string; - clientInsert: boolean; - placeId: number; - requestId: string; - scriptInsert: boolean; - serverPlaceId: number; - universeId: number; - accept: string; - encoding: string; - hash: string; - userAssetId: number; +export type AssetDeliveryGetAssetByAlias = AssetDeliveryBaseAsset; +export type AssetDeliveryGetAssetByIdOptions = AssetDeliveryBaseOptions & { + id: number; +}; +export type AssetDeliveryGetAssetById = { + location?: string; + request?: unknown; +}; +export type AssetDeliveryGetAssetByHashOptions = AssetDeliveryBaseOptions & { + hash: string; +}; +export type AssetDeliveryGetAssetByHash = unknown; +export type AssetDeliveryGetAssetByAssetIdOptions = AssetDeliveryBaseOptions & { + assetId: number; +}; +export type AssetDeliveryGetAssetByAssetId = unknown; +export type AssetDeliveryGetAssetVersionByAssetIdOptions = + AssetDeliveryBaseOptions & { assetId: number; version: number; + }; +export type AssetDeliveryGetAssetVersionByAssetId = unknown; +export type AssetDeliveryGetAssetByAssetVersionIdOptions = + AssetDeliveryBaseOptions & { assetVersionId: number; - modulePlaceId: number; + }; +export type AssetDeliveryGetAssetByAssetVersionId = unknown; +export type AssetDeliveryGetAssetByMarAssetHashOptions = + AssetDeliveryBaseOptions & { + marAssetHash: string; + marCheckSum: string; + }; +export type AssetDeliveryGetAssetByMarAssetHash = unknown; +export type AssetDeliveryGetAssetByUserAssetIdOptions = + AssetDeliveryBaseOptions & { + userAssetId: number; + }; +export type AssetDeliveryGetAssetByUserAssetId = unknown; +export type AssetDeliveryGetBatchAssetsOptions = { + assetName: string; + assetType: string; + clientInsert: boolean; + placeId: number; + requestId: string; + scriptInsert: boolean; + serverPlaceId: number; + universeId: number; + accept: string; + encoding: string; + hash: string; + userAssetId: number; + assetId: number; + version: number; + assetVersionId: number; + modulePlaceId: number; }; -export type GetBatchAssets = BaseAsset[]; +export type AssetDeliveryGetBatchAssets = AssetDeliveryBaseAsset[]; -export default class AssetDeliveryAPI extends BaseAPI { - constructor (client: Client) { - super({ - baseUrl: "https://assetdelivery.roblox.com/", - client - }); - } +export class AssetDeliveryAPI extends BaseAPI { + constructor(client: Client) { + super({ + baseUrl: "https://assetdelivery.roblox.com/", + client + }); + } - getAssetByAlias (options: GetAssetByAliasOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/alias/${options.alias}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByAlias); - } + getAssetByAlias( + options: AssetDeliveryGetAssetByAliasOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/alias/${options.alias}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetById (options: GetAssetByIdOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/asset`, - qs: { - ...generatedOptions.qs, - id: options.id - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => ({ - location: response.body.Location || undefined, - request: response.body.Request - })); - } + getAssetById( + options: AssetDeliveryGetAssetByIdOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/asset`, + qs: { + ...generatedOptions.qs, + id: options.id + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => ({ + location: response.body.Location || undefined, + request: response.body.Request + })); + } - getAssetByHash (options: GetAssetByHashOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/assetHash/${options.hash}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByHash); - } + getAssetByHash( + options: AssetDeliveryGetAssetByHashOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetHash/${options.hash}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetByAssetId (options: GetAssetByAssetIdOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/assetId/${options.assetId}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByAssetId); - } + getAssetByAssetId( + options: AssetDeliveryGetAssetByAssetIdOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetId/${options.assetId}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetVersionByAssetId (options: GetAssetVersionByAssetIdOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/assetId/${options.assetId}/version/${options.version}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetVersionByAssetId); - } + getAssetVersionByAssetId( + options: AssetDeliveryGetAssetVersionByAssetIdOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetId/${options.assetId}/version/${options.version}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetByAssetVersionId (options: GetAssetByAssetVersionIdOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/assetVersionId/${options.assetVersionId}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByAssetVersionId); - } + getAssetByAssetVersionId( + options: AssetDeliveryGetAssetByAssetVersionIdOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/assetVersionId/${options.assetVersionId}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetByMarAssetHash (options: GetAssetByMarAssetHashOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/marAssetHash/${options.marAssetHash}/marCheckSum/${options.marCheckSum}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByMarAssetHash); - } + getAssetByMarAssetHash( + options: AssetDeliveryGetAssetByMarAssetHashOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/marAssetHash/${options.marAssetHash}/marCheckSum/${options.marCheckSum}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getAssetByUserAssetId (options: GetAssetByUserAssetIdOptions): Promise { - const generatedOptions = generateBaseDeliveryAssetOptions(options); - return this.request({ - json: true, - requiresAuth: true, - request: { - path: `v1/userAssetId/${options.userAssetId}`, - qs: { - ...generatedOptions.qs - }, - headers: { - ...generatedOptions.headers - } - } - }) - .then(response => convertToBaseAsset(response.body) as GetAssetByUserAssetId); - } + getAssetByUserAssetId( + options: AssetDeliveryGetAssetByUserAssetIdOptions + ): Promise { + const generatedOptions = generateBaseDeliveryAssetOptions(options); + return this.request({ + json: true, + requiresAuth: true, + request: { + path: `v1/userAssetId/${options.userAssetId}`, + qs: { + ...generatedOptions.qs + }, + headers: { + ...generatedOptions.headers + } + } + }).then((response) => convertToBaseAsset(response.body)); + } - getBatchAssets (options: GetBatchAssetsOptions): Promise { - return this.request({ - requiresAuth: true, - json: true, - request: { - path: "v1/assets/bath", - method: "POST", - json: options - } - }) - .then(response => response.body.map((value: BaseAssetRaw) => convertToBaseAsset(value)) as GetBatchAssets); - } + getBatchAssets( + options: AssetDeliveryGetBatchAssetsOptions + ): Promise { + return this.request({ + requiresAuth: true, + json: true, + request: { + path: "v1/assets/bath", + method: "POST", + json: options + } + }).then((response) => + response.body.map((value: AssetDeliveryBaseAssetRaw) => + convertToBaseAsset(value) + ) + ); + } } diff --git a/src/client/apis/AuthAPI.ts b/src/client/apis/AuthAPI.ts index 764648502..917e258e0 100644 --- a/src/client/apis/AuthAPI.ts +++ b/src/client/apis/AuthAPI.ts @@ -1,568 +1,558 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { UsernamePasswordOption } from "../../types/GenericOptionTypes"; - -export type GetAuthTicket = { - authTicket: string; +// AccountPin +export type AuthPin = { + pin: string; }; -export type GetAuthMetaData = { - cookieLawNoticeTimeout: number; +export type AuthUnlockPinOptions = AuthPin; +export type AuthUnlockPin = { + unlockedUntil: number; }; -export type LoginOptions = { - ctype: "Email" | "Username" | string; - cvalue: string; - password: string; - captchaToken: string; - captchaProvider: "PROVIDER_ARKOSELABS" | string; +export type AuthLockPin = { + success: boolean; }; -export type Login = { - user: { - id: number; - name: string; - displayName: string; - }; - twoStepVerificationData?: { - mediaType: "Email" | string; - ticket: string; - }; + +// Metadata +export type AuthMetaData = { + isUpdateUsernameEnabled: boolean; + ftuxAvatarAssetMap: string; + isEmailUpsellAtLogoutEnabled: boolean; + shouldFetchEmailUpsellIXPValuesAtLogout: boolean; + isAccountRecoveryPromptEnabled: boolean; + isContactMethodRequiredAtSignup: boolean; + isUserAgreementsSignupIntegrationEnabled: boolean; + isRetypePasswordRequired: boolean; + arePasswordFieldsPlaintext: boolean; + isKoreaIdVerificationEnabled: boolean; + isSignupButtonGreenColorEnabled: boolean; }; -export type Logout = unknown; -export type GetCredentialsVerificationStatusOptions = { - credentialType: "Email" | "Username" | "PhoneNumber"; - credentialValue: string; - password: string; -} -export type GetCredentialsVerificationStatus = { - canSend: boolean; -} -export type SendCredentialsVerificationMessageOptions = { - credentialType: "Email" | "Username" | "PhoneNumber"; - credentialValue: string; - password: string; -}; -export type SendCredentialsVerificationMessage = unknown; -export type GetMetaData = { - isUpdateUsernameEnabled: boolean; - ftuxAvatarAssetMap: string; -}; -export type GetCurrentPasswordStatus = { - valid: boolean; +export type AuthTicket = { + authTicket: string; }; -export type GetPasswordResetMetaDataOptions = { - targetType: "Email" | "PhoneNumber"; - ticket: string; -} -export type GetPasswordResetMetaData = { - users: { - userId: number; - username: string; - displayName: string; - }[]; -} -export type ResetPasswordOptions = { - targetType: "Email" | "PhoneNumber"; - ticket: string; - userId: number; - password: string; - passwordRepeated: string; +export type AuthEndpointMetaData = { + cookieLawNoticeTimeout: number; }; -export type ResetPassword = Login; -export type ValidatePasswordOptions = { - username: string; - password: string; -} -export type ValidatePassword = { - code: string; - message: string; -} -export type SendPasswordResetOptions = { - targetType: ResetPasswordOptions["targetType"]; - target: string; - captchaToken: string; - captchaProvider: "PROVIDER_ARKOSELABS" | string; -} -export type SendPasswordReset = { - nonce: string; - transmissionType: string; -} -export type VerifyPasswordResetOptions = { - targetType: ResetPasswordOptions["targetType"]; - nonce: string; - code: string; -} -export type VerifyPasswordReset = { - userTickets: { - user: { - userId: number; - username: string; - displayName: string; - }; - ticket: string; - }[]; -} -export type ChangeUserPasswordOptions = { - currentPassword: string; - newPassword: string; -} -export type ChangeUserPassword = unknown; -export type GetRecoveryMetaData = { - isOnPhone: boolean; - codeLength: number; - isPhoneFeatureEnabledForUsername: boolean; - isPhoneFeatureEnabledForPassword: boolean; - isBedev2CaptchaEnabledForPasswordReset: boolean; -} -export type RevertAccountInfoOptions = { - ticket: string; -} -export type RevertAccountInfo = { - isTwoStepVerificationEnabled: boolean; - isEmailVerified: boolean; - isEmailChanged: boolean; - userId: number; - username: string; +export type AuthLoginOptions = { + ctype: "Email" | "Username" | string; + cvalue: string; + password: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export type AuthLogin = { + user: { + id: number; + name: string; + displayName: string; + }; + twoStepVerificationData?: { + mediaType: "Email" | string; ticket: string; -} -export type RevertAccountOptions = { + }; +}; +export type AuthCredentialsVerificationOptions = { + credentialType: "Email" | "Username" | "PhoneNumber"; + credentialValue: string; + password: string; +}; +export type AuthGetCredentialsVerificationStatus = { + canSend: boolean; +}; +export type AuthGetCurrentPasswordStatus = { + valid: boolean; +}; +export type AuthGetPasswordResetMetaDataOptions = { + targetType: "Email" | "PhoneNumber"; + ticket: string; +}; +export type AuthGetPasswordResetMetaData = { + users: { userId: number; - newPassword: string; - ticket: string; -} -export type RevertAccount = Login; -export type GetSAMLMetaData = unknown; -export type SAMLRequest = unknown -export type GetTwoStepVerificationMetaData = { - codeLength: number; - loadingImageUrl: string; - supportUrl: string; -} -export type ResendTwoStepVerificationOptions = { username: string; - ticket: string; - actionType: string; -} -export type ResendTwoStepVerification = RequestTwoStepVerification; -export type RequestTwoStepVerification = { - mediaType: "Email" | "PhoneNumber" | string; - ticket: string; + displayName: string; + }[]; }; -export type VerifyTwoStepVerificationOptions = { - username: string; +export type AuthResetPasswordOptions = { + targetType: "Email" | "PhoneNumber"; + ticket: string; + userId: number; + password: string; + passwordRepeated: string; +}; +export type AuthValidatePassword = { + code: string; + message: string; +}; +export type AuthSendPasswordResetOptions = { + targetType: AuthResetPasswordOptions["targetType"]; + target: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export type AuthSendPasswordReset = { + nonce: string; + transmissionType: string; +}; +export type AuthVerifyPasswordResetOptions = { + targetType: AuthResetPasswordOptions["targetType"]; + nonce: string; + code: string; +}; +export type AuthVerifyPasswordReset = { + userTickets: { + user: { + userId: number; + username: string; + displayName: string; + }; ticket: string; - code: string; - rememberDevice: boolean; - actionType: string; -} -export type VerifyTwoStepVerification = unknown -export type GetExistingUsernamesOptions = { - username: string; -} -export type GetExistingUsernames = { - usernames: string[]; -} -export type ValidateUsernameOptions = { - username: string; - birthday: string; - context: "Unknown" | "Signup" | "UsernameChange" | string; -} -export type ValidateUsername = { - code: string; - message: string; -} -export type RecoverUsernamesOptions = { - targetType: "Email" | string; - target: string; -} -export type RecoverUsernames = { - transmissionType: string; + }[]; }; -export type SignUpOptions = { - username: string; - password: string; - gender: "Unknown" | string; - birthday: string; - isTosAgreementBoxChecked: boolean; - email: string; - locale: string; - assetIds: number[]; - bodyColorId: number; - bodyTypeScale: number; - headScale: number; - heightScale: number; - widthScale: number; - proportionScale: number; - captchaToken: string; - captchaProvider: string; -} -export type SignUp = { - userId: number; - starterPlaceId: number; -} -export type ChangeUsernameOptions = { - username: string; - password: string; -} -export type ChangeUsername = unknown - -export default class AuthAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://auth.roblox.com/" - }); - } - - getAuthTicket (): Promise { - return this.request({ - json: true, - requiresAuth: true, - request: { - path: "v1/authentication-ticket", - method: "POST", - headers: { - referer: "https://www.roblox.com/", - origin: "roblox.com" - } - } - }) - .then(response => ({ - authTicket: response.headers["rbx-authentication-ticket"] - })); - } - - getAuthMetaData (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/auth/metadata" - } - }) - .then(response => response.body as GetAuthMetaData); - } +export type AuthChangeUserPasswordOptions = { + currentPassword: string; + newPassword: string; +}; +export type AuthGetRecoveryMetaData = { + isOnPhone: boolean; + codeLength: number; + isPhoneFeatureEnabledForUsername: boolean; + isPhoneFeatureEnabledForPassword: boolean; + isBedev2CaptchaEnabledForPasswordReset: boolean; +}; +export type AuthRevertAccountInfoOptions = { + ticket: string; +}; +export type AuthRevertAccountInfo = { + isTwoStepVerificationEnabled: boolean; + isEmailVerified: boolean; + isEmailChanged: boolean; + userId: number; + username: string; + ticket: string; +}; +export type AuthRevertAccountOptions = { + userId: number; + newPassword: string; + ticket: string; +}; +export type AuthGetSAMLMetaData = unknown; +export type AuthSAMLRequest = unknown; +export type AuthGetTwoStepVerificationMetaData = { + codeLength: number; + loadingImageUrl: string; + supportUrl: string; +}; +export type AuthResendTwoStepVerificationOptions = { + username: string; + ticket: string; + actionType: string; +}; +export type AuthTwoStepVerification = { + mediaType: "Email" | "PhoneNumber" | string; + ticket: string; +}; +export type AuthVerifyTwoStepVerificationOptions = { + username: string; + ticket: string; + code: string; + rememberDevice: boolean; + actionType: string; +}; +export type AuthVerifyTwoStepVerification = unknown; +export type AuthGetExistingUsernamesOptions = { + username: string; +}; +export type AuthGetExistingUsernames = { + usernames: string[]; +}; +export type AuthValidateUsernameOptions = { + username: string; + birthday: string; + context: "Unknown" | "Signup" | "UsernameChange" | string; +}; +export type AuthValidateUsername = { + code: string; + message: string; +}; +export type AuthRecoverUsernamesOptions = { + targetType: "Email" | string; + target: string; +}; +export type AuthRecoverUsernames = { + transmissionType: string; +}; +export type AuthSignUpOptions = { + username: string; + password: string; + gender: "Unknown" | string; + birthday: string; + isTosAgreementBoxChecked: boolean; + email: string; + locale: string; + assetIds: number[]; + bodyColorId: number; + bodyTypeScale: number; + headScale: number; + heightScale: number; + widthScale: number; + proportionScale: number; + captchaToken: string; + captchaProvider: string; +}; +export type AuthSignUp = { + userId: number; + starterPlaceId: number; +}; +export type AuthChangeUsernameOptions = { + username: string; + password: string; +}; +export type AuthChangeUsername = unknown; +export type AuthChangeUserPassword = unknown; +export type AuthResetPassword = AuthLogin & { + identityVerificationLoginTicket: string; + isBanned: boolean; +}; +export type AuthRevertAccount = AuthResetPassword; - login (options: LoginOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/login", - method: "POST", - json: options - } - }) - .then(response => response.body as Login); - } +export class AuthAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://auth.roblox.com/" + }); + } - logout (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/logout", - method: "POST" - } - }) - .then(response => response.body as Logout); - } + unlockPin(options: AuthUnlockPinOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/pin/unlock", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getCredentialsVerificationStatus (options: GetCredentialsVerificationStatusOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/credentials/verification", - qs: { - "request.credentialType": options.credentialType, - "request.credentialValue": options.credentialValue, - "request.password": options.password - } - } - }) - .then(response => response.body as GetCredentialsVerificationStatus); - } + lockPin(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/account/pin/lock", + method: "POST" + }, + json: true + }).then((response) => response.body); + } - sendCredentialsVerificationMessage (options: SendCredentialsVerificationMessageOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/credentials/verification/send", - method: "POST", - json: options - } - }) - .then(response => response.body as SendCredentialsVerificationMessage); - } + getAuthTicket(): Promise { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v1/authentication-ticket", + method: "POST", + headers: { + referer: "https://www.roblox.com/", + origin: "roblox.com" + } + } + }).then((response) => ({ + authTicket: response.headers["rbx-authentication-ticket"] + })); + } - getMetaData (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/metadata" - } - }) - .then(response => response.body as GetMetaData); - } + getMetaData(): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/metadata" + } + }).then((response) => ({ + isUpdateUsernameEnabled: response.body.isUpdateUsernameEnabled, + ftuxAvatarAssetMap: response.body.ftuxAvatarAssetMap, + isEmailUpsellAtLogoutEnabled: response.body.IsEmailUpsellAtLogoutEnabled, + shouldFetchEmailUpsellIXPValuesAtLogout: + response.body.ShouldFetchEmailUpsellIXPValuesAtLogout, + isAccountRecoveryPromptEnabled: + response.body.IsAccountRecoveryPromptEnabled, + isContactMethodRequiredAtSignup: + response.body.IsContactMethodRequiredAtSignup, + isUserAgreementsSignupIntegrationEnabled: + response.body.IsUserAgreementsSignupIntegrationEnabled, + isRetypePasswordRequired: response.body.IsRetypePasswordRequired, + arePasswordFieldsPlaintext: response.body.ArePasswordFieldsPlaintext, + isKoreaIdVerificationEnabled: response.body.IsKoreaIdVerificationEnabled, + isSignupButtonGreenColorEnabled: + response.body.IsSignupButtonGreenColorEnabled + })); + } - getCurrentUserPasswordStatus (): Promise { - return this.request({ - json: true, - requiresAuth: true, - request: { - path: "v2/passwords/current-status" - } - }) - .then(response => response.body as GetCurrentPasswordStatus); - } + getCurrentUserPasswordStatus(): Promise { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/passwords/current-status" + } + }).then((response) => response.body); + } - getPasswordResetMetaData (options: GetPasswordResetMetaDataOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/passwords/reset", - qs: { - "request.targetType": options.targetType, - "request.ticket": options.ticket - } - } - }) - .then(response => response.body as GetPasswordResetMetaData); - } + getPasswordResetMetaData( + options: AuthGetPasswordResetMetaDataOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset", + qs: { + "request.targetType": options.targetType, + "request.ticket": options.ticket + } + } + }).then((response) => response.body); + } - resetPassword (options: ResetPasswordOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/auth/metadata", - method: "POST", - json: options - } - }) - .then(response => response.body as ResetPassword); - } + resetPassword(options: AuthResetPasswordOptions): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset", + method: "POST", + json: options + } + }).then((response) => response.body); + } - validatePassword (options: ValidatePasswordOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/passwords/validate", - qs: { - "request.username": options.username, - "request.password": options.password - } - } - }) - .then(response => response.body as ValidatePassword); - } + validatePassword( + options: UsernamePasswordOption + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/validate", + qs: { + "request.username": options.username, + "request.password": options.password + } + } + }).then((response) => response.body); + } - sendPasswordReset (options: SendPasswordResetOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/passwords/reset/send", - method: "POST", - json: options - } - }) - .then(response => response.body as SendPasswordReset); - } + sendPasswordReset( + options: AuthSendPasswordResetOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset/send", + method: "POST", + json: options + } + }).then((response) => response.body); + } - verifyPasswordReset (options: VerifyPasswordResetOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/passwords/reset/verify", - method: "POST", - json: options - } - }) - .then(response => response.body as VerifyPasswordReset); - } + verifyPasswordReset( + options: AuthVerifyPasswordResetOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/passwords/reset/verify", + method: "POST", + json: options + } + }).then((response) => response.body); + } - changeUserPassword (options: ChangeUserPasswordOptions): Promise { - return this.request({ - json: true, - requiresAuth: true, - request: { - path: "v2/user/passwords/change", - method: "POST", - json: options - } - }) - .then(response => response.body as ChangeUserPassword); - } + changeUserPassword( + options: AuthChangeUserPasswordOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/user/passwords/change", + method: "POST", + json: options + } + }).then((response) => response.body); + } - getRecoveryMetaData (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/recovery/metadata" - } - }) - .then(response => response.body as GetRecoveryMetaData); - } + getRecoveryMetaData(): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/recovery/metadata" + } + }).then((response) => response.body); + } - getRevertAccountInfo (options: RevertAccountInfoOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/revert/account", - qs: { - ticket: options.ticket - } - } - }) - .then(response => response.body as RevertAccountInfo); - } + getRevertAccountInfo( + options: AuthRevertAccountInfoOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/revert/account", + qs: { + ticket: options.ticket + } + } + }).then((response) => response.body); + } - revertAccount (options: RevertAccountOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/revert/account", - method: "POST", - json: options - } - }) - .then(response => response.body as RevertAccount); - } + revertAccount(options: AuthRevertAccountOptions): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/revert/account", + method: "POST", + json: options + } + }).then((response) => response.body); + } - getSAMLMetaData (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/saml/metadata" - } - }) - .then(response => response.body as GetSAMLMetaData); - } + getSAMLMetaData(): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/saml/metadata" + } + }).then((response) => response.body); + } - samlAuthenticate (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/saml/login", - method: "POST" - } - }) - .then(response => response.body as SAMLRequest); - } + samlAuthenticate(): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/saml/login", + method: "POST" + } + }).then((response) => response.body); + } - getTwoStepVerificationMetaData (): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/twostepverification/metadata" - } - }) - .then(response => response.body as GetTwoStepVerificationMetaData); - } + getTwoStepVerificationMetaData(): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata" + } + }).then((response) => response.body); + } - resendTwoStepVerificationCode (options: ResendTwoStepVerificationOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/twostepverification/resend", - method: "POST", - json: options - } - }) - .then(response => response.body as ResendTwoStepVerification); - } + resendTwoStepVerificationCode( + options: AuthResendTwoStepVerificationOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/resend", + method: "POST", + json: options + } + }).then((response) => response.body); + } - verifyTwoStepCode (options: VerifyTwoStepVerificationOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/twostepverification/verify", - method: "POST", - json: options - } - }) - .then(response => response.body as VerifyTwoStepVerification); - } + verifyTwoStepVerificationCode( + options: AuthVerifyTwoStepVerificationOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/verify", + method: "POST", + json: options + } + }).then((response) => response.body); + } - getExistingUsernames (options: GetExistingUsernamesOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/usernames", - qs: { - username: options.username - } - } - }) - .then(response => response.body as GetExistingUsernames); - } + getExistingUsernames( + options: AuthGetExistingUsernamesOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/usernames", + qs: { + username: options.username + } + } + }).then((response) => response.body); + } - validateUsername (options: ValidateUsernameOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/usernames/validate", - qs: { - "request.username": options.username, - "request.birthday": options.birthday, - "request.context": options.context - } - } - }) - .then(response => response.body as ValidateUsername); - } + validateUsername( + options: AuthValidateUsernameOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/usernames/validate", + qs: { + "request.username": options.username, + "request.birthday": options.birthday, + "request.context": options.context + } + } + }).then((response) => response.body); + } - recoverUsernames (options: RecoverUsernamesOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/twostepverification/metadata", - json: options - } - }) - .then(response => response.body as RecoverUsernames); - } + recoverUsernames( + options: AuthRecoverUsernamesOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata", + json: options + } + }).then((response) => response.body); + } - signUp (options: SignUpOptions): Promise { - return this.request({ - json: true, - requiresAuth: false, - request: { - path: "v2/twostepverification/metadata", - method: "POST", - json: options - } - }) - .then(response => response.body as SignUp); - } + signUp(options: AuthSignUpOptions): Promise { + return this.request({ + json: true, + requiresAuth: false, + request: { + path: "v2/twostepverification/metadata", + method: "POST", + json: options + } + }).then((response) => response.body); + } - changeUserUsername (options: ChangeUsernameOptions): Promise { - return this.request({ - json: true, - requiresAuth: true, - request: { - path: "v2/username", - method: "POST", - json: options - } - }) - .then(response => response.body as ChangeUsername); - } + changeUserUsername( + options: AuthChangeUsernameOptions + ): Promise { + return this.request({ + json: true, + requiresAuth: true, + request: { + path: "v2/username", + method: "POST", + json: options + } + }).then((response) => response.body); + } } diff --git a/src/client/apis/AvatarAPI.ts b/src/client/apis/AvatarAPI.ts index f919ae1ce..b388b98c4 100644 --- a/src/client/apis/AvatarAPI.ts +++ b/src/client/apis/AvatarAPI.ts @@ -1,452 +1,401 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import type { + AssetIdOption, + AssetIdsOption, + SuccessResponse, + UserIdOption +} from "../.."; - -export type BodyScales = { - height: number; - width: number; - head: number; - depth: number; - proportion: number; - bodyType: number; -} -export type BodyColors = { - headColorId: number; - torsoColorId: number; - rightArmColorId: number; - leftArmColorId: number; - rightLegColorId: number; - leftLegColorId: number; +export type AvatarBodyScales = { + height: number; + width: number; + head: number; + depth: number; + proportion: number; + bodyType: number; }; -export type Scale = { - min: number; - max: number; - increment: number; +export type AvatarBodyColors = { + headColorId: number; + torsoColorId: number; + rightArmColorId: number; + leftArmColorId: number; + rightLegColorId: number; + leftLegColorId: number; }; -export type ColorPalette = { - brickColorId: number; - hexColor: string; - name: string; -} - -export type UserAvatar = { - scales: BodyScales; - playerAvatarType: "R6" | "R15" | string; - bodyColors: BodyColors; - assets: { - id: number; - name: string; - assetType: { - id: number; - name: string; - }; - }[]; - defaultShirtApplied: boolean; - defaultPantsApplied: boolean; - emotes: { - assetId: number; - assetName: string; - position: number; - }[]; -} -export type GetAvatarMetadata = { - enableDefaultClothingMessage: boolean; - isAvatarScaleEmbeddedInTab: boolean; - isBodyTypeScaleOutOfTab: boolean; - scaleHeightIncrement: number; - scaleWidthIncrement: number; - scaleHeadIncrement: number; - scaleProportionIncrement: number; - scaleBodyTypeIncrement: number; - supportProportionAndBodyType: boolean; - showDefaultClothingMessageOnPageLoad: boolean; - areThreeDeeThumbsEnabled: boolean; -}; -export type GetAvatarRules = { - playerAvatarTypes: ("R6" | "R15" | string)[]; - scales: { - height: Scale; - width: Scale; - head: Scale; - bodyType: Scale; - }; - wearableAssetTypes: { - maxNumber: number; - id: number; - name: string; - }[]; - bodyColorsPalette: ColorPalette[]; - basicBodyColorsPalette: ColorPalette[]; - minimumDeltaEBodyColorDifference: number; - proportionsAndBodyTypeEnabledForUser: boolean; - defaultClothingAssetLists: { - defaultShirtAssetIds: number[]; - defaultPantAssetIds: number[]; - }; - bundlesEnabledForUser: boolean; - emotesEnabledForUser: boolean; - -} -export type GetUserAvatarOptions = { - userId: number; -} -export type GetUserAvatar = UserAvatar; -export type GetUserCurrentlyWearingOptions = { - userId: number; -} -export type GetUserCurrentlyWearing = { - assetIds: number[]; +export type AvatarScale = { + min: number; + max: number; + increment: number; }; -export type GetUserOutfitsOptions = { - userId: number; - page?: number; - itemsPerPage?: number; - isEditable?: boolean; -} -export type GetUserOutfits = { - filteredCount: number; - data: { - id: number; - name: string; - isEditable: boolean; - }[]; - total: number; +export type AvatarColorPalette = { + brickColorId: number; + hexColor: string; + name: string; }; -export type RemoveAssetFromAvatarOptions = { + +export type AvatarUserAvatar = { + scales: AvatarBodyScales; + playerAvatarType: "R6" | "R15" | string; + bodyColors: AvatarBodyColors; + assets: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + defaultShirtApplied: boolean; + defaultPantsApplied: boolean; + emotes: { assetId: number; + assetName: string; + position: number; + }[]; }; -export type RemoveAssetFromAvatar = { - success: boolean; -}; -export type WearAssetOnAvatarOptions = { - assetId: number; +export type AvatarGetMetaData = { + enableDefaultClothingMessage: boolean; + isAvatarScaleEmbeddedInTab: boolean; + isBodyTypeScaleOutOfTab: boolean; + scaleHeightIncrement: number; + scaleWidthIncrement: number; + scaleHeadIncrement: number; + scaleProportionIncrement: number; + scaleBodyTypeIncrement: number; + supportProportionAndBodyType: boolean; + showDefaultClothingMessageOnPageLoad: boolean; + areThreeDeeThumbsEnabled: boolean; }; -export type WearAssetOnAvatar = { - success: boolean; +export type AvatarGetRules = { + playerAvatarTypes: ("R6" | "R15" | string)[]; + scales: { + height: AvatarScale; + width: AvatarScale; + head: AvatarScale; + bodyType: AvatarScale; + }; + wearableAssetTypes: { + maxNumber: number; + id: number; + name: string; + }[]; + bodyColorsPalette: AvatarColorPalette[]; + basicBodyColorsPalette: AvatarColorPalette[]; + minimumDeltaEBodyColorDifference: number; + proportionsAndBodyTypeEnabledForUser: boolean; + defaultClothingAssetLists: { + defaultShirtAssetIds: number[]; + defaultPantAssetIds: number[]; + }; + bundlesEnabledForUser: boolean; + emotesEnabledForUser: boolean; }; -export declare type RedrawThumbnail = unknown; -export type SetBodyColorsOptions = BodyColors; -export type SetBodyColors = { - success: boolean; -} -export type SetPlayerAvatarTypeOptions = { - playerAvatarType: "R6" | "R15" | string; +export type AvatarGetUserOutfits = { + filteredCount: number; + data: { + id: number; + name: string; + isEditable: boolean; + }[]; + total: number; }; -export type SetPlayerAvatarType = { - success: boolean; +export declare type AvatarRedrawThumbnail = unknown; +export type AvatarSetPlayerAvatarWearingAssets = { + invalidAssets?: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + invalidAssetIds?: number[]; + success: boolean; }; -export type SetPlayerAvatarScalesOptions = BodyScales; -export type SetPlayerAvatarScales = { - success: boolean; -} -export type SetPlayerAvatarWearingAssetsOptions = { - assetIds: number[]; +export type AvatarGetOutfit = { + id: number; + name: string; + assets: { + id: number; + name: string; + assetType: { + id: number; + name: string; + }; + }[]; + bodyColors: AvatarBodyColors; + scale: { + height: number; + width: number; + head: number; + depth: number; + proportion: number; + bodyType: number; + }; + playerAvatarType: string; + isEditable: boolean; }; -export type SetPlayerAvatarWearingAssets = { - invalidAssets?: { - id: number; - name: string; - assetType: { - id: number; - name: string; - }; - }[]; - invalidAssetIds?: number[]; - success: boolean; -} -export type GetOutfitOptions = { - userOutfitId: number; -} -export type GetOutfit = { +export type AvatarWearOutfit = AvatarSetPlayerAvatarWearingAssets; +export type AvatarGetRecentItems = { + data: { id: number; name: string; - assets: { - id: number; - name: string; - assetType: { - id: number; - name: string; - }; - }[]; - bodyColors: BodyColors; - scale: { - height: number; - width: number; - head: number; - depth: number; - proportion: number; - bodyType: number; + type: string; + assetType: { + id: number; + name: string; }; - playerAvatarType: string; isEditable: boolean; + }[]; + total: number; +}; +export type AvatarGetUserOutfitsOptions = { + userId: number; + page?: number; + itemsPerPage?: number; + isEditable?: boolean; +}; +export type AvatarSetSelfAvatarBodyColorsOptions = AvatarBodyColors; +export type AvatarSetSelfAvatarTypeOptions = { + playerAvatarType: "R6" | "R15"; +}; +export type AvatarSetSelfAvatarScalesOptions = AvatarBodyScales; +export type AvatarGetOutfitOptions = { + userOutfitId: number; +}; +export type AvatarDeleteOutfitOptions = AvatarGetOutfitOptions; +export type AvatarUpdateOutfitOptions = Omit; +export type AvatarWearOutfitOptions = { + userOutfitId: number; +}; +export type AvatarCreateOutfitOptions = AvatarUpdateOutfitOptions; +export type AvatarGetRecentlyUsedOptions = { + recentItemListType: string; }; -export type DeleteOutfitOptions = { - userOutfitId: number; -} -export type DeleteOutfit = { - success: boolean; -} -export type UpdateOutfitOptions = Omit; -export type UpdateOutfit = { - success: boolean; -} -export type WearOutfitOptions = { - userOutfitId: number; -} -export type WearOutfit = SetPlayerAvatarWearingAssets; -export type CreateOutfitOptions = Omit -export type CreateOutfit = { - success: boolean; -} -export type GetRecentItemsOptions = { - recentItemListType: "All" | "Clothing" | "BodyParts" | "AvatarAnimations" | "Accessories" | "Outfits" | "Gear" | string; -} -export type GetRecentItems = { - data: { - id: number; - name: string; - type: string; - assetType: { - id: number; - name: string; - }; - isEditable: boolean; - }[]; - total: number; -} - -export default class AvatarAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://avatar.roblox.com/" - }); - } +export class AvatarAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://avatar.roblox.com/" + }); + } - getSelfAvatar (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar" - }, - json: true - }) - .then(response => response.body); - } + getSelfAvatar(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar" + }, + json: true + }).then((response) => response.body); + } - getAvatarMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "v1/avatar/metadata" - }, - json: true - }) - .then(response => response.body); - } + getAvatarMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "v1/avatar/metadata" + }, + json: true + }).then((response) => response.body); + } - getAvatarRules (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar-rules" - }, - json: true - }) - .then(response => response.body); - } + getAvatarRules(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar-rules" + }, + json: true + }).then((response) => response.body); + } - getUserAvatar (options: GetUserAvatarOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/avatar` - }, - json: true - }) - .then(response => response.body); - } + getUserAvatar(options: UserIdOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/avatar` + }, + json: true + }).then((response) => response.body); + } - getUserCurrentlyWearing (options: GetUserCurrentlyWearingOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/currently-wearing` - }, - json: true - }) - .then(response => response.body); - } + getUserCurrentlyWearing(options: UserIdOption): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/currently-wearing` + }, + json: true + }).then((response) => response.body); + } - getUserOutfits (options: GetUserOutfitsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/outfits` - }, - json: true - }) - .then(response => response.body); - } + getUserOutfits( + options: AvatarGetUserOutfitsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/outfits` + }, + json: true + }).then((response) => response.body); + } - removeAssetFromAvatar (options: RemoveAssetFromAvatarOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/avatar/assets/${options.assetId}/remove`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + removeAssetFromAvatar(options: AssetIdOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/avatar/assets/${options.assetId}/remove`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - wearAssetOnAvatar (options: WearAssetOnAvatarOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/avatar/assets/${options.assetId}/wear`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + wearAssetOnAvatar(options: AssetIdOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/avatar/assets/${options.assetId}/wear`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - redrawThumbnail (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar/redraw-thumbnail", - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + redrawThumbnail(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/redraw-thumbnail", + method: "POST" + }, + json: true + }).then((response) => response.body); + } - setSelfAvatarBodyColors (options: SetBodyColorsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar/set-body-colors", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setSelfAvatarBodyColors( + options: AvatarSetSelfAvatarBodyColorsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-body-colors", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setSelfAvatarType (options: SetPlayerAvatarTypeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar/set-player-avatar-type", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setSelfAvatarType( + options: AvatarSetSelfAvatarTypeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-player-avatar-type", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setSelfAvatarScales (options: SetPlayerAvatarScalesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar/set-scales", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setSelfAvatarScales( + options: AvatarSetSelfAvatarScalesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-scales", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setSelfWearingAssets (options: SetPlayerAvatarWearingAssetsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/avatar/set-swearing-assets", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setSelfWearingAssets(options: AssetIdsOption): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/avatar/set-swearing-assets", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getOutfit (options: GetOutfitOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/outfits/${options.userOutfitId}/details` - }, - json: true - }) - .then(response => response.body); - } + getOutfit(options: AvatarGetOutfitOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/details` + }, + json: true + }).then((response) => response.body); + } - deleteOutfit (options: DeleteOutfitOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/outfits/${options.userOutfitId}/delete`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + deleteOutfit(options: AvatarDeleteOutfitOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/delete`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - updateOutfit (options: UpdateOutfitOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/outfits/${options.id}/update`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + updateOutfit(options: AvatarUpdateOutfitOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.id}/update`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - wearOutfit (options: WearOutfitOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/outfits/${options.userOutfitId}/wear`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + wearOutfit(options: AvatarWearOutfitOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/outfits/${options.userOutfitId}/wear`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - createOutfit (options: CreateOutfitOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "v1/outfits/create", - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + createOutfit(options: AvatarCreateOutfitOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "v1/outfits/create", + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getRecentlyUsed (options: GetRecentItemsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/recent-items/${options.recentItemListType}/list` - }, - json: true - }) - .then(response => response.body); - } + getRecentlyUsed( + options: AvatarGetRecentlyUsedOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/recent-items/${options.recentItemListType}/list` + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/BadgesAPI.ts b/src/client/apis/BadgesAPI.ts index 1951b6afc..4d873aea0 100644 --- a/src/client/apis/BadgesAPI.ts +++ b/src/client/apis/BadgesAPI.ts @@ -1,147 +1,177 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { GameBadgeOptions } from "../../structures/Game"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { SortOption } from "../.."; +export type BadgesMetaData = { + badgeCreationPrice: number; + maxBadgeNameLength: number; + maxBadgeDescriptionLength: number; +}; -export type GetBadgeOptions = { - badgeId: number; -} -export type GetBadge = GameBadgeOptions; -export type UpdateBadgeOptions = { +export type BadgesGetBadge = { + id: number; + name: string; + description: string; + displayName: string; + displayDescription: string; + enabled: boolean; + iconImageId: number; + displayIconImageId: number; + created: string; + updated: string; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: { id: number; name: string; - description: string; - enabled: boolean; + rootPlaceId: number; + }; }; -export type UpdateBadge = unknown; -export type GetUniverseBadgesOptions = { - universeId: number; - limit?: 10 | 25 | 50 | 100; - cursor?: string; - sortOrder?: "Asc" | "Desc"; -} -export type GetUniverseBadges = { - previousPageCursor: string; - nextPageCursor: string; - data: GetBadge[]; +export type BadgesUpdateBadge = unknown; +export type BadgesGetBadges = { + previousPageCursor: string; + nextPageCursor: string; + data: BadgesGetBadge[]; }; -export type GetUserBadgesOptions = { - userId: number; - limit?: 10 | 25 | 50 | 100; - cursor?: string; - sortOrder?: "Asc" | "Desc"; -} -export type GetUserBadges = GetUniverseBadges; -export type GetUserBadgesAwardedDatesOptions = { - userId: number; - badgeIds: number[]; -} -export type GetUserBadgesAwardedDates = { - data: { - badgeId: number; - awardedDate: string; - }[]; -} -export type DeleteBadgeFromUserOptions = { - userId: number; - badgeId: number; -} -export type DeleteBadgeFromUser = unknown; -export type DeleteBadgeFromSelfOptions = { +export type BadgesGetUserBadgesAwardedDates = { + data: { badgeId: number; -} -export type DeleteBadgeFromSelf = DeleteBadgeFromUser; + awardedDate: string; + }[]; +}; +export type BadgesDeleteBadgeFromUser = unknown; +export type BadgesDeleteBadgeFromSelf = BadgesDeleteBadgeFromUser; +export type BadgesGetBadgeOptions = { + badgeId: number; +}; +export type BadgesUpdateBadgeOptions = { + id: number; + name: string; + description: string; + enabled: boolean; +}; +export type BadgesGetUniverseBadgesOptions = { + universeId: number; +} & SortOption; +export type BadgesGetUserBadgesOptions = { + userId: number; +} & SortOption; +export type BadgesGetUserBadgesAwardedDatesOptions = { + userId: number; + badgeIds: number[]; +}; +export type BadgesDeleteBadgeFromUserOptions = { + userId: number; + badgeId: number; +}; +export type BadgesDeleteBadgeFromSelfOptions = { + badgeId: number; +}; + +export class BadgesAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://badges.roblox.com/" + }); + } -export default class AvatarAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://badges.roblox.com/" - }); - } + getMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "v1/badges/metadata" + }, + json: true + }).then((response) => response.body); + } - getBadge (options: GetBadgeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/badges/${options.badgeId}` - }, - json: true - }) - .then(response => response.body); - } + getBadge(options: BadgesGetBadgeOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.badgeId}` + }, + json: true + }).then((response) => response.body); + } - updateBadge (options: UpdateBadgeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/badges/${options.id}`, - method: "PATCH" - }, - json: true - }) - .then(response => response.body); - } + updateBadge(options: BadgesUpdateBadgeOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.id}`, + method: "PATCH" + }, + json: true + }).then((response) => response.body); + } - getUniverseBadges (options: GetUniverseBadgesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/badges`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUniverseBadges( + options: BadgesGetUniverseBadgesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/badges`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserBadges (options: GetUserBadgesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/badges`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserBadges(options: BadgesGetUserBadgesOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/badges`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserBadgesAwardedDates (options: GetUserBadgesAwardedDatesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/badges/awarded-dates`, - qs: { - badgeIds: options.badgeIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getUserBadgesAwardedDates( + options: BadgesGetUserBadgesAwardedDatesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/badges/awarded-dates`, + qs: { + badgeIds: options.badgeIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - deleteBadgeFromUser (options: DeleteBadgeFromUserOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/${options.userId}/badges/${options.badgeId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + deleteBadgeFromUser( + options: BadgesDeleteBadgeFromUserOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/${options.userId}/badges/${options.badgeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - deleteBadgeFromSelf (options: DeleteBadgeFromSelfOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/badges/${options.badgeId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + deleteBadgeFromSelf( + options: BadgesDeleteBadgeFromSelfOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/badges/${options.badgeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/BaseAPI.ts b/src/client/apis/BaseAPI.ts index a2094062c..0378e0361 100644 --- a/src/client/apis/BaseAPI.ts +++ b/src/client/apis/BaseAPI.ts @@ -1,55 +1,64 @@ import { BaseAPIOptions } from "../../interfaces/APIInterfaces"; -import { RESTRequestOptions, RESTResponseDataType } from "../../interfaces/RESTInterfaces"; -import Client from "../Client"; +import { + RESTRequestOptions, + RESTResponseDataType +} from "../../interfaces/RESTInterfaces"; +import { Client } from "../Client"; - -export declare type BaseAPIRequestOptions = { - /** - * The request options - */ - request: Omit & { - url?: string; - path?: string; - }; - /** - * If the client must be authenticated in order to send the request - */ - requiresAuth: boolean; - /** - * If the response body is JSON - */ - json?: boolean; +export type BaseAPIRequestOptions = { + /** + * The request options + */ + request: Omit & { + url?: string; + path?: string; + }; + /** + * If the client must be authenticated in order to send the request + */ + requiresAuth: boolean; + /** + * If the response body is JSON + */ + json?: boolean; }; -export default class BaseAPI { - public client: Client; - public options: BaseAPIOptions; +export class BaseAPI { + public client: Client; + public options: BaseAPIOptions; + + constructor(options: BaseAPIOptions) { + this.client = options.client; + this.options = options; + } - constructor (options: BaseAPIOptions) { - this.client = options.client; - this.options = options; + request(options: BaseAPIRequestOptions): Promise { + if (options.requiresAuth) { + if (!this.options.client.isLoggedIn()) { + throw new Error( + `You must be authenticated in order to perform this request! API: ${( + options.request.method || "GET" + ).toUpperCase()} ${options.request.path ? this.options.baseUrl : ""}${ + options.request.path || options.request.url + }` + ); + } + } + if (!options.request.url && !options.request.path) { + throw new Error(`Must provide a URL or path!`); + } else if (options.request.path) { + options.request.url = this.options.baseUrl + options.request.path; + delete options.request.path; } - request (options: BaseAPIRequestOptions): Promise { - if (options.requiresAuth) { - if (!this.options.client.isLoggedIn()) { - throw new Error(`You must be authenticated in order to perform this request! API: ${(options.request.method || "GET").toUpperCase()} ${options.request.path ? this.options.baseUrl : ""}${options.request.path || options.request.url}`); - } + return this.options.client.rest + .request(options.request as RESTRequestOptions) + .then((response) => { + if (options.json && !(response.body instanceof Object)) { + response.body = JSON.parse(response.body); } - if (!options.request.url && !options.request.path) { - throw new Error(`Must provide a URL or path!`); - } else if (options.request.path) { - options.request.url = this.options.baseUrl + options.request.path; - delete options.request.path; - } - - return this.options.client.rest.request(options.request as RESTRequestOptions) - .then(response => { - if (options.json && !(response.body instanceof Object)) { - response.body = JSON.parse(response.body); - } - return response; - }); - } + return response; + }); + } } diff --git a/src/client/apis/BillingAPI.ts b/src/client/apis/BillingAPI.ts index f3662dc1e..34592d3b9 100644 --- a/src/client/apis/BillingAPI.ts +++ b/src/client/apis/BillingAPI.ts @@ -1,400 +1,414 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { SortOption } from "../.."; - -export type GetDeveloperExchangeRate = { - rate: number; - "currency-code": string; -} -export type SubmitDeveloperExchangeOptions = { - firstName: string; - lastName: string; - emailAddress: string; - password: string; - robuxAmount: number; -} -export type SubmitDeveloperExchange = unknown -export type GetLuobuDeveloperExchangeBalance = { - amount: number; -} -export type GetLuobuDeveloperExchangeEligibility = { - eligibility?: "Eligible" | string; - errors?: { - code: number; - message: string; - userFacingMessage: string; - }; -} -export type GetLatestLuobuDeveloperExchangeStatus = { - date?: string; - status?: string; - amount?: number; -} -export type SubmitLuobuDeveloperExchangeOptions = { - firstName: string; - lastName: string; - email: string; - amount: number; -} -export type SubmitLuobuDeveloperExchange = unknown -export type GetUserPaymentsOptions = { - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUserPayments = { - previousPageCursor: string; - nextPageCursor: string; - data: { - paymentDate: string; - products: { - name: string; - }[]; - money: { - Amount: number; - USDAmount: number; - Currency: { - Id: number; - CurrencyType: string; - CurrencyName: string; - CurrencySymbol: string; - }; - }; - paymentProviderType: "AppleAppStore"; - creditCardType: string; - cardNumber: string; - }; -} -export type PurchaseAmazonProductOptions = { - receiptId: string; - amazonUserId: string; - isRetry: boolean; -} -export type PurchaseAmazonProduct = unknown -export type ValidateAmazonProductOptions = { - productId: string; - currency: string; -} -export type ValidateAmazonProduct = unknown -export type PurchaseAppleProductOptions = PurchaseAmazonProductOptions; -export type PurchaseAppleProduct = PurchaseAmazonProduct; -export type ValidateAppleProductOptions = ValidateAmazonProductOptions; -export type ValidateAppleProduct = ValidateAmazonProduct; -export type RedeemDigitalCodeOptions = { - redemptionCode: string; -} -export type RedeemDigitalCode = unknown; -export type RedeemGameCardOptions = { - pinCode: string; - captchaToken: string; - captchaProvider: "PROVIDER_ARKOSELABS" | string; -} -export type RedeemGameCard = { - balance: string; - successMsg: string; - successSubText: string; - bonusMsg: string; - error: string; - errorMsg: string; -} -export type ReverseGameCardOptions = { - PinCode: string; - UserId: number; -} -export type ReverseGameCard = unknown; -export type PurchaseGoogleProductOptions = { - packageName: string; - productId: string; - token: string; - isRetry: boolean; - orderId: string; +export type BillingGetDeveloperExchangeRate = { + rate: number; + "currency-code": string; }; -export type PurchaseGoogleProduct = unknown -export type ValidateGoogleProductOptions = ValidateAmazonProductOptions; -export type ValidateGoogleProduct = ValidateAmazonProduct; -export type SendXsollaWebhookOptions = unknown; -export type SendXsollaWebhook = unknown; -export type GetXsollaIFrameTokenOptions = { - mainProductId: number; - upsellProductId: number; - paymentProviderType: string; - verifiedEmailOrPhone: boolean; -} -export type GetXsollaIFrameToken = { - token: string; - success: boolean; +export type BillingSubmitDeveloperExchange = unknown; +export type BillingGetLuobuDeveloperExchangeBalance = { + amount: number; +}; +export type BillingGetLuobuDeveloperExchangeEligibility = { + eligibility?: "Eligible" | string; + errors?: { + code: number; message: string; -} -export type IncrementCounterByAgentOptions = { - counterPrefix: string; -} -export type IncrementCounterByAgent = unknown; -export type RedeemPromoCodeOptions = { - code: string; -} -export type RedeemPromoCode = { - success: boolean; - errorMsg: string; - successMsg: string; -} - + userFacingMessage: string; + }; +}; +export type BillingGetLatestLuobuDeveloperExchangeStatus = { + date?: string; + status?: string; + amount?: number; +}; +export type BillingSubmitLuobuDeveloperExchange = unknown; +export type BillingGetUserPaymentsHistory = { + previousPageCursor: string; + nextPageCursor: string; + data: { + paymentDate: string; + products: { + name: string; + }[]; + money: { + Amount: number; + USDAmount: number; + Currency: { + Id: number; + CurrencyType: string; + CurrencyName: string; + CurrencySymbol: string; + }; + }; + paymentProviderType: "AppleAppStore"; + creditCardType: string; + cardNumber: string; + }; +}; +export type BillingPurchaseAmazonProduct = unknown; +export type BillingValidateAmazonProduct = unknown; +export type BillingPurchaseAppleProduct = BillingPurchaseAmazonProduct; +export type BillingValidateAppleProduct = BillingValidateAmazonProduct; +export type BillingRedeemDigitalCode = unknown; +export type BillingRedeemGameCard = { + balance: string; + successMsg: string; + successSubText: string; + bonusMsg: string; + error: string; + errorMsg: string; +}; +export type BillingReverseGameCard = unknown; +export type BillingPurchaseGoogleProduct = unknown; +export type BillingValidateGoogleProduct = BillingValidateAmazonProduct; +export type BillingSendXsollaWebhook = unknown; +export type BillingGetXsollaIFrameToken = { + token: string; + success: boolean; + message: string; +}; +export type BillingIncrementCounterByAgent = unknown; +export type BillingRedeemPromoCode = { + success: boolean; + errorMsg: string; + successMsg: string; +}; +export type BillingSubmitDeveloperExchangeOptions = { + firstName: string; + lastName: string; + emailAddress: string; + password: string; + robuxAmount: number; +}; +export type BillingSubmitLuobuDeveloperExchangeOptions = { + firstName: string; + lastName: string; + email: string; + amount: number; +}; +export type BillingGetUserPaymentsHistoryOptions = SortOption; +export type BillingPurchaseAmazonProductOptions = { + receiptId: string; + amazonUserId: string; + isRetry: boolean; +}; +export type BillingValidateAmazonProductOptions = { + productId: string; + currency: string; +}; +export type BillingPurchaseAppleProductOptions = { + receiptId: string; + appleUserId: string; + isRetry: boolean; +}; +export type BillingValidateAppleProductOptions = { + productId: string; + currency: string; +}; +export type BillingRedeemDigitalCodeOptions = { + redemptionCode: string; +}; +export type BillingRedeemGameCardOptions = { + pinCode: string; + captchaToken: string; + captchaProvider: string; +}; +export type BillingReverseGameCardOptions = { + PinCode: number; + UserId: number; +}; +export type BillingPurchaseGoogleProductOptions = { + packageName: string; + productId: string; + token: string; + isRetry: boolean; + orderId: string; +}; +export type BillingValidateGoogleProductOptions = { + productId: string; + currency: string; +}; +export type BillingGetXsollaIFrameTokenOptions = { + mainProductId: number; + upsellProductId: number; + paymentProviderType: string; + verifiedEmailOrPhone: boolean; +}; +export type BillingIncrementCounterByAgentOptions = { + counterPrefix: string; +}; +export type BillingRedeemPromoCodeOptions = { + code: string; +}; -export default class BillingAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://billing.roblox.com/" - }); - } +export class BillingAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://billing.roblox.com/" + }); + } - getDeveloperExchangeRate (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/developer-exchange-rate` - }, - json: true - }) - .then(response => response.body); - } + getDeveloperExchangeRate(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-exchange-rate` + }, + json: true + }).then((response) => response.body); + } - submitDeveloperExchange (options: SubmitDeveloperExchangeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/developer-exchange-rate`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + submitDeveloperExchange( + options: BillingSubmitDeveloperExchangeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange-rate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getLuobuDeveloperExchangeBalance (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/luobu-developer-exchange/balance` - }, - json: true - }) - .then(response => response.body); - } + getLuobuDeveloperExchangeBalance(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/balance` + }, + json: true + }).then((response) => response.body); + } - getLuobuDeveloperExchangeEligibility (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/luobu-developer-exchange/eligibility` - }, - json: true - }) - .then(response => response.body); - } + getLuobuDeveloperExchangeEligibility(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/eligibility` + }, + json: true + }).then((response) => response.body); + } - getLuobuDeveloperExchangeLatestRequestStatus (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/luobu-developer-exchange/latest-request-status` - }, - json: true - }) - .then(response => response.body); - } + getLuobuDeveloperExchangeLatestRequestStatus(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/luobu-developer-exchange/latest-request-status` + }, + json: true + }).then((response) => response.body); + } - submitLuobuDeveloperExchange (options: SubmitLuobuDeveloperExchangeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/developer-exchange-rate/request`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + submitLuobuDeveloperExchange( + options: BillingSubmitLuobuDeveloperExchangeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-exchange-rate/request`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getUserPaymentsHistory (options: GetUserPaymentsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/payments`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserPaymentsHistory( + options: BillingGetUserPaymentsHistoryOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/payments`, + qs: options + }, + json: true + }).then((response) => response.body); + } - purchaseAmazonProduct (options: PurchaseAmazonProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/amazon/purchase`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + purchaseAmazonProduct( + options: BillingPurchaseAmazonProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/amazon/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - validateAmazonProduct (options: ValidateAmazonProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/amazon/validate`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + validateAmazonProduct( + options: BillingValidateAmazonProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/amazon/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - purchaseAppleProduct (options: PurchaseAppleProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/apple/purchase`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + purchaseAppleProduct( + options: BillingPurchaseAppleProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/apple/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - validateAppleProduct (options: ValidateAppleProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/apple/validate`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + validateAppleProduct( + options: BillingValidateAppleProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/apple/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - redeemDigitalCode (options: RedeemDigitalCodeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/digital-codes/redeem`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + redeemDigitalCode( + options: BillingRedeemDigitalCodeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/digital-codes/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - redeemGameCard (options: RedeemGameCardOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gamecard/redeem`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + redeemGameCard( + options: BillingRedeemGameCardOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gamecard/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - reverseGameCard (options: ReverseGameCardOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gamecard/reverse`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + reverseGameCard( + options: BillingReverseGameCardOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gamecard/reverse`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - purchaseGoogleProduct (options: PurchaseGoogleProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/google/purchase`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + purchaseGoogleProduct( + options: BillingPurchaseGoogleProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/google/purchase`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - validateGoogleProduct (options: ValidateGoogleProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/google/validate`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + validateGoogleProduct( + options: BillingValidateGoogleProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/google/validate`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - sendXsollaWebhook (options: SendXsollaWebhookOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/notifications/xsolla`, - method: "POST", - json: options as any - }, - json: true - }) - .then(response => response.body); - } + sendXsollaWebhook(options: unknown): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/notifications/xsolla`, + method: "POST", + json: options as any + }, + json: true + }).then((response) => response.body); + } - getXsollaIFrameToken (options: GetXsollaIFrameTokenOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/payments/xsolla/iframe-token`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getXsollaIFrameToken( + options: BillingGetXsollaIFrameTokenOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/payments/xsolla/iframe-token`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - incrementCounterByAgent (options: IncrementCounterByAgentOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/payments/xsolla/incrementcounterbyagent`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + incrementCounterByAgent( + options: BillingIncrementCounterByAgentOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/payments/xsolla/incrementcounterbyagent`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - redeemPromoCode (options: RedeemPromoCodeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/promocodes/redeem`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + redeemPromoCode( + options: BillingRedeemPromoCodeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/promocodes/redeem`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/CatalogAPI.ts b/src/client/apis/CatalogAPI.ts index c70dc08e7..54fd36956 100644 --- a/src/client/apis/CatalogAPI.ts +++ b/src/client/apis/CatalogAPI.ts @@ -1,371 +1,352 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { AssetIdOption, SortOption, UserIdOption } from "../.."; - -export type ProductDetails = { +export type CatalogProductDetails = { + id: number; + type: string; + isPublicDomain: boolean; + isForSale: boolean; + priceInRobux: number; + premiumPricing: { + premiumDiscountPercentage: number; + premiumPriceInRobux: number; + }; +}; +export type CatalogGetAssetBundles = { + previousPageCursor: string; + nextPageCursor: string; + data: { id: number; - type: string; - isPublicDomain: boolean; - isForSale: boolean; - priceInRobux: number; - premiumPricing: { - premiumDiscountPercentage: number; - premiumPriceInRobux: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creator: { + id: number; + name: string; + type: string; }; + creatorType: number; + product: CatalogProductDetails; + }[]; +}; +export type CatalogGetBundleDetails = CatalogGetAssetBundles["data"][0]; +export type CatalogGetBundleRecommendationsByBundleId = { + data: CatalogGetAssetBundles["data"]; +}; +export type CatalogGetMultiBundleDetails = CatalogGetAssetBundles["data"]; +export type CatalogUnpackBundle = unknown; +export type CatalogGetAssetToCategory = Record; +export type CatalogGetAppStoreExclusiveBundles = { + data: CatalogProductDetails[]; +}; +export type CatalogGetAssetFavoriteCountOptions = { + assetId: number; +}; +export type CatalogGetFavoriteCount = number; +export type CatalogRemoveSelfAssetFavorite = unknown; +export type CatalogGetUserFavoriteAsset = { + assetId: number; + userId: number; + created: string; +}; +export type CatalogFavoriteAsset = unknown; +export type CatalogRemoveFavoriteBundle = unknown; +export type CatalogGetSelfFavoriteBundle = { + bundleId: number; + userId: number; + created: string; +}; +export type CatalogFavoriteBundle = unknown; +export type CatalogGetAssetBundlesOptions = SortOption & AssetIdOption; +export type CatalogGetBundleDetailsOptions = { bundleId: number }; +export type CatalogGetBundleRecommendationsByBundleIdOptions = { + bundleId: number; + numItems?: number; +}; +export type CatalogGetMultiBundleDetailsOptions = { + bundleIds: number[]; +}; +export type CatalogGetUserBundlesOptions = SortOption & UserIdOption; +export type CatalogGetUserBundlesByTypeOptions = + CatalogGetUserBundlesOptions & { + bundleType: string; + }; +export type CatalogUnpackBundleOptions = { + bundleId: number; +}; +export type CatalogGetAppStoreExclusiveBundlesOptions = { + appStoreType: "iOS" | "GooglePlay" | "Xbox" | "Amazon"; +}; +export type CatalogGetBundleFavoriteCount = CatalogUnpackBundleOptions; +export type CatalogRemoveAssetFavoriteOptions = AssetIdOption & UserIdOption; +export type CatalogGetUserFavoriteAssetOptions = AssetIdOption & UserIdOption; +export type CatalogFavoriteAssetOptions = AssetIdOption & UserIdOption; +export type CatalogRemoveBundleFavoriteOptions = UserIdOption & { + bundleId: number; +}; +export type CatalogGetUserFavoriteBundleOptions = UserIdOption & { + bundleId: number; +}; +export type CatalogFavoriteBundleOptions = UserIdOption & { + bundleId: number; }; -export type GetAssetBundlesOptions = { - assetId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetAssetBundles = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - name: string; - description: string; - bundleType: string; - items: { - owned: boolean; - id: number; - name: string; - type: string; - }[]; - creator: { - id: number; - name: string; - type: string; - }; - creatorType: number; - product: ProductDetails; - }[]; -} -export type GetBundleDetailsOptions = { - bundleId: number; -} -export type GetBundleDetails = GetAssetBundles["data"][0]; -export type GetBundleRecommendationsByBundleIdOptions = { - bundleId: number; - numItems?: number; -} -export type GetBundleRecommendationsByBundleId = { - data: GetAssetBundles["data"]; -} -export type GetMultiBundleDetailsOptions = { - bundleIds: number[]; -} -export type GetMultiBundleDetails = GetAssetBundles["data"]; -export type GetUserBundlesOptions = { - userId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUserBundles = GetAssetBundles; -export type GetUserBundlesByTypeOptions = GetUserBundlesOptions & { - bundleType: "BodyParts" | "AvatarAnimations" | string; -} -export type GetUserBundlesByType = GetUserBundles; -export type UnpackBundleOptions = { - bundleId: number; -} -export type UnpackBundle = unknown; -export type GetAssetToCategory = Record; -export type GetAssetToSubCategory = GetAssetToCategory; -export type GetCategories = GetAssetToCategory -export type GetSubCategories = GetAssetToCategory; -export type GetAppStoreExclusiveBundlesOptions = { - appStoreType: "iOS" | "GooglePlay" | "Xbox" | "Amazon"; -} -export type GetAppStoreExclusiveBundles = { - data: ProductDetails[]; -} -export type GetAssetFavoriteCountOptions = { - assetId: number; -} -export type GetAssetFavoriteCount = number; -export type GetBundleFavoriteCountOptions = { - bundleId: number; -} -export type GetBundleFavoriteCount = number; -export type RemoveSelfAssetFavoriteOptions = { - userId: number; - assetId: number; -} -export type RemoveSelfAssetFavorite = unknown -export type GetUserFavoriteAssetOptions = { - userId: number; - assetId: number; -} -export type GetUserFavoriteAsset = { - assetId: number; - userId: number; - created: string; -} -export type FavoriteAssetOptions = { - userId: number; - assetId: number; -} -export type FavoriteAsset = unknown -export type RemoveFavoriteBundleOptions = { - userId: number; - bundleId: number; -} -export type RemoveFavoriteBundle = unknown -export type GetSelfFavoriteBundleOptions = { - userId: number; - bundleId: number; -} -export type GetSelfFavoriteBundle = { - bundleId: number; - userId: number; - created: string; -} -export type FavoriteBundleOptions = { - userId: number; - bundleId: number; -} -export type FavoriteBundle = unknown -export default class CatalogAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://catalog.roblox.com/" - }); - } +export class CatalogAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://catalog.roblox.com/" + }); + } - getAssetBundles (options: GetAssetBundlesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/${options.assetId}/bundles`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getAssetBundles( + options: CatalogGetAssetBundlesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/bundles`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getBundleDetails (options: GetBundleDetailsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/bundles/${options.bundleId}/details`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getBundleDetails( + options: CatalogGetBundleDetailsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/${options.bundleId}/details`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getBundleRecommendationsByBundleId (options: GetBundleRecommendationsByBundleIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/${options.bundleId}/recommendations`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getBundleRecommendationsByBundleId( + options: CatalogGetBundleRecommendationsByBundleIdOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.bundleId}/recommendations`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getMultiBundleDetails (options: GetMultiBundleDetailsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/bundles/details`, - qs: { - bundleIds: options.bundleIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getMultiBundleDetails( + options: CatalogGetMultiBundleDetailsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/details`, + qs: { + bundleIds: options.bundleIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - getUserBundles (options: GetUserBundlesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/bundles`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserBundles( + options: CatalogGetUserBundlesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/bundles`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserBundlesByType (options: GetUserBundlesByTypeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/bundles/${options.bundleType}` - }, - json: true - }) - .then(response => response.body); - } + getUserBundlesByType( + options: CatalogGetUserBundlesByTypeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/bundles/${options.bundleType}` + }, + json: true + }).then((response) => response.body); + } - unpackBundle (options: UnpackBundleOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/bundles/${options.bundleId}/unpack`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + unpackBundle( + options: CatalogUnpackBundleOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/${options.bundleId}/unpack`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - getAssetToCategory (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/asset-to-category` - }, - json: true - }) - .then(response => response.body); - } + getAssetToCategory(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/asset-to-category` + }, + json: true + }).then((response) => response.body); + } - getAssetToSubCategory (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/asset-to-subcategory` - }, - json: true - }) - .then(response => response.body); - } + getAssetToSubCategory(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/asset-to-subcategory` + }, + json: true + }).then((response) => response.body); + } - getCategories (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/categories` - }, - json: true - }) - .then(response => response.body); - } + getCategories(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/categories` + }, + json: true + }).then((response) => response.body); + } - getSubCategories (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/subcategories` - }, - json: true - }) - .then(response => response.body); - } + getSubCategories(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/subcategories` + }, + json: true + }).then((response) => response.body); + } - getAppStoreExclusiveBundles (options: GetAppStoreExclusiveBundlesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/exclusive-items/${options.appStoreType}/bundles` - }, - json: true - }) - .then(response => response.body); - } + getAppStoreExclusiveBundles( + options: CatalogGetAppStoreExclusiveBundlesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/exclusive-items/${options.appStoreType}/bundles` + }, + json: true + }).then((response) => response.body); + } - getAssetFavoriteCount (options: GetAssetFavoriteCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/assets/${options.assetId}/count` - }, - json: true - }) - .then(response => response.body); - } + getAssetFavoriteCount( + options: AssetIdOption + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/assets/${options.assetId}/count` + }, + json: true + }).then((response) => response.body); + } - getBundleFavoriteCount (options: GetBundleFavoriteCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/bundles/${options.bundleId}/count` - }, - json: true - }) - .then(response => response.body); - } + getBundleFavoriteCount( + options: CatalogGetBundleFavoriteCount + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/bundles/${options.bundleId}/count` + }, + json: true + }).then((response) => response.body); + } - removeAssetFavorite (options: RemoveSelfAssetFavoriteOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + removeAssetFavorite( + options: CatalogRemoveAssetFavoriteOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - getUserFavoriteAsset (options: GetUserFavoriteAssetOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite` - }, - json: true - }) - .then(response => response.body); - } + getUserFavoriteAsset( + options: CatalogGetUserFavoriteAssetOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite` + }, + json: true + }).then((response) => response.body); + } - favoriteAsset (options: FavoriteAssetOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + favoriteAsset( + options: CatalogFavoriteAssetOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/assets/${options.assetId}/favorite`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - removeBundleFavorite (options: RemoveFavoriteBundleOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + removeBundleFavorite( + options: CatalogRemoveBundleFavoriteOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - getUserFavoriteBundle (options: GetSelfFavoriteBundleOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite` - }, - json: true - }) - .then(response => response.body); - } + getUserFavoriteBundle( + options: CatalogGetUserFavoriteBundleOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite` + }, + json: true + }).then((response) => response.body); + } - favoriteBundle (options: FavoriteBundleOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + favoriteBundle( + options: CatalogFavoriteBundleOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/favorites/users/${options.userId}/bundles/${options.bundleId}/favorite`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/ChatAPI.ts b/src/client/apis/ChatAPI.ts index ff9ad466a..3ef6eba7c 100644 --- a/src/client/apis/ChatAPI.ts +++ b/src/client/apis/ChatAPI.ts @@ -1,474 +1,547 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { - ChatConversationOptions, - ChatMessageOptions, - ChatMessageSentOptions, - PartialChatConversationOptions -} from "../../structures/Chat"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetChatSettings = { - chatEnabled: boolean; -} -export type GetConversationsOptions = { - conversationIds: number[]; -} -export type GetConversations = ChatConversationOptions[]; -export type GetConversationMessagesOptions = { - conversationId: number; - pageSize: number; - exclusiveStartMessageId?: string; -} -export type GetConversationMessages = ChatMessageOptions[]; -export type GetRolloutSettingsOptions = { - featureNames: string[]; -} -export type GetRolloutSettings = { - rolloutFeatures: { - featureName: string; - isRolloutEnabled: boolean; - }[]; -} -export type GetUnreadConversationCount = { - count: number; -} -export type GetUnreadMessagesInConversationsOptions = { - conversationIds: number[]; - pageSize?: number; -} -export type GetUnreadMessagesInConversations = { - conversationId: number; - chatMessages: ChatMessageOptions[]; -}[]; -export type GetUserConversationsOptions = { - pageNumber: number; - pageSize: number; -} -export type GetUserConversations = ChatConversationOptions[]; -export type GetMetaData = { - isChatEnabledByPrivacySetting: string; - languageForPrivacySettingUnavailable: string; - maxConversationTitleLength: number; - numberOfMembersForPartyChrome: number; - partyChromeDisplayTimeStampInterval: number; - signalRDisconnectionResponseInMilliseconds: number; - typingInChatFromSenderThrottleMs: number; - typingInChatForReceiverExpirationMs: number; - relativeValueToRecordUiPerformance: number; - isChatDataFromLocalStorageEnabled: boolean; - chatDataFromLocalStorageExpirationSeconds: number; - isUsingCacheToLoadFriendsInfoEnabled: boolean; - cachedDataFromLocalStorageExpirationMS: number; - senderTypesForUnknownMessageTypeError: string[]; - isInvalidMessageTypeFallbackEnabled: boolean; - isRespectingMessageTypeEnabled: boolean; - validMessageTypesWhiteList: string[]; - shouldRespectConversationHasUnreadMessageToMarkAsRead: boolean; - isVoiceChatForClientSideEnabled: boolean; - isAliasChatForClientSideEnabled: boolean; - isPlayTogetherForGameCardsEnabled: boolean; - isRoactChatEnabled: boolean; -} -export type GetMultiLatestConversationMessagesOptions = { - conversationIds: number[]; - pageSize: number; -} -export type GetMultiLatestConversationMessages = GetUnreadMessagesInConversations; -export type AddUsersToConversationOptions = { - participantUserIds: number[]; - conversationId: number; -} -export type AddUsersToConversation = { - conversationId: number; - rejectedParticipants: { - rejectedReason: string; - type: "User" | string; - targetId: number; - name: string; - displayName: string; - }[]; - resultType: "Success" | string; - statusMessage: string; -} -export type MarkMessageInConversationAsReadOptions = { - conversationId: number; - endMessageId: string; -} -export type MarkMessageInConversationAsRead = { - resultType: "Success" | string; -} -export type MarkConversationsAsSeenOptions = { - conversationsToMarkSeen: number[]; -} -export type MarkConversationsAsSeen = { - resultType: "Success" | string; -} -export type RemoveUserFromConversationOptions = { - participantUserId: number; - conversationId: number; -} -export type RemoveUserFromConversation = { - conversation: PartialChatConversationOptions; - resultType: "Success" | string; - statusMessage: string; -} -export type RenameGroupConversationOptions = { - conversationId: number; - newTitle: string; -} -export type RenameGroupConversation = { - conversationTitle: string; - statusMessage: string; - resultType: "Success" | string; - title: { - titleForViewer: string; - isDefaultTitle: boolean; +export type ChatPartialConversationData = { + id: number; + title?: string; +}; +export type ChatMessageSentData = { + content: string; + filteredForReceivers: boolean; + messageId: string; + sent: string; + messageType: "PlainText" | string; + resultType: "Success" | string; + statusMessage: string; +}; +export type ChatMessageData = { + id: string; + senderType: string; + sent: string; + read: boolean; + messageType: "PlainText" | string; + decorators: string[]; + senderTargetId: number; + content: string; + link?: { + type: "Game"; + game: { + universeId: number; }; -} -export type ResetConversationUniverseOptions = { - conversationId: number; -} -export type ResetConversationUniverse = { - statusMessage: string; -} -export type SendGameLinkMessageOptions = { - universeId: number; - conversationId: number; - decorators: string[]; -} -export type SendGameLinkMessage = ChatMessageSentOptions; -export type SendMessageOptions = { - message: string; - conversationId: number; - decorators: string[]; -} -export type SendMessage = ChatMessageSentOptions; -export type SetConversationUniverseOptions = { - conversationId: number; - universeId: number; -} -export type SetConversationUniverse = { - statusMessage: string; -} -export type StartCloudEditConversationOptions = { - placeId: number; -} -export type StartCloudEditConversation = { - conversation: ChatConversationOptions; - rejectedParticipants: { - rejectedReason: string; - type: "User"; - targetId: number; - name: string; - displayName: string; - }[]; - resultType: "Success" | string; - statusMessage: string; -} -export type StartGroupConversationOptions = { - participantUserIds: number[]; - title: string; -} -export type StartGroupConversation = StartCloudEditConversation; -export type StartOneToOneConversationOptions = { - participantUserId: number; -} -export type StartOneToOneConversation = StartCloudEditConversation; -export type UpdateUserTypingStatusOptions = { - conversationId: number; - isTyping: boolean; -} -export type UpdateUserTypingStatus = { - statusMessage: string; -} + }; + eventBased?: { + type: "SetConversationUniverse"; + setConversationUniverse: { + actorUserId: number; + universeId: number; + }; + }; +}; +export type ChatGetChatSettings = { + chatEnabled: boolean; +}; +export type ChatGetConversationMessages = ChatMessageData[]; +export type ChatGetRolloutSettings = { + rolloutFeatures: { + featureName: string; + isRolloutEnabled: boolean; + }[]; +}; +export type ChatGetUnreadConversationCount = { + count: number; +}; +export type ChatGetUnreadMessagesInConversations = { + conversationId: number; + chatMessages: ChatMessageData[]; +}[]; +export type ChatConversationData = { + id: number; + title: string; + initiator: { + type: "User" | string; + targetId: number; + name: string | null; + displayName: string | null; + }; + hasUnreadMessages: boolean; + participants: { + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + conversationType: "OneToOneConversation" | string; + conversationTitle: { + titleForViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: string; + conversationUniverse: number | null; +}; +export type ChatGetMetaData = { + isChatEnabledByPrivacySetting: string; + languageForPrivacySettingUnavailable: string; + maxConversationTitleLength: number; + numberOfMembersForPartyChrome: number; + partyChromeDisplayTimeStampInterval: number; + signalRDisconnectionResponseInMilliseconds: number; + typingInChatFromSenderThrottleMs: number; + typingInChatForReceiverExpirationMs: number; + relativeValueToRecordUiPerformance: number; + isChatDataFromLocalStorageEnabled: boolean; + chatDataFromLocalStorageExpirationSeconds: number; + isUsingCacheToLoadFriendsInfoEnabled: boolean; + cachedDataFromLocalStorageExpirationMS: number; + senderTypesForUnknownMessageTypeError: string[]; + isInvalidMessageTypeFallbackEnabled: boolean; + isRespectingMessageTypeEnabled: boolean; + validMessageTypesWhiteList: string[]; + shouldRespectConversationHasUnreadMessageToMarkAsRead: boolean; + isVoiceChatForClientSideEnabled: boolean; + isAliasChatForClientSideEnabled: boolean; + isPlayTogetherForGameCardsEnabled: boolean; + isRoactChatEnabled: boolean; +}; +export type ChatGetMultiLatestConversationMessages = + ChatGetUnreadMessagesInConversations; +export type ChatAddUsersToConversation = { + conversationId: number; + rejectedParticipants: { + rejectedReason: string; + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + resultType: "Success" | string; + statusMessage: string; +}; +export type ChatMarkMessageInConversationAsReadOptions = { + conversationId: number; + endMessageId: string; +}; +export type ChatMarkConversationMessagesRead = { + resultType: "Success" | string; +}; +export type ChatMarkConversationsAsSeenOptions = { + conversationsToMarkSeen: number[]; +}; +export type ChatMarkConversationsSeen = { + resultType: "Success" | string; +}; +export type ChatRemoveUserFromConversation = { + conversation: ChatPartialConversationData; + resultType: "Success" | string; + statusMessage: string; +}; +export type ChatRenameGroupConversation = { + conversationTitle: string; + statusMessage: string; + resultType: "Success" | string; + title: { + titleForViewer: string; + isDefaultTitle: boolean; + }; +}; +export type ChatResetConversationUniverse = { + statusMessage: string; +}; +export type ChatSendGameLinkMessage = ChatMessageSentData; +export type ChatSendMessage = ChatMessageSentData; +export type ChatSetConversationUniverse = { + statusMessage: string; +}; +export type ChatStartCloudEditConversation = { + conversation: ChatConversationData; + rejectedParticipants: { + rejectedReason: string; + type: "User"; + targetId: number; + name: string; + displayName: string; + }[]; + resultType: "Success" | string; + statusMessage: string; +}; +export type ChatStartGroupConversation = ChatStartCloudEditConversation; +export type ChatStartOneToOneConversation = ChatStartCloudEditConversation; +export type ChatUpdateUserTypingStatus = { + statusMessage: string; +}; +export type ChatGetConversationsOptions = { + conversationIds: number[]; +}; +export type ChatGetConversationMessagesOptions = { + conversationId: number; + pageSize: number; + exclusiveStartMessageId?: string; +}; +export type ChatGetRolloutSettingsOptions = { + featureNames: string[]; +}; +export type ChatGetUnreadMessagesInConversationsOptions = { + conversationIds: number[]; + pageSize?: number; +}; +export type ChatGetUserConversationsOptions = { + pageNumber: number; + pageSize: number; +}; +export type ChatGetMultiLatestConversationMessagesOptions = { + conversationIds: number[]; + pageSize: number; +}; +export type ChatAddUsersToConversationOptions = { + participantUserIds: number[]; + conversationId: number; +}; +export type ChatMarkConversationMessagesReadOptions = { + conversationId: number; + endMessageId: string; +}; +export type ChatMarkConversationsSeenOptions = { + conversationsToMarkSeen: number[]; +}; +export type ChatRemoveUserFromConversationOptions = { + participantUserId: number; + conversationId: number; +}; +export type ChatRenameGroupConversationOptions = { + conversationId: number; + newTitle: string; +}; +export type ChatResetConversationUniverseOptions = { + conversationId: number; +}; +export type ChatSendMessageOptions = { + message: string; + conversationId: number; + decorators: string[]; +}; +export type ChatSetConversationUniverseOptions = { + conversationId: number; + universeId: number; +}; +export type ChatStartCloudEditConversationOptions = { + placeId: number; +}; +export type ChatStartGroupConversationOptions = { + participantUserIds: number[]; + title: string; +}; +export type ChatStartOneToOneConversationOptions = { + participantUserId: number; +}; +export type ChatUpdateUserTypingStatusOptions = { + conversationId: number; + isTyping: boolean; +}; +export type ChatSendGameLinkMessageOptions = { + universeId: number; + conversationId: number; + decorators: string[]; +}; -export default class ChatAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://chat.roblox.com/" - }); - } +export class ChatAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://chat.roblox.com/" + }); + } - getChatSettings (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/chat-settings` - }, - json: true - }) - .then(response => response.body); - } + getChatSettings(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/chat-settings` + }, + json: true + }).then((response) => response.body); + } - getConversations (options: GetConversationsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-conversations`, - qs: { - conversationIds: options.conversationIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getConversations( + options: ChatGetConversationsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-conversations`, + qs: { + conversationIds: options.conversationIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - getConversationMessages (options: GetConversationMessagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-messages`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getConversationMessages( + options: ChatGetConversationMessagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getRolloutSettings (options: GetRolloutSettingsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-rollout-settings`, - qs: { - featureNames: options.featureNames.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getRolloutSettings( + options: ChatGetRolloutSettingsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-rollout-settings`, + qs: { + featureNames: options.featureNames.join(",") + } + }, + json: true + }).then((response) => response.body); + } - getUnreadConversationCount (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-conversations` - }, - json: true - }) - .then(response => response.body); - } + getUnreadConversationCount(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-conversation-count` + }, + json: true + }).then((response) => response.body); + } - getUnreadMessagesInConversations (options: GetUnreadMessagesInConversationsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-unread-messages`, - qs: { - conversationIds: options.conversationIds.join(","), - pageSize: options.pageSize - } - }, - json: true - }) - .then(response => response.body); - } + getUnreadMessagesInConversations( + options: ChatGetUnreadMessagesInConversationsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-unread-messages`, + qs: { + conversationIds: options.conversationIds.join(","), + pageSize: options.pageSize + } + }, + json: true + }).then((response) => response.body); + } - getUserConversations (options: GetUserConversationsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-user-conversations`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserConversations( + options: ChatGetUserConversationsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-user-conversations`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getMetaData (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/metadata` - }, - json: true - }) - .then(response => response.body); - } + getMetaData(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/metadata` + }, + json: true + }).then((response) => response.body); + } - getMultiLatestConversationMessages (options: GetMultiLatestConversationMessagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/multi-get-latest-messages`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getMultiLatestConversationMessages( + options: ChatGetMultiLatestConversationMessagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/multi-get-latest-messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } - addUsersToConversation (options: AddUsersToConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/add-to-conversation`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + addUsersToConversation( + options: ChatAddUsersToConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/add-to-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - markConversationMessagesRead (options: MarkMessageInConversationAsReadOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/mark-as-read`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + markConversationMessagesRead( + options: ChatMarkConversationMessagesReadOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/mark-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - markConversationsSeen (options: MarkConversationsAsSeenOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/mark-as-seen`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + markConversationsSeen( + options: ChatMarkConversationsSeenOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/mark-as-seen`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - removeUserFromConversation (options: RemoveUserFromConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/remove-from-conversation`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + removeUserFromConversation( + options: ChatRemoveUserFromConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/remove-from-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - renameGroupConversation (options: RenameGroupConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/rename-group-conversation`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + renameGroupConversation( + options: ChatRenameGroupConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/rename-group-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - resetConversationUniverse (options: ResetConversationUniverseOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/reset-conversation-universe`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + resetConversationUniverse( + options: ChatResetConversationUniverseOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/reset-conversation-universe`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - sendGameLinkMessage (options: SendGameLinkMessageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/send-game-link-message`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + sendGameLinkMessage( + options: ChatSendGameLinkMessageOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/send-game-link-message`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - sendMessage (options: SendMessageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/send-message`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + sendMessage(options: ChatSendMessageOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/send-message`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setConversationUniverse (options: SetConversationUniverseOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/set-conversation-universe`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setConversationUniverse( + options: ChatSetConversationUniverseOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/set-conversation-universe`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - startCloudEditConversation (options: StartCloudEditConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/start-cloud-edit-conversation`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + startCloudEditConversation( + options: ChatStartCloudEditConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/start-cloud-edit-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - startGroupConversation (options: StartGroupConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/get-user-conversations`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + startGroupConversation( + options: ChatStartGroupConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/get-user-conversations`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - startOneToOneConversation (options: StartOneToOneConversationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/start-one-to-one-conversation`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + startOneToOneConversation( + options: ChatStartOneToOneConversationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/start-one-to-one-conversation`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - updateUserTypingStatus (options: UpdateUserTypingStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v2/update-user-typing-status`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + updateUserTypingStatus( + options: ChatUpdateUserTypingStatusOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v2/update-user-typing-status`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/ContactsAPI.ts b/src/client/apis/ContactsAPI.ts index a4474c8e5..839cee38c 100644 --- a/src/client/apis/ContactsAPI.ts +++ b/src/client/apis/ContactsAPI.ts @@ -1,87 +1,87 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetContactsMetaData = { - multiGetContactsMaxSize: number; -} -export type GetUsersTagsOptions = { - targetUserIds: number[]; -} -export type GetUsersTags = { - targetUserId: number; - targetUserTag: string; +export type ContactsGetContactsMetaData = { + multiGetContactsMaxSize: number; + multiGetContactsCacheTTLinMS: number; +}; +export type ContactsGetUsersTagsOptions = { + targetUserIds: number[]; +}; +export type ContactsGetUsersTags = { + targetUserId: number; + targetUserTag: string; }[]; -export type SetPendingUserTagOptions = { - targetUserId: number; - userTag: string; -} -export type SetPendingUserTag = { - status: "Success" | string; -} -export type SetUserTagOptions = { - targetUserId: number; - userTag: string; -} -export type SetUserTag = { - status: "Success" | string; -} +export type ContactsSetPendingUserTagOptions = { + targetUserId: number; + userTag: string; +}; +export type ContactsSetPendingUserTag = { + status: "Success" | string; +}; +export type ContactsSetUserTagOptions = { + targetUserId: number; + userTag: string; +}; +export type ContactsSetUserTag = { + status: "Success" | string; +}; -export default class ContactsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://contacts.roblox.com/" - }); - } +export class ContactsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://contacts.roblox.com/" + }); + } - getContactsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/contacts/metadata` - }, - json: true - }) - .then(response => response.body); - } + getContactsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/contacts/metadata` + }, + json: true + }).then((response) => response.body); + } - getUsersTags (options: GetUsersTagsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/get-tags`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getUsersTags( + options: ContactsGetUsersTagsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/get-tags`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setPendingUserTag (options: SetPendingUserTagOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/set-pending-tag`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setPendingUserTag( + options: ContactsSetPendingUserTagOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/set-pending-tag`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - setUserTag (options: SetUserTagOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/tag`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setUserTag(options: ContactsSetUserTagOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/tag`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/DataAPI.ts b/src/client/apis/DataAPI.ts index 0e41a9012..2feb54a95 100644 --- a/src/client/apis/DataAPI.ts +++ b/src/client/apis/DataAPI.ts @@ -1,36 +1,34 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export type DataUploadDataOptions = { + assetId: number; + data: unknown; +}; +export type DataUploadDataResult = unknown; -export type UploadDataOptions = { - assetId: number; - data: unknown; -} -export type UploadDataResult = unknown; - -export default class DataAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://data.roblox.com/" - }); - } +export class DataAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://data.roblox.com/" + }); + } - uploadData (options: UploadDataOptions): Promise { - return this.request({ - requiresAuth: true, - json: true, - request: { - path: `Data/Upload.ashx?assetid=${options.assetId}`, - method: "POST", - headers: { - "User-Agent": "Roblox/WinInet", - Requester: "Client", - "Content-Type": "application/xml", - Accept: "application/json" - } - } - }) - .then(response => response.body); - } + uploadData(options: DataUploadDataOptions): Promise { + return this.request({ + requiresAuth: true, + json: true, + request: { + path: `Data/Upload.ashx?assetid=${options.assetId}`, + method: "POST", + headers: { + "User-Agent": "Roblox/WinInet", + Requester: "Client", + "Content-Type": "application/xml", + Accept: "application/json" + } + } + }).then((response) => response.body); + } } diff --git a/src/client/apis/DevelopAPI.ts b/src/client/apis/DevelopAPI.ts index 0cb1f3c21..d3b0d0995 100644 --- a/src/client/apis/DevelopAPI.ts +++ b/src/client/apis/DevelopAPI.ts @@ -1,950 +1,1222 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { GameUniverseOptions } from "../../structures/Game"; -import { PartialGroupOptions } from "../../structures/Group"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { PartialGroupOptions } from "../../old_structures/Group"; +import { ISOString } from "../../types/GenericTypes"; +export type DevelopGameUniverseOptions = { + id: number; + rootPlaceId: number; + name: string; + description: string; + creatorType: string; + creator: { + id: number; + name: string; + }; + price: number; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: string; + updated: string; + studioAccessToApisAllowed: boolean; + createVipServersAllowed: boolean; + universeAvatarType: string; + genre: string; +}; +export type DevelopAgeDataAvailable = { + isAgeDataAvailable: boolean; +}; +export type DevelopProductAggregation = { + developerProductName: string; + revenueAmount: number; +}; +export type DevelopProductAggregations = { + allDevicesDeveloperProductRevenue: DevelopProductAggregation[]; + developerProductRevenueByDevice: { + Computer: DevelopProductAggregation[]; + Phone: DevelopProductAggregation[]; + Tablet: DevelopProductAggregation[]; + Console: DevelopProductAggregation[]; + }; +}; -export type GetAssetsVoteInformationOptions = { - assetIds: number[]; -} -export type GetAssetsVoteInformation = { - data: { - assetId: number; - hasUserVoted: number; - canUserVote: number; - shouldShowVote: boolean; - upVotes: number; - downVotes: number; - reasonForNotAbleToVote: string; - }[]; -} -export type GetGameTemplates = { - gameTemplateType: string; - hasTutorials: boolean; - universe: GameUniverseOptions; +export type DevelopTeamCreateSessionMember = { + id: number; + name: string; + displayName: string; +}; +export type DevelopTeamCreateSessionMembers = { + data: DevelopTeamCreateSessionMember[]; +}; +export type DevelopTeamCreateEnabled = { + isEnabled: boolean; +}; +export type DevelopTeamCreateMember = { + buildersClubMembershipType: "None" | "RobloxPremium"; + userId: number; + username: string; + displayName: string; +}; +export type DevelopTeamCreateMembers = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopTeamCreateMember[]; +}; +export type DevelopInvitedTeamCreatePlace = { + id: number; + name: string; + description: string; + isArchived: boolean; + rootPlaceId: number; + isActive: boolean; + privacyType: "Public" | "FriendsOnly" | "Private"; + creatorType: "User" | "Group"; + creatorTargetId: number; + creatorName: string; + created: ISOString; + updated: ISOString; +}; +export type DevelopInvitedTeamCreatePlaces = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopInvitedTeamCreatePlace[]; +}; +export type DevelopGetUniverseLiveStatsOptions = { + universeId: number; +}; +export type DevelopGetUniverseLiveStats = { + totalPlayerCount: number; + playerCountsByDeviceType: Record; + gameCount: number; +}; +export type DevelopGetUniverseRevenueReportsOptions = { + universeId: number; +}; +export type DevelopGetUniverseRevenueReport = { + month: number; + year: number; + RevenueReportStatus: "NotGenerated" | "ReadyForDownload"; +}; +export type DevelopGetUniverseRevenueReports = { + monthlyRevenueReportStatusList: DevelopGetUniverseRevenueReport[]; +}; +export type DevelopGetUniverseRevenueReportOptions = { + universeId: number; + yearDashMonth: `${number}-${number}`; +}; + +export type DevelopCreatorDashboardMetadata = { + isPlayFabDataSourceChartsEnabled: boolean; + playFabDataSourceChartsAvailableByKPITypes: string[]; +}; + +export type DevelopGetAssetsVoteInformationOptions = { + assetIds: number[]; +}; +export type DevelopGetAssetsVoteInformation = { + data: { + assetId: number; + hasUserVoted: number; + canUserVote: number; + shouldShowVote: boolean; + upVotes: number; + downVotes: number; + reasonForNotAbleToVote: string; + }[]; +}; +export type DevelopGetGameTemplates = { + gameTemplateType: string; + hasTutorials: boolean; + universe: DevelopGameUniverseOptions; }[]; -export type GetGameUpdatesHistoryOptions = { - universeId: number; -} -export type GetGameUpdatesHistory = { - universeId: number; - createdOn: string; - createdOnKey: string; - creatorType: string; - creatorId: number; - creatorName: string; - expiredOn: string; - content: string; - impressions: number; - plays: number; - unfollows: number; +export type DevelopGetGameUpdatesHistoryOptions = { + universeId: number; +}; +export type DevelopGetGameUpdatesHistory = { + universeId: number; + createdOn: string; + createdOnKey: string; + creatorType: string; + creatorId: number; + creatorName: string; + expiredOn: string; + content: string; + impressions: number; + plays: number; + unfollows: number; }[]; -export type PublishGameNotificationOptions = { - universeId: number; - gameUpdateText: unknown; -} -export type PublishGameNotification = GetGameUpdatesHistory; -export type FilterPublishGameNotificationOptions = { - text: string; -} -export type FilterPublishGameNotification = { - filteredGameUpdateText: string; - isFiltered: boolean; - moderationLevel: number; -} -export type GetGroupUniversesOptions = { - groupId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetGroupUniverses = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - name: string; - description: string; - isArchived: boolean; - rootPlaceId: number | null; - isActive: boolean; - privacyType: "Private" | string; - creatorType: "Group" | string; - creatorTargetId: null; - creatorName: string; - created: string; - updated: string; - }[]; -} -export type GetPlaceCompatibilitiesOptions = { - placeId: number; -} -export type GetPlaceCompatibilities = { - Compatibilities: { - status: "Good" | string; - platformName: string; - crashRatePercentage: number; - }[]; -} -export type UpdatePlaceConfigurationOptions = { - placeId: number; - name: string; - description: string; -} -export type UpdatePlaceConfiguration = { - id: number; - universeId: number; - name: string; - description: string; -} -export type GetPlaceStatisticsByTypeOptions = { - placeId: number; - type: "Revenue" | "RevenuePerVisit" | "AverageVisitLength" | "Visits"; - granularity?: "Hourly" | "Daily" | "Monthly"; - divisionType?: "Device" | "Age"; - startTime?: string; - endTime?: string; -} -export type GetPlaceStatisticsByType = { - placeId: number; - dataType: GetPlaceStatisticsByTypeOptions["type"]; - dataGranularity: GetPlaceStatisticsByTypeOptions["granularity"]; - startTime: string; - endTime: string; - data: unknown; -} -export type GetPluginsByIdOptions = { - pluginIds: number[]; -} -export type GetPluginsById = { - data: { - id: number; - name: string; - description: string; - commentsEnabled: boolean; - versionId: number; - created: string; - updated: string; - }[]; -} -export type UpdatePluginOptions = { - pluginId: number; - name: string; - description: string; - commentsEnabled: boolean; -} -export type UpdatePlugin = unknown -export type SearchUniversesOptions = { - q: { - creator: "user" | "group" | "team"; - archived?: boolean; - active?: boolean; - groups?: unknown[]; - search?: string; - }; - sort?: ("+GameCreated" | "-GameCreated" | "+GameName" | "-GameName" | "+RootPlaceName" | "-RootPlaceName" | "+RootPlaceUpdated" | "-RootPlaceUpdated" | "+LastUpdated" | "-LastUpdated")[]; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type SearchUniverseData = { +export type DevelopPublishGameNotificationOptions = { + universeId: number; + gameUpdateText: unknown; +}; +export type DevelopPublishGameNotification = DevelopGetGameUpdatesHistory; +export type DevelopFilterPublishGameNotificationOptions = { + text: string; +}; +export type DevelopFilterPublishGameNotification = { + filteredGameUpdateText: string; + isFiltered: boolean; + moderationLevel: number; +}; +export type DevelopGetGroupUniversesOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopGetGroupUniverses = { + previousPageCursor: string; + nextPageCursor: string; + data: { id: number; name: string; description: string; isArchived: boolean; - rootPlaceId: number; + rootPlaceId: number | null; isActive: boolean; - privacyType: "Public" | "Private"; - creatorType: "User" | "Group"; - creatorTargetId: number; + privacyType: "Private" | string; + creatorType: "Group" | string; + creatorTargetId: null; creatorName: string; created: string; updated: string; + }[]; }; -export type SearchUniverses = { - previousPageCursor: string | null; - nextPageCursor: string | null; - data: SearchUniverseData[]; -} -export type SearchToolboxOptions = { - category: string; - keyword?: string; - sort?: string; - creatorId?: number; - num?: number; - page?: number; - groupId?: number; - cacheMode?: "Normal" | "Bypass" | "ForceUpdate"; -} -export type SearchToolbox = { - TotalResults: number; - Results: { - Asset: { - Id: number; - Name: string; - TypeId: number; - AssetGenres: string[]; - IsEndorsed: boolean; - Description: string; - Duration: number; - Created: string; - Updated: string; - CreatedRaw: string; - UpdatedRaw: string; - }; - Creator: { - Id: number; - Name: string; - Type: number; - }; - Thumbnail: { - Final: boolean; - Url: string; - RetryUrl: string; - UserId: number; - EndpointType: string; - }; - Voting: { - ShowVotes: boolean; - UpVotes: number; - DownVotes: number; - CanVote: boolean; - UserVote: boolean; - HasVoted: number; - ReasonForNotVoteable: string; - Product: { - ProductId: number; - Price: number; - }; - }; - }[]; -} -export type GetUniverseOptions = { - universeId: number; -} -export type GetUniverse = GameUniverseOptions; -export type GetUniversePermissionsOptions = { - universeId: number; -} -export type GetUniversePermissions = { - canManage: boolean; - canCloudEdit: boolean; -} -export type GetUniversePlacesOptions = { - universeId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUniversePlaces = { - previousPageCursor: string; - nextPageCursor: string; - data: unknown[]; -} -export type GetUniverseStatisticsReportsOptions = { - universeId: number; -} -export type GetUniverseStatisticsReports = { - reports: { - universeId: number; - yearDashMonth: string; - status: "NotGenerated" | string; - spreadsheetId: string; - }[]; -} -export type GetUniverseStatisticsReportsByTimeOptions = { - universeId: number; - yearDashMonth: string; -} -export type GetUniverseStatisticsReportByTime = { +export type DevelopGetPlaceCompatibilitiesOptions = { + placeId: number; +}; +export type DevelopGetPlaceCompatibilities = { + Compatibilities: { + status: "Good" | string; + platformName: string; + crashRatePercentage: number; + }[]; +}; +export type DevelopUpdatePlaceConfigurationOptions = { + placeId: number; + name: string; + description: string; +}; +export type DevelopUpdatePlaceConfiguration = { + id: number; + universeId: number; + name: string; + description: string; +}; +export type DevelopGetPlaceStatisticsByTypeOptions = { + placeId: number; + type: "Revenue" | "RevenuePerVisit" | "AverageVisitLength" | "Visits"; + granularity?: "Hourly" | "Daily" | "Monthly"; + divisionType?: "Device" | "Age"; + startTime?: string; + endTime?: string; +}; +export type DevelopGetPlaceStatisticsByType = { + placeId: number; + dataType: DevelopGetPlaceStatisticsByTypeOptions["type"]; + dataGranularity: DevelopGetPlaceStatisticsByTypeOptions["granularity"]; + startTime: string; + endTime: string; + data: unknown; +}; +export type DevelopGetPluginsByIdOptions = { + pluginIds: number[]; +}; +export type DevelopGetPluginsById = { + data: { + id: number; + name: string; + description: string; + commentsEnabled: boolean; + versionId: number; + created: string; + updated: string; + }[]; +}; +export type DevelopUpdatePluginOptions = { + pluginId: number; + name: string; + description: string; + commentsEnabled: boolean; +}; +export type DevelopUpdatePlugin = unknown; +export type DevelopSearchUniversesOptions = { + q: { + creator: "user" | "group" | "team"; + archived?: boolean; + active?: boolean; + groups?: unknown[]; + search?: string; + }; + sort?: ( + | "+GameCreated" + | "-GameCreated" + | "+GameName" + | "-GameName" + | "+RootPlaceName" + | "-RootPlaceName" + | "+RootPlaceUpdated" + | "-RootPlaceUpdated" + | "+LastUpdated" + | "-LastUpdated" + )[]; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopSearchUniverseData = { + id: number; + name: string; + description: string; + isArchived: boolean; + rootPlaceId: number; + isActive: boolean; + privacyType: "Public" | "Private"; + creatorType: "User" | "Group"; + creatorTargetId: number; + creatorName: string; + created: string; + updated: string; +}; +export type DevelopSearchUniverses = { + previousPageCursor: string | null; + nextPageCursor: string | null; + data: DevelopSearchUniverseData[]; +}; +export type DevelopSearchToolboxOptions = { + category: string; + keyword?: string; + sort?: string; + creatorId?: number; + num?: number; + page?: number; + groupId?: number; + cacheMode?: "Normal" | "Bypass" | "ForceUpdate"; +}; +export type DevelopSearchToolbox = { + TotalResults: number; + Results: { + Asset: { + Id: number; + Name: string; + TypeId: number; + AssetGenres: string[]; + IsEndorsed: boolean; + Description: string; + Duration: number; + Created: string; + Updated: string; + CreatedRaw: string; + UpdatedRaw: string; + }; + Creator: { + Id: number; + Name: string; + Type: number; + }; + Thumbnail: { + Final: boolean; + Url: string; + RetryUrl: string; + UserId: number; + EndpointType: string; + }; + Voting: { + ShowVotes: boolean; + UpVotes: number; + DownVotes: number; + CanVote: boolean; + UserVote: boolean; + HasVoted: number; + ReasonForNotVoteable: string; + Product: { + ProductId: number; + Price: number; + }; + }; + }[]; +}; +export type DevelopGetUniverseOptions = { + universeId: number; +}; +export type DevelopGetUniverse = DevelopGameUniverseOptions; +export type DevelopGetUniversePermissionsOptions = { + universeId: number; +}; +export type DevelopGetUniversePermissions = { + canManage: boolean; + canCloudEdit: boolean; +}; +export type DevelopGetUniversePlacesOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopGetUniversePlaces = { + previousPageCursor: string; + nextPageCursor: string; + data: unknown[]; +}; +export type DevelopGetUniverseStatisticsReportsOptions = { + universeId: number; +}; +export type DevelopGetUniverseStatisticsReports = { + reports: { universeId: number; yearDashMonth: string; status: "NotGenerated" | string; spreadsheetId: string; -} -export type DownloadUniverseStatisticsReportByTimeOptions = { - universeId: number; - yearDashMonth: string; + }[]; }; -export type DownloadUniverseStatisticsReportByTime = unknown; -export type MultiGetUniversesOptions = { - ids: number[]; -} -export type MultiGetUniverses = GameUniverseOptions[]; -export type MultiGetUniversesPermissionsOptions = { - ids: number[]; -} -export type MultiGetUniversesPermissions = { - data: { - universeId: number; - canManage: boolean; - canCloudEdit: boolean; - }[]; -} -export type ActivateUniverseOptions = { - universeId: number; -} -export type ActivateUniverse = unknown -export type DeactivateUniverseOptions = { - universeId: number; -} -export type DeactivateUniverse = unknown -export type GenerateUniverseStatisticReportsByTimeOptions = { - universeId: number; - yearDashMonth: string; -} -export type GenerateUniverseStatisticReportsByTime = unknown -export type GetUniverseConfigurationOptions = { - universeId: number; -} -export type GetUniverseConfiguration = { - id: number; - name: string; - universeAvatarType: "MorphToR6" | "MorphToR15"; - universeScaleType: "NoScales" | string; - universeAnimationType: "Standard" | string; - universeCollisionType: "InnerBox" | string; - universeBodyType: "Standard" | string; - universeJointPositioningType: "Standard" | string; - isArchived: boolean; - isFriendsOnly: boolean; - genre: "All" | string; - playableDevices: ("Computer" | string)[]; - isForSale: boolean; - price: number; -} -export type UpdateUniverseConfigurationOptions = Omit & { universeId: number }; -export type UpdateUniverseConfiguration = GetUniverseConfiguration; -export type GetUniverseVIPServersConfigurationOptions = { - universeId: number; -} -export type GetUniverseVIPServersConfiguration = { - isEnabled: boolean; - price: number; - activeServersCount: number; - activeSubscriptionsCount: number; -} -export type GetUniverseTeamCreateSettingsOptions = { - universeId: number; -} -export type GetUniverseTeamCreateSettings = { - isEnabled: boolean; -} -export type UpdateUniverseTeamCreateSettingsOptions = GetUniverseTeamCreateSettingsOptions; -export type UpdateUniverseTeamCreateSettings = unknown -export type RemoveUserFromUniverseTeamCreateOptions = { +export type DevelopGetUniverseStatisticsReportsByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export type DevelopGetUniverseStatisticsReportByTime = { + universeId: number; + yearDashMonth: string; + status: "NotGenerated" | string; + spreadsheetId: string; +}; +export type DevelopDownloadUniverseStatisticsReportByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export type DevelopDownloadUniverseStatisticsReportByTime = unknown; +export type DevelopMultiGetUniversesOptions = { + ids: number[]; +}; +export type DevelopMultiGetUniverses = DevelopGameUniverseOptions[]; +export type DevelopMultiGetUniversesPermissionsOptions = { + ids: number[]; +}; +export type DevelopMultiGetUniversesPermissions = { + data: { universeId: number; + canManage: boolean; + canCloudEdit: boolean; + }[]; +}; +export type DevelopActivateUniverseOptions = { + universeId: number; +}; +export type DevelopActivateUniverse = unknown; +export type DevelopDeactivateUniverseOptions = { + universeId: number; +}; +export type DevelopDeactivateUniverse = unknown; +export type DevelopGenerateUniverseStatisticReportsByTimeOptions = { + universeId: number; + yearDashMonth: string; +}; +export type DevelopGenerateUniverseStatisticReportsByTime = unknown; +export type DevelopGetUniverseConfigurationOptions = { + universeId: number; +}; +export type DevelopGetUniverseConfiguration = { + id: number; + name: string; + universeAvatarType: "MorphToR6" | "MorphToR15"; + universeScaleType: "NoScales" | string; + universeAnimationType: "Standard" | string; + universeCollisionType: "InnerBox" | string; + universeBodyType: "Standard" | string; + universeJointPositioningType: "Standard" | string; + isArchived: boolean; + isFriendsOnly: boolean; + genre: "All" | string; + playableDevices: ("Computer" | string)[]; + isForSale: boolean; + price: number; +}; +export type DevelopUpdateUniverseConfigurationOptions = Omit< + DevelopGetUniverseConfiguration, + "id" +> & { universeId: number }; +export type DevelopUpdateUniverseConfiguration = + DevelopGetUniverseConfiguration; +export type DevelopGetUniverseVIPServersConfigurationOptions = { + universeId: number; +}; +export type DevelopGetUniverseVIPServersConfiguration = { + isEnabled: boolean; + price: number; + activeServersCount: number; + activeSubscriptionsCount: number; +}; +export type DevelopGetUniverseTeamCreateSettingsOptions = { + universeId: number; +}; +export type DevelopGetUniverseTeamCreateSettings = { + isEnabled: boolean; +}; +export type DevelopUpdateUniverseTeamCreateSettingsOptions = + DevelopGetUniverseTeamCreateSettingsOptions; +export type DevelopUpdateUniverseTeamCreateSettings = unknown; +export type DevelopRemoveUserFromUniverseTeamCreateOptions = { + universeId: number; + userId: number; +}; +export type DevelopRemoveUserFromUniverseTeamCreate = unknown; +export type DevelopGetUsersInUniverseTeamCreateOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopGetUsersInUniverseTeamCreate = { + previousPageCursor: string; + nextPageCursor: string; + data: { + buildersClubMembershipType: "None" | string; userId: number; -} -export type RemoveUserFromUniverseTeamCreate = unknown -export type GetUsersInUniverseTeamCreateOptions = { - universeId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUsersInUniverseTeamCreate = { - previousPageCursor: string; - nextPageCursor: string; - data: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }[]; -} -export type GetSelfTeamCreateUniversesAccessOptions = { - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetSelfTeamCreateUniversesAccess = { - previousPageCursor: string; - nextPageCursor: string; - data: GameUniverseOptions[]; -} -export type GetSelfGroupsAccess = { - data: PartialGroupOptions[]; -} -export type GetNotificationsStatisticReports = { - data: { - UserId: number; - UniverseId: number; - Expires: number; - RootPlaceId: number; - GameName: string; - }[]; -} -export type GetStudioDataOptions = { - clientKey: string; -} -export type GetStudioData = unknown; -export type SetStudioDataOptions = { - clientKey: string; - data: unknown; -} -export type SetStudioData = { - success: boolean; -} -export type GetSelfUniversesOptions = { - sortOrder?: "Asc" | "Desc"; + username: string; + displayName: string; + }[]; +}; +export type DevelopGetSelfTeamCreateUniversesAccessOptions = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopGetSelfTeamCreateUniversesAccess = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopGameUniverseOptions[]; +}; +export type DevelopGetSelfGroupsAccess = { + data: PartialGroupOptions[]; +}; +export type DevelopGetNotificationsStatisticReports = { + data: { + UserId: number; + UniverseId: number; + Expires: number; + RootPlaceId: number; + GameName: string; + }[]; +}; +export type DevelopGetStudioDataOptions = { + clientKey: string; +}; +export type DevelopGetStudioData = unknown; +export type DevelopSetStudioDataOptions = { + clientKey: string; + data: unknown; +}; +export type DevelopSetStudioData = { + success: boolean; +}; +export type DevelopGetSelfUniversesOptions = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type DevelopGetSelfUniverses = { + previousPageCursor: string; + nextPageCursor: string; + data: DevelopGameUniverseOptions[]; +}; +export type DevelopCreateUniverseAliasOptions = { + name: string; + type: "Asset" | string; + targetId: number; +}; +export type DevelopCreateUniverseAlias = unknown; +export type DevelopDeleteUniverseAliasOptions = { + universeId: number; + name: string; +}; +export type DevelopDeleteUniverseAlias = unknown; +export type DevelopUpdateUniverseAliasOptions = + DevelopCreateUniverseAliasOptions; +export type DevelopUpdateUniverseAlias = unknown; +export type DevelopCreateDeveloperProductOptions = { + universeId: number; + name: string; + description: string; + priceInRobux: number; + iconImageAssetId?: number; +}; +export type DevelopCreateDeveloperProduct = { + id: number; + name: string; + Description: string; + shopId: number; + iconImageAssetId: number; +}; +export type DevelopUpdateDeveloperProductOptions = { + universeId: number; + developerProductId: number; + Name: string; + Description: string; + IconImageAssetId?: number; + PriceInRobux: number; +}; +export type DevelopUpdateDeveloperProduct = unknown; + +export class DevelopAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://develop.roblox.com/" + }); + } + + getGameTemplates(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gametemplates` + }, + json: true + }).then((response) => response.body.data); + } + + getGameUpdatesHistory( + options: DevelopGetGameUpdatesHistoryOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/${options.universeId}` + }, + json: true + }).then((response) => response.body); + } + + publishGameUpdateNotification( + options: DevelopPublishGameNotificationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/${options.universeId}`, + method: "POST", + json: `"${options.gameUpdateText}"` + }, + json: true + }).then((response) => response.body); + } + + filterGameUpdateNotificationText( + options: DevelopFilterPublishGameNotificationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/gameUpdateNotifications/filter`, + method: "POST", + json: `"${options.text}"` + }, + json: true + }).then((response) => response.body); + } + + getGroupUniverses( + options: DevelopGetGroupUniversesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/universes`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getPlaceCompatibilities( + options: DevelopGetPlaceCompatibilitiesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/compatibilities` + }, + json: true + }).then((response) => response.body); + } + + updatePlaceConfiguration( + options: DevelopUpdatePlaceConfigurationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getPlaceStatistics( + options: DevelopGetPlaceStatisticsByTypeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/stats/${options.type}`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + isPlaceAgeDataAvailable(options: { + placeId: number; + }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/is-age-data-available`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } + + getDeveloperProductAggregation(options: { + placeId: number; + timeFrame: "Hourly" | "Daily" | "Monthly"; + }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/places/${options.placeId}/developer-product-aggregation`, + method: "GET", + qs: options + }, + json: true + }).then((response) => response.body); + } + + getCreatorDashboardMetadata(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creator-dashboard-metadata` + }, + json: true + }).then((response) => response.body); + } + + getTeamCreateSessionMembers(options: { + placeId: number; limit?: 10 | 25 | 50 | 100; cursor?: string; -} -export type GetSelfUniverses = { - previousPageCursor: string; - nextPageCursor: string; - data: GameUniverseOptions[]; -} -export type CreateUniverseAliasOptions = { - name: string; - type: "Asset" | string; - targetId: number; -} -export type CreateUniverseAlias = unknown -export type DeleteUniverseAliasOptions = { - universeId: number; - name: string; -} -export type DeleteUniverseAlias = unknown -export type UpdateUniverseAliasOptions = CreateUniverseAliasOptions; -export type UpdateUniverseAlias = unknown; -export type CreateDeveloperProductOptions = { - universeId: number; - name: string; - description: string; - priceInRobux: number; - iconImageAssetId?: number; -} -export type CreateDeveloperProduct = { - id: number; - name: string; - Description: string; - shopId: number; - iconImageAssetId: number; -} -export type UpdateDeveloperProductOptions = { - universeId: number; - developerProductId: number; - Name: string; - Description: string; - IconImageAssetId?: number; - PriceInRobux: number; -} -export type UpdateDeveloperProduct = unknown - -export default class DevelopAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://develop.roblox.com/" - }); - } - - - getGameTemplates (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gametemplates` - }, - json: true - }) - .then(response => response.body.data); - } - - getGameUpdatesHistory (options: GetGameUpdatesHistoryOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gameUpdateNotifications/${options.universeId}` - }, - json: true - }) - .then(response => response.body); - } - - publishGameUpdateNotification (options: PublishGameNotificationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gameUpdateNotifications/${options.universeId}`, - method: "POST", - json: `"${options.gameUpdateText}"` - }, - json: true - }) - .then(response => response.body); - } - - filterGameUpdateNotificationText (options: FilterPublishGameNotificationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/gameUpdateNotifications/filter`, - method: "POST", - json: `"${options.text}"` - }, - json: true - }) - .then(response => response.body); - } - - getGroupUniverses (options: GetGroupUniversesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/universes`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getPlaceCompatibilities (options: GetPlaceCompatibilitiesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/places/${options.placeId}/compatibilities` - }, - json: true - }) - .then(response => response.body); - } - - updatePlaceConfiguration (options: UpdatePlaceConfigurationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/places/${options.placeId}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getPlaceStatistics (options: GetPlaceStatisticsByTypeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/places/${options.placeId}/stats/${options.type}`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getMultiPlugins (options: GetPluginsByIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/plugins`, - qs: { - pluginIds: options.pluginIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - updatePlugin (options: UpdatePluginOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/plugins/${options.pluginId}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - searchUniverses (options: SearchUniversesOptions): Promise { - const encodedQuery = `${options.q.search || ""} creator:${options.q.creator.slice(0, 1) - .toUpperCase() + options.q.creator.slice(1)} ${typeof options.q.active !== "undefined" ? `active:${options.q.active ? "True" : "False"}` : ""} ${options.q.archived ? `archived:${options.q.archived ? "True" : "False"}` : ""} ${options.q.groups ? `groups:${options.q.groups.join(",")}` : ""}`; - - return this.request({ - requiresAuth: false, - request: { - path: `v1/search/universes`, - qs: { - ...options, - sort: (options.sort || []).join(","), - // End me, please... - q: encodedQuery - } - }, - json: true - }) - .then(response => response.body); - } - - searchToolbox (options: SearchToolboxOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/toolbox/items`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getUniverse (options: GetUniverseOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}` - }, - json: true - }) - .then(response => response.body); - } - - getSelfUniversePermissions (options: GetUniversePermissionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/permissions` - }, - json: true - }) - .then(response => response.body); - } - - getPlacesInUniverse (options: GetUniversePlacesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/places`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getUniverseStatisticReports (options: GetUniverseStatisticsReportsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/statistic-reports` - }, - json: true - }) - .then(response => response.body); - } - - getUniverseStatisticReportsByTime (options: GetUniverseStatisticsReportsByTimeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}` - }, - json: true - }) - .then(response => response.body); - } - - downloadUniverseStatisticReportsByTime (options: DownloadUniverseStatisticsReportByTimeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/download` - }, - json: true - }) - .then(response => response.body); - } - - getMultiUniverses (options: MultiGetUniversesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/multiget`, - qs: { - ids: options.ids.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - getMultiUniversesPermissions (options: MultiGetUniversesPermissionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/multiget/permissions`, - qs: { - ids: options.ids.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - activateUniverse (options: ActivateUniverseOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/activate`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - deactivateUniverse (options: DeactivateUniverseOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/deactivate`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - generateUniverseStatisticReportsByTime (options: GenerateUniverseStatisticReportsByTimeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/generate`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - getUniverseConfiguration (options: GetUniverseConfigurationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/configuration` - }, - json: true - }) - .then(response => response.body); - } - - updateUniverseConfiguration (options: UpdateUniverseConfigurationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/configuration`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getUniverseVIPServersConfiguration (options: GetUniverseVIPServersConfigurationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/configuration/vip-servers` - }, - json: true - }) - .then(response => response.body); - } - - getUniverseTeamCreateSettings (options: GetUniverseTeamCreateSettingsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/teamcreate` - }, - json: true - }) - .then(response => response.body); - } - - updateUniverseTeamCreateSettings (options: UpdateUniverseTeamCreateSettingsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/teamcreate`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - removeUserFromUniverseTeamCreate (options: RemoveUserFromUniverseTeamCreateOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/teamcreate/memberships`, - method: "DELETE", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getUniverseTeamCreateMembers (options: GetUsersInUniverseTeamCreateOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/teamcreate/memberships`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getSelfUniversesTeamCreateAccess (options: GetSelfTeamCreateUniversesAccessOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/teamcreate/memberships`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getSelfManageableGroups (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/groups/canmanage` - }, - json: true - }) - .then(response => response.body); - } - - getSelfNotificationStatisticReports (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/notifications/statistic-reports` - }, - json: true - }) - .then(response => response.body); - } - - getStudioData (options: GetStudioDataOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/studiodata`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - setStudioData (options: SetStudioDataOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/studiodata`, - method: "POST", - json: options, - qs: { - clientKey: options.clientKey - } - }, - json: true - }) - .then(response => response.body); - } - - getSelfUniverses (options: GetSelfUniversesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/user/universes`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - createUniverseAlias (options: CreateUniverseAliasOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.targetId}/aliases` - }, - json: true - }) - .then(response => response.body); - } - - deleteUniverseAlias (options: DeleteUniverseAliasOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/aliases/${options.name}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - updateUniverseAlias (options: UpdateUniverseAliasOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.targetId}/aliases/${options.name}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - createDeveloperProduct (options: CreateDeveloperProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/developerproducts`, - method: "POST", - qs: options - }, - json: true - }) - .then(response => response.body); - } - - updateDeveloperProduct (options: UpdateDeveloperProductOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/universes/${options.universeId}/developerproducts/${options.developerProductId}/update`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + }): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/places/${options.placeId}/teamcreate/active_session/members`, + qs: { + limit: options.limit || 10, + cursor: options.cursor + } + }, + json: true + }).then((response) => response.body); + } + + setTeamCreateEnabled( + options: { universeId: number } & DevelopTeamCreateEnabled + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/teamcreate`, + method: "PATCH", + json: { isEnabled: options.isEnabled } + }, + json: true + }).then(() => true); + } + + getMultiPlugins( + options: DevelopGetPluginsByIdOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins`, + qs: { + pluginIds: options.pluginIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + updatePlugin( + options: DevelopUpdatePluginOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins/${options.pluginId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + searchUniverses( + options: DevelopSearchUniversesOptions + ): Promise { + const encodedQuery = `${options.q.search || ""} creator:${ + options.q.creator.slice(0, 1).toUpperCase() + options.q.creator.slice(1) + } ${ + typeof options.q.active !== "undefined" + ? `active:${options.q.active ? "True" : "False"}` + : "" + } ${ + options.q.archived + ? `archived:${options.q.archived ? "True" : "False"}` + : "" + } ${options.q.groups ? `groups:${options.q.groups.join(",")}` : ""}`; + + return this.request({ + requiresAuth: false, + request: { + path: `v1/search/universes`, + qs: { + ...options, + sort: (options.sort || []).join(","), + // End me, please... + q: encodedQuery + } + }, + json: true + }).then((response) => response.body); + } + + searchToolbox( + options: DevelopSearchToolboxOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/toolbox/items`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getUniverse(options: DevelopGetUniverseOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}` + }, + json: true + }).then((response) => response.body); + } + + getUniverseLiveStats( + options: DevelopGetUniverseLiveStatsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/live-stats` + }, + json: true + }).then((response) => response.body); + } + + getSelfUniversePermissions( + options: DevelopGetUniversePermissionsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/permissions` + }, + json: true + }).then((response) => response.body); + } + + getPlacesInUniverse( + options: DevelopGetUniversePlacesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/places`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getUniverseRevenueReports( + options: DevelopGetUniverseRevenueReportsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getUniverseRevenueReport( + options: DevelopGetUniverseRevenueReportOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports/${options.yearDashMonth}` + }, + json: true + }).then((response) => response.body); + } + + downloadUniverseRevenueReport( + options: DevelopGetUniverseRevenueReportOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/revenue-reports/${options.yearDashMonth}/download`, + method: "GET" + } + }).then((response) => response.body); + } + + getUniverseStatisticReports( + options: DevelopGetUniverseStatisticsReportsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports` + }, + json: true + }).then((response) => response.body); + } + + getUniverseStatisticReportsByTime( + options: DevelopGetUniverseStatisticsReportsByTimeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}` + }, + json: true + }).then((response) => response.body); + } + + downloadUniverseStatisticReportsByTime( + options: DevelopDownloadUniverseStatisticsReportByTimeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/download` + }, + json: true + }).then((response) => response.body); + } + + getMultiUniverses( + options: DevelopMultiGetUniversesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/multiget`, + qs: { + ids: options.ids.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + getMultiUniversesPermissions( + options: DevelopMultiGetUniversesPermissionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/multiget/permissions`, + qs: { + ids: options.ids.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + activateUniverse( + options: DevelopActivateUniverseOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/activate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + deactivateUniverse( + options: DevelopDeactivateUniverseOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/deactivate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + generateUniverseStatisticReportsByTime( + options: DevelopGenerateUniverseStatisticReportsByTimeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/statistic-reports/${options.yearDashMonth}/generate`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + getUniverseConfiguration( + options: DevelopGetUniverseConfigurationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration` + }, + json: true + }).then((response) => response.body); + } + + updateUniverseConfiguration( + options: DevelopUpdateUniverseConfigurationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getUniverseVIPServersConfiguration( + options: DevelopGetUniverseVIPServersConfigurationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/configuration/vip-servers` + }, + json: true + }).then((response) => response.body); + } + + getUniverseTeamCreateSettings( + options: DevelopGetUniverseTeamCreateSettingsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate` + }, + json: true + }).then((response) => response.body); + } + + removeUserFromUniverseTeamCreate( + options: DevelopRemoveUserFromUniverseTeamCreateOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate/memberships`, + method: "DELETE", + json: options + }, + json: true + }).then((response) => response.body); + } + + getUniverseTeamCreateMembers( + options: DevelopGetUsersInUniverseTeamCreateOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/teamcreate/memberships`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getSelfUniversesTeamCreateAccess( + options: DevelopGetSelfTeamCreateUniversesAccessOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/teamcreate/memberships`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getSelfManageableGroups(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/groups/canmanage` + }, + json: true + }).then((response) => response.body); + } + + getSelfNotificationStatisticReports(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/notifications/statistic-reports` + }, + json: true + }).then((response) => response.body); + } + + getStudioData( + options: DevelopGetStudioDataOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/studiodata`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + setStudioData( + options: DevelopSetStudioDataOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/studiodata`, + method: "POST", + json: options, + qs: { + clientKey: options.clientKey + } + }, + json: true + }).then((response) => response.body); + } + + getSelfUniverses( + options: DevelopGetSelfUniversesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/user/universes`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + createUniverseAlias( + options: DevelopCreateUniverseAliasOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.targetId}/aliases` + }, + json: true + }).then((response) => response.body); + } + + deleteUniverseAlias( + options: DevelopDeleteUniverseAliasOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/aliases/${options.name}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + updateUniverseAlias( + options: DevelopUpdateUniverseAliasOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.targetId}/aliases/${options.name}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + createDeveloperProduct( + options: DevelopCreateDeveloperProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/developerproducts`, + method: "POST", + qs: options + }, + json: true + }).then((response) => response.body); + } + + updateDeveloperProduct( + options: DevelopUpdateDeveloperProductOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/universes/${options.universeId}/developerproducts/${options.developerProductId}/update`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/EconomyAPI.ts b/src/client/apis/EconomyAPI.ts index e5b415f6f..dffee4b7d 100644 --- a/src/client/apis/EconomyAPI.ts +++ b/src/client/apis/EconomyAPI.ts @@ -1,342 +1,364 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { SubmitDeveloperExchangeOptions as BillingAPISubmitDeveloperExchangeOptions } from "./BillingAPI"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { BillingSubmitDeveloperExchangeOptions } from "./BillingAPI"; - -export type GetAssetResaleDataOptions = { - assetId: number; -} -export type GetAssetResaleData = { - assetStock: number; - sales: number; - numberRemaining: number; - recentAveragePrice: number; - originalPrice: number; - priceDataPoints: { - value: number; - date: string; - }[]; - volumeDataPoints: { - value: number; - date: string; - }[]; -} -export type GetAssetResellersOptions = { - assetId: number; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetAssetResellers = { - previousPageCursor: string; - nextPageCursor: string; - data: { - userAssetId: number; - seller: { - id: number; - type: "User" | "Group"; - name: string; - }; - price: number; - serialNumber: number; - }[]; -} -export type GetUserResellableAssetCopiesOptions = { - userId: number; - assetId: number; -} -export type GetUserResellableAssetCopies = { - data: GetAssetResellers["data"]; -} -export type GetResaleTaxRate = { - taxRate: number; - minimumFee: number; -} -export type SetAssetCopiesOptions = { - assetId: number; +export type EconomyGetAssetResaleDataOptions = { + assetId: number; +}; +export type EconomyGetAssetResaleData = { + assetStock: number; + sales: number; + numberRemaining: number; + recentAveragePrice: number; + originalPrice: number; + priceDataPoints: { + value: number; + date: string; + }[]; + volumeDataPoints: { + value: number; + date: string; + }[]; +}; +export type EconomyGetAssetResellersOptions = { + assetId: number; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type EconomyGetAssetResellers = { + previousPageCursor: string; + nextPageCursor: string; + data: { userAssetId: number; + seller: { + id: number; + type: "User" | "Group"; + name: string; + }; price: number; -} -export type SetAssetCopies = unknown -export type GetDeveloperExchangeAbility = { + serialNumber: number; + }[]; +}; +export type EconomyGetUserResellableAssetCopiesOptions = { + userId: number; + assetId: number; +}; +export type EconomyGetUserResellableAssetCopies = { + data: EconomyGetAssetResellers["data"]; +}; +export type EconomyGetResaleTaxRate = { + taxRate: number; + minimumFee: number; +}; +export type EconomySetAssetCopiesOptions = { + assetId: number; + userAssetId: number; + price: number; +}; +export type EconomySetAssetCopies = unknown; +export type EconomyGetDeveloperExchangeAbility = { + canCashOut: boolean; + meetsPremiumRequirement: boolean; + hasVerifiedEmail: boolean; + isUserBlackListed: boolean; + meetsMinimumCashOutBalance: boolean; + hasCashedOutThisMonth: boolean; + lastImbursementStatusIsValid: boolean; +}; +export type EconomyGetDeveloperExchangeHelp = unknown; +export type EconomyGetDeveloperExchangeInfoOptions = { + fromDevExPage: boolean; +}; +export type EconomyGetDeveloperExchangeInfo = { + hasCurrencyOperationError: boolean; + currencyOperationErrorMessage: string; + showOnlyExchangeRates: boolean; + meetsMembershipRequirements: boolean; + emailIsVerified: boolean; + isImbursementBlacklistUser: boolean; + canProceedToCashout: boolean; + showProgressBar: boolean; + percentRobux: number; + minRobuxToCashOut: number; + maxRobuxCanCashOut: number; + lastImbursementStatus: string; + lastImbursementSubmissionDate: string; + conversionPercent: number; +}; +export type EconomySubmitDeveloperExchangeOptions = + BillingSubmitDeveloperExchangeOptions; +export type EconomySubmitDeveloperExchange = { + submitted: boolean; + cashOutAbility: { canCashOut: boolean; meetsPremiumRequirement: boolean; hasVerifiedEmail: boolean; - isUserBlackListed: boolean; + isUserBlcakListed: boolean; meetsMinimumCashOutBalance: boolean; hasCashedOutThisMonth: boolean; lastImbursementStatusIsValid: boolean; -} -export type GetDeveloperExchangeHelp = unknown; -export type GetDeveloperExchangeInfoOptions = { - fromDevExPage: boolean; -} -export type GetDeveloperExchangeInfo = { - hasCurrencyOperationError: boolean; - currencyOperationErrorMessage: string; - showOnlyExchangeRates: boolean; - meetsMembershipRequirements: boolean; - emailIsVerified: boolean; - isImbursementBlacklistUser: boolean; - canProceedToCashout: boolean; - showProgressBar: boolean; - percentRobux: number; - minRobuxToCashOut: number; - maxRobuxCanCashOut: number; - lastImbursementStatus: string; - lastImbursementSubmissionDate: string; - conversionPercent: number; -} -export type SubmitDeveloperExchangeOptions = BillingAPISubmitDeveloperExchangeOptions; -export type SubmitDeveloperExchange = { - submitted: boolean; - cashOutAbility: { - canCashOut: boolean; - meetsPremiumRequirement: boolean; - hasVerifiedEmail: boolean; - isUserBlcakListed: boolean; - meetsMinimumCashOutBalance: boolean; - hasCashedOutThisMonth: boolean; - lastImbursementStatusIsValid: boolean; + }; + errors: unknown; +}; +export type EconomyGetGroupCurrencyOptions = { + groupId: number; +}; +export type EconomyGetGroupCurrency = { + robux: number; +}; +export type EconomyGetSelfCurrencyOptions = { + userId: number; +}; +export type EconomyGetSelfCurrency = { + robux: number; +}; +export type EconomyGetGroupRevenueSummaryInTimeFrameOptions = { + groupId: number; + timeFrame: "Day" | "Week" | "Month" | "Year"; +}; +export type EconomyGetGroupRevenueSummaryInTimeFrame = { + recurringRobuxStipend: number; + itemSaleRobux: number; + purchasedRoblox: number; + tradeSystemRobux: number; + pendingRobux: number; + groupPayoutRobux: number; +}; +export type EconomyGetSelfRevenueSummaryInTimeFrameOptions = Omit< + EconomyGetGroupRevenueSummaryInTimeFrameOptions, + "groupId" +> & { + userId: number; +}; +export type EconomyGetSelfRevenueSummaryInTimeFrame = + EconomyGetGroupRevenueSummaryInTimeFrame; +export type EconomyGetGroupTransactionsOptions = { + groupId: number; + transactionType: + | "Sale" + | "Purchase" + | "AffiliateSale" + | "DevEx" + | "GroupPayout" + | "AdImpressionPayout"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type EconomyGetGroupTransactions = { + previousPageCursor: string; + nextPageCursor: string; + data: { + created: string; + isPending: boolean; + agent: { + id: number; + type: "User" | "Group"; + name: string; }; - errors: unknown; -} -export type GetGroupCurrencyOptions = { - groupId: number; -} -export type GetGroupCurrency = { - robux: number; -} -export type GetSelfCurrencyOptions = { - userId: number; -} -export type GetSelfCurrency = { - robux: number; -} -export type GetGroupRevenueSummaryInTimeFrameOptions = { - groupId: number; - timeFrame: "Day" | "Week" | "Month" | "Year"; -} -export type GetGroupRevenueSummaryInTimeFrame = { - recurringRobuxStipend: number; - itemSaleRobux: number; - purchasedRoblox: number; - tradeSystemRobux: number; - pendingRobux: number; - groupPayoutRobux: number; -} -export type GetSelfRevenueSummaryInTimeFrameOptions = Omit & { - userId: number; -} -export type GetSelfRevenueSummaryInTimeFrame = GetGroupRevenueSummaryInTimeFrame; -export type GetGroupTransactionsOptions = { - groupId: number; - transactionType: "Sale" | "Purchase" | "AffiliateSale" | "DevEx" | "GroupPayout" | "AdImpressionPayout"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetGroupTransactions = { - previousPageCursor: string; - nextPageCursor: string; - data: { - created: string; - isPending: boolean; - agent: { - id: number; - type: "User" | "Group"; - name: string; - }; - details: unknown; - currency: { - amount: number; - type: "Robux" | string; - }; - }[]; -} -export type GetSelfTransactionsOptions = Omit & { - userId: number; -} -export type GetSelfTransactions = GetGroupTransactions; + details: unknown; + currency: { + amount: number; + type: "Robux" | string; + }; + }[]; +}; +export type EconomyGetSelfTransactionsOptions = Omit< + EconomyGetGroupTransactionsOptions, + "groupId" +> & { + userId: number; +}; +export type EconomyGetSelfTransactions = EconomyGetGroupTransactions; -export default class EconomyAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://economy.roblox.com/" - }); - } +export class EconomyAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://economy.roblox.com/" + }); + } - getAssetResaleData (options: GetAssetResaleDataOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/${options.assetId}/resale-data` - }, - json: true - }) - .then(response => response.body); - } + getAssetResaleData( + options: EconomyGetAssetResaleDataOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/resale-data` + }, + json: true + }).then((response) => response.body); + } - getAssetResellers (options: GetAssetResellersOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/${options.assetId}/resellers`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getAssetResellers( + options: EconomyGetAssetResellersOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/resellers`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserResellableAssetCopies (options: GetUserResellableAssetCopiesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/${options.assetId}/users/${options.userId}/resellable-copies` - }, - json: true - }) - .then(response => response.body); - } + getUserResellableAssetCopies( + options: EconomyGetUserResellableAssetCopiesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/${options.assetId}/users/${options.userId}/resellable-copies` + }, + json: true + }).then((response) => response.body); + } - getResaleTaxRate (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/resale-tax-rate` - }, - json: true - }) - .then(response => response.body); - } + getResaleTaxRate(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/resale-tax-rate` + }, + json: true + }).then((response) => response.body); + } - setAssetCopiesForSale (options: SetAssetCopiesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/assets/${options.assetId}/resellable-copies/${options.userAssetId}`, - method: "PATCH", - json: { - price: options.price - } - }, - json: true - }) - .then(response => response.body); - } + setAssetCopiesForSale( + options: EconomySetAssetCopiesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/assets/${options.assetId}/resellable-copies/${options.userAssetId}`, + method: "PATCH", + json: { + price: options.price + } + }, + json: true + }).then((response) => response.body); + } - getDeveloperExchangeAbility (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/developer-exchange/cashoutAbility` - }, - json: true - }) - .then(response => response.body); - } + getDeveloperExchangeAbility(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/cashoutAbility` + }, + json: true + }).then((response) => response.body); + } - getDeveloperExchangeHelp (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/developer-exchange/help` - }, - json: true - }) - .then(response => response.body); - } + getDeveloperExchangeHelp(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/help` + }, + json: true + }).then((response) => response.body); + } - getDeveloperExchangeInfo (options: GetDeveloperExchangeInfoOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/developer-exchange/info`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getDeveloperExchangeInfo( + options: EconomyGetDeveloperExchangeInfoOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/info`, + qs: options + }, + json: true + }).then((response) => response.body); + } - submitDeveloperExchange (options: SubmitDeveloperExchangeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/developer-exchange/submit`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + submitDeveloperExchange( + options: EconomySubmitDeveloperExchangeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/developer-exchange/submit`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getGroupCurrency (options: GetGroupCurrencyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/currency` - }, - json: true - }) - .then(response => response.body); - } + getGroupCurrency( + options: EconomyGetGroupCurrencyOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/currency` + }, + json: true + }).then((response) => response.body); + } - getSelfCurrency (options: GetSelfCurrencyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/currency` - }, - json: true - }) - .then(response => response.body); - } + getSelfCurrency( + options: EconomyGetSelfCurrencyOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/currency` + }, + json: true + }).then((response) => response.body); + } - getGroupRevenueByTime (options: GetGroupRevenueSummaryInTimeFrameOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/revenue/summary/${options.timeFrame}` - }, - json: true - }) - .then(response => response.body); - } + getGroupRevenueByTime( + options: EconomyGetGroupRevenueSummaryInTimeFrameOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/revenue/summary/${options.timeFrame}` + }, + json: true + }).then((response) => response.body); + } - getSelfRevenueSummaryByTIme (options: GetSelfRevenueSummaryInTimeFrameOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/revenue/summary/${options.timeFrame}` - }, - json: true - }) - .then(response => response.body); - } + getSelfRevenueSummaryByTIme( + options: EconomyGetSelfRevenueSummaryInTimeFrameOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/revenue/summary/${options.timeFrame}` + }, + json: true + }).then((response) => response.body); + } - getGroupTransactions (options: GetGroupTransactionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/transactions`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getGroupTransactions( + options: EconomyGetGroupTransactionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/transactions`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getSelfTransactions (options: GetSelfTransactionsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/transactions`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getSelfTransactions( + options: EconomyGetSelfTransactionsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/transactions`, + qs: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/EconomyCreatorStatsAPI.ts b/src/client/apis/EconomyCreatorStatsAPI.ts index ff4c62ef1..dd7b46d79 100644 --- a/src/client/apis/EconomyCreatorStatsAPI.ts +++ b/src/client/apis/EconomyCreatorStatsAPI.ts @@ -1,39 +1,39 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export type EconomyCreatorStatsGetUniverseStatsOptions = { + universeId: number; + type: "PremiumUpsells" | "PremiumVisits"; + startTime: string; + endTime: string; +}; +export type EconomyCreatorStatsGetUniverseStats = { + dataGranularity: "Hourly" | string; + data: unknown; +}; -export type GetUniverseStatsOptions = { - universeId: number; - type: "PremiumUpsells" | "PremiumVisits"; - startTime: string; - endTime: string; -} -export type GetUniverseStats = { - dataGranularity: "Hourly" | string; - data: unknown; -} - -export default class EconomyCreatorStatsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://economycreatorstats.roblox.com/" - }); - } +export class EconomyCreatorStatsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://economycreatorstats.roblox.com/" + }); + } - getUniverseStats (options: GetUniverseStatsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/universes/${options.universeId}/stats`, - qs: { - "request.type": options.type, - "request.startTime": options.startTime, - "request.endTime": options.endTime - } - }, - json: true - }) - .then(response => response.body); - } + getUniverseStats( + options: EconomyCreatorStatsGetUniverseStatsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universes/${options.universeId}/stats`, + qs: { + "request.type": options.type, + "request.startTime": options.startTime, + "request.endTime": options.endTime + } + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/EngagementPayoutsAPI.ts b/src/client/apis/EngagementPayoutsAPI.ts index 47fec98d4..e06250c17 100644 --- a/src/client/apis/EngagementPayoutsAPI.ts +++ b/src/client/apis/EngagementPayoutsAPI.ts @@ -1,32 +1,31 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export type EngagementPayoutsGetUniversePayoutHistoryOptions = { + universeId: number; + startDate: string; + endDate: string; +}; +export type EngagementPayoutsGetUniversePayoutHistory = unknown; -export type GetUniversePayoutHistoryOptions = { - universeId: number; - startDate: string; - endDate: string; -} -export type GetUniversePayoutHistory = unknown; - - -export default class EngagementPayoutsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://engagementpayouts.roblox.com/" - }); - } +export class EngagementPayoutsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://engagementpayouts.roblox.com/" + }); + } - getUniversePayoutHistory (options: GetUniversePayoutHistoryOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/universe-payout-history`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUniversePayoutHistory( + options: EngagementPayoutsGetUniversePayoutHistoryOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/universe-payout-history`, + qs: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/FollowingsAPI.ts b/src/client/apis/FollowingsAPI.ts index e7c0c39d2..04ed9dc74 100644 --- a/src/client/apis/FollowingsAPI.ts +++ b/src/client/apis/FollowingsAPI.ts @@ -1,88 +1,91 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetUserFollowedUniversesOptions = { - userId: number; -} -export type GetUserFollowedUniverses = { - universeId: number; - userId: number; +export type FollowingsGetUserFollowedUniversesOptions = { + userId: number; +}; +export type FollowingsGetUserFollowedUniverses = { + universeId: number; + userId: number; }[]; -export type GetUserFollowingUniverseStatusOptions = { - userId: number; - universeId: number; -} -export type GetUserFollowingUniverseStatus = { - UniverseId: number; - UserId: number; - CanFollow: boolean; - IsFollowing: boolean; - FollowingCountByType: number; - FollowingLimitByType: number; -} -export type UnFollowUniverseOptions = { - userId: number; - universeId: number; -} -export type UnFollowUniverse = { - universeId: number; - userId: number; -} -export type FollowUniverseOptions = UnFollowUniverseOptions; -export type FollowUniverse = UnFollowUniverse; +export type FollowingsGetUserFollowingUniverseStatusOptions = { + userId: number; + universeId: number; +}; +export type FollowingsGetUserFollowingUniverseStatus = { + UniverseId: number; + UserId: number; + CanFollow: boolean; + IsFollowing: boolean; + FollowingCountByType: number; + FollowingLimitByType: number; +}; +export type FollowingsUnFollowUniverseOptions = { + userId: number; + universeId: number; +}; +export type FollowingsUnFollowUniverse = { + universeId: number; + userId: number; +}; +export type FollowingsFollowUniverseOptions = FollowingsUnFollowUniverseOptions; +export type FollowingsFollowUniverse = FollowingsUnFollowUniverse; -export default class FollowingsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://followings.roblox.com/" - }); - } +export class FollowingsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://followings.roblox.com/" + }); + } - getUserFollowedUniverses (options: GetUserFollowedUniversesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/universes` - }, - json: true - }) - .then(response => response.body); - } + getUserFollowedUniverses( + options: FollowingsGetUserFollowedUniversesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes` + }, + json: true + }).then((response) => response.body); + } - getUserFollowingUniverseStatus (options: GetUserFollowingUniverseStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/universes/${options.universeId}/status` - }, - json: true - }) - .then(response => response.body); - } + getUserFollowingUniverseStatus( + options: FollowingsGetUserFollowingUniverseStatusOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}/status` + }, + json: true + }).then((response) => response.body); + } - unFollowUniverse (options: UnFollowUniverseOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/universes/${options.universeId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + unFollowUniverse( + options: FollowingsUnFollowUniverseOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - followUniverse (options: FollowUniverseOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/universes/${options.universeId}`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + followUniverse( + options: FollowingsFollowUniverseOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/universes/${options.universeId}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/FriendsAPI.ts b/src/client/apis/FriendsAPI.ts index 4094d0cf9..1759f096f 100644 --- a/src/client/apis/FriendsAPI.ts +++ b/src/client/apis/FriendsAPI.ts @@ -1,512 +1,524 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { GetUserFriendsCount, GetUserFriendsCountOptions } from "./GeneralAPI"; -import { PartialUser } from "../../structures/User"; -import { EnumUserPresence, UserPresence } from "../../interfaces/GeneralInterfaces"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { + GeneralGetUserFriendsCount, + GeneralGetUserFriendsCountOptions +} from "./GeneralAPI"; +import { PartialUser } from "../../old_structures/User"; +import { + EnumUserPresence, + UserPresence +} from "../../interfaces/GeneralInterfaces"; - -export type FindFriendByCodeOptions = { - code: string; -} -export type FindFriendByCode = { +export type FriendsFindFriendByCodeOptions = { + code: string; +}; +export type FriendsFindFriendByCode = { + userId: number; + username: string; + friendshipStatus: "NoFriendship" | string; +}; +export type FriendsCheckSessionHealth = unknown; +export type FriendsRedeemNearbyFriendCodeOptions = { + code: string; +}; +export type FriendsRedeemNearbyFriendCode = unknown; +export type FriendsDeleteSession = unknown; +export type FriendsGetOrCreateNearbySession = { + code: string; + expires: number; +}; +export type FriendsRedeemQRCodeOptions = { + code: string; +}; +export type FriendsRedeemQRCode = { + userId: number; + username: string; +}; +export type FriendsDeleteQRCodeSession = unknown; +export type FriendsGetOrCreateQRCodeSession = FriendsGetOrCreateNearbySession; +export type FriendsGetMetaDataOptions = { + targetUserId: number; +}; +export type FriendsGetMetaData = { + isFriendFinderEnabled: boolean; + isNearbyUpsellEnabled: boolean; + isFriendsUserDataStoreCacheEnabled: boolean; + userName: string; +}; +export type FriendsGetSelfFriendsCount = { + count: number; +}; +export type FriendsGetSelfFriendRequestsOptions = { + sortOrder?: "Desc" | "Asc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type FriendsGetSelfFriendRequests = { + previousPageCursor: string; + nextPageCursor: string; + data: { + description: string; + created: string; + isBanned: boolean; userId: number; username: string; - friendshipStatus: "NoFriendship" | string; -} -export type CheckSessionHealth = unknown -export type RedeemNearbyFriendCodeOptions = { - code: string; -} -export type RedeemNearbyFriendCode = unknown -export type DeleteSession = unknown -export type GetOrCreateNearbySession = { - code: string; - expires: number; -} -export type RedeemQRCodeOptions = { - code: string; -} -export type RedeemQRCode = { + }[]; +}; +export type FriendsGetSelfFriendRequestsCount = { + count: number; +}; +export type FriendsGetUserFollowersOptions = { + userId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type FriendsGetUserFollowers = { + previousPageCursor: string; + nextPageCursor: string; + data: { + isOnline: boolean; + isDeleted: boolean; + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + }[]; +}; +export type FriendsGetUserFollowersCountOptions = { + userId: number; +}; +export type FriendsGetUserFollowersCount = { + count: number; +}; +export type FriendsGetUserFollowingOptions = FriendsGetUserFollowersOptions; +export type FriendsGetUserFollowing = FriendsGetUserFollowers; +export type FriendsGetUserFollowingCountOptions = + FriendsGetUserFollowersCountOptions; +export type FriendsGetUserFollowingCount = FriendsGetUserFollowersCount; +export type FriendsGetUserFriendsOptions = { + userSort?: "Alphabetical" | "StatusAlphabetical" | "StatusFrequents"; + userId: number; +}; +export type FriendsGetUserFriends = { + data: { + isOnline: boolean; + isDeleted: boolean; + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + }[]; +}; +export type FriendsGetUserOnlineFriendsOptions = { + userId: number; +}; +export type FriendsGetUserOnlineFriends = { + data: { userId: number; username: string; + presence: { + placeId: number | null; + universeId: number | null; + UserPresenceType: UserPresence | null; + UserLocationType: string | null; + lastLocation: string | null; + gameInstanceId: string | null; + lastOnline: string | null; + }; + }[]; }; -export type DeleteQRCodeSession = unknown -export type GetOrCreateQRCodeSession = GetOrCreateNearbySession; -export type GetMetaDataOptions = { - targetUserId: number; -} -export type GetMetaData = { - isFriendFinderEnabled: boolean; - isNearbyUpsellEnabled: boolean; - isFriendsUserDataStoreCacheEnabled: boolean; - userName: string; -} -export type GetSelfFriendsCount = { - count: number; -} -export type GetSelfFriendRequestsOptions = { - sortOrder?: "Desc" | "Asc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetSelfFriendRequests = { - previousPageCursor: string; - nextPageCursor: string; - data: { - description: string; - created: string; - isBanned: boolean; - userId: number; - username: string; - }[]; -} -export type GetSelfFriendRequestsCount = { - count: number; -} -export type GetUserFollowersOptions = { - userId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUserFollowers = { - previousPageCursor: string; - nextPageCursor: string; - data: { - isOnline: boolean; - isDeleted: boolean; - description: string; - created: string; - isBanned: boolean; - id: number; - name: string; - }[]; +export type FriendsGetUserFriendsWithStatusesOptions = { + userId: number; + withUserIds: number[]; }; -export type GetUserFollowersCountOptions = { - userId: number; -} -export type GetUserFollowersCount = { - count: number; -} -export type GetUserFollowingOptions = GetUserFollowersOptions; -export type GetUserFollowing = GetUserFollowers; -export type GetUserFollowingCountOptions = GetUserFollowersCountOptions; -export type GetUserFollowingCount = GetUserFollowersCount; -export type GetUserFriendsOptions = { - cursor?: string; - limit?: 10 | 25 | 50 | 100; - userId: number; -} -export type GetUserFriends = { - data: { - isOnline: boolean; - isDeleted: boolean; - description: string; - created: string; - isBanned: boolean; - id: number; - name: string; - }[]; +export type FriendsGetUserFriendsWithStatuses = { + data: { + id: number; + status: "NotFriends" | string; + }[]; }; -export type GetUserOnlineFriendsOptions = { - userId: number; -} -export type GetUserOnlineFriends = { - data: { - userId: number; - username: string; - presence: { - placeId: number | null; - universeId: number | null; - UserPresenceType: UserPresence | null; - UserLocationType: string | null; - lastLocation: string | null; - gameInstanceId: string | null; - lastOnline: string | null; - }; - }[]; +export type FriendsDeclineAllFriendRequests = unknown; +export type FriendsAcceptFriendRequestOptions = { + userId: number; }; -export type GetUserFriendsWithStatusesOptions = { - userId: number; - withUserIds: number[]; -} -export type GetUserFriendsWithStatuses = { - data: { - id: number; - status: "NotFriends" | string; - }[]; +export type FriendsAcceptFriendRequest = unknown; +export type FriendsDeclineFriendRequestOptions = + FriendsAcceptFriendRequestOptions; +export type FriendsDeclineFriendRequest = unknown; +export type FriendsFollowUserOptions = { + userId: number; }; -export type DeclineAllFriendRequests = unknown -export type AcceptFriendRequestOptions = { - userId: number; -} -export type AcceptFriendRequest = unknown -export type DeclineFriendRequestOptions = AcceptFriendRequestOptions; -export type DeclineFriendRequest = unknown -export type FollowUserOptions = { - userId: number; -} -export type FollowUser = { - success: boolean; - isCaptchaRequired: boolean; -} -export type SendFriendRequestOptions = { - userId: number; - source?: "Unknown" | string; -} -export type SendFriendRequest = { - success: boolean; - isCaptchaRequired: boolean; -} -export type UnFollowUserOptions = FollowUserOptions; -export type UnFollowUser = FollowUser; -export type UnfriendUserOptions = { - userId: number; -} -export type UnfriendUser = unknown -export type GetSelfRecommendedUsers = { - user: PartialUser; - profileUrl: string; - presenceType: EnumUserPresence; +export type FriendsFollowUser = { + success: boolean; + isCaptchaRequired: boolean; +}; +export type FriendsSendFriendRequestOptions = { + userId: number; + source?: "Unknown" | string; +}; +export type FriendsSendFriendRequest = { + success: boolean; + isCaptchaRequired: boolean; +}; +export type FriendsUnFollowUserOptions = FriendsFollowUserOptions; +export type FriendsUnFollowUser = FriendsFollowUser; +export type FriendsUnfriendUserOptions = { + userId: number; +}; +export type FriendsUnfriendUser = unknown; +export type FriendsGetSelfRecommendedUsers = { + user: PartialUser; + profileUrl: string; + presenceType: EnumUserPresence; }[]; -export default class FriendsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://friends.roblox.com/" - }); - } +export class FriendsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://friends.roblox.com/" + }); + } - findFriendByCode (options: FindFriendByCodeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/nearby/code/${options.code}` - }, - json: true - }) - .then(response => response.body); - } + findFriendByCode( + options: FriendsFindFriendByCodeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/code/${options.code}` + }, + json: true + }).then((response) => response.body); + } - checkSessionHealth (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/nearby/health` - }, - json: true - }) - .then(response => response.body); - } + checkSessionHealth(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/health` + }, + json: true + }).then((response) => response.body); + } - redeemFriendCode (options: RedeemNearbyFriendCodeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/nearby/code/${options.code}/redeem`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + redeemFriendCode( + options: FriendsRedeemNearbyFriendCodeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/code/${options.code}/redeem`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - deleteFriendSession (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/nearby/session`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + deleteFriendSession(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/session`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - getSession (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/nearby/session`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + getSession(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/nearby/session`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - redeemFriendQRCode (options: RedeemQRCodeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/qr/${options.code}/redeem`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + redeemFriendQRCode( + options: FriendsRedeemQRCodeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/${options.code}/redeem`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - deleteFriendQRSession (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/qr/session`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + deleteFriendQRSession(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/session`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - getFriendQRSession (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/friends/verified/qr/session`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + getFriendQRSession(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/friends/verified/qr/session`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - getMetaData (options: GetMetaDataOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/metadata`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getMetaData(options: FriendsGetMetaDataOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/metadata`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getSelfFriendsCount (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/my/friends/count` - }, - json: true - }) - .then(response => response.body); - } + getSelfFriendsCount(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/my/friends/count` + }, + json: true + }).then((response) => response.body); + } - getSelfFriendRequests (options: GetSelfFriendRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/my/friends/requests`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getSelfFriendRequests( + options: FriendsGetSelfFriendRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/my/friends/requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getSelfFriendRequestsCount (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/friend-requests/count` - }, - json: true - }) - .then(response => response.body); - } + getSelfFriendRequestsCount(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/friend-requests/count` + }, + json: true + }).then((response) => response.body); + } - getUserFollowers (options: GetUserFollowersOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/followers`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserFollowers( + options: FriendsGetUserFollowersOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followers`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserFollowersCount (options: GetUserFollowersCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/followers/count` - }, - json: true - }) - .then(response => response.body); - } + getUserFollowersCount( + options: FriendsGetUserFollowersCountOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followers/count` + }, + json: true + }).then((response) => response.body); + } - getUserFollowing (options: GetUserFollowingOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/followings`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserFollowing( + options: FriendsGetUserFollowingOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followings`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserFollowingCount (options: GetUserFollowingCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/followings/count` - }, - json: true - }) - .then(response => response.body); - } + getUserFollowingCount( + options: FriendsGetUserFollowingCountOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/followings/count` + }, + json: true + }).then((response) => response.body); + } - getUserFriends (options: GetUserFriendsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/friends`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserFriends( + options: FriendsGetUserFriendsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserFriendsCount (options: GetUserFriendsCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/friends/count` - }, - json: true - }) - .then(response => response.body); - } + getUserFriendsCount( + options: GeneralGetUserFriendsCountOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends/count` + }, + json: true + }).then((response) => response.body); + } - getUserFriendsOnline (options: GetUserOnlineFriendsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/friends/online` - }, - json: true - }) - .then(response => response.body); - } + getUserFriendsOnline( + options: FriendsGetUserOnlineFriendsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/friends/online` + }, + json: true + }).then((response) => response.body); + } - getUserFriendsWithStatuses (options: GetUserFriendsWithStatusesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/friends/statuses`, - qs: { - userIds: options.withUserIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getUserFriendsWithStatuses( + options: FriendsGetUserFriendsWithStatusesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/friends/statuses`, + qs: { + userIds: options.withUserIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - declineAllFriendRequests (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/friend-requests/decline-all`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + declineAllFriendRequests(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/friend-requests/decline-all`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - acceptFriendRequest (options: AcceptFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/accept-friend-request`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + acceptFriendRequest( + options: FriendsAcceptFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/accept-friend-request`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - declineFriendRequest (options: DeclineFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/decline-friend-request`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + declineFriendRequest( + options: FriendsDeclineFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/decline-friend-request`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - followUser (options: FollowUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/follow`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + followUser(options: FriendsFollowUserOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/follow`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - sendFriendRequest (options: SendFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/request-friendship`, - method: "POST", - json: { - friendshipOriginSourceType: options.source || "Unknown" - } - }, - json: true - }) - .then(response => response.body); - } + sendFriendRequest( + options: FriendsSendFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/request-friendship`, + method: "POST", + json: { + friendshipOriginSourceType: options.source || "Unknown" + } + }, + json: true + }).then((response) => response.body); + } - unFollowUser (options: UnFollowUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/unfollow`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + unFollowUser( + options: FriendsUnFollowUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unfollow`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - unfriendUser (options: UnfriendUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/unfriend`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } + unfriendUser( + options: FriendsUnfriendUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/unfriend`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } - getRecommendedUsers (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/recommended-users` - }, - json: true - }) - .then(response => response.body); - } + getRecommendedUsers(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/recommended-users` + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/GameInternationalizationAPI.ts b/src/client/apis/GameInternationalizationAPI.ts index adf07fe12..98c63667b 100644 --- a/src/client/apis/GameInternationalizationAPI.ts +++ b/src/client/apis/GameInternationalizationAPI.ts @@ -1,252 +1,258 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetGameInfoOptions = { - gameId: number; -} -export type GetGameInfo = { - data: { - name: string; - description: string; - languageCode: string; - }[]; -} -export type UpdateGameInfoOptions = { - gameId: number; - data: GetGameInfo; -}; -export type UpdateGameInfo = { - successOperations: GetGameInfo["data"]; - failedOperations: { - languageCode: string; - errorCode: number; - }[]; -} -export type GetNameDescriptionMetaData = { - isNameDescriptionMigrationEnabled: boolean; -} -export type GetGameInfoHistoryOptions = { - gameId: number; - requestType: string; - languageCode: string; - cursor: string; - count: number; - sortOrder: "Asc" | "Desc" | string; -} -export type GetGameInfoHistory = { - history: { - translationText: string; - translator: { - id: number; - agentType: "User" | string; - }; - created: Date; - }[]; - lastEvaluatedId: string; -} -export type GetGameSourceLanguageOptions = { - gameId: number; -} -export type GetGameSourceLanguage = { +export type GameInternationalizationGetGameInfoOptions = { + gameId: number; +}; +export type GameInternationalizationGetGameInfo = { + data: { name: string; - nativeName: string; + description: string; languageCode: string; -} -export type UpdateGameSourceLanguageOptions = { - gameId: number; + }[]; +}; +export type GameInternationalizationUpdateGameInfoOptions = { + gameId: number; + data: GameInternationalizationGetGameInfo; +}; +export type GameInternationalizationUpdateGameInfo = { + successOperations: GameInternationalizationGetGameInfo["data"]; + failedOperations: { languageCode: string; -} -export type UpdateGameSourceLanguage = unknown -export type GetGameSupportedLanguagesOptions = { - gameId: number; -} -export type GetGameSupportedLanguages = { - data: { - name: string; - languageCodeType: string; - languageCode: string; - }[]; -} -export type ModifyGameSupportedLanguagesOptions = { - data: { - languageCodeType: string; - languageCode: string; - delete: boolean; - }[]; - gameId: number; + errorCode: number; + }[]; }; -export type ModifyGameSupportedLanguages = unknown -export type GetGameAutomaticTranslationResultsOptions = { - gameId: number; -} -export type GetGameAutomaticTranslationResults = { - data: { - languageCodeType: string; - languageCode: string; - isAutomaticTranslationEnabled: boolean; - }[]; -} -export type GetSupportedLanguagesMetaData = { - isFeatureEnabled: boolean; - areAllLanguagesEnabled: boolean; - minimumUniverseIdForFeature: number; - isHumanTranslationProgressUIEnabled: boolean; - isAutomaticTranslationProgressUIEnabled: boolean; - isSupportedLanguagesChildLocalesUIEnabled: boolean; -} -export type ToggleAutomaticGameTranslationOptions = { - gameId: number; +export type GameInternationalizationGetNameDescriptionMetaData = { + isNameDescriptionMigrationEnabled: boolean; +}; +export type GameInternationalizationGetGameInfoHistoryOptions = { + gameId: number; + requestType: string; + languageCode: string; + cursor: string; + count: number; + sortOrder: "Asc" | "Desc" | string; +}; +export type GameInternationalizationGetGameInfoHistory = { + history: { + translationText: string; + translator: { + id: number; + agentType: "User" | string; + }; + created: Date; + }[]; + lastEvaluatedId: string; +}; +export type GameInternationalizationGetGameSourceLanguageOptions = { + gameId: number; +}; +export type GameInternationalizationGetGameSourceLanguage = { + name: string; + nativeName: string; + languageCode: string; +}; +export type GameInternationalizationUpdateGameSourceLanguageOptions = { + gameId: number; + languageCode: string; +}; +export type GameInternationalizationUpdateGameSourceLanguage = unknown; +export type GameInternationalizationGetGameSupportedLanguagesOptions = { + gameId: number; +}; +export type GameInternationalizationGetGameSupportedLanguages = { + data: { + name: string; + languageCodeType: string; languageCode: string; - enableAutomaticTranslation: boolean; -} -export type ToggleAutomaticGameTranslation = { + }[]; +}; +export type GameInternationalizationModifyGameSupportedLanguagesOptions = { + data: { + languageCodeType: string; + languageCode: string; + delete: boolean; + }[]; + gameId: number; +}; +export type GameInternationalizationModifyGameSupportedLanguages = unknown; +export type GameInternationalizationGetGameAutomaticTranslationResultsOptions = + { gameId: number; + }; +export type GameInternationalizationGetGameAutomaticTranslationResults = { + data: { + languageCodeType: string; languageCode: string; isAutomaticTranslationEnabled: boolean; -} + }[]; +}; +export type GameInternationalizationGetSupportedLanguagesMetaData = { + isFeatureEnabled: boolean; + areAllLanguagesEnabled: boolean; + minimumUniverseIdForFeature: number; + isHumanTranslationProgressUIEnabled: boolean; + isAutomaticTranslationProgressUIEnabled: boolean; + isSupportedLanguagesChildLocalesUIEnabled: boolean; +}; +export type GameInternationalizationToggleAutomaticGameTranslationOptions = { + gameId: number; + languageCode: string; + enableAutomaticTranslation: boolean; +}; +export type GameInternationalizationToggleAutomaticGameTranslation = { + gameId: number; + languageCode: string; + isAutomaticTranslationEnabled: boolean; +}; -export default class GameInternationalizationAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://gameinternationalization.roblox.com/" - }); - } +export class GameInternationalizationAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://gameinternationalization.roblox.com/" + }); + } - getGameInfo (options: GetGameInfoOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/name-description/games/${options.gameId}` - }, - json: true - }) - .then(response => response.body); - } + getGameInfo( + options: GameInternationalizationGetGameInfoOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } - updateGameInfo (options: UpdateGameInfoOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/name-description/games/${options.gameId}`, - method: "PATCH", - json: { - data: options.data - } - }, - json: true - }) - .then(response => response.body); - } + updateGameInfo( + options: GameInternationalizationUpdateGameInfoOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}`, + method: "PATCH", + json: { + data: options.data + } + }, + json: true + }).then((response) => response.body); + } - getNameDescriptionMetaData (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/name-description/metadata` - }, - json: true - }) - .then(response => response.body); - } + getNameDescriptionMetaData(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/metadata` + }, + json: true + }).then((response) => response.body); + } - getGameInfoHistory (options: GetGameInfoHistoryOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/name-description/games/${options.gameId}/history`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getGameInfoHistory( + options: GameInternationalizationGetGameInfoHistoryOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/name-description/games/${options.gameId}/history`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getGameSourceLanguage (options: GetGameSourceLanguageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/source-language/games/${options.gameId}` - }, - json: true - }) - .then(response => response.body); - } + getGameSourceLanguage( + options: GameInternationalizationGetGameSourceLanguageOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/source-language/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } - updateGameSourceLanguage (options: UpdateGameSourceLanguageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/source-language/games/${options.gameId}`, - method: "PATCH", - qs: { - languageCode: options.languageCode - } - }, - json: true - }) - .then(response => response.body); - } + updateGameSourceLanguage( + options: GameInternationalizationUpdateGameSourceLanguageOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/source-language/games/${options.gameId}`, + method: "PATCH", + qs: { + languageCode: options.languageCode + } + }, + json: true + }).then((response) => response.body); + } - getGameSupportedLanguages (options: GetGameSupportedLanguagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/supported-languages/games/${options.gameId}` - }, - json: true - }) - .then(response => response.body); - } + getGameSupportedLanguages( + options: GameInternationalizationGetGameSupportedLanguagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}` + }, + json: true + }).then((response) => response.body); + } - modifyGameSupportedLanguages (options: ModifyGameSupportedLanguagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/supported-languages/games/${options.gameId}`, - method: "PATCH", - json: options.data - }, - json: true - }) - .then(response => response.body); - } + modifyGameSupportedLanguages( + options: GameInternationalizationModifyGameSupportedLanguagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}`, + method: "PATCH", + json: options.data + }, + json: true + }).then((response) => response.body); + } - getGameAutomaticTranslationStatus (options: GetGameAutomaticTranslationResultsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/supported-languages/games/${options.gameId}/automatic-translation-status` - }, - json: true - }) - .then(response => response.body); - } + getGameAutomaticTranslationStatus( + options: GameInternationalizationGetGameAutomaticTranslationResultsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}/automatic-translation-status` + }, + json: true + }).then((response) => response.body); + } - getSupportedLanguagesMetaData (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/supported-languages/metadata` - }, - json: true - }) - .then(response => response.body); - } + getSupportedLanguagesMetaData(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/metadata` + }, + json: true + }).then((response) => response.body); + } - toggleGameAutomaticTranslation (options: ToggleAutomaticGameTranslationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/supported-languages/games/${options.gameId}/languages/${options.languageCode}/automatic-translation-status`, - method: "PATCH", - json: String(options.enableAutomaticTranslation) - .toString() - }, - json: true - }) - .then(response => response.body); - } + toggleGameAutomaticTranslation( + options: GameInternationalizationToggleAutomaticGameTranslationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/supported-languages/games/${options.gameId}/languages/${options.languageCode}/automatic-translation-status`, + method: "PATCH", + json: String(options.enableAutomaticTranslation).toString() + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/GamesAPI.ts b/src/client/apis/GamesAPI.ts index 2802ce1dc..71dd65345 100644 --- a/src/client/apis/GamesAPI.ts +++ b/src/client/apis/GamesAPI.ts @@ -1,568 +1,607 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { GameUniverseOptions, PartialGameUniverse, PlaceOptions, VIPServerOptions } from "../../structures/Game"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { + GameUniverseOptions, + PartialGameUniverse, + PlaceOptions, + VIPServerOptions +} from "../../old_structures/Game"; +export type GamesGameServer = { + id: string; + maxPlayers: number; + playing: number; + fps: number; + ping: number; + name: string; + vipServerId: number; + accessCode: string; +}; -export type GameServer = { - id: string; - maxPlayers: number; - playing: number; - fps: number; - ping: number; - name: string; - vipServerId: number; - accessCode: string; -} - -export type GetGameUniversesOptions = { - universeIds: number[]; -} -export type GetGameUniverses = GameUniverseOptions[]; -export type GetGameServersByTypeOptions = { - placeId: number; - serverType: "Public" | "Friend" | "VIP"; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetGameServersByType = { - previousPageCursor: string; - nextPageCursor: string; - data: GameServer[]; -} -export type GetGamesProductInfoOptions = { - universeIds: number[]; -} -export type GameGamesProductInfo = { - data: { - universeId: number; - isForSale: boolean; - price: number; - sellerId: number; - productId: number; - }[]; +export type GamesGetGameUniversesOptions = { + universeIds: number[]; }; -export type ListGamesOptions = { - sortToken?: string; - gameFilter?: string; - timeFilter?: string; - genreFilter?: string; - exclusiveStartId?: number; - sortOrder?: string; - gameSetTargetId?: number; - keyword?: string; - startRows?: number; - maxRows?: number; - isKeywordSuggestionEnabled?: boolean; - contextCountryRegionId?: number; - contextUniverseId?: number; - pageContextPageId?: number; - pageContextSeeAll?: boolean; - sortPosition?: number; -} -export type ListGames = { - games: { - creatorId: number; - creatorName: string; - creatorType: "User" | "Group" | string; - upVotes: number; - downVotes: number; - universeId: number; - placeId: number; - playerCount: number; - imageToken: string; - users: { - userId: number; - gameId: string; - }[]; - isSponsored: boolean; - nativeAdData: string; - price: number; - analyticsIdentifier: string; - }[]; - suggestedKeyword: string; - correctedKeyword: string; - filteredKeyword: string; - hasMoreRows: boolean; - nextPageExclusiveStartId: number; - featuredSearchUniverseId: number; - emphasis: boolean; - cutOffIndex: number; - algorithm: string; - algorithmQueryType: string; - suggestionAlgorithm: string; -} -export type MultiGetPlacesOptions = { - placeIds: number[]; -} -export type MultiGetPlaces = PlaceOptions[]; -export type MultiGetGameUniversesPlayabilityOptions = { - universeIds: number[]; -} -export type MultiGetGameUniversesPlayability = { - playabilityStatus: "UnplayableOtherReason" | string; - isPlayable: boolean; - universeId: number; -}[]; -export type GetGameRecommendationsByAlgorithmOptions = { - algorithmName: string; - paginationKey?: string; - maxRows?: number; -} -export type GetGameRecommendationsByAlgorithm = { - games: ListGames["games"]; - nextPaginationKey: string | null; +export type GamesGetGameUniverses = GameUniverseOptions[]; +export type GamesGetGameServersByTypeOptions = { + placeId: number; + serverType: "Public" | "Friend" | "VIP"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; }; -export type GetGameRecommendationsByGameOptions = { - universeId: number; - paginationKey?: string; - maxRows?: number; -} -export type GetGameRecommendationsByGame = GetGameRecommendationsByAlgorithm; -export type GetGameSortsOptions = { - gameSortsContext?: "GamesDefaultSorts" | "GamesAllSorts" | "HomeSorts" | "ChatSorts" | "UnifiedHomeSorts" | "GamesPageAbTestSorts1" | "GamesPageAbTestSorts2"; -} -export type GetGameSorts = { - sorts: { - token: string; - name: string; - displayName: string; - gameSetTargetId: null; - timeOptionsAvailable: boolean; - genreOptionsAvailable: boolean; - numberOfRows: number; - numberOfGames: null; - isDefaultSort: boolean; - contextUniverseId: null; - contextCountryRegionId: number; - tokenExpiryInSeconds: number; - }[]; - timeFilters: { - token: string; - name: string; - tokenExpiryInSeconds: number; - }[]; - genreFilters: { - token: string; - name: string; - tokenExpiryInSeconds: number; - }[]; - pageContext: { - pageId: string; - isSeeAllPage: boolean; - }; -} -export type IsGameFavoritedOptions = { - universeId: number; -} -export type IsGameFavorited = { - isFavorited: boolean; -} -export type ToggleGameFavoriteOptions = { - universeId: number; - favorite: boolean; -} -export type ToggleGameFavorite = unknown; -export type GetGameFavoriteCountOptions = { - universeId: number; -} -export type GetGameFavoriteCount = { - favoritesCount: number; -} -export type GetGameGamePassesOptions = { +export type GamesGetGameServersByType = { + previousPageCursor: string; + nextPageCursor: string; + data: GamesGameServer[]; +}; +export type GamesGetGamesProductInfoOptions = { + universeIds: number[]; +}; +export type GamesGameGamesProductInfo = { + data: { universeId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetGameGamePasses = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - name: string; - displayName: string; - productId: number; - price: number; - }[]; -} -export type GetSelfUniverseVoteStatusOptions = { + isForSale: boolean; + price: number; + sellerId: number; + productId: number; + }[]; +}; +export type GamesListGamesOptions = { + sortToken?: string; + gameFilter?: string; + timeFilter?: string; + genreFilter?: string; + exclusiveStartId?: number; + sortOrder?: string; + gameSetTargetId?: number; + keyword?: string; + startRows?: number; + maxRows?: number; + isKeywordSuggestionEnabled?: boolean; + contextCountryRegionId?: number; + contextUniverseId?: number; + pageContextPageId?: number; + pageContextSeeAll?: boolean; + sortPosition?: number; +}; +export type GamesListGames = { + games: { + creatorId: number; + creatorName: string; + creatorType: "User" | "Group" | string; + upVotes: number; + downVotes: number; universeId: number; -} -export type GetSelfUniverseVoteStatus = { - canVote: boolean; - userVote: boolean; - reasonForNotVoteable: string; -} -export type GetGamesVotesOptions = { - universeIds: number[]; -} -export type GetGamesVotes = { - data: { - number: PartialGameUniverse; - upVotes: number; - downVotes: number; + placeId: number; + playerCount: number; + imageToken: string; + users: { + userId: number; + gameId: string; }[]; + isSponsored: boolean; + nativeAdData: string; + price: number; + analyticsIdentifier: string; + }[]; + suggestedKeyword: string; + correctedKeyword: string; + filteredKeyword: string; + hasMoreRows: boolean; + nextPageExclusiveStartId: number; + featuredSearchUniverseId: number; + emphasis: boolean; + cutOffIndex: number; + algorithm: string; + algorithmQueryType: string; + suggestionAlgorithm: string; }; -export type SetSelfGameVoteOptions = { - universeId: number; - vote: boolean; -} -export type SetSelfGameVote = unknown -export type CanSelfInviteUserToVIPServerOptions = { - userId: number; -} -export type CanSelfInviteUserToVIPServer = { - canInvite: boolean; -} -export type GetVIPServerOptions = { - id: number; -} -export type GetVIPServer = VIPServerOptions; -export type UpdateVIPServerOptions = { - id: number; +export type GamesMultiGetPlacesOptions = { + placeIds: number[]; +}; +export type GamesMultiGetPlaces = PlaceOptions[]; +export type GamesMultiGetGameUniversesPlayabilityOptions = { + universeIds: number[]; +}; +export type GamesMultiGetGameUniversesPlayability = { + playabilityStatus: "UnplayableOtherReason" | string; + isPlayable: boolean; + universeId: number; +}[]; +export type GamesGetGameRecommendationsByAlgorithmOptions = { + algorithmName: string; + paginationKey?: string; + maxRows?: number; +}; +export type GamesGetGameRecommendationsByAlgorithm = { + games: GamesListGames["games"]; + nextPaginationKey: string | null; +}; +export type GamesGetGameRecommendationsByGameOptions = { + universeId: number; + paginationKey?: string; + maxRows?: number; +}; +export type GamesGetGameRecommendationsByGame = + GamesGetGameRecommendationsByAlgorithm; +export type GamesGetGameSortsOptions = { + gameSortsContext?: + | "GamesDefaultSorts" + | "GamesAllSorts" + | "HomeSorts" + | "ChatSorts" + | "UnifiedHomeSorts" + | "GamesPageAbTestSorts1" + | "GamesPageAbTestSorts2"; +}; +export type GamesGetGameSorts = { + sorts: { + token: string; name: string; - newJoinCode: boolean; - active: boolean; -} -export type UpdateVIPServer = VIPServerOptions; -export type CreateVIPServerOptions = { - universeId: number; + displayName: string; + gameSetTargetId: null; + timeOptionsAvailable: boolean; + genreOptionsAvailable: boolean; + numberOfRows: number; + numberOfGames: null; + isDefaultSort: boolean; + contextUniverseId: null; + contextCountryRegionId: number; + tokenExpiryInSeconds: number; + }[]; + timeFilters: { + token: string; name: string; - expectedPrice: number; -} -export type CreateVIPServer = GameServer; -export type UpdateVIPServerPermissionsOptions = { - id: number; - clanAllowed: boolean; - enemyClanId: number; - friendsAllowed: boolean; - usersToAdd: number[]; - usersToRemove: number[]; -} -export type UpdateVIPServerPermissions = { - clanAllowed: boolean; - enemyClanId: number; - friendsAllowed: boolean; - users: { - id: number; - name: string; - displayName: string; - }[]; -} -export type UpdateVIPServerSubscriptionOptions = { + tokenExpiryInSeconds: number; + }[]; + genreFilters: { + token: string; + name: string; + tokenExpiryInSeconds: number; + }[]; + pageContext: { + pageId: string; + isSeeAllPage: boolean; + }; +}; +export type GamesIsGameFavoritedOptions = { + universeId: number; +}; +export type GamesIsGameFavorited = { + isFavorited: boolean; +}; +export type GamesToggleGameFavoriteOptions = { + universeId: number; + favorite: boolean; +}; +export type GamesToggleGameFavorite = unknown; +export type GamesGetGameFavoriteCountOptions = { + universeId: number; +}; +export type GamesGetGameFavoriteCount = { + favoritesCount: number; +}; +export type GamesGetGameGamePassesOptions = { + universeId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GamesGetGameGamePasses = { + previousPageCursor: string; + nextPageCursor: string; + data: { id: number; - active: boolean; - price: number; -} -export type UpdateVIPServerSubscription = { - active: boolean; - expired: boolean; - expirationDate: string; + name: string; + displayName: string; + productId: number; price: number; -} + }[]; +}; +export type GamesGetSelfUniverseVoteStatusOptions = { + universeId: number; +}; +export type GamesGetSelfUniverseVoteStatus = { + canVote: boolean; + userVote: boolean; + reasonForNotVoteable: string; +}; +export type GamesGetGamesVotesOptions = { + universeIds: number[]; +}; +export type GamesGetGamesVotes = { + data: { + number: PartialGameUniverse; + upVotes: number; + downVotes: number; + }[]; +}; +export type GamesSetSelfGameVoteOptions = { + universeId: number; + vote: boolean; +}; +export type GamesSetSelfGameVote = unknown; +export type GamesCanSelfInviteUserToVIPServerOptions = { + userId: number; +}; +export type GamesCanSelfInviteUserToVIPServer = { + canInvite: boolean; +}; +export type GamesGetVIPServerOptions = { + id: number; +}; +export type GamesGetVIPServer = VIPServerOptions; +export type GamesUpdateVIPServerOptions = { + id: number; + name: string; + newJoinCode: boolean; + active: boolean; +}; +export type GamesUpdateVIPServer = VIPServerOptions; +export type GamesCreateVIPServerOptions = { + universeId: number; + name: string; + expectedPrice: number; +}; +export type GamesCreateVIPServer = GamesGameServer; +export type GamesUpdateVIPServerPermissionsOptions = { + id: number; + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + usersToAdd: number[]; + usersToRemove: number[]; +}; +export type GamesUpdateVIPServerPermissions = { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: { + id: number; + name: string; + displayName: string; + }[]; +}; +export type GamesUpdateVIPServerSubscriptionOptions = { + id: number; + active: boolean; + price: number; +}; +export type GamesUpdateVIPServerSubscription = { + active: boolean; + expired: boolean; + expirationDate: string; + price: number; +}; -export default class GamesAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://games.roblox.com/" - }); - } +export class GamesAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://games.roblox.com/" + }); + } - getGames (options: GetGameUniversesOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: true, - request: { - path: `v1/games?${universeIdsQueryString}` - }, - json: true - }) - .then(response => response.body); - } + getGames( + options: GamesGetGameUniversesOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } - getGameServersByType (options: GetGameServersByTypeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.placeId}/servers/${options.serverType}`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getGameServersByType( + options: GamesGetGameServersByTypeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.placeId}/servers/${options.serverType}`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getGamesProductInfo (options: GetGamesProductInfoOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/games-product-info?${universeIdsQueryString}` - }, - json: true - }) - .then(response => response.body); - } + getGamesProductInfo( + options: GamesGetGamesProductInfoOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/games-product-info?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } - listGames (options: ListGamesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/list`, - qs: { - "model.sortToken": options.sortToken, - "model.gameFilter": options.gameFilter, - "model.timeFilter": options.timeFilter, - "model.genreFilter": options.genreFilter, - "model.exclusiveStartId": options.exclusiveStartId, - "model.sortOrder": options.sortOrder, - "model.gameSetTargetId": options.gameSetTargetId, - "model.keyword": options.keyword, - "model.startRows": options.startRows, - "model.maxRows": options.maxRows, - "model.isKeywordSuggestionEnabled": options.isKeywordSuggestionEnabled, - "model.contextCountryRegionId": options.contextCountryRegionId, - "model.contextUniverseId": options.contextUniverseId, - "model.pageContext.pageId": options.pageContextPageId, - "model.pageContext.isSeeAllPage": options.pageContextSeeAll, - "model.sortPosition": options.sortPosition - } - }, - json: true - }) - .then(response => response.body); - } + listGames(options: GamesListGamesOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/list`, + qs: { + "model.sortToken": options.sortToken, + "model.gameFilter": options.gameFilter, + "model.timeFilter": options.timeFilter, + "model.genreFilter": options.genreFilter, + "model.exclusiveStartId": options.exclusiveStartId, + "model.sortOrder": options.sortOrder, + "model.gameSetTargetId": options.gameSetTargetId, + "model.keyword": options.keyword, + "model.startRows": options.startRows, + "model.maxRows": options.maxRows, + "model.isKeywordSuggestionEnabled": + options.isKeywordSuggestionEnabled, + "model.contextCountryRegionId": options.contextCountryRegionId, + "model.contextUniverseId": options.contextUniverseId, + "model.pageContext.pageId": options.pageContextPageId, + "model.pageContext.isSeeAllPage": options.pageContextSeeAll, + "model.sortPosition": options.sortPosition + } + }, + json: true + }).then((response) => response.body); + } - getMultiPlaces (options: MultiGetPlacesOptions): Promise { - const placeIdsQueryString = `placeIds=${options.placeIds.join("&placeIds=")}`; + getMultiPlaces( + options: GamesMultiGetPlacesOptions + ): Promise { + const placeIdsQueryString = `placeIds=${options.placeIds.join( + "&placeIds=" + )}`; - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/multiget-place-details?${placeIdsQueryString}` - }, - json: true - }) - .then(response => response.body); - } + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/multiget-place-details?${placeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } - getMultiGamesPlayabilityStatus (options: MultiGetGameUniversesPlayabilityOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/multiget-playability-status?${universeIdsQueryString}` - }, - json: true - }) - .then(response => response.body); - } + getMultiGamesPlayabilityStatus( + options: GamesMultiGetGameUniversesPlayabilityOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/multiget-playability-status?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } - getGameRecommendationsByAlgorithm (options: GetGameRecommendationsByAlgorithmOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/recommendations/algorithm/${options.algorithmName}`, - qs: { - "model.paginationKey": options.paginationKey, - "model.maxRows": options.maxRows - } - }, - json: true - }) - .then(response => response.body); - } + getGameRecommendationsByAlgorithm( + options: GamesGetGameRecommendationsByAlgorithmOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/recommendations/algorithm/${options.algorithmName}`, + qs: { + "model.paginationKey": options.paginationKey, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } - getGameRecommendationsByGame (options: GetGameRecommendationsByGameOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/recommendations/game/${options.universeId}`, - qs: { - "model.paginationKey": options.paginationKey, - "model.maxRows": options.maxRows - } - }, - json: true - }) - .then(response => response.body); - } + getGameRecommendationsByGame( + options: GamesGetGameRecommendationsByGameOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/recommendations/game/${options.universeId}`, + qs: { + "model.paginationKey": options.paginationKey, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } - getGameSorts (options: GetGameSortsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/sorts`, - qs: { - "model.gameSortsContext": options.gameSortsContext - } - }, - json: true - }) - .then(response => response.body); - } + getGameSorts(options: GamesGetGameSortsOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/sorts`, + qs: { + "model.gameSortsContext": options.gameSortsContext + } + }, + json: true + }).then((response) => response.body); + } - isGameFavorited (options: IsGameFavoritedOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/favorites` - }, - json: true - }) - .then(response => response.body); - } + isGameFavorited( + options: GamesIsGameFavoritedOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites` + }, + json: true + }).then((response) => response.body); + } - toggleGameFavorite (options: ToggleGameFavoriteOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/favorites`, - method: "POST", - json: { - isFavorited: options.favorite - } - }, - json: true - }) - .then(response => response.body); - } + toggleGameFavorite( + options: GamesToggleGameFavoriteOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites`, + method: "POST", + json: { + isFavorited: options.favorite + } + }, + json: true + }).then((response) => response.body); + } - getGameFavoriteCount (options: GetGameFavoriteCountOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/favorites/count` - }, - json: true - }) - .then(response => response.body); - } + getGameFavoriteCount( + options: GamesGetGameFavoriteCountOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/favorites/count` + }, + json: true + }).then((response) => response.body); + } - getGameGamePasses (options: GetGameGamePassesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/game-passes`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getGameGamePasses( + options: GamesGetGameGamePassesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/game-passes`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getSelfGameVote (options: GetSelfUniverseVoteStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/votes/user` - }, - json: true - }) - .then(response => response.body); - } + getSelfGameVote( + options: GamesGetSelfUniverseVoteStatusOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/votes/user` + }, + json: true + }).then((response) => response.body); + } - getGamesVotes (options: GetGamesVotesOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/votes?${universeIdsQueryString}` - }, - json: true - }) - .then(response => response.body); - } + getGamesVotes( + options: GamesGetGamesVotesOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/votes?${universeIdsQueryString}` + }, + json: true + }).then((response) => response.body); + } - setSelfGameVote (options: SetSelfGameVoteOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/${options.universeId}/user-votes`, - method: "PATCH", - json: { - vote: options.vote - } - }, - json: true - }) - .then(response => response.body); - } + setSelfGameVote( + options: GamesSetSelfGameVoteOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/${options.universeId}/user-votes`, + method: "PATCH", + json: { + vote: options.vote + } + }, + json: true + }).then((response) => response.body); + } - canSelfInviteUserToVIPServer (options: CanSelfInviteUserToVIPServerOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/vip-server/can-invite/${options.userId}` - }, - json: true - }) - .then(response => response.body); - } + canSelfInviteUserToVIPServer( + options: GamesCanSelfInviteUserToVIPServerOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-server/can-invite/${options.userId}` + }, + json: true + }).then((response) => response.body); + } - getVIPServer (options: GetVIPServerOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/vip-servers/${options.id}`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getVIPServer(options: GamesGetVIPServerOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-servers/${options.id}`, + qs: options + }, + json: true + }).then((response) => response.body); + } - updateVIPServer (options: UpdateVIPServerOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/vip-servers/${options.id}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } + updateVIPServer( + options: GamesUpdateVIPServerOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/vip-servers/${options.id}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } - createVIPServer (options: CreateVIPServerOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/vip-servers/${options.universeId}`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + createVIPServer( + options: GamesCreateVIPServerOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.universeId}`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - updateVIPServerPermissions (options: UpdateVIPServerPermissionsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/vip-servers/${options.id}/permissions`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } + updateVIPServerPermissions( + options: GamesUpdateVIPServerPermissionsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.id}/permissions`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } - updateVIPServerSubscription (options: UpdateVIPServerSubscriptionOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/games/vip-servers/${options.id}/subscription`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } + updateVIPServerSubscription( + options: GamesUpdateVIPServerSubscriptionOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/games/vip-servers/${options.id}/subscription`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/GeneralAPI.ts b/src/client/apis/GeneralAPI.ts index f350babb9..90d994972 100644 --- a/src/client/apis/GeneralAPI.ts +++ b/src/client/apis/GeneralAPI.ts @@ -1,494 +1,512 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { AssetVersionOptions, ProductOptions } from "../../structures/Asset"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +import { + AssetVersionOptions, + ProductOptions +} from "../../old_structures/Asset"; - -export declare type GetAssetVersionOptions = number; -export declare type AwardBadgeOptions = { - userId: number; - badgeId: number; - placeId: number; -} -export declare type GetUserFriendsOptions = { - userId: number; - page: number; -} -export declare type AcceptFriendRequestOptions = { - userId: number; -} -export declare type DeclineFriendRequestOptions = { - userId: number; -} -export declare type SendFriendRequestOptions = { - userId: number; -} -export declare type GetUserFriendsCountOptions = { - userId: number; -} -export declare type UnfriendUserOptions = { - userId: number; -} -export declare type IsUserFollowingOptions = { - userId: number; - followUserId: number; -} -export declare type FollowUserOptions = { - userId: number; -} -export declare type UnfollowUserOptions = { - userId: number; -} -export declare type GetUserGroupsOptions = { - userId: number; -} -export declare type GetGroupOptions = { - groupId: number; -} -export declare type GetGroupAlliesOptions = { - groupId: number; - page: number; -} -export declare type GetGroupEnemiesOptions = { - groupId: number; - page: number; -} -export declare type GetProductInfoOptions = { - assetId: number; -} -export declare type GetGamePassProductInfoOptions = { - gamePassId: number; -} -export declare type UserOwnsAssetOptions = { - userId: number; - assetId: number; -} -export declare type BlockUserOptions = { - userId: number; -} -export declare type UnblockUserOptions = { - userId: number; -} -export declare type GetUserByUsernameOptions = { - username: string; -} -export declare type UserCanManageAssetOptions = { - userId: number; - assetId: number; -} -export declare type GetUserByIdOptions = { - userId: number; -} -export declare type GetAssetVersions = AssetVersionOptions[]; -export declare type AwardBadge = boolean; -export declare type GetBalance = { - robux: number; -} -export declare type GetUserFriends = { - Id: number; - Username: string; - AvatarUri: string; - AvatarFinal: boolean; - IsOnline: boolean; +export declare type GeneralGetAssetVersionOptions = number; +export declare type GeneralAwardBadgeOptions = { + userId: number; + badgeId: number; + placeId: number; +}; +export declare type GeneralGetUserFriendsOptions = { + userId: number; + page: number; +}; +export declare type GeneralAcceptFriendRequestOptions = { + userId: number; +}; +export declare type GeneralDeclineFriendRequestOptions = { + userId: number; +}; +export declare type GeneralSendFriendRequestOptions = { + userId: number; +}; +export declare type GeneralGetUserFriendsCountOptions = { + userId: number; +}; +export declare type GeneralUnfriendUserOptions = { + userId: number; +}; +export declare type GeneralIsUserFollowingOptions = { + userId: number; + followUserId: number; +}; +export declare type GeneralFollowUserOptions = { + userId: number; +}; +export declare type GeneralUnfollowUserOptions = { + userId: number; +}; +export declare type GeneralGetUserGroupsOptions = { + userId: number; +}; +export declare type GeneralGetGroupOptions = { + groupId: number; +}; +export declare type GeneralGetGroupAlliesOptions = { + groupId: number; + page: number; +}; +export declare type GeneralGetGroupEnemiesOptions = { + groupId: number; + page: number; +}; +export declare type GeneralGetProductInfoOptions = { + assetId: number; +}; +export declare type GeneralGetGamePassProductInfoOptions = { + gamePassId: number; +}; +export declare type GeneralUserOwnsAssetOptions = { + userId: number; + assetId: number; +}; +export declare type GeneralBlockUserOptions = { + userId: number; +}; +export declare type GeneralUnblockUserOptions = { + userId: number; +}; +export declare type GeneralGetUserByUsernameOptions = { + username: string; +}; +export declare type GeneralUserCanManageAssetOptions = { + userId: number; + assetId: number; +}; +export declare type GeneralGetUserByIdOptions = { + userId: number; +}; +export declare type GeneralGetAssetVersions = AssetVersionOptions[]; +export declare type GeneralAwardBadge = boolean; +export declare type GeneralGetBalance = { + robux: number; +}; +export declare type GeneralGetUserFriends = { + Id: number; + Username: string; + AvatarUri: string; + AvatarFinal: boolean; + IsOnline: boolean; }[]; -export declare type AcceptFriendRequest = boolean; -export declare type DeclineFriendRequest = boolean; -export declare type SendFriendRequest = boolean; -export declare type GetUserFriendsCount = { - count: number; +export declare type GeneralAcceptFriendRequest = boolean; +export declare type GeneralDeclineFriendRequest = boolean; +export declare type GeneralSendFriendRequest = boolean; +export declare type GeneralGetUserFriendsCount = { + count: number; }; -export declare type UnfriendUser = boolean; -export declare type IsUserFollowing = boolean; -export declare type FollowUser = boolean; -export declare type UnfollowUser = boolean; -export declare type GetUserGroups = { - id: number; +export declare type GeneralUnfriendUser = boolean; +export declare type GeneralIsUserFollowing = boolean; +export declare type GeneralFollowUser = boolean; +export declare type GeneralUnfollowUser = boolean; +export declare type GeneralGetUserGroups = { + id: number; + name: string; + emblemId: number | null; + emblemUrl: string | null; + role: { + rank: number; name: string; - emblemId: number | null; - emblemUrl: string | null; - role: { - rank: number; - name: string; - }; - inClan: boolean; - primary: boolean; + }; + inClan: boolean; + primary: boolean; }[]; -export declare type GetGroup = { +export declare type GeneralGetGroup = { + Name: string; + Id: number; + Owner: { Name: string; Id: number; - Owner: { - Name: string; - Id: number; - }; - EmblemUrl: string; - Description: string; - Roles: { - Name: string; - Rank: number; - }[]; -} -export declare type GetGroupAllies = { - Groups: GetGroup[]; - FinalPage: boolean; + }; + EmblemUrl: string; + Description: string; + Roles: { + Name: string; + Rank: number; + }[]; }; -export declare type GetGroupEnemies = GetGroupAllies -export declare type GetIncomingItems = { - unreadMessageCount: number; - friendRequestsCount: number; -} -export declare type GetProductInfo = ProductOptions; -export declare type GetGamePassProductInfo = ProductOptions; -export declare type UserOwnsAsset = boolean; -export declare type GetDeviceInfo = { - platformType: string; - deviceType: string; - operatingSystemType: string; -} -export declare type BlockUser = boolean; -export declare type UnblockUser = boolean; -export declare type GetUserById = { - id: number; - name: string; +export declare type GeneralGetGroupAllies = { + Groups: GeneralGetGroup[]; + FinalPage: boolean; +}; +export declare type GeneralGetGroupEnemies = GeneralGetGroupAllies; +export declare type GeneralGetIncomingItems = { + unreadMessageCount: number; + friendRequestsCount: number; +}; +export declare type GeneralGetProductInfo = ProductOptions; +export declare type GeneralGetGamePassProductInfo = ProductOptions; +export declare type GeneralUserOwnsAsset = boolean; +export declare type GeneralGetDeviceInfo = { + platformType: string; + deviceType: string; + operatingSystemType: string; +}; +export declare type GeneralBlockUser = boolean; +export declare type GeneralUnblockUser = boolean; +export declare type GeneralGetUserById = { + id: number; + name: string; }; -export declare type GetUserByUsername = GetUserById; -export declare type UserCanManageAsset = boolean; +export declare type GeneralGetUserByUsername = GeneralGetUserById; +export declare type GeneralUserCanManageAsset = boolean; -export default class GeneralAPI extends BaseAPI { - constructor (client: Client) { - super({ - baseUrl: "https://api.roblox.com/", - client - }); - } +export class GeneralAPI extends BaseAPI { + constructor(client: Client) { + super({ + baseUrl: "https://api.roblox.com/", + client + }); + } - getAssetVersions (options: GetAssetVersionOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `assets/${options}/versions` - }, - json: true - }) - .then(response => response.body); - } + getAssetVersions( + options: GeneralGetAssetVersionOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `assets/${options}/versions` + }, + json: true + }).then((response) => response.body); + } - awardBadge (options: AwardBadgeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "assets/award-badge", - method: "POST", - qs: options - } - }) - .then(() => true); - } + awardBadge(options: GeneralAwardBadgeOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "assets/award-badge", + method: "POST", + qs: options + } + }).then(() => true); + } - getBalance (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "currency/balance" - } - }) - .then(response => response.body as GetBalance); - } + getBalance(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "currency/balance" + } + }).then((response) => response.body as GeneralGetBalance); + } - getUserFriends (options: GetUserFriendsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `users/${options.userId}/friends`, - qs: { - page: options.page - } - }, - json: true - }) - .then(response => response.body); - } + getUserFriends( + options: GeneralGetUserFriendsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/friends`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } - acceptFriendRequest (options: AcceptFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/accept-friend-request", - method: "POST", - qs: { - requesterUserId: options.userId - } - } - }) - .then(() => true as AcceptFriendRequest); - } + acceptFriendRequest( + options: GeneralAcceptFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/accept-friend-request", + method: "POST", + qs: { + requesterUserId: options.userId + } + } + }).then(() => true as GeneralAcceptFriendRequest); + } - declineFriendRequest (options: DeclineFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/decline-friend-request", - method: "POST", - qs: { - requesterUserId: options.userId - } - } - }) - .then(() => true as DeclineFriendRequest); - } + declineFriendRequest( + options: GeneralDeclineFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/decline-friend-request", + method: "POST", + qs: { + requesterUserId: options.userId + } + } + }).then(() => true as GeneralDeclineFriendRequest); + } - sendFriendRequest (options: SendFriendRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/request-friendship", - method: "POST", - qs: { - recipientUserId: options.userId - } - } - }) - .then(() => true as SendFriendRequest); - } + sendFriendRequest( + options: GeneralSendFriendRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/request-friendship", + method: "POST", + qs: { + recipientUserId: options.userId + } + } + }).then(() => true as GeneralSendFriendRequest); + } - getUserFriendsCount (options: GetUserFriendsCountOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "user/get-friendship-count", - qs: options - }, - json: true - }) - .then(response => response.body.count); - } + getUserFriendsCount( + options: GeneralGetUserFriendsCountOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "user/get-friendship-count", + qs: options + }, + json: true + }).then((response) => response.body.count); + } - unfriendUser (options: UnfriendUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/unfriend", - method: "POST", - qs: { - friendUserId: options.userId - } - } - }) - .then(() => true as UnfriendUser); - } + unfriendUser( + options: GeneralUnfriendUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/unfriend", + method: "POST", + qs: { + friendUserId: options.userId + } + } + }).then(() => true as GeneralUnfriendUser); + } - isUserFollowing (options: IsUserFollowingOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "user/following-exists", - qs: options - } - }) - .then(response => response.body.isFollowing); - } + isUserFollowing( + options: GeneralIsUserFollowingOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "user/following-exists", + qs: options + } + }).then((response) => response.body.isFollowing); + } - followUser (options: FollowUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/follow", - method: "POST", - qs: { - followedUserId: options.userId - } - } - }) - .then(() => true as FollowUser); - } + followUser(options: GeneralFollowUserOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/follow", + method: "POST", + qs: { + followedUserId: options.userId + } + } + }).then(() => true as GeneralFollowUser); + } - unfollowUser (options: UnfollowUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "user/unfollow", - method: "POST", - qs: { - followedUserId: options.userId - } - } - }) - .then(() => true as UnfollowUser); - } + unfollowUser( + options: GeneralUnfollowUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "user/unfollow", + method: "POST", + qs: { + followedUserId: options.userId + } + } + }).then(() => true as GeneralUnfollowUser); + } - getUserGroups (options: GetUserGroupsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `users/${options.userId}/groups` - } - }) - .then(response => response.body); - } + getUserGroups( + options: GeneralGetUserGroupsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/groups` + } + }).then((response) => response.body); + } - getGroup (options: GetGroupOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `groups/${options.groupId}` - }, - json: true - }) - .then(response => response.body); - } + getGroup(options: GeneralGetGroupOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `groups/${options.groupId}` + }, + json: true + }).then((response) => response.body); + } - getGroupAllies (options: GetGroupAlliesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `groups/${options.groupId}/allies`, - qs: { - page: options.page - } - }, - json: true - }) - .then(response => response.body); - } + getGroupAllies( + options: GeneralGetGroupAlliesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `groups/${options.groupId}/allies`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } - getGroupEnemies (options: GetGroupEnemiesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `groups/${options.groupId}/enemies`, - qs: { - page: options.page - } - }, - json: true - }) - .then(response => response.body); - } + getGroupEnemies( + options: GeneralGetGroupEnemiesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `groups/${options.groupId}/enemies`, + qs: { + page: options.page + } + }, + json: true + }).then((response) => response.body); + } - getIncomingItems (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "incoming-items/counts" - }, - json: true - }) - .then((response: any) => ({ - friendRequestsCount: response.body.friendRequestsCount, - unreadMessageCount: response.body.unreadMessageCount - })); - } + getIncomingItems(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "incoming-items/counts" + }, + json: true + }).then((response: any) => ({ + friendRequestsCount: response.body.friendRequestsCount, + unreadMessageCount: response.body.unreadMessageCount + })); + } - getProductInfo (options: GetProductInfoOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "marketplace/productinfo", - qs: options - }, - json: true - }) - .then(response => response.body); - } + getProductInfo( + options: GeneralGetProductInfoOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "marketplace/productinfo", + qs: options + }, + json: true + }).then((response) => response.body); + } - getGamePassProductInfo (options: GetGamePassProductInfoOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "marketplace/game-pass-product-info", - qs: options - }, - json: true - }) - .then(response => response.body); - } + getGamePassProductInfo( + options: GeneralGetGamePassProductInfoOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "marketplace/game-pass-product-info", + qs: options + }, + json: true + }).then((response) => response.body); + } - userOwnsAsset (options: UserOwnsAssetOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "ownership/hasasset", - qs: options - } - }) - .then(response => (response.body as string).includes("true") as UserOwnsAsset); - } + userOwnsAsset( + options: GeneralUserOwnsAssetOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "ownership/hasasset", + qs: options + } + }).then( + (response) => + (response.body as string).includes("true") as GeneralUserOwnsAsset + ); + } - getDeviceInfo (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "reference/deviceinfo" - } - }) - .then(response => ({ - deviceType: response.body.DeviceType, - operatingSystemType: response.body.OperationSystemType, - platformType: response.body.PlatformType - })); - } + getDeviceInfo(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "reference/deviceinfo" + } + }).then((response) => ({ + deviceType: response.body.DeviceType, + operatingSystemType: response.body.OperationSystemType, + platformType: response.body.PlatformType + })); + } - blockUser (options: BlockUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "userblock/block", - qs: options, - method: "POST" - }, - json: true - }) - .then(response => response.body.success === true as BlockUser); - } + blockUser(options: GeneralBlockUserOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "userblock/block", + qs: options, + method: "POST" + }, + json: true + }).then((response) => response.body.success === (true as GeneralBlockUser)); + } - unblockUser (options: UnblockUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: "userblock/unblock", - qs: options, - method: "POST" - }, - json: true - }) - .then(response => response.body.success === true as UnblockUser); - } + unblockUser(options: GeneralUnblockUserOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: "userblock/unblock", + qs: options, + method: "POST" + }, + json: true + }).then( + (response) => response.body.success === (true as GeneralUnblockUser) + ); + } - getUserById (options: GetUserByIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `users/${options.userId}` - }, - json: true - }) - .then(response => ({ - id: response.body.Id, - name: response.body.Username - })); - } + getUserById(options: GeneralGetUserByIdOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}` + }, + json: true + }).then((response) => ({ + id: response.body.Id, + name: response.body.Username + })); + } - getUserByUsername (options: GetUserByUsernameOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: "users/get-by-username", - qs: options - }, - json: true - }) - .then(response => ({ - id: response.body.Id, - name: response.body.Username - })); - } + getUserByUsername( + options: GeneralGetUserByUsernameOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: "users/get-by-username", + qs: options + }, + json: true + }).then((response) => ({ + id: response.body.Id, + name: response.body.Username + })); + } - userCanManageAsset (options: UserCanManageAssetOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `users/${options.userId}/canmanage/${options.assetId}` - }, - json: true - }) - .then(response => response.body.CanManage === true as UserCanManageAsset); - } + userCanManageAsset( + options: GeneralUserCanManageAssetOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `users/${options.userId}/canmanage/${options.assetId}` + }, + json: true + }).then( + (response) => + response.body.CanManage === (true as GeneralUserCanManageAsset) + ); + } } diff --git a/src/client/apis/GroupsAPI.ts b/src/client/apis/GroupsAPI.ts index bda2a11ac..b2f35533f 100644 --- a/src/client/apis/GroupsAPI.ts +++ b/src/client/apis/GroupsAPI.ts @@ -1,1312 +1,1473 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; -import { GroupOptions, GroupRoleOptions, GroupRolePermissionsOptions } from "../../structures/Group"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetGroupOptions = { - groupId: number; -} -export type GetGroup = { +export type GroupsGroupRolePermissionsOptions = { + groupId: number; + role: { id: number; name: string; description: string; - owner: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - shout: { - body: string; - poster: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - created: string; - updated: string; - }; + rank: number; memberCount: number; - isBuildersClubOnly: boolean; - publicEntryAllowed: boolean; - isLocked: boolean; -} -export type GetMultiGroupsOptions = { - groupIds: number[]; -} -export type GetMultiGroups = { - data: GroupOptions[]; -} -export type GetGroupAuditLogsOptions = { - groupId: number; - actionType: "DeletePost" | "RemoveMember" | "AcceptJoinRequest" | "DeclineJoinRequest" | "PostStatus" | "ChangeRank" | "BuyAd" | "SendAllyRequest" | "CreateEnemy" | "AcceptAllyRequest" | "DeclineAllyRequest" | "DeleteAlly" | "DeleteEnemy" | "AddGroupPlace" | "RemoveGroupPlace" | "CreateItems" | "ConfigureItems" | "SpendGroupFunds" | "ChangeOwner" | "Delete" | "AdjustCurrencyAmounts" | "Abandon" | "Claim" | "Rename" | "ChangeDescription" | "InviteToClan" | "KickFromClan" | "CancelCLanInvite" | "BuyClan" | "CreateGroupAsset" | "UpdateGroupAsset" | "ConfigureGroupAsset" | "RevertGroupAsset" | "CreateGroupDeveloperProduct" | "ConfigureGroupGame" | "Lock" | "Unlock" | "CreateGamePass" | "CreateBadge" | "ConfigureBadge" | "SavePlace" | "PublishPlace"; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetGroupAuditLogs = { - previousPageCursor: string; - nextPageCursor: string; - data: { - actor: { - user: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - role: { - id: number; - name: string; - description: string; - rank: number; - memberCount: number; - }; - }; - actionType: string; - description: unknown; - created: string; - }[]; -} -export type GetGroupSettingsOptions = { - groupId: number; -} -export type GetGroupSettings = { - groupId: number; - isApprovalRequired: boolean; - isBuildersClubRequired: boolean; - areEnemiesAllowed: boolean; - areGroupFundsVisible: boolean; - areGroupGamesVisible: boolean; -} -export type UpdateGroupSettingsOptions = GetGroupSettings; -export type UpdateGroupSettings = unknown -export type GetGroupConfigurationMetaData = { - groupConfiguration: { - nameMaxLength: number; - descriptionMaxLength: number; - iconMaxFileSizeMb: number; - cost: number; + }; + permissions: { + groupPostsPermissions: { + viewWall: boolean; + postToWall: boolean; + deleteFromWall: boolean; + viewStatus: boolean; + postToStatus: boolean; }; - recurringPayoutsConfiguration: { - maxPayoutPartners: number; + groupMembershipPermissions: { + changeRank: boolean; + inviteMembers: boolean; + removeMembers: boolean; }; - roleConfiguration: { - nameMaxLength: number; - descriptionMaxLength: number; - limit: number; - cost: number; - minRank: number; - maxRank: number; + groupManagementPermissions: { + manageRelationships: boolean; + manageClan: boolean; + viewAuditLogs: boolean; }; - isPremiumPayoutsEnabled: boolean; - isDefaultEmblemPolicyEnabled: boolean; -} -export type GetGroupsMetaData = { - groupLimit: number; - currentGroupCount: number; - groupStatusMaxLength: number; - areProfileGroupsHidden: boolean; - isGroupDetailsPolicyEnabled: boolean; -} -export type CreateGroupOptions = { - name: string; - description: string; - publicGroup: boolean; - buildersClubMembersOnly: boolean; - files: unknown; -} -export type CreateGroup = GroupOptions; -export type UpdateGroupDescriptionOptions = { - groupId: number; - description: string; -} -export type UpdateGroupDescription = { - newDescription: string; -} -export type UpdateGroupStatusOptions = { - groupId: number; - message: string; -} -export type UpdateGroupStatus = GroupOptions["shout"]; -export type UpdateGroupIconOptions = { - groupId: number; - files: unknown; -} -export type UpdateGroupIcon = unknown -export type DeclineJoinRequestsOptions = { - groupId: number; - userIds: number[]; -} -export type DeclineJoinRequests = unknown -export type GetJoinRequestsOptions = { - groupId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetJoinRequests = { - previousPageCursor: string; - nextPageCursor: string; - data: { - requester: { - userId: number; - username: string; - displayName: string; - }; - created: string; - }[]; -} -export type AcceptJoinRequestsOptions = { - groupId: number; - userIds: number[]; -} -export type AcceptJoinRequests = unknown -export type DeclineJoinRequestOptions = { - groupId: number; - userId: number; -} -export type DeclineJoinRequest = unknown -export type GetJoinRequestOptions = { - groupId: number; + groupEconomyPermissions: { + spendGroupFunds: boolean; + advertiseGroup: boolean; + createItems: boolean; + manageItems: boolean; + addGroupPlaces: boolean; + manageGroupGames: boolean; + viewGroupPayouts: boolean; + }; + }; +}; +export type GroupsGroupRoleOptions = { + id?: number; + name?: string; + rank?: number; + group: { + id: number; + name?: string; + }; +}; +export type GroupsGroupOptions = { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: string; userId: number; -} -export type GetJoinRequest = GetJoinRequests["data"][0]; -export type AcceptJoinRequestOptions = { - groupId: number; + username: string; + displayName: string; + } | null; + shout: { + body: string; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + } | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +}; +export type GroupsGetGroupOptions = { + groupId: number; +}; +export type GroupsGetGroup = { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: "None" | string; userId: number; -} -export type AcceptJoinRequest = unknown -export type GetSelfGroupMembershipOptions = { - groupId: number; -} -export type GetSelfGroupMembership = { - groupId: number; - isPrimary: boolean; - isPendingJoin: boolean; - userRole: { - user: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - role: { - id: number; - name: string; - description: string; - rank: number; - memberCount: number; - }; + username: string; + displayName: string; + }; + shout: { + body: string; + poster: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; }; - permissions: GroupRolePermissionsOptions["permissions"]; + created: string; + updated: string; + }; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; }; -export type GetGroupRolesOptions = { - groupId: number; -} -export type GetGroupRoles = { - groupId: number; - roles: { +export type GroupsGetMultiGroupsOptions = { + groupIds: number[]; +}; +export type GroupsGetMultiGroups = { + data: GroupsGroupOptions[]; +}; +export type GroupsGetGroupAuditLogsOptions = { + groupId: number; + actionType: + | "DeletePost" + | "RemoveMember" + | "AcceptJoinRequest" + | "DeclineJoinRequest" + | "PostStatus" + | "ChangeRank" + | "BuyAd" + | "SendAllyRequest" + | "CreateEnemy" + | "AcceptAllyRequest" + | "DeclineAllyRequest" + | "DeleteAlly" + | "DeleteEnemy" + | "AddGroupPlace" + | "RemoveGroupPlace" + | "CreateItems" + | "ConfigureItems" + | "SpendGroupFunds" + | "ChangeOwner" + | "Delete" + | "AdjustCurrencyAmounts" + | "Abandon" + | "Claim" + | "Rename" + | "ChangeDescription" + | "InviteToClan" + | "KickFromClan" + | "CancelCLanInvite" + | "BuyClan" + | "CreateGroupAsset" + | "UpdateGroupAsset" + | "ConfigureGroupAsset" + | "RevertGroupAsset" + | "CreateGroupDeveloperProduct" + | "ConfigureGroupGame" + | "Lock" + | "Unlock" + | "CreateGamePass" + | "CreateBadge" + | "ConfigureBadge" + | "SavePlace" + | "PublishPlace"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsGetGroupAuditLogs = { + previousPageCursor: string; + nextPageCursor: string; + data: { + actor: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + role: { id: number; name: string; description: string; rank: number; memberCount: number; - }[]; -} -export type GetMembersWithRoleOptions = { - groupId: number; - roleId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetMembersWithRole = { - previousPageCursor: string; - nextPageCursor: string; - data: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }[]; -} -export type GetMembersOptions = { - groupId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetMembers = GetMembersWithRole; -export type JoinGroupOptions = { - groupId: number; - captchaToken: string; - captchaProvider: "PROVIDER_ARKOSELABS" | string; -} -export type JoinGroup = unknown -export type GetSelfPendingGroupJoins = { - data: GroupOptions[]; -} -export type GetUserGroupsOptions = { - userId: number; -} -export type GetUserGroups = { - data: { - group: GroupOptions; - role: GetGroupRoles["roles"][0]; - }[]; -} -export type ChangeOwnerOptions = { - groupId: number; - userId: number; -} -export type ChangeOwner = unknown -export type ClaimGroupOptions = { - groupId: number; -} -export type ClaimGroup = unknown -export type KickMemberOptions = { - groupId: number; + }; + }; + actionType: string; + description: unknown; + created: string; + }[]; +}; +export type GroupsGetGroupSettingsOptions = { + groupId: number; +}; +export type GroupsGetGroupSettings = { + groupId: number; + isApprovalRequired: boolean; + isBuildersClubRequired: boolean; + areEnemiesAllowed: boolean; + areGroupFundsVisible: boolean; + areGroupGamesVisible: boolean; +}; +export type GroupsUpdateGroupSettingsOptions = GroupsGetGroupSettings; +export type GroupsUpdateGroupSettings = unknown; +export type GroupsGetGroupConfigurationMetaData = { + groupConfiguration: { + nameMaxLength: number; + descriptionMaxLength: number; + iconMaxFileSizeMb: number; + cost: number; + }; + recurringPayoutsConfiguration: { + maxPayoutPartners: number; + }; + roleConfiguration: { + nameMaxLength: number; + descriptionMaxLength: number; + limit: number; + cost: number; + minRank: number; + maxRank: number; + }; + isPremiumPayoutsEnabled: boolean; + isDefaultEmblemPolicyEnabled: boolean; +}; +export type GroupsGetGroupsMetaData = { + groupLimit: number; + currentGroupCount: number; + groupStatusMaxLength: number; + groupPostMaxLength: number; + isGroupWallNotificationsEnabled: boolean; + groupWallNotificationsSubscribeIntervalInMilliseconds: number; + areProfileGroupsHidden: boolean; + isGroupDetailsPolicyEnabled: boolean; + showPreviousGroupNames: boolean; +}; +export type GroupsCreateGroupOptions = { + name: string; + description: string; + publicGroup: boolean; + buildersClubMembersOnly: boolean; + files: unknown; +}; +export type GroupsCreateGroup = GroupsGroupOptions; +export type GroupsUpdateGroupDescriptionOptions = { + groupId: number; + description: string; +}; +export type GroupsUpdateGroupDescription = { + newDescription: string; +}; +export type GroupsUpdateGroupStatusOptions = { + groupId: number; + message: string; +}; +export type GroupsUpdateGroupStatus = GroupsGroupOptions["shout"]; +export type GroupsUpdateGroupIconOptions = { + groupId: number; + files: unknown; +}; +export type GroupsUpdateGroupIcon = unknown; +export type GroupsDeclineJoinRequestsOptions = { + groupId: number; + userIds: number[]; +}; +export type GroupsDeclineJoinRequests = unknown; +export type GroupsGetJoinRequestsOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsGetJoinRequests = { + previousPageCursor: string; + nextPageCursor: string; + data: { + requester: { + userId: number; + username: string; + displayName: string; + }; + created: string; + }[]; +}; +export type GroupsAcceptJoinRequestsOptions = { + groupId: number; + userIds: number[]; +}; +export type GroupsAcceptJoinRequests = unknown; +export type GroupsDeclineJoinRequestOptions = { + groupId: number; + userId: number; +}; +export type GroupsDeclineJoinRequest = unknown; +export type GroupsGetJoinRequestOptions = { + groupId: number; + userId: number; +}; +export type GroupsGetJoinRequest = GroupsGetJoinRequests["data"][0]; +export type GroupsAcceptJoinRequestOptions = { + groupId: number; + userId: number; +}; +export type GroupsAcceptJoinRequest = unknown; +export type GroupsGetSelfGroupMembershipOptions = { + groupId: number; +}; +export type GroupsGetSelfGroupMembership = { + groupId: number; + isPrimary: boolean; + isPendingJoin: boolean; + userRole: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + }; + permissions: GroupsGroupRolePermissionsOptions["permissions"]; +}; +export type GroupsGetGroupRolesOptions = { + groupId: number; +}; +export type GroupsGetGroupRoles = { + groupId: number; + roles: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }[]; +}; +export type GroupsGetMembersWithRoleOptions = { + groupId: number; + roleId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsGetMembersWithRole = { + previousPageCursor: string; + nextPageCursor: string; + data: { + buildersClubMembershipType: "None" | string; userId: number; -} -export type KickMember = unknown -export type UpdateMemberOptions = { - groupId: number; + username: string; + displayName: string; + }[]; +}; +export type GroupsGetMembersOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsGetMembers = GroupsGetMembersWithRole; +export type GroupsJoinGroupOptions = { + groupId: number; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export type GroupsJoinGroup = unknown; +export type GroupsGetSelfPendingGroupJoins = { + data: GroupsGroupOptions[]; +}; +export type GroupsGetUserGroupsOptions = { + userId: number; +}; +export type GroupsGetUserGroups = { + data: { + group: GroupsGroupOptions; + role: GroupsGetGroupRoles["roles"][0]; + }[]; +}; +export type GroupsChangeOwnerOptions = { + groupId: number; + userId: number; +}; +export type GroupsChangeOwner = unknown; +export type GroupsClaimGroupOptions = { + groupId: number; +}; +export type GroupsClaimGroup = unknown; +export type GroupsKickMemberOptions = { + groupId: number; + userId: number; +}; +export type GroupsKickMember = unknown; +export type GroupsUpdateMemberOptions = { + groupId: number; + userId: number; + roleId: number; +}; +export type GroupsUpdateMember = unknown; +export type GroupsGetGroupPayoutsOptions = { + groupId: number; +}; +export type GroupsGetGroupPayouts = { + data: { + user: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + percentage: number; + }[]; +}; +export type GroupsPayoutMembersOptions = { + groupId: number; + users: { userId: number; - roleId: number; -} -export type UpdateMember = unknown -export type GetGroupPayoutsOptions = { - groupId: number; -} -export type GetGroupPayouts = { - data: { - user: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - percentage: number; - }[]; -} -export type PayoutMembersOptions = { - groupId: number; - users: { - userId: number; - amount: number; - }[]; - type: "FixedAmount" | "Percentage" | string; -} -export type PayoutMembers = unknown -export type UpdateRecurringPayoutsOptions = PayoutMembersOptions -export type UpdateRecurringPayouts = unknown -export type GetGroupRelationshipsOptions = { - groupId: number; - relationshipType: "enemies" | "allies"; - startRowIndex?: number; - maxRows?: number; -} -export type GetGroupRelationships = { - groupId: number; - relationshipType: GetGroupRelationshipsOptions["relationshipType"]; - totalGroupCount: number; - relatedGroups: GroupOptions[]; - nextRowIndex: number; -} -export type DeclineRelationshipRequestsOptions = { - groupId: number; - relationshipType: GetGroupRelationshipsOptions["relationshipType"]; - withGroups: number[]; -} -export type DeclineRelationshipRequests = unknown -export type GetRelationshipRequestsOptions = GetGroupRelationshipsOptions; -export type GetRelationshipRequests = GetGroupRelationships; -export type AcceptRelationshipRequestsOptions = DeclineRelationshipRequestsOptions -export type AcceptRelationshipRequests = unknown -export type DeleteRelationshipOptions = Omit & { - withGroup: number; -} -export type DeleteRelationship = unknown -export type CreateRelationshipOptions = Omit & { - withGroup: number; -} -export type CreateRelationship = unknown -export type DeclineRelationshipRequestOptions = Omit & { - withGroup: number; -}; -export type DeclineRelationshipRequest = unknown -export type AcceptRelationshipRequestOptions = DeclineRelationshipRequestOptions; -export type AcceptRelationshipRequest = unknown -export type GetRolePermissionsOptions = { - groupId: number; - roleId: number; -} -export type GetRolePermissions = GroupRolePermissionsOptions; -export type UpdateRolePermissionsOptions = { - groupId: number; - roleId: number; - DeleteFromWall: boolean; - PostToWall: boolean; - InviteMembers: boolean; - PostToStatus: boolean; - RemoveMembers: boolean; - ViewStatus: boolean; - ViewWall: boolean; - ChangeRank: boolean; - AdvertiseGroup: boolean; - ManageRelationships: boolean; - AddGroupPlaces: boolean; - ViewAuditLogs: boolean; - CreateItems: boolean; - ManageItems: boolean; - SpendGroupFunds: boolean; - ManageClan: boolean; - ManageGroupGames: boolean; -} -export type UpdateRolePermissions = unknown -export type GetGuestPermissionsOptions = { - groupId: number; -} -export type GetGuestPermissions = GroupRolePermissionsOptions; -export type GetAllRolesPermissionsOptions = { - groupId: number; -} -export type GetAllRolesPermissions = { - data: GroupRolePermissionsOptions[]; -} -export type GetSocialLinksOptions = { - groupId: number; -} -export type GetSocialLinks = { - data: { - id: number; - type: "Facebook" | string; - url: string; - title: string; - }[]; -} -export type PostSocialLinkOptions = { - groupId: number; - type: "Facebook" | string; - url: string; - title: string; -} -export type PostSocialLink = GetSocialLinks["data"][0]; -export type DeleteSocialLinkOptions = { - groupId: number; - id: number; -} -export type DeleteSocialLink = unknown -export type UpdateSocialLinkOptions = { - groupId: number; + amount: number; + }[]; + type: "FixedAmount" | "Percentage" | string; +}; +export type GroupsPayoutMembers = unknown; +export type GroupsUpdateRecurringPayoutsOptions = GroupsPayoutMembersOptions; +export type GroupsUpdateRecurringPayouts = unknown; +export type GroupsGetGroupRelationshipsOptions = { + groupId: number; + relationshipType: "enemies" | "allies"; + startRowIndex?: number; + maxRows?: number; +}; +export type GroupsGetGroupRelationships = { + groupId: number; + relationshipType: GroupsGetGroupRelationshipsOptions["relationshipType"]; + totalGroupCount: number; + relatedGroups: GroupsGroupOptions[]; + nextRowIndex: number; +}; +export type GroupsDeclineRelationshipRequestsOptions = { + groupId: number; + relationshipType: GroupsGetGroupRelationshipsOptions["relationshipType"]; + withGroups: number[]; +}; +export type GroupsDeclineRelationshipRequests = unknown; +export type GroupsGetRelationshipRequestsOptions = + GroupsGetGroupRelationshipsOptions; +export type GroupsGetRelationshipRequests = GroupsGetGroupRelationships; +export type GroupsAcceptRelationshipRequestsOptions = + GroupsDeclineRelationshipRequestsOptions; +export type GroupsAcceptRelationshipRequests = unknown; +export type GroupsDeleteRelationshipOptions = Omit< + GroupsDeclineRelationshipRequestsOptions, + "withGroups" +> & { + withGroup: number; +}; +export type GroupsDeleteRelationship = unknown; +export type GroupsCreateRelationshipOptions = Omit< + GroupsDeclineRelationshipRequestsOptions, + "withGroups" +> & { + withGroup: number; +}; +export type GroupsCreateRelationship = unknown; +export type GroupsDeclineRelationshipRequestOptions = Omit< + GroupsDeclineRelationshipRequestsOptions, + "withGroups" +> & { + withGroup: number; +}; +export type GroupsDeclineRelationshipRequest = unknown; +export type GroupsAcceptRelationshipRequestOptions = + GroupsDeclineRelationshipRequestOptions; +export type GroupsAcceptRelationshipRequest = unknown; +export type GroupsGetRolePermissionsOptions = { + groupId: number; + roleId: number; +}; +export type GroupsGetRolePermissions = GroupsGroupRolePermissionsOptions; +export type GroupsUpdateRolePermissionsOptions = { + groupId: number; + roleId: number; + DeleteFromWall: boolean; + PostToWall: boolean; + InviteMembers: boolean; + PostToStatus: boolean; + RemoveMembers: boolean; + ViewStatus: boolean; + ViewWall: boolean; + ChangeRank: boolean; + AdvertiseGroup: boolean; + ManageRelationships: boolean; + AddGroupPlaces: boolean; + ViewAuditLogs: boolean; + CreateItems: boolean; + ManageItems: boolean; + SpendGroupFunds: boolean; + ManageClan: boolean; + ManageGroupGames: boolean; +}; +export type GroupsUpdateRolePermissions = unknown; +export type GroupsGetGuestPermissionsOptions = { + groupId: number; +}; +export type GroupsGetGuestPermissions = GroupsGroupRolePermissionsOptions; +export type GroupsGetAllRolesPermissionsOptions = { + groupId: number; +}; +export type GroupsGetAllRolesPermissions = { + data: GroupsGroupRolePermissionsOptions[]; +}; +export type GroupsGetSocialLinksOptions = { + groupId: number; +}; +export type GroupsGetSocialLinks = { + data: { id: number; type: "Facebook" | string; url: string; title: string; -} -export type UpdateSocialLink = unknown -export type GetWallPostsOptions = { - groupId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetWallPosts = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - body: string; - created: string; - updated: string; - poster: { - buildersClubMembershipType: "None" | string; - userId: number; - username: string; - displayName: string; - }; - }[]; -} -export type CreateWallPostOptions = { - groupId: number; - body: string; - captchaToken: string; - captchaProvider: "PROVIDER_ARKOSELABS" | string; -} -export type CreateWallPost = GetWallPosts["data"][0]; -export type DeleteWallPostOptions = { - groupId: number; + }[]; +}; +export type GroupsPostSocialLinkOptions = { + groupId: number; + type: "Facebook" | string; + url: string; + title: string; +}; +export type GroupsPostSocialLink = GroupsGetSocialLinks["data"][0]; +export type GroupsDeleteSocialLinkOptions = { + groupId: number; + id: number; +}; +export type GroupsDeleteSocialLink = unknown; +export type GroupsUpdateSocialLinkOptions = { + groupId: number; + id: number; + type: "Facebook" | string; + url: string; + title: string; +}; +export type GroupsUpdateSocialLink = unknown; +export type GroupsGetWallPostsOptions = { + groupId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsGetWallPosts = { + previousPageCursor: string; + nextPageCursor: string; + data: { id: number; -} -export type DeleteWallPost = unknown -export type DeleteWallPostsByUserOptions = { - groupId: number; - userId: number; -} -export type DeleteWallPostsByUser = unknown -export type SearchGroupsByKeywordOptions = { - keyword: string; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type SearchGroupsByKeyword = { - keyword: string; - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - name: string; - description: string; - memberCount: number; - publicEntryAllowed: boolean; - created: string; - updated: string; - }[]; + body: string; + created: string; + updated: string; + poster: { + buildersClubMembershipType: "None" | string; + userId: number; + username: string; + displayName: string; + }; + }[]; }; -export type SearchGroupsOptions = { - groupName: string; -} -export type SearchGroups = { - data: { - id: number; - name: string; - memberCount: number; - }[]; -} -export type GetGroupSearchMetaData = { - SuggestedGroupKeywords: string[]; -} -export type GetRolesByIdsOptions = { - roleIds: number[]; -} -export type GetRolesByIds = { - data: { - groupId: number; - id: number; - name: string; - description: string; - rank: number; - memberCount: number; - }[]; -} -export type GetUserPrimaryGroupOptions = { - userId: number; -} -export type GetUserPrimaryGroup = { - group?: GroupOptions; - role?: GroupRoleOptions; - isPrimaryGroup?: boolean; -} -export type RemovePrimaryGroup = unknown; -export type SetPrimaryGroupOptions = { - groupId: number; -} -export type SetPrimaryGroup = unknown -export type CreateRoleOptions = { - groupId: number; +export type GroupsCreateWallPostOptions = { + groupId: number; + body: string; + captchaToken: string; + captchaProvider: "PROVIDER_ARKOSELABS" | string; +}; +export type GroupsCreateWallPost = GroupsGetWallPosts["data"][0]; +export type GroupsDeleteWallPostOptions = { + groupId: number; + id: number; +}; +export type GroupsDeleteWallPost = unknown; +export type GroupsDeleteWallPostsByUserOptions = { + groupId: number; + userId: number; +}; +export type GroupsDeleteWallPostsByUser = unknown; +export type GroupsSearchGroupsByKeywordOptions = { + keyword: string; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type GroupsSearchGroupsByKeyword = { + keyword: string; + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; name: string; description: string; - rank: number; - usingGroupFunds: boolean; -} -export type CreateRole = Omit; -export type DeleteRoleOptions = { - groupId: number; - roleId: number; -} -export type DeleteRole = unknown -export type UpdateRoleOptions = { + memberCount: number; + publicEntryAllowed: boolean; + created: string; + updated: string; + }[]; +}; +export type GroupsSearchGroupsOptions = { + groupName: string; +}; +export type GroupsSearchGroups = { + data: { + id: number; + name: string; + memberCount: number; + }[]; +}; +export type GroupsGetGroupSearchMetaData = { + SuggestedGroupKeywords: string[]; +}; +export type GroupsGetRolesByIdsOptions = { + roleIds: number[]; +}; +export type GroupsGetRolesByIds = { + data: { groupId: number; - roleId: number; + id: number; name: string; description: string; rank: number; + memberCount: number; + }[]; +}; +export type GroupsGetUserPrimaryGroupOptions = { + userId: number; +}; +export type GroupsGetUserPrimaryGroup = { + group?: GroupsGroupOptions; + role?: GroupsGroupRoleOptions; + isPrimaryGroup?: boolean; +}; +export type GroupsRemovePrimaryGroup = unknown; +export type GroupsSetPrimaryGroupOptions = { + groupId: number; +}; +export type GroupsSetPrimaryGroup = unknown; +export type GroupsCreateRoleOptions = { + groupId: number; + name: string; + description: string; + rank: number; + usingGroupFunds: boolean; +}; +export type GroupsCreateRole = Omit; +export type GroupsDeleteRoleOptions = { + groupId: number; + roleId: number; +}; +export type GroupsDeleteRole = unknown; +export type GroupsUpdateRoleOptions = { + groupId: number; + roleId: number; + name: string; + description: string; + rank: number; +}; +export type GroupsUpdateRole = GroupsCreateRole; + +export class GroupsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://groups.roblox.com/" + }); + } + + getGroup(options: GroupsGetGroupOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}` + }, + json: true + }).then((response) => response.body); + } + + getMultiGroups( + options: GroupsGetMultiGroupsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/groups`, + qs: { + groupIds: options.groupIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + getAuditLogs( + options: GroupsGetGroupAuditLogsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/audit-log`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getGroupSettings( + options: GroupsGetGroupSettingsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/settings` + }, + json: true + }).then((response) => response.body); + } + + updateGroupSettings( + options: GroupsUpdateGroupSettingsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/settings`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getGroupConfigurationMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/configuration/metadata` + }, + json: true + }).then((response) => response.body); + } + + getGroupsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/metadata` + }, + json: true + }).then((response) => response.body); + } + + createGroup(options: GroupsCreateGroupOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/create`, + method: "POST", + formData: { + "request.name": options.name, + "request.description": options.description, + "request.publicGroup": options.publicGroup, + "request.buildersClubMembersOnly": options.buildersClubMembersOnly, + "request.files": options.files + } + }, + json: true + }).then((response) => response.body); + } + + updateGroupDescription( + options: GroupsUpdateGroupDescriptionOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/description`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + updateGroupStatus( + options: GroupsUpdateGroupStatusOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/status`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + updateGroupIcon( + options: GroupsUpdateGroupIconOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/icon`, + method: "PATCH", + body: options.files + }, + json: true + }).then((response) => response.body); + } + + declineJoinRequests( + options: GroupsDeclineJoinRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + method: "DELETE", + json: { + UserIds: options.userIds + } + }, + json: true + }).then((response) => response.body); + } + + getJoinRequests( + options: GroupsGetJoinRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + acceptJoinRequests( + options: GroupsAcceptJoinRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests`, + method: "POST", + json: { + UserIds: options.userIds + } + }, + json: true + }).then((response) => response.body); + } + + declineJoinRequest( + options: GroupsDeclineJoinRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + getJoinRequest( + options: GroupsGetJoinRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}` + }, + json: true + }).then((response) => response.body); + } + + acceptJoinRequest( + options: GroupsAcceptJoinRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + getSelfGroupMembership( + options: GroupsGetSelfGroupMembershipOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/membership` + }, + json: true + }).then((response) => response.body); + } + + getGroupRoles( + options: GroupsGetGroupRolesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/roles` + }, + json: true + }).then((response) => response.body); + } + + getMembersWithRole( + options: GroupsGetMembersWithRoleOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/users`, + qs: { + ...options, + roleSetId: options.roleId + } + }, + json: true + }).then((response) => response.body); + } + + getMembers(options: GroupsGetMembersOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/users`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + joinGroup(options: GroupsJoinGroupOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + getSelfPendingGroupJoins(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/pending` + }, + json: true + }).then((response) => response.body); + } + + getUserGroups( + options: GroupsGetUserGroupsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/groups/roles` + }, + json: true + }).then((response) => response.body); + } + + changeGroupOwner( + options: GroupsChangeOwnerOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/change-owner`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + claimGroup(options: GroupsClaimGroupOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/claim-ownership`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + kickMember(options: GroupsKickMemberOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users/${options.userId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + updateMember( + options: GroupsUpdateMemberOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/users/${options.userId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getGroupPayouts( + options: GroupsGetGroupPayoutsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts` + }, + json: true + }).then((response) => response.body); + } + + payoutMembers( + options: GroupsPayoutMembersOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts`, + method: "POST", + json: { + PayoutType: options.type, + Recipients: options.users.map((userData) => ({ + recipientId: userData.userId, + recipientType: "User", + amount: userData.amount + })) + } + }, + json: true + }).then((response) => response.body); + } + + updateRecurringPayouts( + options: GroupsUpdateRecurringPayoutsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/payouts/recurring`, + method: "POST", + json: { + PayoutType: options.type, + Recipients: options.users.map((userData) => ({ + recipientId: userData.userId, + recipientType: "User", + amount: userData.amount + })) + } + }, + json: true + }).then((response) => response.body); + } + + getGroupRelationships( + options: GroupsGetGroupRelationshipsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}`, + qs: { + "model.startRowIndex": options.startRowIndex || 0, + "model.maxRows": options.maxRows + } + }, + json: true + }).then((response) => response.body); + } + + declineRelationshipRequests( + options: GroupsDeclineRelationshipRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + method: "DELETE", + json: { + GroupIds: options.withGroups + } + }, + json: true + }).then((response) => response.body); + } + + getRelationshipRequests( + options: GroupsGetRelationshipRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + acceptRelationshipRequests( + options: GroupsAcceptRelationshipRequestsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, + method: "DELETE", + json: { + GroupIds: options.withGroups + } + }, + json: true + }).then((response) => response.body); + } + + deleteRelationship( + options: GroupsDeleteRelationshipOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + createRelationship( + options: GroupsCreateRelationshipOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + acceptRelationshipRequest( + options: GroupsAcceptRelationshipRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}` + }, + json: true + }).then((response) => response.body); + } + + declineRelationshipRequest( + options: GroupsDeclineRelationshipRequestOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + getRolePermissions( + options: GroupsGetRolePermissionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions` + }, + json: true + }).then((response) => response.body); + } + + updateRolePermissions( + options: GroupsUpdateRolePermissionsOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getGuestPermissions( + options: GroupsGetGuestPermissionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/guest/permissions` + }, + json: true + }).then((response) => response.body); + } + + getAllRolesPermissions( + options: GroupsGetAllRolesPermissionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/roles/permissions` + }, + json: true + }).then((response) => response.body); + } + + getSocialLinks( + options: GroupsGetSocialLinksOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/social-links` + }, + json: true + }).then((response) => response.body); + } + + createSocialLink( + options: GroupsPostSocialLinkOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + deleteSocialLink( + options: GroupsDeleteSocialLinkOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links/${options.id}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + updateSocialLink( + options: GroupsUpdateSocialLinkOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/social-links/${options.id}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } + + getWallPosts( + options: GroupsGetWallPostsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/${options.groupId}/wall/posts`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + createWallPost( + options: GroupsCreateWallPostOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/posts`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + deleteWallPost( + options: GroupsDeleteWallPostOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/posts/${options.id}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + deleteUserWallPosts( + options: GroupsDeleteWallPostsByUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/wall/users/${options.userId}/posts`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + searchGroupsByKeyword( + options: GroupsSearchGroupsByKeywordOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + searchGroups( + options: GroupsSearchGroupsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search/lookup`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getGroupSearchMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/search/metadata` + }, + json: true + }).then((response) => response.body); + } + + getRolesByIds( + options: GroupsGetRolesByIdsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/roles`, + qs: { + ids: options.roleIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + getUserPrimaryGroup( + options: GroupsGetUserPrimaryGroupOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/groups/primary/role` + }, + json: true + }).then((response) => response.body); + } + + removePrimaryGroup(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/primary`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + setPrimaryGroup( + options: GroupsSetPrimaryGroupOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/user/groups/primary`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + createRole(options: GroupsCreateRoleOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/create`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + deleteRole(options: GroupsDeleteRoleOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } + + updateRole(options: GroupsUpdateRoleOptions): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } } -export type UpdateRole = CreateRole; - -export default class GroupsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://groups.roblox.com/" - }); - } - - getGroup (options: GetGroupOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}` - }, - json: true - }) - .then(response => response.body); - } - - getMultiGroups (options: GetMultiGroupsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/groups`, - qs: { - groupIds: options.groupIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - getAuditLogs (options: GetGroupAuditLogsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/audit-log`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getGroupSettings (options: GetGroupSettingsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/settings` - }, - json: true - }) - .then(response => response.body); - } - - updateGroupSettings (options: UpdateGroupSettingsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/settings`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getGroupConfigurationMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/configuration/metadata` - }, - json: true - }) - .then(response => response.body); - } - - getGroupsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/metadata` - }, - json: true - }) - .then(response => response.body); - } - - createGroup (options: CreateGroupOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/create`, - method: "POST", - formData: { - "request.name": options.name, - "request.description": options.description, - "request.publicGroup": options.publicGroup, - "request.buildersClubMembersOnly": options.buildersClubMembersOnly, - "request.files": options.files - } - }, - json: true - }) - .then(response => response.body); - } - - updateGroupDescription (options: UpdateGroupDescriptionOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/description`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - updateGroupStatus (options: UpdateGroupStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/status`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - updateGroupIcon (options: UpdateGroupIconOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/icon`, - method: "PATCH", - body: options.files - }, - json: true - }) - .then(response => response.body); - } - - declineJoinRequests (options: DeclineJoinRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests`, - method: "DELETE", - json: { - UserIds: options.userIds - } - }, - json: true - }) - .then(response => response.body); - } - - getJoinRequests (options: GetJoinRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - acceptJoinRequests (options: AcceptJoinRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests`, - method: "POST", - json: { - UserIds: options.userIds - } - }, - json: true - }) - .then(response => response.body); - } - - declineJoinRequest (options: DeclineJoinRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - getJoinRequest (options: GetJoinRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}` - }, - json: true - }) - .then(response => response.body); - } - - acceptJoinRequest (options: AcceptJoinRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/join-requests/users/${options.userId}`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - getSelfGroupMembership (options: GetSelfGroupMembershipOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/membership` - }, - json: true - }) - .then(response => response.body); - } - - getGroupRoles (options: GetGroupRolesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/roles` - }, - json: true - }) - .then(response => response.body); - } - - getMembersWithRole (options: GetMembersWithRoleOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/roles/${options.roleId}/users`, - qs: { - ...options, - roleSetId: options.roleId - } - }, - json: true - }) - .then(response => response.body); - } - - getMembers (options: GetMembersOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/users`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - joinGroup (options: JoinGroupOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/users`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getSelfPendingGroupJoins (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/groups/pending` - }, - json: true - }) - .then(response => response.body); - } - - getUserGroups (options: GetUserGroupsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/groups/roles` - }, - json: true - }) - .then(response => response.body); - } - - changeGroupOwner (options: ChangeOwnerOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/change-owner`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - claimGroup (options: ClaimGroupOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/claim-ownership`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - kickMember (options: KickMemberOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/users/${options.userId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - updateMember (options: UpdateMemberOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/users/${options.userId}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getGroupPayouts (options: GetGroupPayoutsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/payouts` - }, - json: true - }) - .then(response => response.body); - } - - payoutMembers (options: PayoutMembersOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/payouts`, - method: "POST", - json: { - PayoutType: options.type, - Recipients: options.users.map(userData => ({ - recipientId: userData.userId, - recipientType: "User", - amount: userData.amount - })) - } - }, - json: true - }) - .then(response => response.body); - } - - updateRecurringPayouts (options: UpdateRecurringPayoutsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/payouts/recurring`, - method: "POST", - json: { - PayoutType: options.type, - Recipients: options.users.map(userData => ({ - recipientId: userData.userId, - recipientType: "User", - amount: userData.amount - })) - } - }, - json: true - }) - .then(response => response.body); - } - - getGroupRelationships (options: GetGroupRelationshipsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}`, - qs: { - "model.startRowIndex": options.startRowIndex || 0, - "model.maxRows": options.maxRows - } - }, - json: true - }) - .then(response => response.body); - } - - declineRelationshipRequests (options: DeclineRelationshipRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, - method: "DELETE", - json: { - GroupIds: options.withGroups - } - }, - json: true - }) - .then(response => response.body); - } - - getRelationshipRequests (options: GetRelationshipRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - acceptRelationshipRequests (options: AcceptRelationshipRequestsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests`, - method: "DELETE", - json: { - GroupIds: options.withGroups - } - }, - json: true - }) - .then(response => response.body); - } - - deleteRelationship (options: DeleteRelationshipOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - createRelationship (options: CreateRelationshipOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/${options.withGroup}`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - acceptRelationshipRequest (options: AcceptRelationshipRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}` - }, - json: true - }) - .then(response => response.body); - } - - declineRelationshipRequest (options: DeclineRelationshipRequestOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/relationships/${options.relationshipType}/requests/${options.withGroup}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - getRolePermissions (options: GetRolePermissionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions` - }, - json: true - }) - .then(response => response.body); - } - - updateRolePermissions (options: UpdateRolePermissionsOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/roles/${options.roleId}/permissions`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getGuestPermissions (options: GetGuestPermissionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/roles/guest/permissions` - }, - json: true - }) - .then(response => response.body); - } - - getAllRolesPermissions (options: GetAllRolesPermissionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/roles/permissions` - }, - json: true - }) - .then(response => response.body); - } - - getSocialLinks (options: GetSocialLinksOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/social-links` - }, - json: true - }) - .then(response => response.body); - } - - createSocialLink (options: PostSocialLinkOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/social-links`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - deleteSocialLink (options: DeleteSocialLinkOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/social-links/${options.id}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - updateSocialLink (options: UpdateSocialLinkOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/social-links/${options.id}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getWallPosts (options: GetWallPostsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/${options.groupId}/wall/posts`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - createWallPost (options: CreateWallPostOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/wall/posts`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - deleteWallPost (options: DeleteWallPostOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/wall/posts/${options.id}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - deleteUserWallPosts (options: DeleteWallPostsByUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/wall/users/${options.userId}/posts`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - searchGroupsByKeyword (options: SearchGroupsByKeywordOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/search`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - searchGroups (options: SearchGroupsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/search/lookup`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getGroupSearchMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/search/metadata` - }, - json: true - }) - .then(response => response.body); - } - - getRolesByIds (options: GetRolesByIdsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/roles`, - qs: { - ids: options.roleIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - getUserPrimaryGroup (options: GetUserPrimaryGroupOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/groups/primary/role` - }, - json: true - }) - .then(response => response.body); - } - - removePrimaryGroup (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/groups/primary`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - setPrimaryGroup (options: SetPrimaryGroupOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/user/groups/primary`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - createRole (options: CreateRoleOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/rolesets/create`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - deleteRole (options: DeleteRoleOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } - - updateRole (options: UpdateRoleOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/groups/${options.groupId}/rolesets/${options.roleId}`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } -} - diff --git a/src/client/apis/InventoryAPI.ts b/src/client/apis/InventoryAPI.ts index 7dfb80534..3ca76cfa7 100644 --- a/src/client/apis/InventoryAPI.ts +++ b/src/client/apis/InventoryAPI.ts @@ -1,184 +1,300 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetPackageAssetsOptions = { - packageId: number; -} -export type GetPackageAssets = { - assetIds: number[]; -} -export type GetUserCollectiblesOptions = { - userId: number; - assetType?: "Image" | "TShirt" | "Audio" | "Mesh" | "Lua" | "HTML" | "Text" | "Hat" | "Place" | "Model" | "Shirt" | "Pants" | "Decal" | "Avatar" | "Head" | "Face" | "Gear" | "Badge" | "GroupEmblem" | "Animation" | "Arms" | "Legs" | "Torso" | "RightArm" | "LeftArm" | "LeftLeg" | "RightLeg" | "Package" | "YouTubeVideo" | "GamePass" | "App" | "Code" | "Plugin" | "SolidModel" | "MeshPart" | "HairAccessory" | "NeckAccessory" | "ShoulderAccessory" | "FrontAccessory" | "BackAccessory" | "WaistAccessory" | "ClimbAnimation" | "DeathAnimation" | "FallAnimation" | "IdleAnimation" | "JumpAnimation" | "RunAnimation" | "SwimAnimation" | "WalkAnimation" | "PoseAnimation" | "LocalizationTableManifest" | "LocalizationTableTranslation" | "EmoteAnimation" | "Video" | "TexturePack"; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetUserCollectibles = { - previousPageCursor: string; - nextPageCursor: string; - data: { - userAssetId: number; - serialNumber: number; - assetId: number; - name: string; - recentAveragePrice: number; - originalPrice: number; - assetStock: number; - buildersClubMembershipType: "None" | string; - }[]; -} -export type GetUserItemsByTypeAndTargetIdOptions = { - userId: number; - itemType: "Asset" | "GamePass" | "Badge" | "Bundle"; - itemTargetId: number; -} -export type GetUserItemsByTypeAndTargetId = { - previousPageCursor: string; - nextPageCursor: string; - data: { - Id: number; - Name: string; - Type: GetUserItemsByTypeAndTargetIdOptions["itemType"]; - InstanceId: number; - }[]; -} -export type GetAssetOwnersOptions = { +export type InventoryCanViewInventory = { + canView: boolean; +}; +export type InventoryItem = { + name: string; + displayName: string; + filter: string; + id: number; + type: string; + categoryType: string; +}; +export type InventoryCategory = { + name: string; + displayName: string; + categoryType: string; + items: InventoryItem[]; +}; +export type InventoryCategories = { + categories: InventoryCategory[]; +}; +export type InventoryGetPackageAssetsOptions = { + packageId: number; +}; +export type InventoryGetPackageAssets = { + assetIds: number[]; +}; +export type InventoryGetUserCollectiblesOptions = { + userId: number; + assetType?: + | "Image" + | "TShirt" + | "Audio" + | "Mesh" + | "Lua" + | "HTML" + | "Text" + | "Hat" + | "Place" + | "Model" + | "Shirt" + | "Pants" + | "Decal" + | "Avatar" + | "Head" + | "Face" + | "Gear" + | "Badge" + | "GroupEmblem" + | "Animation" + | "Arms" + | "Legs" + | "Torso" + | "RightArm" + | "LeftArm" + | "LeftLeg" + | "RightLeg" + | "Package" + | "YouTubeVideo" + | "GamePass" + | "App" + | "Code" + | "Plugin" + | "SolidModel" + | "MeshPart" + | "HairAccessory" + | "NeckAccessory" + | "ShoulderAccessory" + | "FrontAccessory" + | "BackAccessory" + | "WaistAccessory" + | "ClimbAnimation" + | "DeathAnimation" + | "FallAnimation" + | "IdleAnimation" + | "JumpAnimation" + | "RunAnimation" + | "SwimAnimation" + | "WalkAnimation" + | "PoseAnimation" + | "LocalizationTableManifest" + | "LocalizationTableTranslation" + | "EmoteAnimation" + | "Video" + | "TexturePack"; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type InventoryGetUserCollectibles = { + previousPageCursor: string; + nextPageCursor: string; + data: { + userAssetId: number; + serialNumber: number; assetId: number; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetAssetOwners = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - serialNumber: number; - owner: { - id: number; - type: "User" | string; - name: string; - }; - created: string; - updated: string; + name: string; + recentAveragePrice: number; + originalPrice: number; + assetStock: number; + buildersClubMembershipType: "None" | string; + }[]; +}; +export type InventoryGetUserItemsByTypeAndTargetIdOptions = { + userId: number; + itemType: "Asset" | "GamePass" | "Badge" | "Bundle"; + itemTargetId: number; +}; +export type InventoryGetUserItemsByTypeAndTargetId = { + previousPageCursor: string; + nextPageCursor: string; + data: { + Id: number; + Name: string; + Type: InventoryGetUserItemsByTypeAndTargetIdOptions["itemType"]; + InstanceId: number; + }[]; +}; +export type InventoryGetAssetOwnersOptions = { + assetId: number; + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type InventoryGetAssetOwners = { + previousPageCursor: string; + nextPageCursor: string; + data: { + id: number; + serialNumber: number; + owner: { + id: number; + type: "User" | string; + name: string; }; -} -export type GetUserInventoryOptions = { - userId: number; - assetTypes: GetUserCollectiblesOptions["assetType"][]; - limit?: 10 | 25 | 50 | 100; - cursor?: string; - sortOrder?: "Asc" | "Desc"; -} -export type GetUserInventory = { - previousPageCursor: string; - nextPageCursor: string; - data: { - assetId: number; - name: string; - assetType: GetUserCollectiblesOptions["assetType"]; - created: string; - }[]; -} -export type GetUserInventoryByAssetTypeIdOptions = Omit & { - assetTypeId: number; -} -export type GetUserInventoryByAssetTypeId = { - previousPageCursor: string; - nextPageCursor: string; - data: { - assetName: string; - userAssetId: number; - assetId: number; - serialNumber: number; - owner: { - userId: number; - username: string; - buildersClubMembershipType: "None" | string; - }; - created: string; - updated: string; - }[]; -} + created: string; + updated: string; + }; +}; +export type InventoryGetUserInventoryOptions = { + userId: number; + assetTypes: InventoryGetUserCollectiblesOptions["assetType"][]; + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; +}; +export type InventoryGetUserInventory = { + previousPageCursor: string; + nextPageCursor: string; + data: { + assetId: number; + name: string; + assetType: InventoryGetUserCollectiblesOptions["assetType"]; + created: string; + }[]; +}; +export type InventoryGetUserInventoryByAssetTypeIdOptions = Omit< + InventoryGetUserInventoryOptions, + "assetTypes" +> & { + assetTypeId: number; +}; +export type InventoryGetUserInventoryByAssetTypeId = { + previousPageCursor: string; + nextPageCursor: string; + data: { + assetName: string; + userAssetId: number; + assetId: number; + serialNumber: number; + owner: { + userId: number; + username: string; + buildersClubMembershipType: "None" | string; + }; + created: string; + updated: string; + }[]; +}; + +export class InventoryAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://inventory.roblox.com/" + }); + } + getPackageAssets( + options: InventoryGetPackageAssetsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/packages/${options.packageId}/assets` + }, + json: true + }).then((response) => response.body); + } -export default class InventoryAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://inventory.roblox.com/" - }); - } + getUserCollectibles( + options: InventoryGetUserCollectiblesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/assets/collectibles`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getPackageAssets (options: GetPackageAssetsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/packages/${options.packageId}/assets` - }, - json: true - }) - .then(response => response.body); - } + getUserItemsByTypeAndTargetId( + options: InventoryGetUserItemsByTypeAndTargetIdOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/items/${options.itemType}/${options.itemTargetId}` + }, + json: true + }).then((response) => response.body); + } - getUserCollectibles (options: GetUserCollectiblesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/assets/collectibles`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + canViewInventory(options: { + userId: number; + }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/can-view-inventory` + }, + json: true + }).then((response) => response.body); + } - getUserItemsByTypeAndTargetId (options: GetUserItemsByTypeAndTargetIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/items/${options.itemType}/${options.itemTargetId}` - }, - json: true - }) - .then(response => response.body); - } + getCategories(options: { userId: number }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/categories` + }, + json: true + }).then((response) => response.body); + } + + getCategoriesFavorites(options: { + userId: number; + }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/categories/favorites` + }, + json: true + }).then((response) => response.body); + } - getAssetOwners (options: GetAssetOwnersOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/assets/${options.assetId}/owners`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getAssetOwners( + options: InventoryGetAssetOwnersOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/assets/${options.assetId}/owners`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserInventory (options: GetUserInventoryOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/users/${options.userId}/inventory`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserInventory( + options: InventoryGetUserInventoryOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/users/${options.userId}/inventory`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserInventoryByAssetTypeId (options: GetUserInventoryByAssetTypeIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/users/${options.userId}/inventory/${options.assetTypeId}`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUserInventoryByAssetTypeId( + options: InventoryGetUserInventoryByAssetTypeIdOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/users/${options.userId}/inventory/${options.assetTypeId}`, + qs: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/ItemConfigurationAPI.ts b/src/client/apis/ItemConfigurationAPI.ts index fd7c31dc0..27efe8d84 100644 --- a/src/client/apis/ItemConfigurationAPI.ts +++ b/src/client/apis/ItemConfigurationAPI.ts @@ -1,189 +1,198 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetCreatedAssetsOptions = { - assetType: string; - isArchived?: boolean; - groupId?: number; - sortOrder?: "Asc" | "Desc"; -} -export type GetCreatedAssets = { - previousPageCursor: string; - nextPageCursor: string; - data: { - assetId: number; - name: string; - }[]; -} -export type GetMultiCreatedAssetDetailsOptions = { - assetIds: number[]; -} -export type GetMultiCreatedAssetDetails = { +export type ItemConfigurationGetCreatedAssetsOptions = { + assetType: string; + isArchived?: boolean; + groupId?: number; + sortOrder?: "Asc" | "Desc"; +}; +export type ItemConfigurationGetCreatedAssets = { + previousPageCursor: string; + nextPageCursor: string; + data: { assetId: number; name: string; - status: string; - description: string; - creatorType: string; - creatorTargetId: number; - price: number; - priceConfiguration: { - priceInRobux: number; - premiumDiscountPercentage: number; - premiumPriceInRobux: number; - }; - isArchived: boolean; - assetType: string; -}[] -export type GetItemTagsByItemIdsOptions = { - itemIds: number[]; -} -export type GetItemTagsByItemIds = { - data: { - id: string; - itemTags: { - id: string; - tag: { - tagId: string; - name: string; - localizedDisplayName: string; - status: "Success" | string; - }; - }[]; + }[]; +}; +export type ItemConfigurationGetMultiCreatedAssetDetailsOptions = { + assetIds: number[]; +}; +export type ItemConfigurationGetMultiCreatedAssetDetails = { + assetId: number; + name: string; + status: string; + description: string; + creatorType: string; + creatorTargetId: number; + price: number; + priceConfiguration: { + priceInRobux: number; + premiumDiscountPercentage: number; + premiumPriceInRobux: number; + }; + isArchived: boolean; + assetType: string; +}[]; +export type ItemConfigurationGetItemTagsByItemIdsOptions = { + itemIds: number[]; +}; +export type ItemConfigurationGetItemTagsByItemIds = { + data: { + id: string; + itemTags: { + id: string; + tag: { + tagId: string; + name: string; + localizedDisplayName: string; + status: "Success" | string; + }; }[]; -} -export type CreateItemTagOptions = { - itemId: number; - tagId: string; -} -export type CreateItemTag = GetItemTagsByItemIds["data"][0]["itemTags"][0]; -export type GetItemTagsMetaData = { - isItemTagsFeatureEnabled: boolean; - enabledAssetTypes: string[]; - maximumItemTagsPerItem: number; -} -export type DeleteItemTagOptions = { - itemTagId: number; -} -export type DeleteItemTag = unknown -export type GetTagsByTagIdsOptions = { - tagIds: number[]; -} -export type GetTagsByTagIds = { - data: Omit[]; -} -export type SearchTagsOptions = { - prefix: string; - results: number; -} -export type SearchTags = GetTagsByTagIds; + }[]; +}; +export type ItemConfigurationCreateItemTagOptions = { + itemId: number; + tagId: string; +}; +export type ItemConfigurationCreateItemTag = + ItemConfigurationGetItemTagsByItemIds["data"][0]["itemTags"][0]; +export type ItemConfigurationGetItemTagsMetaData = { + isItemTagsFeatureEnabled: boolean; + enabledAssetTypes: string[]; + maximumItemTagsPerItem: number; +}; +export type ItemConfigurationDeleteItemTagOptions = { + itemTagId: number; +}; +export type ItemConfigurationDeleteItemTag = unknown; +export type ItemConfigurationGetTagsByTagIdsOptions = { + tagIds: number[]; +}; +export type ItemConfigurationGetTagsByTagIds = { + data: Omit< + ItemConfigurationGetItemTagsByItemIds["data"][0]["itemTags"][0], + "id" + >[]; +}; +export type ItemConfigurationSearchTagsOptions = { + prefix: string; + results: number; +}; +export type ItemConfigurationSearchTags = ItemConfigurationGetTagsByTagIds; -export default class InventoryAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://itemconfiguration.roblox.com/" - }); - } +export class ItemConfigurationAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://itemconfiguration.roblox.com/" + }); + } - getCreatedAssets (options: GetCreatedAssetsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/creations/get-assets`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getCreatedAssets( + options: ItemConfigurationGetCreatedAssetsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creations/get-assets`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getMultiCreatedAssets (options: GetMultiCreatedAssetDetailsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/creations/get-asset-details`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getMultiCreatedAssets( + options: ItemConfigurationGetMultiCreatedAssetDetailsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/creations/get-asset-details`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getItemTagsByItemIds (options: GetItemTagsByItemIdsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/item-tags`, - qs: { - itemIds: options.itemIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getItemTagsByItemIds( + options: ItemConfigurationGetItemTagsByItemIdsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags`, + qs: { + itemIds: options.itemIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - createItemTag (options: CreateItemTagOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/item-tags`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + createItemTag( + options: ItemConfigurationCreateItemTagOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getItemTagsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/item-tags/metadata` - }, - json: true - }) - .then(response => response.body); - } + getItemTagsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags/metadata` + }, + json: true + }).then((response) => response.body); + } - deleteItemTag (options: DeleteItemTagOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/item-tags/${options.itemTagId}`, - method: "DELETE" - }, - json: true - }) - .then(response => response.body); - } + deleteItemTag( + options: ItemConfigurationDeleteItemTagOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/item-tags/${options.itemTagId}`, + method: "DELETE" + }, + json: true + }).then((response) => response.body); + } - getTagsByTagIds (options: GetTagsByTagIdsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/tags`, - qs: { - tagIds: options.tagIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } + getTagsByTagIds( + options: ItemConfigurationGetTagsByTagIdsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/tags`, + qs: { + tagIds: options.tagIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } - searchTags (options: SearchTagsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/tags/prefix-search`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + searchTags( + options: ItemConfigurationSearchTagsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/tags/prefix-search`, + qs: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/LocaleAPI.ts b/src/client/apis/LocaleAPI.ts index 9502a54f5..0982abd21 100644 --- a/src/client/apis/LocaleAPI.ts +++ b/src/client/apis/LocaleAPI.ts @@ -1,132 +1,139 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetCountryRegionsOptions = { - locale: string; -} -export type GetCountryRegions = { - countryRegionList: { - code: string; +export type LocaleGetCountryRegionsOptions = { + locale: string; +}; +export type LocaleGetCountryRegions = { + countryRegionList: { + code: string; + name: string; + displayName: string; + }[]; +}; +export type LocaleGetLocalesOptions = { + displayValueLocale?: string; +}; +export type LocaleGetLocales = { + data: { + locale: { + id: number; + locale: string; + name: string; + nativeName: string; + language: { + id: number; name: string; - displayName: string; - }[]; -} -export type GetLocalesOptions = { - displayValueLocale?: string; -} -export type GetLocales = { - data: { - locale: { - id: number; - locale: string; - name: string; - nativeName: string; - language: { - id: number; - name: string; - nativeName: string; - languageCode: string; - }; - }; - isEnabledForFullExperience: boolean; - isEnabledForSignupAndLogin: boolean; - isEnabledForInGameUgc: boolean; - }[]; -} -export type GetSupportedLocales = { - supportedLocales: GetLocales["data"][0]["locale"][]; -} -export type GetUserLocale = { - supportedLocale: GetLocales["data"][0]["locale"]; -} -export type GetLocusSupportedLocales = { - signupAndLogin: GetLocales["data"][0]["locale"]; - generalExperience: GetLocales["data"][0]["locale"]; - ugc: GetLocales["data"][0]["locale"]; -} -export type SetUserLocaleOptions = { - supportedLocaleCode: string; -} -export type SetUserLocale = { - success: boolean; -} + nativeName: string; + languageCode: string; + }; + }; + isEnabledForFullExperience: boolean; + isEnabledForSignupAndLogin: boolean; + isEnabledForInGameUgc: boolean; + }[]; +}; +export type LocaleGetSupportedLocales = { + supportedLocales: LocaleGetLocales["data"][0]["locale"][]; +}; +export type LocaleGetUserLocale = { + supportedLocale: LocaleGetLocales["data"][0]["locale"]; +}; +export type LocaleGetLocusSupportedLocales = { + signupAndLogin: LocaleGetLocales["data"][0]["locale"]; + generalExperience: LocaleGetLocales["data"][0]["locale"]; + ugc: LocaleGetLocales["data"][0]["locale"]; +}; +export type LocaleSetUserLocaleOptions = { + supportedLocaleCode: string; +}; +export type LocaleSetUserLocale = { + success: boolean; +}; + +export class LocaleAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://locale.roblox.com/" + }); + } -export default class LocaleAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://locale.roblox.com/" - }); - } + getCountryRegions( + options: LocaleGetCountryRegionsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/country-regions`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getCountryRegions (options: GetCountryRegionsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/country-regions`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getLocales(options: LocaleGetLocalesOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getLocales (options: GetLocalesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/locales`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getSupportedLocales(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/supported-locales` + }, + json: true + }).then((response) => response.body); + } - getSupportedLocales (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/locales/supported-locales` - }, - json: true - }) - .then(response => response.body); - } + getSupportedLocalsForCreators(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/supported-locales-for-creators` + }, + json: true + }).then((response) => response.body); + } - getUserLocale (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/locales/user-locale` - }, - json: true - }) - .then(response => response.body); - } + getUserLocale(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/locales/user-locale` + }, + json: true + }).then((response) => response.body); + } - getLocusSupportedLocales (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/locales/user-localization-locus-supported-locales` - }, - json: true - }) - .then(response => response.body); - } + getLocusSupportedLocales(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/locales/user-localization-locus-supported-locales` + }, + json: true + }).then((response) => response.body); + } - setUserLocale (options: SetUserLocaleOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/locales/set-user-supported-locale`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + setUserLocale( + options: LocaleSetUserLocaleOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/locales/set-user-supported-locale`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/MetricsAPI.ts b/src/client/apis/MetricsAPI.ts index 97b49f2a5..384d264a7 100644 --- a/src/client/apis/MetricsAPI.ts +++ b/src/client/apis/MetricsAPI.ts @@ -1,68 +1,68 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export type MetricsGetThumbnailsMetaData = { + logRatio: number; +}; +export type MetricsRecordThumbnailLoadOptions = { + duration: number; + loadState: string; + thumbnailType: string; +}; +export type MetricsRecordThumbnailLoad = unknown; +export type MetricsReportBundleLoadOptions = { + bundleUrl: string; + bundleName: string; + loadTimeInMilliseconds: number; + cdnProviderName: string; + loadState: string; + bundleContentType: string; +}; +export type MetricsReportBundleLoad = unknown; -export type GetThumbnailsMetaData = { - logRatio: number; -} -export type RecordThumbnailLoadOptions = { - duration: number; - loadState: string; - thumbnailType: string; -} -export type RecordThumbnailLoad = unknown -export type RecordBundleLoadOptions = { - bundleUrl: string; - bundleName: string; - loadTimeInMilliseconds: number; - cdnProviderName: string; - loadState: string; - bundleContentType: string; -} -export type RecordBundleLoad = unknown - -export default class LocaleAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://metrics.roblox.com/" - }); - } +export class MetricsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://metrics.roblox.com/" + }); + } - getThumbnailsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/thumbnails/metadata` - }, - json: true - }) - .then(response => response.body); - } + getThumbnailsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/thumbnails/metadata` + }, + json: true + }).then((response) => response.body); + } - recordThumbnailLoad (options: RecordThumbnailLoadOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/thumbnails/load`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + recordThumbnailLoad( + options: MetricsRecordThumbnailLoadOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/thumbnails/load`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - recordBundleLoad (options: RecordBundleLoadOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/thumbnails/metadata`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + recordBundleLoad( + options: MetricsReportBundleLoadOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundle-metrics/report`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/NotificationsAPI.ts b/src/client/apis/NotificationsAPI.ts index 57b78bdbe..a183b5485 100644 --- a/src/client/apis/NotificationsAPI.ts +++ b/src/client/apis/NotificationsAPI.ts @@ -1,650 +1,661 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetNotificationsSettings = { - notificationBandSettings: { - notificationSourceType: string; - receiverDestinationType: string; - isEnabled: boolean; - isOverridable: boolean; - isSetByReceiver: boolean; - pushNotificationDestinationPreferences: [ - { - name: string; - platform: string; - destinationId: 0; - isEnabled: boolean; - isSetByReceiver: boolean; - } - ]; - }[]; - optedOutNotificationSourceTypes: string[]; - optedOutReceiverDestinationTypes: string[]; -} -export type GetRealtimeNotificationsSettings = { - primaryDomain: string; - fallbackDomain: string; -} -export type AllowNotificationSourceOptions = { - sourceType: string; -} -export type AllowNotificationSource = unknown -export type DisallowNotificationSourceOptions = AllowNotificationSourceOptions; -export type DisallowNotificationSource = unknown -export type AllowNotificationsDestinationOptions = { - destinationType: string; -} -export type AllowNotificationsDestination = unknown -export type DisallowNotificationsDestinationOptions = AllowNotificationsDestinationOptions; -export type DisallowNotificationsDestination = unknown -export type UpdateNotificationDestinationSettingsOptions = { +export type NotificationsGetNotificationsSettings = { + notificationBandSettings: { notificationSourceType: string; - destinationId: number; + receiverDestinationType: string; isEnabled: boolean; -} -export type UpdateNotificationDestinationSettings = unknown -export type UpdateNotificationSettingsOptions = { - updatedSettings: { - notificationSourceType: string; - receiverDestination: string; - isEnabled: boolean; - }[]; -} -export type UpdateNotificationSettings = unknown -export type GetChromeNotificationsManifest = { - name: string; - gcm_sender_id: string; -} -export type GetCurrentNotificationDeviceDestination = { - destination: { - user: { - name: string; - userId: number; - }; + isOverridable: boolean; + isSetByReceiver: boolean; + pushNotificationDestinationPreferences: [ + { name: string; - notificationToken: string; - supportsUpdateNotifications: boolean; - userPushNotificationDestinationId: number; - application: string; platform: string; + destinationId: 0; + isEnabled: boolean; + isSetByReceiver: boolean; + } + ]; + }[]; + optedOutNotificationSourceTypes: string[]; + optedOutReceiverDestinationTypes: string[]; +}; +export type NotificationsGetRealtimeNotificationsSettings = { + primaryDomain: string; + fallbackDomain: string; +}; +export type NotificationsAllowNotificationSourceOptions = { + sourceType: string; +}; +export type NotificationsAllowNotificationSource = unknown; +export type NotificationsDisallowNotificationSourceOptions = + NotificationsAllowNotificationSourceOptions; +export type NotificationsDisallowNotificationSource = unknown; +export type NotificationsAllowNotificationsDestinationOptions = { + destinationType: string; +}; +export type NotificationsAllowNotificationsDestination = unknown; +export type NotificationsDisallowNotificationsDestinationOptions = + NotificationsAllowNotificationsDestinationOptions; +export type NotificationsDisallowNotificationsDestination = unknown; +export type NotificationsUpdateNotificationDestinationSettingsOptions = { + notificationSourceType: string; + destinationId: number; + isEnabled: boolean; +}; +export type NotificationsUpdateNotificationDestinationSettings = unknown; +export type NotificationsUpdateNotificationSettingsOptions = { + updatedSettings: { + notificationSourceType: string; + receiverDestination: string; + isEnabled: boolean; + }[]; +}; +export type NotificationsUpdateNotificationSettings = unknown; +export type NotificationsGetChromeNotificationsManifest = { + name: string; + gcm_sender_id: string; +}; +export type NotificationsGetCurrentNotificationDeviceDestination = { + destination: { + user: { + name: string; + userId: number; }; - statusMessage: string; -} -export type GetNotificationDestinations = { - destinations: GetCurrentNotificationDeviceDestination["destination"][]; - statusMessage: string; -} -export type GetNotificationsMetaDataOptions = { - notificationToken: string; - notificationId: number; -} -export type GetNotificationsMetaData = { - metadata: { - notificationId: string; - type: string; - detail: unknown; - fallbackDelivered: boolean; - }; - statusMessage: string; -} -export type GetNotificationIdsOptions = { + name: string; notificationToken: string; - limit: number; - cursor?: string; -} -export type GetNotificationIds = { - ids: string[]; - statusMessage: string; -} -export type DeregisterAllDevices = { - statusMessage: string; -} -export type DeregisterCurrentDevice = { - statusMessage: string; -} -export type MarkNotificationReadOptions = { - platformType: string; + supportsUpdateNotifications: boolean; + userPushNotificationDestinationId: number; + application: string; + platform: string; + }; + statusMessage: string; +}; +export type NotificationsGetNotificationDestinations = { + destinations: NotificationsGetCurrentNotificationDeviceDestination["destination"][]; + statusMessage: string; +}; +export type NotificationsGetNotificationsMetaDataOptions = { + notificationToken: string; + notificationId: number; +}; +export type NotificationsGetNotificationsMetaData = { + metadata: { notificationId: string; -} -export type MarkNotificationRead = { - statusMessage: string; -} -export type MarkNotificationCategoryReadOptions = { - notificationType: string; - category: string; - latestNotificationId: string; -} -export type MarkNotificationCategoryRead = { - statusMessage: string; -} -export type MarkNotificationInteractionOptions = { - platformType: string; - notificationToken: string; - notificationId: number; - interactionType: string; -} -export type MarkNotificationInteraction = { - statusMessage: string; -} -export type RegisterAmazonAndroidOptions = { - notificationToken: string; - authorizeForUser: boolean; - oldNotificationToken: string; - deviceName: string; -} -export type RegisterAmazonAndroid = { - registration: { - userPushNotificationDestinationId: number; - name: string; - notificationToken: string; - application: string; - platform: string; - }; - statusMessage: string; -} -export type RegisterAndroidNativeOptions = RegisterAmazonAndroidOptions; -export type RegisterAndroidNative = RegisterAmazonAndroid; -export type RegisterAndroidTencentServiceOptions = RegisterAmazonAndroidOptions; -export type RegisterAndroidTencentService = RegisterAmazonAndroid; -export type RegisterChromeOptions = { + type: string; + detail: unknown; + fallbackDelivered: boolean; + }; + statusMessage: string; +}; +export type NotificationsGetNotificationIdsOptions = { + notificationToken: string; + limit: number; + cursor?: string; +}; +export type NotificationsGetNotificationIds = { + ids: string[]; + statusMessage: string; +}; +export type NotificationsDeregisterAllDevices = { + statusMessage: string; +}; +export type NotificationsDeregisterCurrentDevice = { + statusMessage: string; +}; +export type NotificationsMarkNotificationReadOptions = { + platformType: string; + notificationId: string; +}; +export type NotificationsMarkNotificationRead = { + statusMessage: string; +}; +export type NotificationsMarkNotificationCategoryReadOptions = { + notificationType: string; + category: string; + latestNotificationId: string; +}; +export type NotificationsMarkNotificationCategoryRead = { + statusMessage: string; +}; +export type NotificationsMarkNotificationInteractionOptions = { + platformType: string; + notificationToken: string; + notificationId: number; + interactionType: string; +}; +export type NotificationsMarkNotificationInteraction = { + statusMessage: string; +}; +export type NotificationsRegisterAmazonAndroidOptions = { + notificationToken: string; + authorizeForUser: boolean; + oldNotificationToken: string; + deviceName: string; +}; +export type NotificationsRegisterAmazonAndroid = { + registration: { + userPushNotificationDestinationId: number; + name: string; notificationToken: string; - initiatedByUser: boolean; -} -export type RegisterChrome = RegisterAmazonAndroid; -export type RegisterFirefoxOptions = RegisterChromeOptions & { + application: string; + platform: string; + }; + statusMessage: string; +}; +export type NotificationsRegisterAndroidNativeOptions = + NotificationsRegisterAmazonAndroidOptions; +export type NotificationsRegisterAndroidNative = + NotificationsRegisterAmazonAndroid; +export type NotificationsRegisterAndroidTencentServiceOptions = + NotificationsRegisterAmazonAndroidOptions; +export type NotificationsRegisterAndroidTencentService = + NotificationsRegisterAmazonAndroid; +export type NotificationsRegisterChromeOptions = { + notificationToken: string; + initiatedByUser: boolean; +}; +export type NotificationsRegisterChrome = NotificationsRegisterAmazonAndroid; +export type NotificationsRegisterFirefoxOptions = + NotificationsRegisterChromeOptions & { notificationEndpoint: string; -} -export type RegisterFirefox = RegisterAmazonAndroid; -export type RegisterIOSNativeOptions = { - notificationToken: string; - destinationIdentifier: string; - authorizeForUser: boolean; - oldNotificationToken: string; - deviceName: string; -}; -export type RegisterIOSNative = RegisterAmazonAndroid; -export type GetLatestUniversesUpdatesOptions = { - universeIds: number[]; - sinceDateTime?: string; -} -export type GetLatestUniverseUpdates = { - universeId: number; - rootPlaceId: number; - createdOn: string; - createdOnKey: string; - content: string; - universeName: string; + }; +export type NotificationsRegisterFirefox = NotificationsRegisterAmazonAndroid; +export type NotificationsRegisterIOSNativeOptions = { + notificationToken: string; + destinationIdentifier: string; + authorizeForUser: boolean; + oldNotificationToken: string; + deviceName: string; +}; +export type NotificationsRegisterIOSNative = NotificationsRegisterAmazonAndroid; +export type NotificationsGetLatestUniversesUpdatesOptions = { + universeIds: number[]; + sinceDateTime?: string; +}; +export type NotificationsGetLatestUniverseUpdates = { + universeId: number; + rootPlaceId: number; + createdOn: string; + createdOnKey: string; + content: string; + universeName: string; }[]; -export type GetStreamNotificationsPromptSettings = { - hasUserInteractedWithNotificationsStream: boolean; - showNotificationStreamPrompt: boolean; -} -export type GetRecentStreamNotificationsOptions = { - startIndex?: number; - maxRows?: number; -} -export type GetRecentStreamNotifications = { - id: number; - notificationSourceType: string; - eventDate: string; - isInteracted: boolean; - metadataCollection: unknown[]; - eventCount: number; +export type NotificationsGetStreamNotificationsPromptSettings = { + hasUserInteractedWithNotificationsStream: boolean; + showNotificationStreamPrompt: boolean; +}; +export type NotificationsGetRecentStreamNotificationsOptions = { + startIndex?: number; + maxRows?: number; +}; +export type NotificationsGetRecentStreamNotifications = { + id: number; + notificationSourceType: string; + eventDate: string; + isInteracted: boolean; + metadataCollection: unknown[]; + eventCount: number; }[]; -export type GetStreamNotificationsMetaData = { - bannerDismissTimeSpan: number; - signalRDisconnectionResponseInMilliseconds: number; - canLaunchGameFromGameUpdate: boolean; - useFriendsApiForAjaxRequests: boolean; -} -export type GetStreamNotificationsUnreadCount = { - unreadNotifications: number; - statusMessage: string; -} -export type ClearUnreadStreamNotifications = { - statusMessage: string; -} -export type SendGameUpdateNotificationInteractedOptions = { - universeId: number; - createdOnKey: string; - interactioNType: string; - currentUserId: number; -} -export type SendGameUpdateNotificationInteracted = { - statusMessage: string; -} -export type SendGameUpdateNotificationReadOptions = { - universeId: number; - createdOn: string; - currentUserId: number; -} -export type SendGameUpdateNotificationRead = { - statusMessage: string; -} -export type MarkStreamNotificationInteractedOptions = { - eventId: string; -} -export type MarkStreamNotificationInteracted = { - statusMessage: string; - -} -export type SuppressStreamNotificationsPrompt = { - statusMessage: string; -} - +export type NotificationsGetStreamNotificationsMetaData = { + bannerDismissTimeSpan: number; + signalRDisconnectionResponseInMilliseconds: number; + canLaunchGameFromGameUpdate: boolean; + useFriendsApiForAjaxRequests: boolean; +}; +export type NotificationsGetStreamNotificationsUnreadCount = { + unreadNotifications: number; + statusMessage: string; +}; +export type NotificationsClearUnreadStreamNotifications = { + statusMessage: string; +}; +export type NotificationsSendGameUpdateNotificationInteractedOptions = { + universeId: number; + createdOnKey: string; + interactioNType: string; + currentUserId: number; +}; +export type NotificationsSendGameUpdateNotificationInteracted = { + statusMessage: string; +}; +export type NotificationsSendGameUpdateNotificationReadOptions = { + universeId: number; + createdOn: string; + currentUserId: number; +}; +export type NotificationsSendGameUpdateNotificationRead = { + statusMessage: string; +}; +export type NotificationsMarkStreamNotificationInteractedOptions = { + eventId: string; +}; +export type NotificationsMarkStreamNotificationInteracted = { + statusMessage: string; +}; +export type NotificationsSuppressStreamNotificationsPrompt = { + statusMessage: string; +}; -export default class NotificationsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://notifications.roblox.com/" - }); - } - - getNotificationsSettings (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/get-settings` - }, - json: true - }) - .then(response => response.body); - } - - getRealtimeNotificationSettings (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/settings/realtime` - }, - json: true - }) - .then(response => response.body); - } - - allowNotificationSource (options: AllowNotificationSourceOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/notification-source-types/allow`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - disallowNotificationSource (options: DisallowNotificationSourceOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/notification-source-types/opt-out`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - allowNotificationDestination (options: AllowNotificationsDestinationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/receiver-destination-types/allow`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - disallowNotificationDestination (options: DisallowNotificationsDestinationOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/receiver-destination-types/opt-out`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - updateDestinationSetting (options: UpdateNotificationDestinationSettingsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/update-destination-setting`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - updateNotificationSettings (options: UpdateNotificationSettingsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/notifications/update-notification-settings`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getChromeManifest (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/chrome-manifest` - }, - json: true - }) - .then(response => response.body); - } - - getCurrentDeviceDestination (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/get-current-device-destination` - }, - json: true - }) - .then(response => response.body); - } - - getDestinations (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/get-destinations` - }, - json: true - }) - .then(response => response.body); - } - - getPushNotificationsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/metadata` - }, - json: true - }) - .then(response => response.body); - } - - getNotificationIds (options: GetNotificationIdsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/notification-ids`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - deregisterAllDevices (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/deregister-all-devices`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - deregisterCurrentDevice (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/deregister-current-device` - }, - json: true - }) - .then(response => response.body); - } - - markNotificationRead (options: MarkNotificationReadOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/mark-as-read`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - markNotificationCategoryRead (options: MarkNotificationCategoryReadOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/mark-category-as-read`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - markNotificationInteraction (options: MarkNotificationInteractionOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/mark-interaction`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerAndroidAmazon (options: RegisterAmazonAndroidOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-android-amazon`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerAndroidNative (options: RegisterAndroidNativeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-android-native`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerAndroidTencentSerice (options: RegisterAndroidTencentServiceOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-android-tencent-service`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerChrome (options: RegisterChromeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-chrome`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerFirefox (options: RegisterFirefoxOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-firefox`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - registerIOSNative (options: RegisterIOSNativeOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/push-notifications/register-ios-native`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - getLatestUniversesUpdates (options: GetLatestUniversesUpdatesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/get-latest-game-updates`, - qs: { - ...options, - universeId: options.universeIds.join(",") - } - }, - json: true - }) - .then(response => response.body); - } - - getStreamNotificationsPromptSettings (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/get-prompt-settings` - }, - json: true - }) - .then(response => response.body); - } - - getRecentStreamNotifications (options: GetRecentStreamNotificationsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/get-recent`, - qs: options - }, - json: true - }) - .then(response => response.body); - } - - getStreamNotificationsMetaData (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/metadata` - }, - json: true - }) - .then(response => response.body); - } - - getUnreadStreamNotificationsCount (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/unread-count` - }, - json: true - }) - .then(response => response.body); - } - - clearUnreadStreamNotifications (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/clear-unread`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - markGameUpdateNotificationInteracted (options: SendGameUpdateNotificationInteractedOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/game-update-notification-interacted`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - markGameUpdateNotificationRead (options: SendGameUpdateNotificationReadOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/get-latest-game-updates`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - suppressStreamNotificationsPrompt (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v2/stream-notifications/suppress-prompt`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } +export class NotificationsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://notifications.roblox.com/" + }); + } + + getNotificationsSettings(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/get-settings` + }, + json: true + }).then((response) => response.body); + } + + getRealtimeNotificationSettings(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/settings/realtime` + }, + json: true + }).then((response) => response.body); + } + + allowNotificationSource( + options: NotificationsAllowNotificationSourceOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/notification-source-types/allow`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + disallowNotificationSource( + options: NotificationsDisallowNotificationSourceOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/notification-source-types/opt-out`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + allowNotificationDestination( + options: NotificationsAllowNotificationsDestinationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/receiver-destination-types/allow`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + disallowNotificationDestination( + options: NotificationsDisallowNotificationsDestinationOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/receiver-destination-types/opt-out`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + updateDestinationSetting( + options: NotificationsUpdateNotificationDestinationSettingsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/update-destination-setting`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + updateNotificationSettings( + options: NotificationsUpdateNotificationSettingsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/notifications/update-notification-settings`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + getChromeManifest(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/chrome-manifest` + }, + json: true + }).then((response) => response.body); + } + + getCurrentDeviceDestination(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/get-current-device-destination` + }, + json: true + }).then((response) => response.body); + } + + getDestinations(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/get-destinations` + }, + json: true + }).then((response) => response.body); + } + + getPushNotificationsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/metadata` + }, + json: true + }).then((response) => response.body); + } + + getNotificationIds( + options: NotificationsGetNotificationIdsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/notification-ids`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + deregisterAllDevices(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/deregister-all-devices`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + deregisterCurrentDevice(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/deregister-current-device` + }, + json: true + }).then((response) => response.body); + } + + markNotificationRead( + options: NotificationsMarkNotificationReadOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + markNotificationCategoryRead( + options: NotificationsMarkNotificationCategoryReadOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-category-as-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + markNotificationInteraction( + options: NotificationsMarkNotificationInteractionOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/mark-interaction`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerAndroidAmazon( + options: NotificationsRegisterAmazonAndroidOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-amazon`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerAndroidNative( + options: NotificationsRegisterAndroidNativeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-native`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerAndroidTencentSerice( + options: NotificationsRegisterAndroidTencentServiceOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-android-tencent-service`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerChrome( + options: NotificationsRegisterChromeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-chrome`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerFirefox( + options: NotificationsRegisterFirefoxOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-firefox`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + registerIOSNative( + options: NotificationsRegisterIOSNativeOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/push-notifications/register-ios-native`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + getLatestUniversesUpdates( + options: NotificationsGetLatestUniversesUpdatesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-latest-game-updates`, + qs: { + ...options, + universeId: options.universeIds.join(",") + } + }, + json: true + }).then((response) => response.body); + } + + getStreamNotificationsPromptSettings(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-prompt-settings` + }, + json: true + }).then((response) => response.body); + } + + getRecentStreamNotifications( + options: NotificationsGetRecentStreamNotificationsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-recent`, + qs: options + }, + json: true + }).then((response) => response.body); + } + + getStreamNotificationsMetaData(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/metadata` + }, + json: true + }).then((response) => response.body); + } + + getUnreadStreamNotificationsCount(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/unread-count` + }, + json: true + }).then((response) => response.body); + } + + clearUnreadStreamNotifications(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/clear-unread`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } + + markGameUpdateNotificationInteracted( + options: NotificationsSendGameUpdateNotificationInteractedOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/game-update-notification-interacted`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + markGameUpdateNotificationRead( + options: NotificationsSendGameUpdateNotificationReadOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/get-latest-game-updates`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } + + suppressStreamNotificationsPrompt(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v2/stream-notifications/suppress-prompt`, + method: "POST" + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/OtherAPI.ts b/src/client/apis/OtherAPI.ts index c058a3d3e..5bfc12b20 100644 --- a/src/client/apis/OtherAPI.ts +++ b/src/client/apis/OtherAPI.ts @@ -1,67 +1,67 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; import { EnumUserPresence } from "../../interfaces/GeneralInterfaces"; - -export type GetUserProfileHeaderOptions = { - userId: number; -} -export type GetUserProfileHeader = { +export type OtherGetUserProfileHeaderOptions = { + userId: number; +}; +export type OtherGetUserProfileHeader = { + UserId: number; + ProfileUserId: number; + ProfileUserName: string; + ProfileDisplayName: string; + FriendsCount: number; + UserPresenceType: EnumUserPresence; + LastLocation: string | null; + UserStatus: string | null; + UserStatusDate: string | null; + UserPlaceId: number | null; + FollowersCount: number; + FollowingsCount: number; + IsVieweeBlocked: boolean; + IsViewerBlocked: boolean; + AreFriends: boolean; + IncomingFriendRequestPending: boolean; + MaySendFriendInvitation: boolean; + FriendRequestPending: boolean; + MayFollow: boolean; + IsFollowing: boolean; + CanMessage: boolean; + MessagesDisabled: boolean; + CanBeFollowed: boolean; + CanTrade: boolean; + CanSeeFavorites: boolean; + MayImpersonate: boolean; + MayEdit: boolean; + HeadShotImage: { + Final: boolean; + Url: string; + RetryUrl: string | null; UserId: number; - ProfileUserId: number; - ProfileUserName: string; - ProfileDisplayName: string; - FriendsCount: number; - UserPresenceType: EnumUserPresence; - LastLocation: string | null; - UserStatus: string | null; - UserStatusDate: string | null; - UserPlaceId: number | null; - FollowersCount: number; - FollowingsCount: number; - IsVieweeBlocked: boolean; - IsViewerBlocked: boolean; - AreFriends: boolean; - IncomingFriendRequestPending: boolean; - MaySendFriendInvitation: boolean; - FriendRequestPending: boolean; - MayFollow: boolean; - IsFollowing: boolean; - CanMessage: boolean; - MessagesDisabled: boolean; - CanBeFollowed: boolean; - CanTrade: boolean; - CanSeeFavorites: boolean; - MayImpersonate: boolean; - MayEdit: boolean; - HeadShotImage: { - Final: boolean; - Url: string; - RetryUrl: string | null; - UserId: number; - EndpointType: "Avatar" | string; - }; - PreviousUserNames: string; - IsUserOnPhone: boolean; - CanSeeInventory: boolean; -} + EndpointType: "Avatar" | string; + }; + PreviousUserNames: string; + IsUserOnPhone: boolean; + CanSeeInventory: boolean; +}; -export default class OtherAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://roblox.com/" - }); - } +export class OtherAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://roblox.com/" + }); + } - getUserProfileHeader (options: GetUserProfileHeaderOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - url: `https://www.roblox.com/users/profile/profileheader-json?userId=${options.userId}` - }, - json: true - }) - .then(response => response.body); - } + getUserProfileHeader( + options: OtherGetUserProfileHeaderOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + url: `https://www.roblox.com/users/profile/profileheader-json?userId=${options.userId}` + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/PremiumFeaturesAPI.ts b/src/client/apis/PremiumFeaturesAPI.ts index 641592578..13d9bd8e7 100644 --- a/src/client/apis/PremiumFeaturesAPI.ts +++ b/src/client/apis/PremiumFeaturesAPI.ts @@ -1,47 +1,47 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; +export type PremiumFeaturesUpsellCheckOptions = { + userId: number; + universeId: number; + placeId: number; +}; +export type PremiumFeaturesUpsellCheck = unknown; +export type PremiumFeaturesValidateUserMembershipOptions = { + userId: number; +}; +export type PremiumFeaturesValidateUserMembership = boolean; -export type PremiumUpsellCheckOptions = { - userId: number; - universeId: number; - placeId: number; -} -export type PremiumUpsellCheck = unknown -export type ValidateUserMembershipOptions = { - userId: number; -} -export type ValidateUserMembership = boolean; - - -export default class PremiumFeaturesAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://premiumfeatures.roblox.com/" - }); - } +export class PremiumFeaturesAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://premiumfeatures.roblox.com/" + }); + } - premiumUpsellCheck (options: PremiumUpsellCheckOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/premium-upsell-check`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + premiumUpsellCheck( + options: PremiumFeaturesUpsellCheckOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/premium-upsell-check`, + qs: options + }, + json: true + }).then((response) => response.body); + } - validateUserMembership (options: ValidateUserMembershipOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/validate-membership` - }, - json: true - }) - .then(response => response.body); - } + validateUserMembership( + options: PremiumFeaturesValidateUserMembershipOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/validate-membership` + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/PresenceAPI.ts b/src/client/apis/PresenceAPI.ts index 59cc2d97d..9447a56b7 100644 --- a/src/client/apis/PresenceAPI.ts +++ b/src/client/apis/PresenceAPI.ts @@ -1,61 +1,63 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; import { EnumUserPresence } from "../../interfaces/GeneralInterfaces"; +export type PresenceRegisterAppPresenceOptions = { + location: string; + placeId: number; + disconnect: boolean; +}; +export type PresenceRegisterAppPresence = unknown; +export type PresenceGetUsersPresencesOptions = { + userIds: number[]; +}; +export type PresenceGetUsersPresences = { + userPresences: PresenceGetUsersPresence[]; +}; +export type PresenceGetUsersPresence = { + userPresenceType: EnumUserPresence; + lastLocation: string; + placeId: number; + rootPlaceId: number; + gameId: string; + universeId: number; + userId: number; + lastOnline: string; +}; -export type RegisterAppPresenceOptions = { - location: string; - placeId: number; - disconnect: boolean; -} -export type RegisterAppPresence = unknown -export type GetUsersPresencesOptions = { - userIds: number[]; -} -export type GetUsersPresences = { - userPresences: { - userPresenceType: EnumUserPresence; - lastLocation: string; - placeId: number; - rootPlaceId: number; - gameId: string; - universeId: number; - userId: number; - lastOnline: string; - }[]; -} - -export default class PresenceAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://presence.roblox.com/" - }); - } +export class PresenceAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://presence.roblox.com/" + }); + } - registerAppPresence (options: RegisterAppPresenceOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/presence/register-app-presence`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + registerAppPresence( + options: PresenceRegisterAppPresenceOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/presence/register-app-presence`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getUsersPresences (options: GetUsersPresencesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/presence/users`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getUsersPresences( + options: PresenceGetUsersPresencesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/presence/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/PrivateMessagesAPI.ts b/src/client/apis/PrivateMessagesAPI.ts index 853d0fc56..d20f4ebff 100644 --- a/src/client/apis/PrivateMessagesAPI.ts +++ b/src/client/apis/PrivateMessagesAPI.ts @@ -1,218 +1,234 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetAnnouncements = { - collection: { - id: number; - sender: { - id: number; - name: string; - displayName: string; - }; - subject: string; - body: string; - created: string; - updated: string; +export type PrivateMessagesGetAnnouncements = { + collection: { + id: number; + sender: { + id: number; + name: string; + displayName: string; }; - totalCollectionSize: number; -} -export type GetAnnouncementsMetaData = { - numOfAnnouncements: number; -} -export type GetMessagesOptions = { - pageNumber?: number; - pageSize?: number; - messageTab?: "Inbox" | "Sent" | "Archive"; -} -export type GetMessages = { - collection: { - id: number; - sender: { - id: number; - name: string; - displayName: string; - }; - recipient: { - id: number; - name: string; - displayName: string; - }; - subject: string; - body: string; - created: string; - updated: string; - isRead: boolean; - isSystemMessage: boolean; - isReportAbuseDisplayed: boolean; - }[]; - totalCollectionSize: number; - totalPages: number; - pageNumber: number; -} -export type GetMessageOptions = { - messageId: number; -} -export type GetMessage = GetMessages["collection"][0]; -export type GetUnreadMessagesCount = { - count: number; -} -export type ArchiveMessagesOptions = { - messageIds: number[]; -} -export type ArchiveMessages = { - failedMessages?: { - messageId: number; - errorMessage: string; - }[]; -} -export type MarkMessagesReadOptions = ArchiveMessagesOptions; -export type MarkMessagesRead = ArchiveMessages; -export type MarkMessagesUnreadOptions = ArchiveMessagesOptions; -export type MarkMessagesUnread = ArchiveMessages; -export type SendMessageOptions = { - userId: number; subject: string; body: string; - recipientId: number; - replyMessageId?: number; - includePreviousMessage?: boolean; -} -export type SendMessage = { - success: boolean; - shortMessage: string; - message: string; -} -export type UnArchiveMessagesOptions = ArchiveMessagesOptions; -export type UnArchiveMessages = ArchiveMessages; + created: string; + updated: string; + }; + totalCollectionSize: number; +}; +export type PrivateMessagesGetAnnouncementsMetaData = { + numOfAnnouncements: number; +}; +export type PrivateMessagesGetMessagesOptions = { + pageNumber?: number; + pageSize?: number; + messageTab?: "Inbox" | "Sent" | "Archive"; +}; +export type PrivateMessagesGetMessages = { + collection: { + id: number; + sender: { + id: number; + name: string; + displayName: string; + }; + recipient: { + id: number; + name: string; + displayName: string; + }; + subject: string; + body: string; + created: string; + updated: string; + isRead: boolean; + isSystemMessage: boolean; + isReportAbuseDisplayed: boolean; + }[]; + totalCollectionSize: number; + totalPages: number; + pageNumber: number; +}; +export type PrivateMessagesGetMessageOptions = { + messageId: number; +}; +export type PrivateMessagesGetMessage = + PrivateMessagesGetMessages["collection"][0]; +export type PrivateMessagesGetUnreadMessagesCount = { + count: number; +}; +export type PrivateMessagesArchiveMessagesOptions = { + messageIds: number[]; +}; +export type PrivateMessagesArchiveMessages = { + failedMessages?: { + messageId: number; + errorMessage: string; + }[]; +}; +export type PrivateMessagesMarkMessagesReadOptions = + PrivateMessagesArchiveMessagesOptions; +export type PrivateMessagesMarkMessagesRead = PrivateMessagesArchiveMessages; +export type PrivateMessagesMarkMessagesUnreadOptions = + PrivateMessagesArchiveMessagesOptions; +export type PrivateMessagesMarkMessagesUnread = PrivateMessagesArchiveMessages; +export type PrivateMessagesSendMessageOptions = { + userId: number; + subject: string; + body: string; + recipientId: number; + replyMessageId?: number; + includePreviousMessage?: boolean; +}; +export type PrivateMessagesSendMessage = { + success: boolean; + shortMessage: string; + message: string; +}; +export type PrivateMessagesUnArchiveMessagesOptions = + PrivateMessagesArchiveMessagesOptions; +export type PrivateMessagesUnArchiveMessages = PrivateMessagesArchiveMessages; +export class PrivateMessagesAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://privatemessages.roblox.com/" + }); + } -export default class PrivateMessagesAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://privatemessages.roblox.com/" - }); - } + getAnnouncements(): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/announcements` + }, + json: true + }).then((response) => response.body); + } - getAnnouncements (): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/announcements` - }, - json: true - }) - .then(response => response.body); - } + getAnnouncementsMetaData(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/announcements/metadata` + }, + json: true + }).then((response) => response.body); + } - getAnnouncementsMetaData (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/announcements/metadata` - }, - json: true - }) - .then(response => response.body); - } + getMessages( + options: PrivateMessagesGetMessagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getMessages (options: GetMessagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getMessage( + options: PrivateMessagesGetMessageOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/${options.messageId}` + }, + json: true + }).then((response) => response.body); + } - getMessage (options: GetMessageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/${options.messageId}` - }, - json: true - }) - .then(response => response.body); - } + canMessage(options: { userId: number }): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/${options.userId}/can-message` + }, + json: true + }).then((response) => response.body.canMessage); + } - getUnreadMessagesCount (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/unread/count` - }, - json: true - }) - .then(response => response.body); - } + getUnreadMessagesCount(): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/unread/count` + }, + json: true + }).then((response) => response.body); + } - archiveMessages (options: ArchiveMessagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/archive`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + archiveMessages( + options: PrivateMessagesArchiveMessagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/archive`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - markMessagesRead (options: MarkMessagesReadOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/mark-read`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + markMessagesRead( + options: PrivateMessagesMarkMessagesReadOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/mark-read`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - markMessagesUnread (options: MarkMessagesUnreadOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/mark-unread`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + markMessagesUnread( + options: PrivateMessagesMarkMessagesUnreadOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/mark-unread`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - sendMessage (options: SendMessageOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/send`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + sendMessage( + options: PrivateMessagesSendMessageOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/send`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - unArchiveMessages (options: UnArchiveMessagesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/messages/unarchive`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + unArchiveMessages( + options: PrivateMessagesUnArchiveMessagesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/messages/unarchive`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/PublishAPI.ts b/src/client/apis/PublishAPI.ts index c105c7b8d..5f360f8d0 100644 --- a/src/client/apis/PublishAPI.ts +++ b/src/client/apis/PublishAPI.ts @@ -1,157 +1,165 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type UploadAssetsOptions = { - files: unknown; -} -export type UploadAssets = { - AssetDetails: { - assetId: number; - assetFileName: string; - uploadAssetError: "None" | string; - }[]; -} +export type PublishUploadAssetsOptions = { + files: unknown; +}; +export type PublishUploadAssets = { + AssetDetails: { + assetId: number; + assetFileName: string; + uploadAssetError: "None" | string; + }[]; +}; export type PublishAudioOptions = { - name: string; - file: unknown; - groupId?: number; - paymentSource: string; -} + name: string; + file: unknown; + groupId?: number; + paymentSource: string; +}; export type PublishAudio = { - Id: number; - Name: string; -} -export type VerifyAudioOptions = PublishAudioOptions; -export type VerifyAudio = { - price: number; - canAfford: boolean; -} + Id: number; + Name: string; +}; +export type PublishVerifyAudioOptions = PublishAudioOptions; +export type PublishVerifyAudio = { + price: number; + canAfford: boolean; +}; export type PublishBadgeIconOptions = { - badgeId: number; - files: unknown; -} + badgeId: number; + files: unknown; +}; export type PublishBadgeIcon = { - targetId: number; -} + targetId: number; +}; export type PublishGamePassIconOptions = { - gamePassId: number; - files: unknown; -} + gamePassId: number; + files: unknown; +}; export type PublishGamePassIcon = { - targetId: number; -} -export type UploadGameThumbnailOptions = { - gameId: number; - files: unknown; -} -export type UploadGameThumbnail = { - targetId: number; -} -export type UploadPluginIconOptions = { - pluginId: number; - files: unknown; -} -export type UploadPluginIcon = { - targetId: number; -} + targetId: number; +}; +export type PublishUploadGameThumbnailOptions = { + gameId: number; + files: unknown; +}; +export type PublishUploadGameThumbnail = { + targetId: number; +}; +export type PublishUploadPluginIconOptions = { + pluginId: number; + files: unknown; +}; +export type PublishUploadPluginIcon = { + targetId: number; +}; -export default class PublishAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://publish.roblox.com/" - }); - } +export class PublishAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://publish.roblox.com/" + }); + } - uploadAssets (options: UploadAssetsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets/upload`, - method: "POST", - body: options.files - }, - json: true - }) - .then(response => response.body); - } + /** + * @hidden + */ + uploadAssets( + options: PublishUploadAssetsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets/upload`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } - publishAudio (options: PublishAudioOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/audio`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + publishAudio(options: PublishAudioOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/audio`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - verifyAudio (options: VerifyAudioOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/audio/verify`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + verifyAudio(options: PublishVerifyAudioOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/audio/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - publishBadgeIcon (options: PublishBadgeIconOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/badges/${options.badgeId}/icon`, - method: "POST", - body: options.files - }, - json: true - }) - .then(response => response.body); - } + publishBadgeIcon( + options: PublishBadgeIconOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/${options.badgeId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } - publishGamePassIcon (options: PublishGamePassIconOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/game-passes/${options.gamePassId}/icon`, - method: "POST", - body: options.files - }, - json: true - }) - .then(response => response.body); - } + /** + * @hidden + */ + publishGamePassIcon( + options: PublishGamePassIconOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/game-passes/${options.gamePassId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } - uploadGameThumbnail (options: UploadGameThumbnailOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/games/${options.gameId}/thumbnail/image`, - method: "POST", - body: options.files - }, - json: true - }) - .then(response => response.body); - } + uploadGameThumbnail( + options: PublishUploadGameThumbnailOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/${options.gameId}/thumbnail/image`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } - uploadPluginIcon (options: UploadPluginIconOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/plugins/${options.pluginId}/icon`, - method: "POST", - body: options.files - }, - json: true - }) - .then(response => response.body); - } + uploadPluginIcon( + options: PublishUploadPluginIconOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/plugins/${options.pluginId}/icon`, + method: "POST", + body: options.files + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/ThumbnailsAPI.ts b/src/client/apis/ThumbnailsAPI.ts index 01efb3a29..bcfc056f0 100644 --- a/src/client/apis/ThumbnailsAPI.ts +++ b/src/client/apis/ThumbnailsAPI.ts @@ -1,353 +1,443 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetAssetsThumbnailsOptions = { - assetIds: number[]; - returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; - size?: "42x42" | "50x50" | "75x75" | "110x110" | "140x140" | "150x150" | "160x100" | "160x600" | "250x250" | "256x144" | "300x250" | "304x166" | "384x216" | "396x216" | "420x420" | "480x270" | "512x512" | "576x324" | "700x700" | "728x90" | "768x432"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetAssetsThumbnails = { - data: { - targetId: number; - state: "Error" | string; - imageUrl: string; - }[]; -} -export type GetBadgesIconsOptions = { - badgeIds: number[]; - size?: "150x150"; - format?: "png" | "jpg"; - isCircular?: boolean; +export type ThumbnailsGetAssetsThumbnailsOptions = { + assetIds: number[]; + returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; + size?: + | "42x42" + | "50x50" + | "75x75" + | "110x110" + | "140x140" + | "150x150" + | "160x100" + | "160x600" + | "250x250" + | "256x144" + | "300x250" + | "304x166" + | "384x216" + | "396x216" + | "420x420" + | "480x270" + | "512x512" + | "576x324" + | "700x700" + | "728x90" + | "768x432"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetAssetsThumbnails = { + data: { + targetId: number; + state: "Error" | string; + imageUrl: string; + }[]; +}; +export type ThumbnailsGetBadgesIconsOptions = { + badgeIds: number[]; + size?: "150x150"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetBadgesIcons = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetBundlesThumbnailsOptions = { + bundleIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; }; -export type GetBadgesIcons = GetAssetsThumbnails; -export type GetBundlesThumbnailsOptions = { - bundleIds: number[]; - size?: "150x150" | "420x420"; - format?: "png" | "jpg"; - isCircular?: boolean; +export type ThumbnailsGetBundlesThumbnails = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetDeveloperProductsIconsOptions = { + developerProductIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; }; -export type GetBundlesThumbnails = GetAssetsThumbnails; -export type GetDeveloperProductsIconsOptions = { - developerProductIds: number[]; - size?: "150x150" | "420x420"; - format?: "png" | "jpg"; - isCircular?: boolean; +export type ThumbnailsGetDeveloperProductsIcons = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetGamePassesIconsOptions = { + gamePassIds: number[]; + size?: "150x150"; + format?: "png" | "jpg"; + isCircular?: boolean; }; -export type GetDeveloperProductsIcons = GetAssetsThumbnails; -export type GetGamePassesIconsOptions = { - gamePassIds: number[]; - size?: "150x150"; - format?: "png" | "jpg"; - isCircular?: boolean; +export type ThumbnailsGetGamePassesIcons = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUniverseThumbnailsOptions = { + universeId: number; + thumbnailIds: number[]; + size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; + format?: "png" | "jpg"; + isCircular?: boolean; }; -export type GetGamePassesIcons = GetAssetsThumbnails; -export type GetUniverseThumbnailsOptions = { +export type ThumbnailsGetUniverseThumbnails = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUniversesRootPlaceThumbnailsOptions = { + universeIds: number[]; + returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; + size?: "50x50" | "128x128" | "150x150" | "256x256" | "512x512"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUniversesRootPlaceThumbnails = + ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUniversesThumbnailsOptions = { + universeIds: number[]; + countPerUniverse?: number; + defaults?: boolean; + size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUniversesThumbnails = { + data: { universeId: number; - thumbnailIds: number[]; - size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUniverseThumbnails = GetAssetsThumbnails; -export type GetUniversesRootPlaceThumbnailsOptions = { - universeIds: number[]; - returnPolicy?: "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated"; - size?: "50x50" | "128x128" | "150x150" | "256x256" | "512x512"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUniversesRootPlaceThumbnails = GetAssetsThumbnails; -export type GetUniversesThumbnailsOptions = { - universeIds: number[]; - countPerUniverse?: number; - defaults?: boolean; - size?: "768x432" | "576x324" | "480x270" | "384x216" | "256x144"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUniversesThumbnails = { - data: { - universeId: number; - error?: { - code: number; - message: string; - userFacingMessage: string; - field: string; - fieldData: unknown; - }; - thumbnails: { - targetId: number; - state: "Error" | string; - imageUrl: string; - }[]; + error?: { + code: number; + message: string; + userFacingMessage: string; + field: string; + fieldData: unknown; + }; + thumbnails: { + targetId: number; + state: "Error" | string; + imageUrl: string; }[]; -} -export type GetGroupsIconsOptions = { - groupIds: number[]; - size?: "150x150" | "420x420"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetGroupsIcons = GetAssetsThumbnails; -export type GetUsersFullBodyAvatarImagesOptions = { - userIds: number[]; - size?: "30x30" | "48x48" | "60x60" | "75x75" | "100x100" | "140x140" | "150x150" | "150x200" | "180x180" | "250x250" | "352x352" | "420x420" | "720x720"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUsersFullBodyAvatarImages = GetAssetsThumbnails; -export type GetUsersAvatarBustImagesOptions = { - userIds: number[]; - size?: "50x50" | "60x60" | "75x75"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUsersAvatarBustImages = GetAssetsThumbnails; -export type GetUsersAvatarHeadShotsImagesOptions = { - userIds: number[]; - size?: "48x48" | "50x50" | "60x60" | "75x75" | "110x110" | "150x150" | "180x180" | "352x352" | "420x420" | "720x720"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUsersAvatarHeadShotsImages = GetAssetsThumbnails; -export type GetUsersOutfitsImagesOptions = { - userOutfitIds: number[]; - size?: "150x150" | "420x420"; - format?: "png" | "jpg"; - isCircular?: boolean; -} -export type GetUsersOutfitsImages = GetAssetsThumbnails; -export type GetBatchImagesOptions = { + }[]; +}; +export type ThumbnailsGetGroupsIconsOptions = { + groupIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetGroupsIcons = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUsersFullBodyAvatarImagesOptions = { + userIds: number[]; + size?: + | "30x30" + | "48x48" + | "60x60" + | "75x75" + | "100x100" + | "140x140" + | "150x150" + | "150x200" + | "180x180" + | "250x250" + | "352x352" + | "420x420" + | "720x720"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUsersFullBodyAvatarImages = + ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUsersAvatarBustImagesOptions = { + userIds: number[]; + size?: "50x50" | "60x60" | "75x75"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUsersAvatarBustImages = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUsersAvatarHeadShotsImagesOptions = { + userIds: number[]; + size?: + | "48x48" + | "50x50" + | "60x60" + | "75x75" + | "110x110" + | "150x150" + | "180x180" + | "352x352" + | "420x420" + | "720x720"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUsersAvatarHeadShotsImages = + ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetUsersOutfitsImagesOptions = { + userOutfitIds: number[]; + size?: "150x150" | "420x420"; + format?: "png" | "jpg"; + isCircular?: boolean; +}; +export type ThumbnailsGetUsersOutfitsImages = ThumbnailsGetAssetsThumbnails; +export type ThumbnailsGetBatchImagesOptions = { + requestId: string; + targetId: number; + type: + | "Avatar" + | "AvatarHeadShot" + | "GameIcon" + | "BadgeIcon" + | "GameThumbnail" + | "GamePass" + | "Asset" + | "BundleThumbnail" + | "Outfit" + | "GroupIcon" + | "DeveloperProduct" + | "AutoGeneratedAsset"; + size: string; + isCircular: boolean; +}; +export type ThumbnailsGetBatchImages = { + data: { requestId: string; + errorCode?: number; + errorMessage?: string; targetId: number; - type: "Avatar" | "AvatarHeadShot" | "GameIcon" | "BadgeIcon" | "GameThumbnail" | "GamePass" | "Asset" | "BundleThumbnail" | "Outfit" | "GroupIcon" | "DeveloperProduct" | "AutoGeneratedAsset"; - size: string; - isCircular: boolean; -} -export type GetBatchImages = { - data: { - requestId: string; - errorCode?: number; - errorMessage?: string; - targetId: number; - state: "Error" | string; - imageUrl: string; - }[]; -} + state: "Error" | string; + imageUrl: string; + }[]; +}; -export default class ThumbnailsAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://thumbnails.roblox.com/" - }); - } +export class ThumbnailsAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://thumbnails.roblox.com/" + }); + } - getAssetsThumbnails (options: GetAssetsThumbnailsOptions): Promise { - const assetIdsQueryString = `assetIds=${options.assetIds.join("&assetIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets?${assetIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getAssetsThumbnails( + options: ThumbnailsGetAssetsThumbnailsOptions + ): Promise { + const assetIdsQueryString = `assetIds=${options.assetIds.join( + "&assetIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${assetIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getBadgesIcons (options: GetBadgesIconsOptions): Promise { - const badgeIdsQueryString = `badgeIds=${options.badgeIds.join("&badgeIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/badges/icons?${badgeIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getBadgesIcons( + options: ThumbnailsGetBadgesIconsOptions + ): Promise { + const badgeIdsQueryString = `badgeIds=${options.badgeIds.join( + "&badgeIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/badges/icons?${badgeIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getBundlesThumbnails (options: GetBundlesThumbnailsOptions): Promise { - const bundleIdsQueryString = `bundleIds=${options.bundleIds.join("&bundleIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/bundles/thumbnails?${bundleIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getBundlesThumbnails( + options: ThumbnailsGetBundlesThumbnailsOptions + ): Promise { + const bundleIdsQueryString = `bundleIds=${options.bundleIds.join( + "&bundleIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/bundles/thumbnails?${bundleIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getDeveloperProductIcons (options: GetDeveloperProductsIconsOptions): Promise { - const developerProductIdsQueryString = `developerProductIds=${options.developerProductIds.join("&developerProductIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/developer-products/icons?${developerProductIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getDeveloperProductIcons( + options: ThumbnailsGetDeveloperProductsIconsOptions + ): Promise { + const developerProductIdsQueryString = `developerProductIds=${options.developerProductIds.join( + "&developerProductIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/developer-products/icons?${developerProductIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getGamePassesIcons (options: GetGamePassesIconsOptions): Promise { - const gamePassIdsQueryString = `gamePassIds=${options.gamePassIds.join("&gamePassIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets?${gamePassIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getGamePassesIcons( + options: ThumbnailsGetGamePassesIconsOptions + ): Promise { + const gamePassIdsQueryString = `gamePassIds=${options.gamePassIds.join( + "&gamePassIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${gamePassIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUniverseThumbnailIds (options: GetUniverseThumbnailsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/games/${options.universeId}/thumbnails`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getUniverseThumbnailIds( + options: ThumbnailsGetUniverseThumbnailsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/${options.universeId}/thumbnails`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUniversesRootPlaceThumbnail (options: GetUniversesRootPlaceThumbnailsOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/games/icons?${universeIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUniversesRootPlaceThumbnail( + options: ThumbnailsGetUniversesRootPlaceThumbnailsOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/icons?${universeIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUniversesThumbnailIds (options: GetUniversesThumbnailsOptions): Promise { - const universeIdsQueryString = `universeIds=${options.universeIds.join("&universeIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/games/multiget/thumbnails?${universeIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUniversesThumbnailIds( + options: ThumbnailsGetUniversesThumbnailsOptions + ): Promise { + const universeIdsQueryString = `universeIds=${options.universeIds.join( + "&universeIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/games/multiget/thumbnails?${universeIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getGroupsIcons (options: GetGroupsIconsOptions): Promise { - const groupIdsQueryString = `groupIds=${options.groupIds.join("&groupIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/groups/icons?${groupIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getGroupsIcons( + options: ThumbnailsGetGroupsIconsOptions + ): Promise { + const groupIdsQueryString = `groupIds=${options.groupIds.join( + "&groupIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/groups/icons?${groupIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUsersFullBodyAvatarImages (options: GetUsersFullBodyAvatarImagesOptions): Promise { - const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/avatar?${userIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUsersFullBodyAvatarImages( + options: ThumbnailsGetUsersFullBodyAvatarImagesOptions + ): Promise { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar?${userIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUsersAvatarBustImages (options: GetUsersAvatarBustImagesOptions): Promise { - const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/avatar-bust?${userIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUsersAvatarBustImages( + options: ThumbnailsGetUsersAvatarBustImagesOptions + ): Promise { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar-bust?${userIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUsersAvatarHeadShotImages (options: GetUsersAvatarHeadShotsImagesOptions): Promise { - const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/avatar-headshot?${userIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUsersAvatarHeadShotImages( + options: ThumbnailsGetUsersAvatarHeadShotsImagesOptions + ): Promise { + const userIdsQueryString = `userIds=${options.userIds.join("&userIds=")}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/avatar-headshot?${userIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getUsersOutfitsImages (options: GetUsersOutfitsImagesOptions): Promise { - const outfitIdsQueryString = `userOutfitIds=${options.userOutfitIds.join("&userOutfitIds=")}`; - return this.request({ - requiresAuth: false, - request: { - path: `v1/assets?${outfitIdsQueryString}`, - qs: { - ...options - } - }, - json: true - }) - .then(response => response.body); - } + getUsersOutfitsImages( + options: ThumbnailsGetUsersOutfitsImagesOptions + ): Promise { + const outfitIdsQueryString = `userOutfitIds=${options.userOutfitIds.join( + "&userOutfitIds=" + )}`; + return this.request({ + requiresAuth: false, + request: { + path: `v1/assets?${outfitIdsQueryString}`, + qs: { + ...options + } + }, + json: true + }).then((response) => response.body); + } - getBatchImages (options: GetBatchImagesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/batch`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getBatchImages( + options: ThumbnailsGetBatchImagesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/batch`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/TradesAPI.ts b/src/client/apis/TradesAPI.ts deleted file mode 100644 index b2c38814e..000000000 --- a/src/client/apis/TradesAPI.ts +++ /dev/null @@ -1,216 +0,0 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; - - -export type GetTradeOptions = { - tradeId: number; -} -export type GetTrade = { - offers: { - user: { - id: number; - name: string; - displayName: string; - }; - userAssets: { - id: number; - serialNumber: number; - assetId: number; - name: string; - recentAveragePrice: number; - originalPrice: number; - assetStock: number; - membershipType: "None" | string; - }[]; - robux: number; - }[]; - id: number; - user: { - id: number; - name: string; - displayName: string; - }; - created: string; - expiration: string; - isActive: boolean; - status: string; -} -export type GetTradesByStatusTypeOptions = { - tradeStatusType: "Inbound" | "Outbound" | "Completed" | "Inactive"; - sortOrder?: "Asc" | "Desc"; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type GetTradesByStatusType = { - previousPageCursor: string; - nextPageCursor: string; - data: { - id: number; - user: { - id: number; - name: string; - displayName: string; - }; - created: string; - expiration: string; - isActive: boolean; - status: string; - }[]; -} -export type GetTradesCountByStatusTypeOptions = { - tradeStatusType: GetTradesByStatusTypeOptions["tradeStatusType"]; -} -export type GetTradesCountByStatusType = { - count: number; -} -export type GetTradesMetaData = { - maxItemsPerSide: number; - minValueRatio: number; - tradeSystemMaxRobuxPercent: number; - tradeSystemRobuxFee: number; -} -export type CanSelfTradeWithUserOptions = { - userId: number; -} -export type CanSelfTradeWithUser = { - canTrade: boolean; - status: string; -} -export type AcceptTradeOptions = { - tradeId: number; -} -export type AcceptTrade = unknown -export type CounterTradeOptions = { - tradeId: number; - offers: { - userId: number; - userAssetIds: number[]; - robux: number; - }[]; -} -export type CounterTrade = { - id: number; -} -export type DeclineTradeOptions = { - tradeId: number; -} -export type DeclineTrade = unknown -export type SendTradeOptions = Omit; -export type SendTrade = { - id: number; -} - - -export default class TradesAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://trades.roblox.com/" - }); - } - - getTrade (options: GetTradeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeId}` - }, - json: true - }) - .then(response => response.body); - } - - getTradesByStatusType (options: GetTradesByStatusTypeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeStatusType}` - }, - json: true - }) - .then(response => response.body); - } - - getTradesCountByStatusType (options: GetTradesCountByStatusTypeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeStatusType}/count` - }, - json: true - }) - .then(response => response.body); - } - - getTradesMetaData (): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/metadata` - }, - json: true - }) - .then(response => response.body); - } - - canTradeWith (options: CanSelfTradeWithUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/can-trade-with` - }, - json: true - }) - .then(response => response.body); - } - - acceptTrade (options: AcceptTradeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeId}/accept`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - counterTrade (options: CounterTradeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeId}/counter`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } - - declineTrade (options: DeclineTradeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/${options.tradeId}/decline`, - method: "POST" - }, - json: true - }) - .then(response => response.body); - } - - sendTrade (options: SendTradeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/trades/send`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } -} diff --git a/src/client/apis/TranslationRolesAPI.ts b/src/client/apis/TranslationRolesAPI.ts index 717f7e734..2624508a0 100644 --- a/src/client/apis/TranslationRolesAPI.ts +++ b/src/client/apis/TranslationRolesAPI.ts @@ -1,102 +1,105 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetSelfGameRolesOptions = { - gameId: number; -} -export type GetSelfGameRoles = { - data: string[]; -} -export type GetGameRoleAssigneesOptions = { - gameId: number; - role: "translator"; -} -export type GetGameRoleAssignees = { - data: { - id: null; - name: string; - type: "user"; - }[]; -} -export type GetSelfGamesAccessByRoleOptions = { - role: "translator"; - exclusiveStartKey?: string; - pageSize?: number; -} -export type GetSelfGamesAccessByRole = { - games: { - gameId: number; - assignee: { - assigneeType: "user"; - id: number; - }; - }[]; -} -export type UpdateUserAccess = { +export type TranslationRolesGetSelfGameRolesOptions = { + gameId: number; +}; +export type TranslationRolesGetSelfGameRoles = { + data: string[]; +}; +export type TranslationRolesGetGameRoleAssigneesOptions = { + gameId: number; + role: "translator"; +}; +export type TranslationRolesGetGameRoleAssignees = { + data: { + id: null; + name: string; + type: "user"; + }[]; +}; +export type TranslationRolesGetSelfGamesAccessByRoleOptions = { + role: "translator"; + exclusiveStartKey?: string; + pageSize?: number; +}; +export type TranslationRolesGetSelfGamesAccessByRole = { + games: { gameId: number; - userId: number; - role: "translator"; - revoke?: boolean; -} -export type UpdateUser = unknown + assignee: { + assigneeType: "user"; + id: number; + }; + }[]; +}; +export type TranslationRolesUpdateUserAccess = { + gameId: number; + userId: number; + role: "translator"; + revoke?: boolean; +}; +export type TranslationRolesUpdateUser = unknown; -export default class TradesAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://translationroles.roblox.com/" - }); - } +export class TranslationRolesAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://translationroles.roblox.com/" + }); + } - getSelfGameRoles (options: GetSelfGameRolesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/game-localization-roles/games/${options.gameId}/current-user/roles` - }, - json: true - }) - .then(response => response.body); - } + getSelfGameRoles( + options: TranslationRolesGetSelfGameRolesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}/current-user/roles` + }, + json: true + }).then((response) => response.body); + } - getGameRoleAssignees (options: GetGameRoleAssigneesOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/game-localization-roles/games/${options.gameId}/roles/${options.role}/assignees` - }, - json: true - }) - .then(response => response.body); - } + getGameRoleAssignees( + options: TranslationRolesGetGameRoleAssigneesOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}/roles/${options.role}/assignees` + }, + json: true + }).then((response) => response.body); + } - getSelfGamesAccessByRole (options: GetSelfGamesAccessByRoleOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/game-localization-roles/roles/${options.role}/current-user` - }, - json: true - }) - .then(response => response.body); - } + getSelfGamesAccessByRole( + options: TranslationRolesGetSelfGamesAccessByRoleOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/roles/${options.role}/current-user` + }, + json: true + }).then((response) => response.body); + } - updateUserAccess (options: UpdateUserAccess): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/game-localization-roles/games/${options.gameId}`, - method: "PATCH", - json: { - assigneeId: options.userId, - assigneeType: "user", - role: "translator", - revoke: options.revoke !== undefined ? options.revoke : false - } - }, - json: true - }) - .then(response => response.body); - } + updateUserAccess( + options: TranslationRolesUpdateUserAccess + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/game-localization-roles/games/${options.gameId}`, + method: "PATCH", + json: { + assigneeId: options.userId, + assigneeType: "user", + role: "translator", + revoke: options.revoke !== undefined ? options.revoke : false + } + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/TwoStepVerificationAPI.ts b/src/client/apis/TwoStepVerificationAPI.ts index 9d4f114c1..ad8cca287 100644 --- a/src/client/apis/TwoStepVerificationAPI.ts +++ b/src/client/apis/TwoStepVerificationAPI.ts @@ -1,210 +1,228 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type GetTwoStepVerificationMetaDataOptions = { - userId: number; - challengeId: string; - actionType: string; +export type TwoStepVerificationGetMetaDataOptions = { + userId: number; + challengeId: string; + actionType: string; }; -export type GetTwoStepVerificationMetaData = { - twoStepVerificationEnabled: boolean; - authenticatorEnabled: boolean; - authenticatorQrCodeSize: string; - emailCodeLength: number; - authenticatorCodeLength: number; +export type TwoStepVerificationGetMetaData = { + twoStepVerificationEnabled: boolean; + authenticatorEnabled: boolean; + authenticatorQrCodeSize: string; + emailCodeLength: number; + authenticatorCodeLength: number; }; -export type GetTwoStepConfigurationOptions = GetTwoStepVerificationMetaDataOptions; -export type GetTwoStepConfiguration = { - primaryMediaType: "Email" | string; - methods: { - mediaType: "Email" | string; - enabled: boolean; - updated: string; - }[]; +export type TwoStepVerificationGetConfigurationOptions = + TwoStepVerificationGetMetaDataOptions; +export type TwoStepVerificationGetConfiguration = { + primaryMediaType: "Email" | string; + methods: { + mediaType: "Email" | string; + enabled: boolean; + updated: string; + }[]; }; -export type AuthenticatorVerifyOptions = { - challengeId: string; - actionType: string; - code: string; +export type TwoStepVerificationAuthenticatorVerifyOptions = { + challengeId: string; + actionType: string; + code: string; }; -export type AuthenticatorVerify = { - verificationToken: string; +export type TwoStepVerificationAuthenticatorVerify = { + verificationToken: string; }; -export type AuthenticatorDisableOptions = { - password: string; +export type TwoStepVerificationAuthenticatorDisableOptions = { + password: string; }; -export type AuthenticatorDisable = unknown; -export type AuthenticatorEnableOptions = { - userId: number; +export type TwoStepVerificationAuthenticatorDisable = unknown; +export type TwoStepVerificationAuthenticatorEnableOptions = { + userId: number; }; -export type AuthenticatorEnable = { - setupToken: string; - qrCodeImageUrl: string; - manualEntryKey: string; +export type TwoStepVerificationAuthenticatorEnable = { + setupToken: string; + qrCodeImageUrl: string; + manualEntryKey: string; }; -export type AuthenticatorVerifySetupOptions = { - setupToken: string; - code: string; +export type TwoStepVerificationAuthenticatorVerifySetupOptions = { + setupToken: string; + code: string; }; -export type AuthenticatorVerifySetup = unknown; -export type EmailSendCodeOptions = { - challengeId: string; - actionType: string; +export type TwoStepVerificationAuthenticatorVerifySetup = unknown; +export type TwoStepVerificationEmailSendCodeOptions = { + challengeId: string; + actionType: string; }; -export type EmailSendCode = { - challengeId: string; - actionType: string; +export type TwoStepVerificationEmailSendCode = { + challengeId: string; + actionType: string; }; -export type EmailVerifyOptions = { - challengeId: string; - actionType: string; - code: string; +export type TwoStepVerificationEmailVerifyOptions = { + challengeId: string; + actionType: string; + code: string; }; -export type EmailVerify = { - verificationToken: string; +export type TwoStepVerificationEmailVerify = { + verificationToken: string; }; -export type EmailDisableOptions = { - password: string; -} -export type EmailDisable = unknown; -export type EmailEnableOptions = { - userId: number; +export type TwoStepVerificationEmailDisableOptions = { + password: string; +}; +export type TwoStepVerificationEmailDisable = unknown; +export type TwoStepVerificationEmailEnableOptions = { + userId: number; }; -export type EmailEnable = unknown; +export type TwoStepVerificationEmailEnable = unknown; -export default class TwoStepVerificationAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://twostepverification.roblox.com/" - }); - } +export class TwoStepVerificationAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://twostepverification.roblox.com/" + }); + } - getMetaData (options: GetTwoStepVerificationMetaDataOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/metadata`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getMetaData( + options: TwoStepVerificationGetMetaDataOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/metadata`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getConfiguration (options?: GetTwoStepConfigurationOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + getConfiguration( + options?: TwoStepVerificationGetConfigurationOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user!.id}/configuration`, + qs: options + }, + json: true + }).then((response) => response.body); + } - verifyWithAuthenticator (options: AuthenticatorVerifyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/challenges/authenticator/verify`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + verifyWithAuthenticator( + options: TwoStepVerificationAuthenticatorVerifyOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${ + this.client.user!.id + }/challenges/authenticator/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - disableAuthenticator (options: AuthenticatorDisableOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration/authenticator/disable`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + disableAuthenticator( + options: TwoStepVerificationAuthenticatorDisableOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${ + this.client.user!.id + }/configuration/authenticator/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - enableAuthenticator (options: AuthenticatorEnableOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration/authenticator/enable`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + enableAuthenticator( + options: TwoStepVerificationAuthenticatorEnableOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${ + this.client.user!.id + }/configuration/authenticator/enable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - verifyAuthenticatorSetup (options: AuthenticatorVerifySetupOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration/authenticator/disable`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + verifyAuthenticatorSetup( + options: TwoStepVerificationAuthenticatorVerifySetupOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${ + this.client.user!.id + }/configuration/authenticator/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - sendEmailCode (options: EmailSendCodeOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/challenges/email/send-code`, - json: options - }, - json: true - }) - .then(response => response.body); - } + sendEmailCode( + options: TwoStepVerificationEmailSendCodeOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user!.id}/challenges/email/send-code`, + json: options + }, + json: true + }).then((response) => response.body); + } - verifyEmail (options: EmailVerifyOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/challenges/email/verify`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + verifyEmail( + options: TwoStepVerificationEmailVerifyOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user!.id}/challenges/email/verify`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - disableEmail (options: EmailDisableOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration/email/disable`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + disableEmail( + options: TwoStepVerificationEmailDisableOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user!.id}/configuration/email/disable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - enableEmail (options: EmailEnableOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${this.client.user!.id}/configuration/email/enable`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + enableEmail( + options: TwoStepVerificationEmailEnableOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${this.client.user!.id}/configuration/email/enable`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/UsersAPI.ts b/src/client/apis/UsersAPI.ts index f7453a75e..5dfd6a3bc 100644 --- a/src/client/apis/UsersAPI.ts +++ b/src/client/apis/UsersAPI.ts @@ -1,213 +1,212 @@ -import BaseAPI from "./BaseAPI"; -import Client from "../Client"; +import { BaseAPI } from "./BaseAPI"; +import { Client } from "../Client"; - -export type ValidateDisplayNameNewUserOptions = { - displayName: string; - birthdate: string; -} -export type ValidateDisplayNameNewUser = unknown -export type ValidateDisplayNameExistingUserOptions = { - userId: number; - displayName: string; -} -export type ValidateDisplayNameExistingUser = unknown -export type SetSelfDisplayNameOptions = { - userId: number; - newDisplayName: string; -} -export type SetSelfDisplayName = unknown -export type GetUserByIdOptions = { - userId: number; -} -export type GetUserById = { - description: string; - created: string; - isBanned: boolean; +export type UsersValidateDisplayNameNewUserOptions = { + displayName: string; + birthdate: string; +}; +export type UsersValidateDisplayNameNewUser = unknown; +export type UsersValidateDisplayNameExistingUserOptions = { + userId: number; + displayName: string; +}; +export type UsersValidateDisplayNameExistingUser = unknown; +export type UsersSetSelfDisplayNameOptions = { + userId: number; + newDisplayName: string; +}; +export type UsersSetSelfDisplayName = unknown; +export type UsersGetUserByIdOptions = { + userId: number; +}; +export type UsersGetUserById = { + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; + displayName: string; + externalAppDisplayName: string; +}; +export type UsersGetSelfAuthenticatedUserInformation = { + id: number; + name: string; + displayName: string; +}; +export type UsersGetUsersByUsernamesOptions = { + usernames: string[]; + excludeBannedUsers?: boolean; +}; +export type UsersGetUsersByUsernames = { + data: { + requestedUsername: string; id: number; name: string; displayName: string; -} -export type GetSelfAuthenticatedUserInformation = { + }[]; +}; +export type UsersGetUsersByUserIdsOptions = { + userIds: number[]; + excludeBannedUsers?: boolean; +}; +export type UsersGetUsersByUserIds = { + data: Omit[]; +}; +export type UsersGetUserStatusOptions = { + userId: number; +}; +export type UsersGetUserStatus = { + status: string; +}; +export type UsersUpdateSelfStatusOptions = { + userId: number; + status: string; +}; +export type UsersUpdateSelfStatus = { + status: string; +}; +export type UsersSearchUsersOptions = { + keyword: string; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type UsersSearchUsers = { + previousPageCursor: string; + nextPageCursor: string; + data: { + previousUsernames: string[]; id: number; name: string; displayName: string; -} -export type GetUsersByUsernamesOptions = { - usernames: string[]; - excludeBannedUsers?: boolean; -} -export type GetUsersByUsernames = { - data: { - requestedUsername: string; - id: number; - name: string; - displayName: string; - }[]; -}; -export type GetUsersByUserIdsOptions = { - userIds: number[]; - excludeBannedUsers?: boolean; -} -export type GetUsersByUserIds = { - data: Omit[]; + }[]; +}; +export type UsersUserNameHistory = { + previousPageCursor: string; + nextPageCursor: string; + data: { name: string }[]; }; -export type GetUserStatusOptions = { - userId: number; -} -export type GetUserStatus = { - status: string; -} -export type UpdateSelfStatusOptions = { - userId: number; - status: string; -} -export type UpdateSelfStatus = { - status: string; -} -export type SearchUsersOptions = { - keyword: string; - limit?: 10 | 25 | 50 | 100; - cursor?: string; -} -export type SearchUsers = { - previousPageCursor: string; - nextPageCursor: string; - data: { - previousUsernames: string[]; - id: number; - name: string; - displayName: string; - }[]; -} - -export default class UsersAPI extends BaseAPI { - constructor (client: Client) { - super({ - client, - baseUrl: "https://users.roblox.com/" - }); - } - validateDisplayNameNewUser (options: ValidateDisplayNameNewUserOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/display-names/validate`, - qs: options - }, - json: true - }) - .then(response => response.body); - } +export class UsersAPI extends BaseAPI { + constructor(client: Client) { + super({ + client, + baseUrl: "https://users.roblox.com/" + }); + } - validateDisplayNameExistingUser (options: ValidateDisplayNameExistingUserOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/display-names/validate`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + validateDisplayNameNewUser( + options: UsersValidateDisplayNameNewUserOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/display-names/validate`, + qs: options + }, + json: true + }).then((response) => response.body); + } - setDisplayName (options: SetSelfDisplayNameOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/display-names`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } + validateDisplayNameExistingUser( + options: UsersValidateDisplayNameExistingUserOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/display-names/validate`, + qs: options + }, + json: true + }).then((response) => response.body); + } - getUserById (options: GetUserByIdOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}` - }, - json: true - }) - .then(response => response.body); - } + setDisplayName( + options: UsersSetSelfDisplayNameOptions + ): Promise { + return this.request({ + requiresAuth: true, + request: { + path: `v1/users/${options.userId}/display-names`, + method: "PATCH", + json: options + }, + json: true + }).then((response) => response.body); + } - getAuthenticatedUserInformation (): Promise { - return this.request({ - // This should actually be "true", but as it's needed in client.login, it's set to false - requiresAuth: false, - request: { - path: `v1/users/authenticated` - }, - json: true - }) - .then(response => response.body); - } + getUserById(options: UsersGetUserByIdOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}` + }, + json: true + }).then((response) => response.body); + } - getUsersByUsernames (options: GetUsersByUsernamesOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/usernames/users`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getAuthenticatedUserInformation(): Promise { + return this.request({ + // This should actually be "true", but as it's needed in client.login, it's set to false + requiresAuth: false, + request: { + path: `v1/users/authenticated` + }, + json: true + }).then((response) => response.body); + } - getUsersByIds (options: GetUsersByUserIdsOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users`, - method: "POST", - json: options - }, - json: true - }) - .then(response => response.body); - } + getUsersByUsernames( + options: UsersGetUsersByUsernamesOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/usernames/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - getUserStatus (options: GetUserStatusOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/${options.userId}/status` - }, - json: true - }) - .then(response => response.body); - } + getUsersByIds( + options: UsersGetUsersByUserIdsOptions + ): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users`, + method: "POST", + json: options + }, + json: true + }).then((response) => response.body); + } - updateStatus (options: UpdateSelfStatusOptions): Promise { - return this.request({ - requiresAuth: true, - request: { - path: `v1/users/${options.userId}/status`, - method: "PATCH", - json: options - }, - json: true - }) - .then(response => response.body); - } + getUserNameHistory(options: { + userId: number; + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; + }): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/${options.userId}/username-history`, + method: "GET" + }, + json: true + }).then((response) => response.body); + } - searchUsers (options: SearchUsersOptions): Promise { - return this.request({ - requiresAuth: false, - request: { - path: `v1/users/search`, - qs: options - }, - json: true - }) - .then(response => response.body); - } + searchUsers(options: UsersSearchUsersOptions): Promise { + return this.request({ + requiresAuth: false, + request: { + path: `v1/users/search`, + qs: options + }, + json: true + }).then((response) => response.body); + } } diff --git a/src/client/apis/index.ts b/src/client/apis/index.ts index 3cfb22648..4c7ac79de 100644 --- a/src/client/apis/index.ts +++ b/src/client/apis/index.ts @@ -1,127 +1,120 @@ -import Client from "../Client"; -import GeneralAPI from "./GeneralAPI"; -import AccountInformationAPI from "./AccountInformationAPI"; -import AccountSettingsAPI from "./AccountSettingsAPI"; -import AdConfigurationAPI from "./AdConfigurationAPI"; -import AdsAPI from "./AdsAPI"; -import AssetDeliveryAPI from "./AssetDeliveryAPI"; -import AuthAPI from "./AuthAPI"; -import AvatarAPI from "./AvatarAPI"; -import BadgesAPI from "./BadgesAPI"; -import BillingAPI from "./BillingAPI"; -import CaptchaAPI from "./CaptchaAPI"; -import CatalogAPI from "./CatalogAPI"; -import ChatAPI from "./ChatAPI"; -import ContactsAPI from "./ContactsAPI"; -import DevelopAPI from "./DevelopAPI"; -import EconomyAPI from "./EconomyAPI"; -import EconomyCreatorStatsAPI from "./EconomyCreatorStatsAPI"; -import EngagementPayoutsAPI from "./EngagementPayoutsAPI"; -import FollowingsAPI from "./FollowingsAPI"; -import FriendsAPI from "./FriendsAPI"; -import GamesAPI from "./GamesAPI"; -import GameInternationalizationAPI from "./GameInternationalizationAPI"; -import GroupsAPI from "./GroupsAPI"; -import InventoryAPI from "./InventoryAPI"; -import ItemConfigurationAPI from "./ItemConfigurationAPI"; -import LocaleAPI from "./LocaleAPI"; -import MetricsAPI from "./MetricsAPI"; -import NotificationsAPI from "./NotificationsAPI"; -import PremiumFeaturesAPI from "./PremiumFeaturesAPI"; -import PresenceAPI from "./PresenceAPI"; -import PrivateMessagesAPI from "./PrivateMessagesAPI"; -import PublishAPI from "./PublishAPI"; -import ThumbnailsAPI from "./ThumbnailsAPI"; -import TradesAPI from "./TradesAPI"; -import TranslationRolesAPI from "./TranslationRolesAPI"; -import UsersAPI from "./UsersAPI"; -import OtherAPI from "./OtherAPI"; -import TwoStepVerificationAPI from "./TwoStepVerificationAPI"; -import DataAPI from "./DataAPI"; - +import { Client } from "../Client"; +import { GeneralAPI } from "./GeneralAPI"; +import { AccountInformationAPI } from "./AccountInformationAPI"; +import { AccountSettingsAPI } from "./AccountSettingsAPI"; +import { AdConfigurationAPI } from "./AdConfigurationAPI"; +import { AssetDeliveryAPI } from "./AssetDeliveryAPI"; +import { AuthAPI } from "./AuthAPI"; +import { AvatarAPI } from "./AvatarAPI"; +import { BadgesAPI } from "./BadgesAPI"; +import { BillingAPI } from "./BillingAPI"; +import { CatalogAPI } from "./CatalogAPI"; +import { ChatAPI } from "./ChatAPI"; +import { ContactsAPI } from "./ContactsAPI"; +import { DevelopAPI } from "./DevelopAPI"; +import { EconomyAPI } from "./EconomyAPI"; +import { EconomyCreatorStatsAPI } from "./EconomyCreatorStatsAPI"; +import { EngagementPayoutsAPI } from "./EngagementPayoutsAPI"; +import { FollowingsAPI } from "./FollowingsAPI"; +import { FriendsAPI } from "./FriendsAPI"; +import { GamesAPI } from "./GamesAPI"; +import { GameInternationalizationAPI } from "./GameInternationalizationAPI"; +import { GroupsAPI } from "./GroupsAPI"; +import { InventoryAPI } from "./InventoryAPI"; +import { ItemConfigurationAPI } from "./ItemConfigurationAPI"; +import { LocaleAPI } from "./LocaleAPI"; +import { MetricsAPI } from "./MetricsAPI"; +import { NotificationsAPI } from "./NotificationsAPI"; +import { PremiumFeaturesAPI } from "./PremiumFeaturesAPI"; +import { PresenceAPI } from "./PresenceAPI"; +import { PrivateMessagesAPI } from "./PrivateMessagesAPI"; +import { PublishAPI } from "./PublishAPI"; +import { ThumbnailsAPI } from "./ThumbnailsAPI"; +import { TranslationRolesAPI } from "./TranslationRolesAPI"; +import { UsersAPI } from "./UsersAPI"; +import { OtherAPI } from "./OtherAPI"; +import { TwoStepVerificationAPI } from "./TwoStepVerificationAPI"; +import { DataAPI } from "./DataAPI"; export declare type APIs = { - accountInformationAPI: AccountInformationAPI; - accountSettingsAPI: AccountSettingsAPI; - adConfigurationAPI: AdConfigurationAPI; - adsAPI: AdsAPI; - assetDeliveryAPI: AssetDeliveryAPI; - authAPI: AuthAPI; - avatarAPI: AvatarAPI; - badgesAPI: BadgesAPI; - billingAPI: BillingAPI; - captchaAPI: CaptchaAPI; - catalogAPI: CatalogAPI; - chatAPI: ChatAPI; - contactsAPI: ContactsAPI; - dataAPI: DataAPI; - developAPI: DevelopAPI; - economyAPI: EconomyAPI; - economyCreatorStats: EconomyCreatorStatsAPI; - engagementPayouts: EngagementPayoutsAPI; - followingsAPI: FollowingsAPI; - friendsAPI: FriendsAPI; - gamesAPI: GamesAPI; - gameInternationalizationAPI: GameInternationalizationAPI; - groupsAPI: GroupsAPI; - inventoryAPI: InventoryAPI; - itemConfigurationAPI: ItemConfigurationAPI; - localeAPI: LocaleAPI; - metricsAPI: MetricsAPI; - notificationsAPI: NotificationsAPI; - otherAPI: OtherAPI; - premiumFeaturesAPI: PremiumFeaturesAPI; - presenceAPI: PresenceAPI; - privateMessagesAPI: PrivateMessagesAPI; - publishAPI: PublishAPI; - thumbnailsAPI: ThumbnailsAPI; - tradesAPI: TradesAPI; - translationRolesAPI: TranslationRolesAPI; - usersAPI: UsersAPI; - generalApi: GeneralAPI; - twpStepVerification: TwoStepVerificationAPI; + accountInformationAPI: AccountInformationAPI; + accountSettingsAPI: AccountSettingsAPI; + adConfigurationAPI: AdConfigurationAPI; + assetDeliveryAPI: AssetDeliveryAPI; + authAPI: AuthAPI; + avatarAPI: AvatarAPI; + badgesAPI: BadgesAPI; + billingAPI: BillingAPI; + catalogAPI: CatalogAPI; + chatAPI: ChatAPI; + contactsAPI: ContactsAPI; + dataAPI: DataAPI; + developAPI: DevelopAPI; + economyAPI: EconomyAPI; + economyCreatorStats: EconomyCreatorStatsAPI; + engagementPayouts: EngagementPayoutsAPI; + followingsAPI: FollowingsAPI; + friendsAPI: FriendsAPI; + gamesAPI: GamesAPI; + gameInternationalizationAPI: GameInternationalizationAPI; + groupsAPI: GroupsAPI; + inventoryAPI: InventoryAPI; + itemConfigurationAPI: ItemConfigurationAPI; + localeAPI: LocaleAPI; + metricsAPI: MetricsAPI; + notificationsAPI: NotificationsAPI; + otherAPI: OtherAPI; + premiumFeaturesAPI: PremiumFeaturesAPI; + presenceAPI: PresenceAPI; + privateMessagesAPI: PrivateMessagesAPI; + publishAPI: PublishAPI; + thumbnailsAPI: ThumbnailsAPI; + translationRolesAPI: TranslationRolesAPI; + usersAPI: UsersAPI; + generalApi: GeneralAPI; + twoStepVerification: TwoStepVerificationAPI; }; -export default function initAPIs (client: Client): APIs { - return { - accountInformationAPI: new AccountInformationAPI(client), - accountSettingsAPI: new AccountSettingsAPI(client), - adConfigurationAPI: new AdConfigurationAPI(client), - adsAPI: new AdsAPI(client), - assetDeliveryAPI: new AssetDeliveryAPI(client), - authAPI: new AuthAPI(client), - avatarAPI: new AvatarAPI(client), - badgesAPI: new BadgesAPI(client), - billingAPI: new BillingAPI(client), - captchaAPI: new CaptchaAPI(client), - catalogAPI: new CatalogAPI(client), - chatAPI: new ChatAPI(client), - contactsAPI: new ContactsAPI(client), - dataAPI: new DataAPI(client), - developAPI: new DevelopAPI(client), - economyAPI: new EconomyAPI(client), - economyCreatorStats: new EconomyCreatorStatsAPI(client), - engagementPayouts: new EngagementPayoutsAPI(client), - followingsAPI: new FollowingsAPI(client), - friendsAPI: new FriendsAPI(client), - gamesAPI: new GamesAPI(client), - gameInternationalizationAPI: new GameInternationalizationAPI(client), - groupsAPI: new GroupsAPI(client), - inventoryAPI: new InventoryAPI(client), - itemConfigurationAPI: new ItemConfigurationAPI(client), - localeAPI: new LocaleAPI(client), - metricsAPI: new MetricsAPI(client), - generalApi: new GeneralAPI(client), - notificationsAPI: new NotificationsAPI(client), - otherAPI: new OtherAPI(client), - premiumFeaturesAPI: new PremiumFeaturesAPI(client), - presenceAPI: new PresenceAPI(client), - privateMessagesAPI: new PrivateMessagesAPI(client), - publishAPI: new PublishAPI(client), - thumbnailsAPI: new ThumbnailsAPI(client), - tradesAPI: new TradesAPI(client), - translationRolesAPI: new TranslationRolesAPI(client), - usersAPI: new UsersAPI(client), - twpStepVerification: new TwoStepVerificationAPI(client) - }; +/** + * @hidden + */ +export function initAPIs(client: Client): APIs { + return { + accountInformationAPI: new AccountInformationAPI(client), + accountSettingsAPI: new AccountSettingsAPI(client), + adConfigurationAPI: new AdConfigurationAPI(client), + assetDeliveryAPI: new AssetDeliveryAPI(client), + authAPI: new AuthAPI(client), + avatarAPI: new AvatarAPI(client), + badgesAPI: new BadgesAPI(client), + billingAPI: new BillingAPI(client), + catalogAPI: new CatalogAPI(client), + chatAPI: new ChatAPI(client), + contactsAPI: new ContactsAPI(client), + dataAPI: new DataAPI(client), + developAPI: new DevelopAPI(client), + economyAPI: new EconomyAPI(client), + economyCreatorStats: new EconomyCreatorStatsAPI(client), + engagementPayouts: new EngagementPayoutsAPI(client), + followingsAPI: new FollowingsAPI(client), + friendsAPI: new FriendsAPI(client), + gamesAPI: new GamesAPI(client), + gameInternationalizationAPI: new GameInternationalizationAPI(client), + groupsAPI: new GroupsAPI(client), + inventoryAPI: new InventoryAPI(client), + itemConfigurationAPI: new ItemConfigurationAPI(client), + localeAPI: new LocaleAPI(client), + metricsAPI: new MetricsAPI(client), + generalApi: new GeneralAPI(client), + notificationsAPI: new NotificationsAPI(client), + otherAPI: new OtherAPI(client), + premiumFeaturesAPI: new PremiumFeaturesAPI(client), + presenceAPI: new PresenceAPI(client), + privateMessagesAPI: new PrivateMessagesAPI(client), + publishAPI: new PublishAPI(client), + thumbnailsAPI: new ThumbnailsAPI(client), + translationRolesAPI: new TranslationRolesAPI(client), + usersAPI: new UsersAPI(client), + twoStepVerification: new TwoStepVerificationAPI(client) + }; } diff --git a/src/client/index.ts b/src/client/index.ts index fdd58e022..eb79981a6 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -1,5 +1 @@ -import Client from "./Client"; -// Import ClientBase from "./ClientBase"; -// import * as ClientInterfaces from "./ClientInterface"; - -export default Client; +export { Client } from "./Client"; diff --git a/src/client/lib/ChatManager/ChatManager.ts b/src/client/lib/ChatManager/ChatManager.ts index b097f4a63..79ff43e01 100644 --- a/src/client/lib/ChatManager/ChatManager.ts +++ b/src/client/lib/ChatManager/ChatManager.ts @@ -1,164 +1,233 @@ -import Client from "../../Client"; +import { Client } from "../../Client"; import { - AddUsersToConversation, - GetChatSettings, - MarkConversationsAsSeen, - MarkMessageInConversationAsRead, - RemoveUserFromConversation, - RenameGroupConversation, - ResetConversationUniverse, - SendGameLinkMessageOptions, - SendMessageOptions, - SetConversationUniverse, - StartCloudEditConversation, - StartGroupConversation, - StartOneToOneConversation, - UpdateUserTypingStatus + ChatAddUsersToConversation, + ChatGetChatSettings, + ChatMarkConversationsSeen, + ChatMarkConversationMessagesRead, + ChatRemoveUserFromConversation, + ChatRenameGroupConversation, + ChatResetConversationUniverse, + ChatSendGameLinkMessageOptions, + ChatSendMessageOptions, + ChatSetConversationUniverse, + ChatStartCloudEditConversation, + ChatStartGroupConversation, + ChatStartOneToOneConversation, + ChatUpdateUserTypingStatus } from "../../apis/ChatAPI"; -import { ChatConversation, ChatMessage, ChatMessageSent } from "../../../structures/Chat"; - - -export default class ChatManager { - public client: Client; - - constructor (client: Client) { - this.client = client; - } - - getSettings (): Promise { - return this.client.apis.chatAPI.getChatSettings(); - } - - getConversation (conversationId: number): Promise { - return this.getConversations([conversationId]) - .then(data => data[0] || null); - } - - getConversationMessages (conversationId: number, amount = 100, startMessageId?: string): Promise { - return this.client.apis.chatAPI.getConversationMessages({ - conversationId, - pageSize: amount, - exclusiveStartMessageId: startMessageId - }) - .then(response => response.map(chatData => new ChatMessage(chatData, this.client))); - } - - getUnreadConversationsCount (): Promise { - return this.client.apis.chatAPI.getUnreadConversationCount() - .then(response => response.count); - } - - getConversations (conversations: number[]): Promise { - return this.client.apis.chatAPI.getConversations({ - conversationIds: conversations - }) - .then(response => response.map(conversationData => new ChatConversation(conversationData, this.client))); - } - - addUsersToConversation (conversation: number, users: number[]): Promise { - return this.client.apis.chatAPI.addUsersToConversation({ - conversationId: conversation, - participantUserIds: users - }); - } - - markMessageRead (conversation: number, id: string): Promise { - return this.client.apis.chatAPI.markConversationMessagesRead({ - conversationId: conversation, - endMessageId: id - }); - } - - markConversationsRead (conversations: number[]): Promise { - return this.client.apis.chatAPI.markConversationsSeen({ - conversationsToMarkSeen: conversations - }); - } - - removeUserFromConversation (conversation: number, user: number): Promise { - return this.client.apis.chatAPI.removeUserFromConversation({ - conversationId: conversation, - participantUserId: user - }); - } - - renameGroupConversation (conversation: number, name: string): Promise { - return this.client.apis.chatAPI.renameGroupConversation({ - conversationId: conversation, - newTitle: name - }); - } - - getUnreadMessagesInConversations (conversations: number[], amount = 100): Promise { - return this.client.apis.chatAPI.getUnreadMessagesInConversations({ - conversationIds: conversations, - pageSize: amount - }) - .then(response => Array.prototype.concat.apply( - [], - response.map(conversationData => conversationData.chatMessages - .map(chatData => new ChatMessage(chatData, this.client)) - ))); - } - - getLatestMessagesInConversations (conversations: number[], amount = 100): Promise { - return this.client.apis.chatAPI.getMultiLatestConversationMessages({ - conversationIds: conversations, - pageSize: amount - }) - .then(response => Array.prototype.concat.apply( - [], - response.map(conversationData => conversationData.chatMessages - .map(chatData => new ChatMessage(chatData, this.client)) - ))); - } - - resetConversationUniverse (conversation: number): Promise { - return this.client.apis.chatAPI.resetConversationUniverse({ - conversationId: conversation - }); - } - - sendGameLinkMessage (options: SendGameLinkMessageOptions): Promise { - return this.client.apis.chatAPI.sendGameLinkMessage(options) - .then(response => new ChatMessageSent(response, this.client)); - } - - sendMessage (options: SendMessageOptions): Promise { - return this.client.apis.chatAPI.sendMessage(options) - .then(response => new ChatMessageSent(response, this.client)); - } - - setConversationUniverse (conversation: number, universe: number): Promise { - return this.client.apis.chatAPI.setConversationUniverse({ - conversationId: conversation, - universeId: universe - }); - } - - startCloudEditConversation (placeId: number): Promise { - return this.client.apis.chatAPI.startCloudEditConversation({ - placeId - }); - } - - startGroupConversation (title: string, users: number[]): Promise { - return this.client.apis.chatAPI.startGroupConversation({ - participantUserIds: users, - title - }); - } - - startOneToOneConversation (userId: number): Promise { - return this.client.apis.chatAPI.startOneToOneConversation({ - participantUserId: userId - }); - } - - updateTypingStatus (conversation: number, isTyping = true): Promise { - return this.client.apis.chatAPI.updateUserTypingStatus({ - conversationId: conversation, - isTyping - }); - } +import { + ChatConversation, + ChatMessage, + ChatMessageSent +} from "../../../old_structures/Chat"; + +export class ChatManager { + public client: Client; + + constructor(client: Client) { + this.client = client; + } + + getSettings(): Promise { + return this.client.apis.chatAPI.getChatSettings(); + } + + getConversation(conversationId: number): Promise { + return this.getConversations([conversationId]).then( + (data) => data[0] || null + ); + } + + getConversationMessages( + conversationId: number, + amount = 100, + startMessageId?: string + ): Promise { + return this.client.apis.chatAPI + .getConversationMessages({ + conversationId, + pageSize: amount, + exclusiveStartMessageId: startMessageId + }) + .then((response) => + response.map((chatData) => new ChatMessage(chatData, this.client)) + ); + } + + getUnreadConversationsCount(): Promise { + return this.client.apis.chatAPI + .getUnreadConversationCount() + .then((response) => response.count); + } + + getConversations(conversations: number[]): Promise { + return this.client.apis.chatAPI + .getConversations({ + conversationIds: conversations + }) + .then((response) => + response.map( + (conversationData) => + new ChatConversation(conversationData, this.client) + ) + ); + } + + addUsersToConversation( + conversation: number, + users: number[] + ): Promise { + return this.client.apis.chatAPI.addUsersToConversation({ + conversationId: conversation, + participantUserIds: users + }); + } + + markMessageRead( + conversation: number, + id: string + ): Promise { + return this.client.apis.chatAPI.markConversationMessagesRead({ + conversationId: conversation, + endMessageId: id + }); + } + + markConversationsRead( + conversations: number[] + ): Promise { + return this.client.apis.chatAPI.markConversationsSeen({ + conversationsToMarkSeen: conversations + }); + } + + removeUserFromConversation( + conversation: number, + user: number + ): Promise { + return this.client.apis.chatAPI.removeUserFromConversation({ + conversationId: conversation, + participantUserId: user + }); + } + + renameGroupConversation( + conversation: number, + name: string + ): Promise { + return this.client.apis.chatAPI.renameGroupConversation({ + conversationId: conversation, + newTitle: name + }); + } + + getUnreadMessagesInConversations( + conversations: number[], + amount = 100 + ): Promise { + return this.client.apis.chatAPI + .getUnreadMessagesInConversations({ + conversationIds: conversations, + pageSize: amount + }) + .then((response) => + Array.prototype.concat.apply( + [], + response.map((conversationData) => + conversationData.chatMessages.map( + (chatData) => new ChatMessage(chatData, this.client) + ) + ) + ) + ); + } + + getLatestMessagesInConversations( + conversations: number[], + amount = 100 + ): Promise { + return this.client.apis.chatAPI + .getMultiLatestConversationMessages({ + conversationIds: conversations, + pageSize: amount + }) + .then((response) => + Array.prototype.concat.apply( + [], + response.map((conversationData) => + conversationData.chatMessages.map( + (chatData) => new ChatMessage(chatData, this.client) + ) + ) + ) + ); + } + + resetConversationUniverse( + conversation: number + ): Promise { + return this.client.apis.chatAPI.resetConversationUniverse({ + conversationId: conversation + }); + } + + sendGameLinkMessage( + options: ChatSendGameLinkMessageOptions + ): Promise { + return this.client.apis.chatAPI + .sendGameLinkMessage(options) + .then((response) => new ChatMessageSent(response, this.client)); + } + + sendMessage(options: ChatSendMessageOptions): Promise { + return this.client.apis.chatAPI + .sendMessage(options) + .then((response) => new ChatMessageSent(response, this.client)); + } + + setConversationUniverse( + conversation: number, + universe: number + ): Promise { + return this.client.apis.chatAPI.setConversationUniverse({ + conversationId: conversation, + universeId: universe + }); + } + + startCloudEditConversation( + placeId: number + ): Promise { + return this.client.apis.chatAPI.startCloudEditConversation({ + placeId + }); + } + + startGroupConversation( + title: string, + users: number[] + ): Promise { + return this.client.apis.chatAPI.startGroupConversation({ + participantUserIds: users, + title + }); + } + + startOneToOneConversation( + userId: number + ): Promise { + return this.client.apis.chatAPI.startOneToOneConversation({ + participantUserId: userId + }); + } + + updateTypingStatus( + conversation: number, + isTyping = true + ): Promise { + return this.client.apis.chatAPI.updateUserTypingStatus({ + conversationId: conversation, + isTyping + }); + } } diff --git a/src/client/lib/ClientSocket/ClientSocket.ts b/src/client/lib/ClientSocket/ClientSocket.ts index dac9be591..7c4b2bc85 100644 --- a/src/client/lib/ClientSocket/ClientSocket.ts +++ b/src/client/lib/ClientSocket/ClientSocket.ts @@ -1,109 +1,179 @@ -import Client from "../../Client"; +import { Client } from "../../Client"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import * as SignalR from "signalr-client"; import { default as socketHandlers } from "./handlers"; import { EventEmitter } from "events"; -import { PartialChatConversation } from "../../../structures/Chat"; -import { PartialUser } from "../../../structures/User"; - +import { PartialChatConversation } from "../../../old_structures/Chat"; +import { PartialUser } from "../../../old_structures/User"; export declare interface Socket extends EventEmitter { - on (event: "chatMessageSent", listener: (data: { conversation: PartialChatConversation }) => void): this; - - on (event: "chatUserTyping", listener: (data: { user: PartialUser; conversation: PartialChatConversation }) => void): this; - - on (event: "chatUserTypingStopped", listener: (data: { user: PartialUser; conversation: PartialChatConversation }) => void): this; - - on (event: "chatMessage", listener: (data: { user: PartialUser; conversation: PartialChatConversation }) => void): this; - - on (event: "chatMessageSent", listener: (data: { user: PartialUser; conversation: PartialChatConversation }) => void): this; - - on (event: "chatConversationAdded", listener: (data: { conversation: PartialChatConversation }) => void): this; - - on (event: "chatConversationRemoved", listener: (data: { conversation: PartialChatConversation }) => void): this; - - on (event: "chatMemberAdded", listener: (data: { conversation: PartialChatConversation }) => void): this; - - on (event: "chatMemberLeft", listener: (data: { conversation: PartialChatConversation }) => void): this; - - on (event: "friendLost", listener: (data: { user: PartialUser }) => void): this; - - on (event: "friendRequest", listener: (data: { user: PartialUser }) => void): this; - - on (event: "friendAdded", listener: (data: { user: PartialUser }) => void): this; - - on (event: "userPresenceChanged", listener: (data: { user: PartialUser }) => void): this; + on( + event: "chatMessageSent", + listener: (data: { conversation: PartialChatConversation }) => void + ): this; + + on( + event: "chatUserTyping", + listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void + ): this; + + on( + event: "chatUserTypingStopped", + listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void + ): this; + + on( + event: "chatMessage", + listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void + ): this; + + on( + event: "chatMessageSent", + listener: (data: { + user: PartialUser; + conversation: PartialChatConversation; + }) => void + ): this; + + on( + event: "chatConversationAdded", + listener: (data: { conversation: PartialChatConversation }) => void + ): this; + + on( + event: "chatConversationRemoved", + listener: (data: { conversation: PartialChatConversation }) => void + ): this; + + on( + event: "chatMemberAdded", + listener: (data: { conversation: PartialChatConversation }) => void + ): this; + + on( + event: "chatMemberLeft", + listener: (data: { conversation: PartialChatConversation }) => void + ): this; + + on( + event: "friendLost", + listener: (data: { user: PartialUser }) => void + ): this; + + on( + event: "friendRequest", + listener: (data: { user: PartialUser }) => void + ): this; + + on( + event: "friendAdded", + listener: (data: { user: PartialUser }) => void + ): this; + + on( + event: "userPresenceChanged", + listener: (data: { user: PartialUser }) => void + ): this; } - export class Socket extends EventEmitter { - public client: Client; - public socket: any; - public connected: boolean; - - constructor (client: Client) { - super(); - - this.client = client; - this.socket = null; - this.connected = false; - } - - connect (): Promise { - return new Promise((resolve, reject) => { - const connectSocket = (retries = 0): void => { - this.socket = new SignalR.client("wss://realtime.roblox.com/notifications", ["usernotificationhub"], 3, true); - this.socket.headers.Cookie = this.client.rest.cookieJar.getCookieStringSync("https://roblox.com"); - const maxRetries = this.client.options.setup?.websocket?.maxRetries ?? 3; - - const attemptReconnect = (): unknown => connectSocket(++retries); - const onError = (error: Error): void => { - this.emit("error", error); - attemptReconnect(); - }; - - if (retries >= maxRetries) { - this.socket.close(); - reject(new Error(`Connection failed, attempted to establish a connection ${retries} times`)); - } - - this.socket.serviceHandlers.connectFailed = (error: Error): unknown => onError(error); - this.socket.serviceHandlers.onerror = (error: Error): unknown => onError(error); - this.socket.serviceHandlers.connected = (): void => { - this.emit("ready"); - this.init(); - resolve(); - }; - this.socket.serviceHandlers.reconnecting = (): void => { - this.emit("reconnecting"); - }; - - // Start the attempt of connection - this.socket.start(); - }; - - connectSocket(); + public client: Client; + public socket: any; + public connected: boolean; + + constructor(client: Client) { + super(); + + this.client = client; + this.socket = null; + this.connected = false; + } + + connect(): Promise { + return new Promise((resolve, reject) => { + const connectSocket = (retries = 0): void => { + this.socket = new SignalR.client( + "wss://realtime.roblox.com/notifications", + ["usernotificationhub"], + 3, + true + ); + this.socket.headers.Cookie = + this.client.rest.cookieJar.getCookieStringSync("https://roblox.com"); + const maxRetries = + this.client.options.setup?.websocket?.maxRetries ?? 3; + + const attemptReconnect = (): unknown => connectSocket(++retries); + const onError = (error: Error): void => { + this.emit("error", error); + attemptReconnect(); + }; + + if (retries >= maxRetries) { + this.socket.close(); + reject( + new Error( + `Connection failed, attempted to establish a connection ${retries} times` + ) + ); + } + + this.socket.serviceHandlers.connectFailed = (error: Error): unknown => + onError(error); + this.socket.serviceHandlers.onerror = (error: Error): unknown => + onError(error); + this.socket.serviceHandlers.connected = (): void => { + this.emit("ready"); + this.init(); + resolve(); + }; + this.socket.serviceHandlers.reconnecting = (): void => { + this.emit("reconnecting"); + }; + + // Start the attempt of connection + this.socket.start(); + }; + + connectSocket(); + }); + } + + /** + * This is called after the connection of the socket has successfully been established + */ + init(): void { + this.socket.on( + "UserNotificationHub", + "notification", + (name: string, message: any) => { + this.emit("event", { + name, + message }); - } - - /** - * This is called after the connection of the socket has successfully been established - */ - init (): void { - this.socket.on("UserNotificationHub", "notification", (name: string, message: any) => { - this.emit("event", { - name, - message - }); - - const parsedMessage = !(message instanceof Object) ? JSON.parse(message) : message; - const messageType = parsedMessage.Type ? parsedMessage.Type.toLowerCase() : null; - const socketHandler = socketHandlers.get(name.toLowerCase()); - - if (socketHandler) { - return socketHandler(this, messageType, parsedMessage); - } - }); - } + + const parsedMessage = !(message instanceof Object) + ? JSON.parse(message) + : message; + const messageType = parsedMessage.Type + ? parsedMessage.Type.toLowerCase() + : null; + const socketHandler = socketHandlers.get(name.toLowerCase()); + + if (socketHandler) { + return socketHandler(this, messageType, parsedMessage); + } + } + ); + } } diff --git a/src/client/lib/ClientSocket/handlers/chatNotifications.ts b/src/client/lib/ClientSocket/handlers/chatNotifications.ts index 6643f53e9..f9e39152b 100644 --- a/src/client/lib/ClientSocket/handlers/chatNotifications.ts +++ b/src/client/lib/ClientSocket/handlers/chatNotifications.ts @@ -1,63 +1,93 @@ import * as ClientSocket from "../ClientSocket"; -import { PartialChatConversation } from "../../../../structures/Chat"; -import { PartialUser } from "../../../../structures/User"; +import { PartialChatConversation } from "../../../../old_structures/Chat"; +import { PartialUser } from "../../../../old_structures/User"; - -export default function handleChatNotifications (socket: ClientSocket.Socket, messageType: string, message: any): void { - switch (messageType) { - case "participanttyping": - socket.emit(message.IsTyping ? "chatUserTyping" : "chatUserTypingStopped", { - user: new PartialUser({ - id: message.UserId - }, socket.client), - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "newmessage": - socket.emit("chatMessage", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "newmessagebyself": - socket.emit("chatMessageSent", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "newconversation": - socket.emit("chatConversationAdded", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "conversationremoved": - socket.emit("chatConversationRemoved", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "participantadded": - socket.emit("chatMemberAdded", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - case "participantlefet": - socket.emit("chatMemberLeft", { - conversation: new PartialChatConversation({ - id: message.ConversationId - }, socket.client) - }); - break; - default: - break; - } +export default function handleChatNotifications( + socket: ClientSocket.Socket, + messageType: string, + message: any +): void { + switch (messageType) { + case "participanttyping": + socket.emit( + message.IsTyping ? "chatUserTyping" : "chatUserTypingStopped", + { + user: new PartialUser( + { + id: message.UserId + }, + socket.client + ), + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + } + ); + break; + case "newmessage": + socket.emit("chatMessage", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + case "newmessagebyself": + socket.emit("chatMessageSent", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + case "newconversation": + socket.emit("chatConversationAdded", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + case "conversationremoved": + socket.emit("chatConversationRemoved", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + case "participantadded": + socket.emit("chatMemberAdded", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + case "participantlefet": + socket.emit("chatMemberLeft", { + conversation: new PartialChatConversation( + { + id: message.ConversationId + }, + socket.client + ) + }); + break; + default: + break; + } } diff --git a/src/client/lib/ClientSocket/handlers/friendShipnotifications.ts b/src/client/lib/ClientSocket/handlers/friendShipnotifications.ts index 120cb3d5b..a55f98058 100644 --- a/src/client/lib/ClientSocket/handlers/friendShipnotifications.ts +++ b/src/client/lib/ClientSocket/handlers/friendShipnotifications.ts @@ -1,31 +1,45 @@ import * as ClientSocket from "../ClientSocket"; -import { PartialUser } from "../../../../structures/User"; +import { PartialUser } from "../../../../old_structures/User"; - -export default function handleFriendshipNotifications (socket: ClientSocket.Socket, messageType: string, message: any): void { - switch (messageType) { - case "friendshipdestroyed": - socket.emit("friendLost", { - user: new PartialUser({ - id: [message.UserId1, message.UserId2].filter(id => id !== socket.client.user!.id)[0]! - }, socket.client) - }); - break; - case "friendshiprequested": - socket.emit("friendRequest", { - user: new PartialUser({ - id: message.UserId1 - }, socket.client) - }); - break; - case "friendshipcreated": - socket.emit("friendAdded", { - user: new PartialUser({ - id: message.UserId1 - }, socket.client) - }); - break; - default: - break; - } +export default function handleFriendshipNotifications( + socket: ClientSocket.Socket, + messageType: string, + message: any +): void { + switch (messageType) { + case "friendshipdestroyed": + socket.emit("friendLost", { + user: new PartialUser( + { + id: [message.UserId1, message.UserId2].filter( + (id) => id !== socket.client.user!.id + )[0]! + }, + socket.client + ) + }); + break; + case "friendshiprequested": + socket.emit("friendRequest", { + user: new PartialUser( + { + id: message.UserId1 + }, + socket.client + ) + }); + break; + case "friendshipcreated": + socket.emit("friendAdded", { + user: new PartialUser( + { + id: message.UserId1 + }, + socket.client + ) + }); + break; + default: + break; + } } diff --git a/src/client/lib/ClientSocket/handlers/index.ts b/src/client/lib/ClientSocket/handlers/index.ts index e5a4a8fd4..d440a8374 100644 --- a/src/client/lib/ClientSocket/handlers/index.ts +++ b/src/client/lib/ClientSocket/handlers/index.ts @@ -4,8 +4,10 @@ import handleFriendshipNotifications from "./friendShipnotifications"; import handleMessageNotifications from "./messageNotifications"; import handlePresenceBulkNotifications from "./presenceBulkNotifications"; - -const handlersMap = new Map void>(); +const handlersMap = new Map< +string, +(socket: ClientSocket, messageType: string, message: unknown) => void +>(); handlersMap.set("chatnotifications", handleChatNotifications); handlersMap.set("friendshipnotifications", handleFriendshipNotifications); diff --git a/src/client/lib/ClientSocket/handlers/messageNotifications.ts b/src/client/lib/ClientSocket/handlers/messageNotifications.ts index 2e46ed063..a2f376e09 100644 --- a/src/client/lib/ClientSocket/handlers/messageNotifications.ts +++ b/src/client/lib/ClientSocket/handlers/messageNotifications.ts @@ -1,34 +1,37 @@ import { Socket as ClientSocket } from "../ClientSocket"; - -export default function handleChatNotifications (socket: ClientSocket, messageType: string, message: any): void { - switch (messageType) { - case "created": - socket.emit("message", { - messageId: message.MessageId - }); - break; - case "markasread": - socket.emit("messageRead", { - messageId: message.MessageId - }); - break; - case "markasunread": - socket.emit("messageUnread", { - messageId: message.MessageId - }); - break; - case "archived": - socket.emit("messageArchived", { - messageId: message.MessageId - }); - break; - case "unarchived": - socket.emit("messageUnarchived", { - messageId: message.MessageId - }); - break; - default: - break; - } +export default function handleChatNotifications ( + socket: ClientSocket, + messageType: string, + message: any +): void { + switch (messageType) { + case "created": + socket.emit("message", { + messageId: message.MessageId + }); + break; + case "markasread": + socket.emit("messageRead", { + messageId: message.MessageId + }); + break; + case "markasunread": + socket.emit("messageUnread", { + messageId: message.MessageId + }); + break; + case "archived": + socket.emit("messageArchived", { + messageId: message.MessageId + }); + break; + case "unarchived": + socket.emit("messageUnarchived", { + messageId: message.MessageId + }); + break; + default: + break; + } } diff --git a/src/client/lib/ClientSocket/handlers/presenceBulkNotifications.ts b/src/client/lib/ClientSocket/handlers/presenceBulkNotifications.ts index 189d9115e..7cf88a9c4 100644 --- a/src/client/lib/ClientSocket/handlers/presenceBulkNotifications.ts +++ b/src/client/lib/ClientSocket/handlers/presenceBulkNotifications.ts @@ -1,15 +1,24 @@ import { Socket as ClientSocket } from "../ClientSocket"; -import { PartialUser } from "../../../../structures/User"; +import { PartialUser } from "../../../../old_structures/User"; +export default function handlePresenceBulkNotifications( + socket: ClientSocket, + _messageType: string, + message: any +): void { + if (!Array.isArray(message)) { + throw new Error("Presence bulk notification message was not an array"); + } -export default function handlePresenceBulkNotifications (socket: ClientSocket, _messageType: string, message: any): void { - if (!Array.isArray(message)) { - throw new Error("Presence bulk notification message was not an array"); - } - - message.forEach(presenceUpdated => { - socket.emit("userPresenceChanged", new PartialUser({ - id: presenceUpdated.UserId - }, socket.client)); - }); + message.forEach((presenceUpdated) => { + socket.emit( + "userPresenceChanged", + new PartialUser( + { + id: presenceUpdated.UserId + }, + socket.client + ) + ); + }); } diff --git a/src/client/lib/DataStoreManager/DataStoreManager.ts b/src/client/lib/DataStoreManager/DataStoreManager.ts index b1a434b45..a9cdc9457 100644 --- a/src/client/lib/DataStoreManager/DataStoreManager.ts +++ b/src/client/lib/DataStoreManager/DataStoreManager.ts @@ -1,40 +1,27 @@ -import Client from "../../Client"; -import OrderedDataStore from "./structures/OrderedDataStore"; -import GlobalDataStore from "./structures/GlobalDataStore"; +import { Client } from "../../Client"; +import { OrderedDataStore } from "./structures/OrderedDataStore"; +import { GlobalDataStore } from "./structures/GlobalDataStore"; +export class DataStoreManager { + public client: Client; -export default class DataStoreManager { - public client: Client; + constructor(client: Client) { + this.client = client; + } - constructor (client: Client) { - this.client = client; + getOrderedDataStore(placeId: number, name: string, scope?: string) { + if (!this.client.isLoggedIn()) { + throw new Error(`You must be logged in to be able to use data stores!`); } - getOrderedDataStore (placeId: number, name: string, scope?: string) { - if (!this.client.isLoggedIn()) { - throw new Error(`You must be logged in to be able to use data stores!`); - } + return new OrderedDataStore(this, placeId, name, scope, false); + } - return new OrderedDataStore( - this, - placeId, - name, - scope, - false - ); + getDataStore(placeId: number, name: string, scope?: string) { + if (!this.client.isLoggedIn()) { + throw new Error(`You must be logged in to be able to use data stores!`); } - getDataStore (placeId: number, name: string, scope?: string) { - if (!this.client.isLoggedIn()) { - throw new Error(`You must be logged in to be able to use data stores!`); - } - - return new GlobalDataStore( - this, - placeId, - name, - scope, - false - ); - } + return new GlobalDataStore(this, placeId, name, scope, false); + } } diff --git a/src/client/lib/DataStoreManager/structures/DataStoreHttpRequest.ts b/src/client/lib/DataStoreManager/structures/DataStoreHttpRequest.ts index 2cc442008..7897b2b9f 100644 --- a/src/client/lib/DataStoreManager/structures/DataStoreHttpRequest.ts +++ b/src/client/lib/DataStoreManager/structures/DataStoreHttpRequest.ts @@ -1,38 +1,41 @@ -import DataStoreManager from "../DataStoreManager"; -import { RESTRequestOptions, RESTResponseDataType } from "../../../../interfaces/RESTInterfaces"; +import { DataStoreManager } from "../DataStoreManager"; +import { + RESTRequestOptions, + RESTResponseDataType +} from "../../../../interfaces/RESTInterfaces"; import { DataStoreRequestType } from "../util/constants"; - type DataStoreHttpRequestOptions = RESTRequestOptions & { - placeId: number; - requestType: DataStoreRequestType; - data: string; + placeId: number; + requestType: DataStoreRequestType; + data: string; }; -export default class DataStoreHttpRequest { - public initiator: DataStoreManager; - public options: DataStoreHttpRequestOptions; +export class DataStoreHttpRequest { + public initiator: DataStoreManager; + public options: DataStoreHttpRequestOptions; - constructor (manager: DataStoreManager, options: DataStoreHttpRequestOptions) { - this.initiator = manager; - this.options = options; + constructor(manager: DataStoreManager, options: DataStoreHttpRequestOptions) { + this.initiator = manager; + this.options = options; - // Adjusting the body - this.options.body = this.options.data.length === 0 ? " " : this.options.data; + // Adjusting the body + this.options.body = + this.options.data.length === 0 ? " " : this.options.data; - // Always POST - this.options.method = this.options.method || "POST"; - this.options.headers = this.options.headers || {}; - this.options.headers = { - ...this.options.headers, - "Cache-Control": "no-cache", - "Content-Type": "application/x-www-form-urlencoded", - "Roblox-Place-Id": this.options.placeId, - Cookie: this.initiator.client.rest.getCookies("https://www.roblox.com/") - }; - } + // Always POST + this.options.method = this.options.method || "POST"; + this.options.headers = this.options.headers || {}; + this.options.headers = { + ...this.options.headers, + "Cache-Control": "no-cache", + "Content-Type": "application/x-www-form-urlencoded", + "Roblox-Place-Id": this.options.placeId, + Cookie: this.initiator.client.rest.getCookies("https://www.roblox.com/") + }; + } - send (): Promise { - return this.initiator.client.rest.request(this.options); - } + send(): Promise { + return this.initiator.client.rest.request(this.options); + } } diff --git a/src/client/lib/DataStoreManager/structures/GenericDataStore.ts b/src/client/lib/DataStoreManager/structures/GenericDataStore.ts index 3baf15f3e..2b4193370 100644 --- a/src/client/lib/DataStoreManager/structures/GenericDataStore.ts +++ b/src/client/lib/DataStoreManager/structures/GenericDataStore.ts @@ -1,299 +1,332 @@ import * as querystring from "querystring"; -import DataStoreManager from "../DataStoreManager"; -import DataStoreHttpRequest from "./DataStoreHttpRequest"; +import { DataStoreManager } from "../DataStoreManager"; +import { DataStoreHttpRequest } from "./DataStoreHttpRequest"; import { DataStoreRequestType } from "../util/constants"; -import { checkKey, checkName, checkPlaceId, checkScope, checkValue } from "../util/checks"; +import { + checkKey, + checkName, + checkPlaceId, + checkScope, + checkValue +} from "../util/checks"; import { RESTResponseDataType } from "../../../../interfaces/RESTInterfaces"; - type DataStoreType = "OrderedDataStore" | "GlobalDataStore"; type DataStoreKey = { - Scope: "global" | string; - Target: string; - Key: string; + Scope: "global" | string; + Target: string; + Key: string; }; type DataStoreValue = string; -export default class GenericDataStore { - public manager: DataStoreManager; - public name: string; - public scope: string; - public legacy: boolean; - public baseAPIUrl: string; - public placeId: number; - public dataStoreType: DataStoreType; - public advanced: { - parseData?: (data: string) => DataType; - serializeData?: (data: DataType) => string; - }; - - constructor (manager: DataStoreManager, dataStoreType: DataStoreType, placeId: number, name: string, scope: string | null, legacy = false) { - this.manager = manager; - this.dataStoreType = dataStoreType; - this.placeId = placeId; - this.name = name; - this.scope = scope || "global"; - this.legacy = legacy; - this.baseAPIUrl = "https://gamepersistence.roblox.com/persistence/"; - this.advanced = {}; - - // Making sure we started off properly by checking all the set values - this.performPreflightChecks({}); - } - - /** - * When data is retrieved from data stores, it will be returned unmodified - * Using your own data converter will allow you to return it if you handle your data in a special way, such as - * JSON parsing it etc. - * @param {(data: string) => DataType} parseDataFunction - * @param {(data: DataType) => string} serializeDataFunction - */ - public setDataConverters (parseDataFunction: (data: string) => DataType, serializeDataFunction: (data: DataType) => string): void { - this.advanced.parseData = parseDataFunction; - this.advanced.serializeData = serializeDataFunction; - } - - buildPostDataForKey (key: string, index = 0): string { - const encodedQueryString = querystring.encode({ - [`qkeys[${index}].scope`]: this.scope ? this.safeEncodeValue(this.scope) : "", - [`qkeys[${index}].target`]: this.legacy ? "" : this.safeEncodeValue(key), - [`qkeys[${index}].key`]: this.legacy ? this.safeEncodeValue(key) : this.safeEncodeValue(this.name) - }); - - return `&${encodedQueryString}`; - } - - buildGetUrl (): string { - const encodedQueryString = this.createQueryString({}); - - return `${this.baseAPIUrl}getV2?${encodedQueryString}`; - } - - buildSetUrl (key: string, valueLength: number): string { - const encodedQueryString = this.createQueryString({ - key: this.legacy ? this.safeEncodeValue(key) : this.safeEncodeValue(this.name), - target: this.legacy ? "" : this.safeEncodeValue(key), - valueLength - }); - - return `${this.baseAPIUrl}set?${encodedQueryString}`; - } - - buildSetIfUrl (key: string, valueLength: number, expectedValueLength: number): string { - const encodedQueryString = this.createQueryString({ - key: this.legacy ? this.safeEncodeValue(key) : this.safeEncodeValue(this.name), - target: this.legacy ? "" : this.safeEncodeValue(key), - valueLength, - expectedValueLength - }); - - return `${this.baseAPIUrl}set?${encodedQueryString}`; +export class GenericDataStore { + public manager: DataStoreManager; + public name: string; + public scope: string; + public legacy: boolean; + public baseAPIUrl: string; + public placeId: number; + public dataStoreType: DataStoreType; + public advanced: { + parseData?: (data: string) => DataType; + serializeData?: (data: DataType) => string; + }; + + constructor( + manager: DataStoreManager, + dataStoreType: DataStoreType, + placeId: number, + name: string, + scope: string | null, + legacy = false + ) { + this.manager = manager; + this.dataStoreType = dataStoreType; + this.placeId = placeId; + this.name = name; + this.scope = scope || "global"; + this.legacy = legacy; + this.baseAPIUrl = "https://gamepersistence.roblox.com/persistence/"; + this.advanced = {}; + + // Making sure we started off properly by checking all the set values + this.performPreflightChecks({}); + } + + /** + * When data is retrieved from data stores, it will be returned unmodified + * Using your own data converter will allow you to return it if you handle your data in a special way, such as + * JSON parsing it etc. + * @param {(data: string) => DataType} parseDataFunction + * @param {(data: DataType) => string} serializeDataFunction + */ + public setDataConverters( + parseDataFunction: (data: string) => DataType, + serializeDataFunction: (data: DataType) => string + ): void { + this.advanced.parseData = parseDataFunction; + this.advanced.serializeData = serializeDataFunction; + } + + buildPostDataForKey(key: string, index = 0): string { + const encodedQueryString = querystring.encode({ + [`qkeys[${index}].scope`]: this.scope + ? this.safeEncodeValue(this.scope) + : "", + [`qkeys[${index}].target`]: this.legacy ? "" : this.safeEncodeValue(key), + [`qkeys[${index}].key`]: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name) + }); + + return `&${encodedQueryString}`; + } + + buildGetUrl(): string { + const encodedQueryString = this.createQueryString({}); + + return `${this.baseAPIUrl}getV2?${encodedQueryString}`; + } + + buildSetUrl(key: string, valueLength: number): string { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + valueLength + }); + + return `${this.baseAPIUrl}set?${encodedQueryString}`; + } + + buildSetIfUrl( + key: string, + valueLength: number, + expectedValueLength: number + ): string { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + valueLength, + expectedValueLength + }); + + return `${this.baseAPIUrl}set?${encodedQueryString}`; + } + + buildIncrementUrl(key: string, delta: number): string { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key), + value: delta + }); + + return `${this.baseAPIUrl}increment?${encodedQueryString}`; + } + + buildRemoveUrl(key: string): string { + const encodedQueryString = this.createQueryString({ + key: this.legacy + ? this.safeEncodeValue(key) + : this.safeEncodeValue(this.name), + target: this.legacy ? "" : this.safeEncodeValue(key) + }); + + return `${this.baseAPIUrl}increment?${encodedQueryString}`; + } + + public parseRetrievedData(data: string): [boolean, Result | any] { + let result = ""; + + if (data.length === 0) { + return [true, result]; } - buildIncrementUrl (key: string, delta: number): string { - const encodedQueryString = this.createQueryString({ - key: this.legacy ? this.safeEncodeValue(key) : this.safeEncodeValue(this.name), - target: this.legacy ? "" : this.safeEncodeValue(key), - value: delta - }); - - return `${this.baseAPIUrl}increment?${encodedQueryString}`; + try { + result = JSON.parse(data); + } catch { + return [false, result]; } - buildRemoveUrl (key: string): string { - const encodedQueryString = this.createQueryString({ - key: this.legacy ? this.safeEncodeValue(key) : this.safeEncodeValue(this.name), - target: this.legacy ? "" : this.safeEncodeValue(key) - }); - - return `${this.baseAPIUrl}increment?${encodedQueryString}`; + return [true, result]; + } + + /** + * Retrieves the value associated with the key (if any), otherwise returns null. + * Equivalent of DataStoreService:GetDataStore("name"):GetAsync("key"); + * @param {string} key + * @returns {Promise} + */ + public async getAsync(key: string): Promise { + this.performPreflightChecks({ + key + }); + + const createdRequest = new DataStoreHttpRequest(this.manager, { + url: this.buildGetUrl(), + placeId: this.placeId, + data: this.buildPostDataForKey(key), + requestType: DataStoreRequestType.GET_ASYNC + }); + + const response = await createdRequest.send(); + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData<{ + data: { + Key: DataStoreKey; + Value: DataStoreValue; + }[]; + }>(response.body); + + if (!parsedResponseSuccess || !parsedResponse) { + throw new Error(`Failed to parse response from data stores!`); } - public parseRetrievedData (data: string): [boolean, Result | any] { - let result = ""; - - if (data.length === 0) { - return [true, result]; - } - - try { - result = JSON.parse(data); - } catch { - return [false, result]; - } - - return [true, result]; + if (parsedResponse.data && parsedResponse.data.length > 0) { + // Sending the returned data for internal processing + return this.parseIncomingData(parsedResponse.data[0].Value); + } else { + return null; } - - /** - * Retrieves the value associated with the key (if any), otherwise returns null. - * Equivalent of DataStoreService:GetDataStore("name"):GetAsync("key"); - * @param {string} key - * @returns {Promise} - */ - public async getAsync (key: string): Promise { - this.performPreflightChecks({ - key - }); - - const createdRequest = new DataStoreHttpRequest(this.manager, { - url: this.buildGetUrl(), - placeId: this.placeId, - data: this.buildPostDataForKey(key), - requestType: DataStoreRequestType.GET_ASYNC - }); - - const response = await createdRequest.send(); - const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData<{ - data: { - Key: DataStoreKey; - Value: DataStoreValue; - }[]; - }>(response.body); - - if (!parsedResponseSuccess || !parsedResponse) { - throw new Error(`Failed to parse response from data stores!`); - } - - if (parsedResponse.data && parsedResponse.data.length > 0) { - // Sending the returned data for internal processing - return this.parseIncomingData(parsedResponse.data[0].Value); - } else { - return null; - } - } - - /** - * Sets a value in data stores to the given key. - * Equivalent of DataStoreService:GetDataStore("name"):SetAsync("key", "value") - * @param {string} key - * @param {DataType} value - * @returns {Promise} - */ - public async setAsync (key: string, value: DataType): Promise { - const serializedValue = this.serializeOutgoingData(value); - this.performPreflightChecks({ - key, - value: serializedValue - }); - const createdRequest = new DataStoreHttpRequest(this.manager, { - url: this.buildSetUrl(key, serializedValue.length), - placeId: this.placeId, - data: `value=${this.safeEncodeValue(serializedValue)}`, - requestType: DataStoreRequestType.SET_ASYNC - }); - - const response = await createdRequest.send(); - const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData<{ data: string }>(response.body); - - if (!parsedResponseSuccess || !parsedResponse) { - throw new Error(`Failed to parse response!`); - } - - return this.parseIncomingData(parsedResponse.data as string); + } + + /** + * Sets a value in data stores to the given key. + * Equivalent of DataStoreService:GetDataStore("name"):SetAsync("key", "value") + * @param {string} key + * @param {DataType} value + * @returns {Promise} + */ + public async setAsync(key: string, value: DataType): Promise { + const serializedValue = this.serializeOutgoingData(value); + this.performPreflightChecks({ + key, + value: serializedValue + }); + const createdRequest = new DataStoreHttpRequest(this.manager, { + url: this.buildSetUrl(key, serializedValue.length), + placeId: this.placeId, + data: `value=${this.safeEncodeValue(serializedValue)}`, + requestType: DataStoreRequestType.SET_ASYNC + }); + + const response = await createdRequest.send(); + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData<{ + data: string; + }>(response.body); + + if (!parsedResponseSuccess || !parsedResponse) { + throw new Error(`Failed to parse response!`); } - public incrementAsync (key: string, delta = 1): Promise { - this.performPreflightChecks({ - key - }); - const createdRequest = new DataStoreHttpRequest(this.manager, { - url: this.buildIncrementUrl(key, delta), - placeId: this.placeId, - data: "", - requestType: DataStoreRequestType.INCREMENT_ASYNC - }); - - return createdRequest.send(); + return this.parseIncomingData(parsedResponse.data as string); + } + + public incrementAsync(key: string, delta = 1): Promise { + this.performPreflightChecks({ + key + }); + const createdRequest = new DataStoreHttpRequest(this.manager, { + url: this.buildIncrementUrl(key, delta), + placeId: this.placeId, + data: "", + requestType: DataStoreRequestType.INCREMENT_ASYNC + }); + + return createdRequest.send(); + } + + public removeAsync(key: string): Promise { + this.performPreflightChecks({ + key + }); + const createdRequest = new DataStoreHttpRequest(this.manager, { + url: this.buildRemoveUrl(key), + placeId: this.placeId, + data: "", + requestType: DataStoreRequestType.SET_ASYNC + }); + + return createdRequest.send(); + } + + public createQueryString(addition: Record) { + return querystring.encode({ + placeId: this.placeId, + type: this.dataStoreType === "GlobalDataStore" ? "standard" : "sorted", + scope: this.safeEncodeValue(this.scope), + ...addition + }); + } + + /** + * This will (possibly) use a custom provided converter function that turns string into DataType. + * @param {string} data + * @returns {DataType} + * @private + */ + parseIncomingData(data: string): DataType { + if (this.advanced.parseData) { + return this.advanced.parseData(data); + } else { + return data as unknown as DataType; } - - public removeAsync (key: string): Promise { - this.performPreflightChecks({ - key - }); - const createdRequest = new DataStoreHttpRequest(this.manager, { - url: this.buildRemoveUrl(key), - placeId: this.placeId, - data: "", - requestType: DataStoreRequestType.SET_ASYNC - }); - - return createdRequest.send(); + } + + /** + * This will (possibly) use a custom provided converter function that turns DataType into string so it can be saved + * to data stores + * @param {DataType} data + * @returns {string} + * @private + */ + serializeOutgoingData(data: DataType): string { + let serializedStage1: string | DataType = ""; + + if (this.advanced.serializeData) { + serializedStage1 = this.advanced.serializeData(data); + } else { + serializedStage1 = data; } - public createQueryString (addition: Record) { - return querystring.encode({ - placeId: this.placeId, - type: this.dataStoreType === "GlobalDataStore" ? "standard" : "sorted", - scope: this.safeEncodeValue(this.scope), - ...addition - }); - } + let serializedFinal: string | null = ""; - /** - * This will (possibly) use a custom provided converter function that turns string into DataType. - * @param {string} data - * @returns {DataType} - * @private - */ - parseIncomingData (data: string): DataType { - if (this.advanced.parseData) { - return this.advanced.parseData(data); - } else { - return data as DataType; - } + try { + serializedFinal = JSON.stringify(serializedStage1); + } catch { + serializedFinal = null; } - /** - * This will (possibly) use a custom provided converter function that turns DataType into string so it can be saved - * to data stores - * @param {DataType} data - * @returns {string} - * @private - */ - serializeOutgoingData (data: DataType): string { - let serializedStage1: string | DataType = ""; - - if (this.advanced.serializeData) { - serializedStage1 = this.advanced.serializeData(data); - } else { - serializedStage1 = data; - } - - let serializedFinal: string | null = ""; - - try { - serializedFinal = JSON.stringify(serializedStage1); - } catch { - serializedFinal = null; - } - - if (!serializedFinal) { - throw new Error(`Failed to serialize the data using JSON.stringify`); - } - - return serializedFinal; + if (!serializedFinal) { + throw new Error(`Failed to serialize the data using JSON.stringify`); } - safeEncodeValue (input: string) { - return encodeURIComponent(input); + return serializedFinal; + } + + safeEncodeValue(input: string) { + return encodeURIComponent(input); + } + + /** + * Performs various checks before sending any requests to make sure the requests are valid before sent + * @param {{key?: string, value?: DataType}} options + * @private + */ + performPreflightChecks(options: { key?: string; value?: string }) { + checkScope(this.scope); + checkName(this.name); + checkPlaceId(this.placeId); + + if (options.key !== undefined) { + checkKey(options.key); } - - /** - * Performs various checks before sending any requests to make sure the requests are valid before sent - * @param {{key?: string, value?: DataType}} options - * @private - */ - performPreflightChecks (options: { key?: string; value?: string }) { - checkScope(this.scope); - checkName(this.name); - checkPlaceId(this.placeId); - - if (options.key !== undefined) { - checkKey(options.key); - } - if (options.value !== undefined) { - checkValue(options.value); - } + if (options.value !== undefined) { + checkValue(options.value); } + } } diff --git a/src/client/lib/DataStoreManager/structures/GlobalDataStore.ts b/src/client/lib/DataStoreManager/structures/GlobalDataStore.ts index db21ee948..ae1e227e5 100644 --- a/src/client/lib/DataStoreManager/structures/GlobalDataStore.ts +++ b/src/client/lib/DataStoreManager/structures/GlobalDataStore.ts @@ -1,9 +1,21 @@ -import GenericDataStore from "./GenericDataStore"; -import DataStoreManager from "../DataStoreManager"; +import { GenericDataStore } from "./GenericDataStore"; +import { DataStoreManager } from "../DataStoreManager"; - -export default class GlobalDataStore extends GenericDataStore { - constructor (manager: DataStoreManager, placeId: number, name: string, scope?: string, legacy?: boolean) { - super(manager, "GlobalDataStore", placeId, name, scope || null, legacy || false); - } +export class GlobalDataStore extends GenericDataStore { + constructor( + manager: DataStoreManager, + placeId: number, + name: string, + scope?: string, + legacy?: boolean + ) { + super( + manager, + "GlobalDataStore", + placeId, + name, + scope || null, + legacy || false + ); + } } diff --git a/src/client/lib/DataStoreManager/structures/OrderedDataStore.ts b/src/client/lib/DataStoreManager/structures/OrderedDataStore.ts index 7ea3f1ad7..791e34135 100644 --- a/src/client/lib/DataStoreManager/structures/OrderedDataStore.ts +++ b/src/client/lib/DataStoreManager/structures/OrderedDataStore.ts @@ -1,65 +1,86 @@ -import GenericDataStore from "./GenericDataStore"; -import DataStoreManager from "../DataStoreManager"; -import DataStoreHttpRequest from "./DataStoreHttpRequest"; -import DataStoreManagerConstants, { DataStoreRequestType } from "../util/constants"; -import OrderedDataStorePage from "./OrderedDataStorePage"; - +import { GenericDataStore } from "./GenericDataStore"; +import { DataStoreManager } from "../DataStoreManager"; +import { DataStoreHttpRequest } from "./DataStoreHttpRequest"; +import { + DataStoreManagerConstants, + DataStoreRequestType +} from "../util/constants"; +import { OrderedDataStorePage } from "./OrderedDataStorePage"; export type GetSortedUrlOptions = { - ascending?: boolean; - pageSize?: number; - minValue?: number; - maxValue?: number; - startKey?: string; + ascending?: boolean; + pageSize?: number; + minValue?: number; + maxValue?: number; + startKey?: string; }; export type OrderedDataStoreResultType = { - data: { - Entries: { - Target: string; - Value: number; - }[]; - ExclusiveStartKey: string | null; - } + data: { + Entries: { + Target: string; + Value: number; + }[]; + ExclusiveStartKey: string | null; + }; }; -export default class OrderedDataStore extends GenericDataStore { - constructor (manager: DataStoreManager, placeId: number, name: string, scope?: string, legacy?: boolean) { - super(manager, "OrderedDataStore", placeId, name, scope || null, legacy || false); - } - - public async getSortedAsync (options: GetSortedUrlOptions): Promise> { - this.performPreflightChecks({}); - const createdRequest = new DataStoreHttpRequest(this.manager, { - url: this.buildGetSortedUrl(options), - placeId: this.placeId, - data: "", - requestType: DataStoreRequestType.GET_SORTED_ASYNC_PAGE - }); +export class OrderedDataStore extends GenericDataStore { + constructor( + manager: DataStoreManager, + placeId: number, + name: string, + scope?: string, + legacy?: boolean + ) { + super( + manager, + "OrderedDataStore", + placeId, + name, + scope || null, + legacy || false + ); + } - const response = await createdRequest.send(); + public async getSortedAsync( + options: GetSortedUrlOptions + ): Promise> { + this.performPreflightChecks({}); + const createdRequest = new DataStoreHttpRequest(this.manager, { + url: this.buildGetSortedUrl(options), + placeId: this.placeId, + data: "", + requestType: DataStoreRequestType.GET_SORTED_ASYNC_PAGE + }); - const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData(response.body); + const response = await createdRequest.send(); - if (!parsedResponseSuccess) { - throw new Error(`Failed to parse response!`); - } + const [parsedResponseSuccess, parsedResponse] = this.parseRetrievedData( + response.body + ); - return new OrderedDataStorePage(this, { - options, - result: parsedResponse - }); + if (!parsedResponseSuccess) { + throw new Error(`Failed to parse response!`); } - private buildGetSortedUrl (options: GetSortedUrlOptions) { - const encodedQueryString = this.createQueryString({ - key: this.safeEncodeValue(this.name), - pageSize: options.pageSize || DataStoreManagerConstants.DFInt.DataStoreMaxPageSize, - ascending: options.ascending ? "True" : "False", - inclusiveMinValue: options.minValue, - inclusiveMaxValue: options.maxValue, - exclusiveStartKey: options.startKey - }); + return new OrderedDataStorePage(this, { + options, + result: parsedResponse + }); + } - return `${this.baseAPIUrl}getSortedValues?${encodedQueryString}`; - } + private buildGetSortedUrl(options: GetSortedUrlOptions) { + const encodedQueryString = this.createQueryString({ + key: this.safeEncodeValue(this.name), + pageSize: + options.pageSize || + DataStoreManagerConstants.DFInt.DataStoreMaxPageSize, + ascending: options.ascending ? "True" : "False", + inclusiveMinValue: options.minValue, + inclusiveMaxValue: options.maxValue, + exclusiveStartKey: options.startKey + }); + + return `${this.baseAPIUrl}getSortedValues?${encodedQueryString}`; + } } diff --git a/src/client/lib/DataStoreManager/structures/OrderedDataStorePage.ts b/src/client/lib/DataStoreManager/structures/OrderedDataStorePage.ts index f35203316..340608941 100644 --- a/src/client/lib/DataStoreManager/structures/OrderedDataStorePage.ts +++ b/src/client/lib/DataStoreManager/structures/OrderedDataStorePage.ts @@ -1,30 +1,36 @@ -import OrderedDataStore, { GetSortedUrlOptions, OrderedDataStoreResultType } from "./OrderedDataStore"; +import { + OrderedDataStore, + GetSortedUrlOptions, + OrderedDataStoreResultType +} from "./OrderedDataStore"; +export class OrderedDataStorePage { + public orderedDataStore: OrderedDataStore; + public options: GetSortedUrlOptions; + public data: { key: string; value: number }[]; + public startKey: string | null; -export default class OrderedDataStorePage { - public orderedDataStore: OrderedDataStore; - public options: GetSortedUrlOptions; - public data: { key: string; value: number }[]; - public startKey: string | null; + constructor( + orderedDataStore: OrderedDataStore, + data: { options: GetSortedUrlOptions; result: OrderedDataStoreResultType } + ) { + this.orderedDataStore = orderedDataStore; + this.options = data.options; + this.data = data.result.data.Entries.map((x) => ({ + key: x.Target, + value: x.Value + })); + this.startKey = data.result.data.ExclusiveStartKey; + } - constructor (orderedDataStore: OrderedDataStore, data: { options: GetSortedUrlOptions; result: OrderedDataStoreResultType }) { - this.orderedDataStore = orderedDataStore; - this.options = data.options; - this.data = data.result.data.Entries.map(x => ({ - key: x.Target, - value: x.Value - })); - this.startKey = data.result.data.ExclusiveStartKey; + fetchNextPage(): Promise> { + if (!this.startKey) { + throw new Error(`There is no next page!`); } - fetchNextPage (): Promise> { - if (!this.startKey) { - throw new Error(`There is no next page!`); - } - - return this.orderedDataStore.getSortedAsync({ - ...this.options, - startKey: this.startKey - }); - } + return this.orderedDataStore.getSortedAsync({ + ...this.options, + startKey: this.startKey + }); + } } diff --git a/src/client/lib/DataStoreManager/util/checks.ts b/src/client/lib/DataStoreManager/util/checks.ts index e3bea1124..c646b7419 100644 --- a/src/client/lib/DataStoreManager/util/checks.ts +++ b/src/client/lib/DataStoreManager/util/checks.ts @@ -1,42 +1,61 @@ -import DataStoreManagerConstants from "./constants"; - - -export function checkKey (key: string): boolean { - if (key.length === 0 || key.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { - throw new Error(`Key cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); - } - - return true; +import { DataStoreManagerConstants } from "./constants"; + +export function checkKey(key: string): boolean { + if ( + key.length === 0 || + key.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit + ) { + throw new Error( + `Key cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!` + ); + } + + return true; } -export function checkPlaceId (placeId: number): boolean { - if (placeId < 1) { - throw new Error(`Place ID must be greater than 1`); - } +export function checkPlaceId(placeId: number): boolean { + if (placeId < 1) { + throw new Error(`Place ID must be greater than 1`); + } - return true; + return true; } -export function checkName (name: string): boolean { - if (name.length === 0 || name.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { - throw new Error(`DataStore name cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); - } - - return true; +export function checkName(name: string): boolean { + if ( + name.length === 0 || + name.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit + ) { + throw new Error( + `DataStore name cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!` + ); + } + + return true; } -export function checkScope (scope: string): boolean { - if (scope.length === 0 || scope.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit) { - throw new Error(`DataStore scope cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!`); - } - - return true; +export function checkScope(scope: string): boolean { + if ( + scope.length === 0 || + scope.length > DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit + ) { + throw new Error( + `DataStore scope cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreKeyLengthLimit} characters!` + ); + } + + return true; } -export function checkValue (value: string): boolean { - if (value.length === 0 || value.length > DataStoreManagerConstants.DFInt.DataStoreMaxValueSize) { - throw new Error(`DataStore values cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreMaxValueSize} characters!`); - } - - return true; +export function checkValue(value: string): boolean { + if ( + value.length === 0 || + value.length > DataStoreManagerConstants.DFInt.DataStoreMaxValueSize + ) { + throw new Error( + `DataStore values cannot be blank or be more than ${DataStoreManagerConstants.DFInt.DataStoreMaxValueSize} characters!` + ); + } + + return true; } diff --git a/src/client/lib/DataStoreManager/util/constants.ts b/src/client/lib/DataStoreManager/util/constants.ts index 7a9b72ed5..98aa1ce39 100644 --- a/src/client/lib/DataStoreManager/util/constants.ts +++ b/src/client/lib/DataStoreManager/util/constants.ts @@ -1,23 +1,20 @@ export enum DataStoreRequestType { - GET_ASYNC = 5, - UPDATE_ASYNC = 6, - SET_ASYNC = 7, - INCREMENT_ASYNC = 8, - GET_SORTED_ASYNC_PAGE = 9 + GET_ASYNC = 5, + UPDATE_ASYNC = 6, + SET_ASYNC = 7, + INCREMENT_ASYNC = 8, + GET_SORTED_ASYNC_PAGE = 9 } - -const DataStoreManagerConstants = { - DFFlag: { - UseNewDataStoreRequestSetTimestampBehaviour: false, - GetGlobalDataStorePcallFix: false, - UseUnstableDevGetAsyncUrl: false - }, - DFInt: { - DataStoreMaxValueSize: 64 * 1024, - DataStoreMaxPageSize: 100, - DataStoreKeyLengthLimit: 50 - } +export const DataStoreManagerConstants = { + DFFlag: { + UseNewDataStoreRequestSetTimestampBehaviour: false, + GetGlobalDataStorePcallFix: false, + UseUnstableDevGetAsyncUrl: false + }, + DFInt: { + DataStoreMaxValueSize: 64 * 1024, + DataStoreMaxPageSize: 100, + DataStoreKeyLengthLimit: 50 + } }; - -export default DataStoreManagerConstants; diff --git a/src/controllers/index.ts b/src/controllers/index.ts index c7a7cefcc..3791424a8 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -1,8 +1,7 @@ -import rest from "./rest"; - +import { RESTController } from "./rest"; const controllers = { - rest + rest: RESTController }; export default controllers; diff --git a/src/controllers/rest/RESTController.ts b/src/controllers/rest/RESTController.ts index 7f08cabde..d7e13624e 100644 --- a/src/controllers/rest/RESTController.ts +++ b/src/controllers/rest/RESTController.ts @@ -1,234 +1,240 @@ -import Client from "../../client/Client"; +import { Client } from "../../client/Client"; import { Cookie, CookieJar } from "tough-cookie"; import { - DefaultCreateCookieOptions, - DefaultRESTControllerOptions, - RESTControllerOptions, - RESTCreateCookieOptions, - RESTRequester, - RESTRequestHandler, - RESTRequestOptions, - RESTResponseDataType, - RESTResponseHandler + DefaultCreateCookieOptions, + DefaultRESTControllerOptions, + RESTControllerOptions, + RESTCreateCookieOptions, + RESTRequester, + RESTRequestHandler, + RESTRequestOptions, + RESTResponseDataType, + RESTResponseHandler } from "../../interfaces/RESTInterfaces"; -import updateXCSRFToken from "./lib/updateXCSRFToken"; -import RESTRequest from "./request"; -import responseHandlers from "./response/handlers"; -import getRequester from "./lib/getRequester"; +import { updateXCSRFToken } from "./lib/updateXCSRFToken"; +import { RESTRequest } from "./request"; +import { responseHandlers } from "./response/handlers"; +import { getRequester } from "./lib/getRequester"; import { utilMergeDeep } from "../../util/utilFunctions"; - -class RESTController { - public client: Client; - public options: RESTControllerOptions; - public requester: RESTRequester; - public cookieJar: CookieJar; - public responseHandlers: RESTResponseHandler[]; - public requestHandlers: RESTRequestHandler[]; - - - constructor (client: Client, options?: RESTControllerOptions) { - /** - * The client - */ - this.client = client; - /** - * The options for this RESTController - */ - this.options = this.setOptions(options || this.client.options.rest); - /** - * The cookie jar - */ - this.cookieJar = new CookieJar(); - /** - * Functions to go through to validate / modify the response - */ - this.responseHandlers = [ - ...responseHandlers - ]; - /** - * Functions to go through to modify the request - */ - this.requestHandlers = []; - /** - * The function that's being used to perform the requests, can be modified - */ - this.requester = getRequester(this, this.options.requester || undefined) as RESTRequester; - } - - /** - * Sends a request - * @param {RequestOptions} options The options - * @returns {Promise} - */ - request (options: RESTRequestOptions): Promise { - const request = new RESTRequest(this, options); - - return request.send(); - } - - /** - * Fetches a new XCSRF token - */ - - fetchXCSRFToken (): Promise { - return updateXCSRFToken(this) - .then(xcsrfToken => { - this.setXCSRFToken(xcsrfToken); - return xcsrfToken; - }); - } - - /** - * Sets the XCSRF token - * @param {string} token The xcsrf token to use in future requets - */ - setXCSRFToken (token: string): void { - this.options.xcsrf = token; - this.options.xcsrfSet = Date.now(); - } - - /** - * Gets the existing XCSRF token if it's not older than set refresh interval, - * otherwise, fetch a new one - */ - async getXCSRFToken (): Promise { - if (!this.options.xcsrf || (Date.now() - (this.options.xcsrfSet || 0)) >= (this.options.xcsrfRefreshInterval || DefaultRESTControllerOptions.xcsrfRefreshInterval)) { - // Refresh token - await this.fetchXCSRFToken() - .then(token => { - this.setXCSRFToken(token); - }); - } - - return this.options.xcsrf; - } - - /** - * Creates a new cookie and returns it, no side effects - * @param {RESTCreateCookieOptions} cookieOptions The options to use - * @returns {Cookie} - */ - createCookie (cookieOptions: RESTCreateCookieOptions): Cookie { - return new Cookie({ - ...DefaultCreateCookieOptions, - ...cookieOptions - }); - } - - /** - * Adds a cookie to the cookie jar - * @param {Cookie} cookie The cookie to add - * @param {?string} domain The domain to add it for - * @param {Object} setCookieOptions Options for setting the cookie - * @returns {Cookie} - */ - addCookie (cookie: Cookie, domain?: string, setCookieOptions?: any): Cookie { - return this.cookieJar.setCookieSync(cookie, domain || "https://roblox.com", setCookieOptions || {}); - } - - /** - * Gets the cookies for a given domain stored in the jar - * @param {string} domain The domain to retrieve the cookies for - * @returns {Cookie[]} - */ - getCookies (domain: string): Cookie[] { - return this.cookieJar.getCookiesSync(domain); - } - - /** - * Adds a response handler - * @param {Function} handler The response handler - */ - addResponseHandler (handler: RESTResponseHandler): void { - this.responseHandlers.push(handler); - } - - /** - * Adds a request handler - * @param {Function} handler The request handler - */ - addRequestHandler (handler: RESTRequestHandler): void { - this.requestHandlers.push(handler); - } - - /** - * Sets the proxy for the requests - * @param {string} proxyURL The proxy URL - */ - setProxy (proxyURL: string): void { - this.options.proxy = proxyURL; - } - - /** - * Gets the proxy used - * @returns {string | undefined} - */ - getProxy (): string | undefined { - return this.options.proxy; - } - - /** - * Sets the user agents for future requests - * @param {string} userAgent The user agent to use - */ - setUserAgent (userAgent: string): void { - this.options.userAgent = userAgent; - } - - /** - * Gets the user agent - * @returns {string | undefined} - */ - getUserAgent (): string | undefined { - return this.options.userAgent; - } - - /** - * Sets the XCSRF token refresh interval - * @param {number} xcsrfRefreshInterval The time in ms to use - */ - setXCSRFTokenRefreshInterval (xcsrfRefreshInterval: number): void { - this.options.xcsrfRefreshInterval = xcsrfRefreshInterval; - } - - /** - * Gets the XCSRF token refresh interval - * @returns {number | undefined} - */ - getXCSRFTokenRefreshInterval (): number | undefined { - return this.options.xcsrfRefreshInterval; - } - - /** - * Sets the amount of retries to be made to refresh XCSRF - * tokens on Token Validation errors - * @param {number} xcsrfRefreshMaxRetries Number of retries - */ - setXCSRFTokenRefreshMaxRetries (xcsrfRefreshMaxRetries: number): void { - this.options.xcsrfRefreshMaxRetries = xcsrfRefreshMaxRetries; - } - - /** - * Gets the amount of retries to be made to refresh XCSRF - * tokens on Token Validation errors - * @returns {number | undefined} - */ - getXCSRFTokenRefreshMaxRetries (): number | undefined { - return this.options.xcsrfRefreshMaxRetries; - } - - /** - * Sets the options for the RESTController - * @param {RESTControllerOptions} options The options to use - * @returns {RESTControllerOptions} - */ - setOptions (options?: RESTControllerOptions): RESTControllerOptions { - this.options = utilMergeDeep(DefaultRESTControllerOptions, options || {}) as RESTControllerOptions; - - return this.options; - } +export class RESTController { + public client: Client; + public options: RESTControllerOptions; + public requester: RESTRequester; + public cookieJar: CookieJar; + public responseHandlers: RESTResponseHandler[]; + public requestHandlers: RESTRequestHandler[]; + + constructor(client: Client, options?: RESTControllerOptions) { + /** + * The client + */ + this.client = client; + /** + * The options for this RESTController + */ + this.options = this.setOptions(options || this.client.options.rest); + /** + * The cookie jar + */ + this.cookieJar = new CookieJar(); + /** + * Functions to go through to validate / modify the response + */ + this.responseHandlers = [...responseHandlers]; + /** + * Functions to go through to modify the request + */ + this.requestHandlers = []; + /** + * The function that's being used to perform the requests, can be modified + */ + this.requester = getRequester( + this, + this.options.requester || undefined + ) as RESTRequester; + } + + /** + * Sends a request + * @param {RequestOptions} options The options + * @returns {Promise} + */ + request(options: RESTRequestOptions): Promise { + const request = new RESTRequest(this, options); + + return request.send(); + } + + /** + * Fetches a new XCSRF token + */ + + fetchXCSRFToken(): Promise { + return updateXCSRFToken(this).then((xcsrfToken) => { + this.setXCSRFToken(xcsrfToken); + return xcsrfToken; + }); + } + + /** + * Sets the XCSRF token + * @param {string} token The xcsrf token to use in future requets + */ + setXCSRFToken(token: string): void { + this.options.xcsrf = token; + this.options.xcsrfSet = Date.now(); + } + + /** + * Gets the existing XCSRF token if it's not older than set refresh interval, + * otherwise, fetch a new one + */ + async getXCSRFToken(): Promise { + if ( + !this.options.xcsrf || + Date.now() - (this.options.xcsrfSet || 0) >= + (this.options.xcsrfRefreshInterval || + DefaultRESTControllerOptions.xcsrfRefreshInterval) + ) { + // Refresh token + await this.fetchXCSRFToken().then((token) => { + this.setXCSRFToken(token); + }); + } + + return this.options.xcsrf; + } + + /** + * Creates a new cookie and returns it, no side effects + * @param {RESTCreateCookieOptions} cookieOptions The options to use + * @returns {Cookie} + */ + createCookie(cookieOptions: RESTCreateCookieOptions): Cookie { + return new Cookie({ + ...DefaultCreateCookieOptions, + ...cookieOptions + }); + } + + /** + * Adds a cookie to the cookie jar + * @param {Cookie} cookie The cookie to add + * @param {?string} domain The domain to add it for + * @param {Object} setCookieOptions Options for setting the cookie + * @returns {Cookie} + */ + addCookie(cookie: Cookie, domain?: string, setCookieOptions?: any): Cookie { + return this.cookieJar.setCookieSync( + cookie, + domain || "https://roblox.com", + setCookieOptions || {} + ); + } + + /** + * Gets the cookies for a given domain stored in the jar + * @param {string} domain The domain to retrieve the cookies for + * @returns {Cookie[]} + */ + getCookies(domain: string): Cookie[] { + return this.cookieJar.getCookiesSync(domain); + } + + /** + * Adds a response handler + * @param {Function} handler The response handler + */ + addResponseHandler(handler: RESTResponseHandler): void { + this.responseHandlers.push(handler); + } + + /** + * Adds a request handler + * @param {Function} handler The request handler + */ + addRequestHandler(handler: RESTRequestHandler): void { + this.requestHandlers.push(handler); + } + + /** + * Sets the proxy for the requests + * @param {string} proxyURL The proxy URL + */ + setProxy(proxyURL: string): void { + this.options.proxy = proxyURL; + } + + /** + * Gets the proxy used + * @returns {string | undefined} + */ + getProxy(): string | undefined { + return this.options.proxy; + } + + /** + * Sets the user agents for future requests + * @param {string} userAgent The user agent to use + */ + setUserAgent(userAgent: string): void { + this.options.userAgent = userAgent; + } + + /** + * Gets the user agent + * @returns {string | undefined} + */ + getUserAgent(): string | undefined { + return this.options.userAgent; + } + + /** + * Sets the XCSRF token refresh interval + * @param {number} xcsrfRefreshInterval The time in ms to use + */ + setXCSRFTokenRefreshInterval(xcsrfRefreshInterval: number): void { + this.options.xcsrfRefreshInterval = xcsrfRefreshInterval; + } + + /** + * Gets the XCSRF token refresh interval + * @returns {number | undefined} + */ + getXCSRFTokenRefreshInterval(): number | undefined { + return this.options.xcsrfRefreshInterval; + } + + /** + * Sets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @param {number} xcsrfRefreshMaxRetries Number of retries + */ + setXCSRFTokenRefreshMaxRetries(xcsrfRefreshMaxRetries: number): void { + this.options.xcsrfRefreshMaxRetries = xcsrfRefreshMaxRetries; + } + + /** + * Gets the amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + * @returns {number | undefined} + */ + getXCSRFTokenRefreshMaxRetries(): number | undefined { + return this.options.xcsrfRefreshMaxRetries; + } + + /** + * Sets the options for the RESTController + * @param {RESTControllerOptions} options The options to use + * @returns {RESTControllerOptions} + */ + setOptions(options?: RESTControllerOptions): RESTControllerOptions { + this.options = utilMergeDeep( + DefaultRESTControllerOptions, + options || {} + ) as RESTControllerOptions; + + return this.options; + } } - - -export default RESTController; diff --git a/src/controllers/rest/index.ts b/src/controllers/rest/index.ts index 96a9592c2..67f3f39a4 100644 --- a/src/controllers/rest/index.ts +++ b/src/controllers/rest/index.ts @@ -1 +1 @@ -export { default } from "./RESTController"; +export { RESTController } from "./RESTController"; diff --git a/src/controllers/rest/lib/getRequester.ts b/src/controllers/rest/lib/getRequester.ts index 6833da4c3..c525ebe8b 100644 --- a/src/controllers/rest/lib/getRequester.ts +++ b/src/controllers/rest/lib/getRequester.ts @@ -1,20 +1,29 @@ -import RESTController from "../RESTController"; +import { RESTController } from "../RESTController"; +import got from "got"; +export function getRequester( + controller: RESTController, + customRequester?: RESTController["requester"] +) { + if ( + !controller.requester && + !controller.client.options.rest!.requester && + customRequester === undefined + ) { + let requester: null | any; -export default function getRequester (controller: RESTController, customRequester?: RESTController["requester"]) { - if (!controller.requester && !controller.client.options.rest!.requester && customRequester === undefined) { - let requester: null | any; - - try { - requester = require("got"); - } catch (e) { - throw new Error(`Failed to retrieve module "got" and no custom requester provided!`); - } - - controller.requester = requester; - } else { - controller.requester = customRequester!; + try { + requester = got; + } catch (e) { + throw new Error( + `Failed to retrieve module "got" and no custom requester provided!` + ); } - return controller.requester; + controller.requester = requester; + } else { + controller.requester = customRequester!; + } + + return controller.requester; } diff --git a/src/controllers/rest/lib/updateXCSRFToken.ts b/src/controllers/rest/lib/updateXCSRFToken.ts index 1ad0aadcc..b760af3e7 100644 --- a/src/controllers/rest/lib/updateXCSRFToken.ts +++ b/src/controllers/rest/lib/updateXCSRFToken.ts @@ -1,25 +1,29 @@ -import RESTController from "../RESTController"; +import { RESTController } from "../RESTController"; - -export default function updateXCSRFToken (restController: RESTController): Promise { - return restController.request({ - url: "https://auth.roblox.com/v2/login", - method: "POST", - xcsrf: false, - checks: { - xcsrf: false - }, - responseOptions: { - allowedStatusCodes: [403] - } +export function updateXCSRFToken( + restController: RESTController +): Promise { + return restController + .request({ + url: "https://auth.roblox.com/v2/login", + method: "POST", + xcsrf: false, + checks: { + xcsrf: false + }, + responseOptions: { + allowedStatusCodes: [403] + } }) - .then(response => { - const foundXcsrfToken = response.headers["x-csrf-token"]; + .then((response) => { + const foundXcsrfToken = response.headers["x-csrf-token"]; - if (!foundXcsrfToken) { - throw new Error(`x-csrf-token was not returned by Roblox. Unable to fetch the token!`); - } else { - return foundXcsrfToken; - } - }); + if (!foundXcsrfToken) { + throw new Error( + `x-csrf-token was not returned by Roblox. Unable to fetch the token!` + ); + } else { + return foundXcsrfToken; + } + }); } diff --git a/src/controllers/rest/request/RESTRequest.ts b/src/controllers/rest/request/RESTRequest.ts index 30d12565d..f34862967 100644 --- a/src/controllers/rest/request/RESTRequest.ts +++ b/src/controllers/rest/request/RESTRequest.ts @@ -1,50 +1,51 @@ import { - DefaultRESTRequestOptions, - RESTRequestOptions, - RESTResponseDataType + DefaultRESTRequestOptions, + RESTRequestOptions, + RESTResponseDataType } from "../../../interfaces/RESTInterfaces"; -import RESTController from "../RESTController"; -import prepare from "./prepare"; -import RESTResponse from "../response"; +import { RESTController } from "../RESTController"; +import { prepare } from "./prepare"; +import { RESTResponse } from "../response"; import { utilMergeDeep } from "../../../util/utilFunctions"; - -class RESTRequest { - public controller: RESTController; - /** - * The options that will be used for sending the request - */ - public requestOptions: RESTRequestOptions; - - /** - * The amount of times this request has been executed - */ - public attempts: number; - - constructor (controller: RESTController, options: RESTRequestOptions) { - this.controller = controller; - this.requestOptions = options; - this.attempts = 0; - } - - setOptions (options: RESTRequestOptions): RESTRequestOptions { - // As lodash overwrites all entries that are provided with each other, it also mutates the default - // This way, it creates a clone of the default each time, so there's "new" default data each time - this.requestOptions = utilMergeDeep(JSON.parse(JSON.stringify(DefaultRESTRequestOptions)), options || {}) as RESTRequestOptions; - return this.requestOptions; - } - - async send (options?: RESTRequestOptions): Promise { - await prepare(this, options || this.requestOptions); - await Promise.all(this.controller.requestHandlers.map(handler => handler(this))); - - const responseData = await this.controller.requester(this.requestOptions); - this.attempts++; - - const response = new RESTResponse(this.controller, this, responseData); - return response.process(); - } +export class RESTRequest { + public controller: RESTController; + /** + * The options that will be used for sending the request + */ + public requestOptions: RESTRequestOptions; + + /** + * The amount of times this request has been executed + */ + public attempts: number; + + constructor(controller: RESTController, options: RESTRequestOptions) { + this.controller = controller; + this.requestOptions = options; + this.attempts = 0; + } + + setOptions(options: RESTRequestOptions): RESTRequestOptions { + // As lodash overwrites all entries that are provided with each other, it also mutates the default + // This way, it creates a clone of the default each time, so there's "new" default data each time + this.requestOptions = utilMergeDeep( + JSON.parse(JSON.stringify(DefaultRESTRequestOptions)), + options || {} + ) as RESTRequestOptions; + return this.requestOptions; + } + + async send(options?: RESTRequestOptions): Promise { + await prepare(this, options || this.requestOptions); + await Promise.all( + this.controller.requestHandlers.map((handler) => handler(this)) + ); + + const responseData = await this.controller.requester(this.requestOptions); + this.attempts++; + + const response = new RESTResponse(this.controller, this, responseData); + return response.process(); + } } - - -export default RESTRequest; diff --git a/src/controllers/rest/request/index.ts b/src/controllers/rest/request/index.ts index bf3bd9dd6..c83b23eaf 100644 --- a/src/controllers/rest/request/index.ts +++ b/src/controllers/rest/request/index.ts @@ -1 +1 @@ -export { default } from "./RESTRequest"; +export { RESTRequest } from "./RESTRequest"; diff --git a/src/controllers/rest/request/prepare.ts b/src/controllers/rest/request/prepare.ts index ab3969f52..bfa8f2607 100644 --- a/src/controllers/rest/request/prepare.ts +++ b/src/controllers/rest/request/prepare.ts @@ -1,55 +1,73 @@ import { RESTRequestOptions } from "../../../interfaces/RESTInterfaces"; -import RESTRequest from "./"; +import { RESTRequest } from "./"; import querystring from "querystring"; +export async function prepare( + request: RESTRequest, + options: RESTRequestOptions +): Promise { + request.setOptions(options); -export default async function prepare (request: RESTRequest, options: RESTRequestOptions): Promise { - request.setOptions(options); - - if (!request.requestOptions.url) { - throw new Error("No url was provided when executing rest.request.prepare"); - } - if (!request.requestOptions.headers) { - request.requestOptions.headers = {}; - } - if (request.requestOptions.followAllRedirects !== false) { - request.requestOptions.followAllRedirects = true; - } - if (!request.requestOptions.method) { - request.requestOptions.method = "GET"; - } - if (request.requestOptions.qs) { - if (!request.requestOptions.url.includes("?")) { - request.requestOptions.url += `?${querystring.stringify(request.requestOptions.qs as Record)}`; - } else { - request.requestOptions.url += `&${querystring.stringify(request.requestOptions.qs as Record)}`; - } - } - if ((request.requestOptions.xcsrf !== false && request.requestOptions.method.toLowerCase() !== "get") || request.requestOptions.xcsrf === true) { - request.requestOptions.headers = { - ...request.requestOptions.headers, - "X-CSRF-TOKEN": await request.controller.getXCSRFToken() - }; - if (!request.requestOptions.responseOptions) { - request.requestOptions.responseOptions = {}; - } - if (!request.requestOptions.responseOptions.disallowedStatusMessages) { - request.requestOptions.responseOptions.disallowedStatusMessages = []; - } - request.requestOptions.responseOptions.disallowedStatusMessages.push("Token Validation Failed"); + if (!request.requestOptions.url) { + throw new Error("No url was provided when executing rest.request.prepare"); + } + if (!request.requestOptions.headers) { + request.requestOptions.headers = {}; + } + if (request.requestOptions.followAllRedirects !== false) { + request.requestOptions.followAllRedirects = true; + } + if (!request.requestOptions.method) { + request.requestOptions.method = "GET"; + } + if (request.requestOptions.qs) { + if (!request.requestOptions.url.includes("?")) { + request.requestOptions.url += `?${querystring.stringify( + request.requestOptions.qs as Record + )}`; + } else { + request.requestOptions.url += `&${querystring.stringify( + request.requestOptions.qs as Record + )}`; } - if (request.requestOptions.json) { - request.requestOptions.body = typeof request.requestOptions.json === "string" ? request.requestOptions.json : JSON.stringify(request.requestOptions.json); - request.requestOptions.headers["content-type"] = "application/json"; - delete request.requestOptions.json; + } + if ( + (request.requestOptions.xcsrf !== false && + request.requestOptions.method.toLowerCase() !== "get") || + request.requestOptions.xcsrf === true + ) { + request.requestOptions.headers = { + ...request.requestOptions.headers, + "X-CSRF-TOKEN": await request.controller.getXCSRFToken() + }; + if (!request.requestOptions.responseOptions) { + request.requestOptions.responseOptions = {}; } - if (!request.requestOptions.excludeCookies) { - request.requestOptions.headers.Cookie = request.controller.cookieJar.getCookieStringSync(request.requestOptions.url); + if (!request.requestOptions.responseOptions.disallowedStatusMessages) { + request.requestOptions.responseOptions.disallowedStatusMessages = []; } + request.requestOptions.responseOptions.disallowedStatusMessages.push( + "Token Validation Failed" + ); + } + if (request.requestOptions.json) { + request.requestOptions.body = + typeof request.requestOptions.json === "string" + ? request.requestOptions.json + : JSON.stringify(request.requestOptions.json); + request.requestOptions.headers["content-type"] = "application/json"; + delete request.requestOptions.json; + } + if (!request.requestOptions.excludeCookies) { + request.requestOptions.headers.Cookie = + request.controller.cookieJar.getCookieStringSync( + request.requestOptions.url + ); + } - // -- Utilities + // -- Utilities - // Making sure the library does not throw errors if the request fails for some reason - // We want to handle any issues ourselves - request.requestOptions.throwHttpErrors = false; + // Making sure the library does not throw errors if the request fails for some reason + // We want to handle any issues ourselves + request.requestOptions.throwHttpErrors = false; } diff --git a/src/controllers/rest/response/RESTResponse.ts b/src/controllers/rest/response/RESTResponse.ts index 33dcfae0b..ec878517e 100644 --- a/src/controllers/rest/response/RESTResponse.ts +++ b/src/controllers/rest/response/RESTResponse.ts @@ -1,42 +1,55 @@ -import RESTController from "../RESTController"; -import RESTRequest from "../request"; +import { RESTController } from "../RESTController"; +import { RESTRequest } from "../request"; import { BloxyHttpError } from "../../../util/errors/errors"; import { RESTResponseDataType } from "../../../interfaces/RESTInterfaces"; - -export default class RESTResponse { - public controller: RESTController; - public request: RESTRequest; - public responseData: RESTResponseDataType; - - // Public options: RESTResponseOptions; - - constructor (controller: RESTController, request: RESTRequest, responseData: RESTResponseDataType) { - this.controller = controller; - this.request = request; - this.responseData = responseData; - } - - async process (): Promise { - const allProcessed = this.controller.responseHandlers.map(handler => handler(this)); - - if (allProcessed.every(processed => processed === true)) { - return this.responseData; +export class RESTResponse { + public controller: RESTController; + public request: RESTRequest; + public responseData: RESTResponseDataType; + + // Public options: RESTResponseOptions; + + constructor( + controller: RESTController, + request: RESTRequest, + responseData: RESTResponseDataType + ) { + this.controller = controller; + this.request = request; + this.responseData = responseData; + } + + // eslint-disable-next-line require-await + async process(): Promise { + const allProcessed = this.controller.responseHandlers.map((handler) => + handler(this) + ); + + if (allProcessed.every((processed) => processed === true)) { + return this.responseData; + } else { + const error = allProcessed.find( + (err) => + err instanceof BloxyHttpError && + err.name === "BloxyHttpInvalidStatusMessageError" && + err.statusMessage.includes("Token Validation Failed") + ); + + if (error) { + // 1 attempt = 0 retries + if ( + this.request.attempts - 1 === + this.controller.getXCSRFTokenRefreshMaxRetries() + ) { + throw error; } else { - const error = allProcessed.find(error => error instanceof BloxyHttpError && error.name === - "BloxyInvalidStatusMessageError" && error.statusMessage.includes("Token Validation Failed")); - - if (error) { - // 1 attempt = 0 retries - if (this.request.attempts - 1 === this.controller.getXCSRFTokenRefreshMaxRetries()) { - throw error; - } else { - this.controller.options.xcsrf = undefined; - return this.request.send(); - } - } - - throw allProcessed.find(error => error instanceof Error); + this.controller.options.xcsrf = undefined; + return this.request.send(); } + } + + throw allProcessed.find((err) => err instanceof Error); } + } } diff --git a/src/controllers/rest/response/handlers/index.ts b/src/controllers/rest/response/handlers/index.ts index 0d9575a26..5ee7ec6f7 100644 --- a/src/controllers/rest/response/handlers/index.ts +++ b/src/controllers/rest/response/handlers/index.ts @@ -1,14 +1,11 @@ -import validBody from "./validBody"; -import validStatusMessage from "./validStatusMessage"; -import validStatusCode from "./validStatusCode"; -import updateHeaders from "./updateHeaders"; +import { validBody } from "./validBody"; +import { validStatusMessage } from "./validStatusMessage"; +import { validStatusCode } from "./validStatusCode"; +import { updateHeaders } from "./updateHeaders"; - -const responseHandlers = [ - updateHeaders, - validStatusCode, - validStatusMessage, - validBody +export const responseHandlers = [ + updateHeaders, + validStatusCode, + validStatusMessage, + validBody ]; - -export default responseHandlers; diff --git a/src/controllers/rest/response/handlers/updateHeaders.ts b/src/controllers/rest/response/handlers/updateHeaders.ts index 7ca1f01dc..b7672ae76 100644 --- a/src/controllers/rest/response/handlers/updateHeaders.ts +++ b/src/controllers/rest/response/handlers/updateHeaders.ts @@ -1,27 +1,26 @@ -import RESTResponse from "../RESTResponse"; +import { RESTResponse } from "../RESTResponse"; import { Cookie } from "tough-cookie"; +export function updateHeaders(response: RESTResponse): boolean { + if (response.responseData.headers["set-cookie"]) { + const setCookieHeader = response.responseData.headers["set-cookie"]; -export default function updateHeaders (response: RESTResponse): boolean { - if (response.responseData.headers["set-cookie"]) { - const setCookieHeader = response.responseData.headers["set-cookie"]; + if (Array.isArray(setCookieHeader)) { + setCookieHeader.forEach((toSetCookie) => { + const parsedCookie = Cookie.parse(toSetCookie); - if (Array.isArray(setCookieHeader)) { - setCookieHeader.forEach(toSetCookie => { - const parsedCookie = Cookie.parse(toSetCookie); - - if (parsedCookie) { - response.controller.addCookie(parsedCookie); - } - }); - } else { - const parsedCookie = Cookie.parse(setCookieHeader); - - if (parsedCookie) { - response.controller.addCookie(parsedCookie); - } + if (parsedCookie) { + response.controller.addCookie(parsedCookie); } + }); + } else { + const parsedCookie = Cookie.parse(setCookieHeader); + + if (parsedCookie) { + response.controller.addCookie(parsedCookie); + } } + } - return true; + return true; } diff --git a/src/controllers/rest/response/handlers/validBody.ts b/src/controllers/rest/response/handlers/validBody.ts index 85d775f4a..2cce3bdbc 100644 --- a/src/controllers/rest/response/handlers/validBody.ts +++ b/src/controllers/rest/response/handlers/validBody.ts @@ -1,3 +1,3 @@ -export default function validBody (): boolean { - return true; +export function validBody(): boolean { + return true; } diff --git a/src/controllers/rest/response/handlers/validStatusCode.ts b/src/controllers/rest/response/handlers/validStatusCode.ts index 47107a1f8..e02ccf381 100644 --- a/src/controllers/rest/response/handlers/validStatusCode.ts +++ b/src/controllers/rest/response/handlers/validStatusCode.ts @@ -1,39 +1,57 @@ -import RESTResponse from "../RESTResponse"; +import { RESTResponse } from "../RESTResponse"; import { BloxyHttpError } from "../../../../util/errors/errors"; +export function validStatusCode(response: RESTResponse): boolean | Error { + const { request, responseData } = response; + let isValid = true; + const responseOptions = request.requestOptions.responseOptions || {}; -export default function validStatusCode (response: RESTResponse): boolean | Error { - const { request, responseData } = response; - let isValid = true; - const responseOptions = request.requestOptions.responseOptions || {}; + if ( + request.requestOptions.responseOptions && + request.requestOptions.checks?.statusCode + ) { + const allowedStatusCodes = responseOptions.allowedStatusCodes || []; + const disallowedStatusCodes = responseOptions.disallowedStatusCodes || []; - if (request.requestOptions.responseOptions && request.requestOptions.checks?.statusCode) { - const allowedStatusCodes = responseOptions.allowedStatusCodes || []; - const disallowedStatusCodes = responseOptions.disallowedStatusCodes || []; + const isAllowed = allowedStatusCodes.some( + (statusCode: number) => responseData.statusCode === statusCode + ); + const isDisallowed = disallowedStatusCodes.some( + (statusCode: number) => responseData.statusCode === statusCode + ); - const isAllowed = allowedStatusCodes.some(statusCode => responseData.statusCode === statusCode); - const isDisallowed = disallowedStatusCodes.some(statusCode => responseData.statusCode === statusCode); - - if (allowedStatusCodes.length > 0) { - // Only these are allowed - if (!isAllowed) { - isValid = false; - } - } else if (allowedStatusCodes.length === 0 && disallowedStatusCodes.length > 0) { - // Only these are disallowed - if (isDisallowed) { - isValid = false; - } - } else if (allowedStatusCodes.length === 0 && disallowedStatusCodes.length === 0) { - // All status are allowed - } + if (allowedStatusCodes.length > 0) { + // Only these are allowed + if (!isAllowed) { + isValid = false; + } + } else if ( + allowedStatusCodes.length === 0 && + disallowedStatusCodes.length > 0 + ) { + // Only these are disallowed + if (isDisallowed) { + isValid = false; + } + } else if ( + allowedStatusCodes.length === 0 && + disallowedStatusCodes.length === 0 + ) { + // All status are allowed } + } - return isValid ? true : new BloxyHttpError({ + return isValid + ? true + : new BloxyHttpError({ statusMessage: responseData.statusMessage, statusCode: responseData.statusCode, - message: `Invalid status code in response. Body: ${responseData.body instanceof Object ? JSON.stringify(responseData.body) : responseData.body}`, + message: `Invalid status code in response. Body: ${ + responseData.body instanceof Object + ? JSON.stringify(responseData.body) + : responseData.body + }`, name: "BloxyHttpInvalidStatusCodeError", possibleReasons: [] - }); + }); } diff --git a/src/controllers/rest/response/handlers/validStatusMessage.ts b/src/controllers/rest/response/handlers/validStatusMessage.ts index ceb496252..f81ee67ca 100644 --- a/src/controllers/rest/response/handlers/validStatusMessage.ts +++ b/src/controllers/rest/response/handlers/validStatusMessage.ts @@ -1,42 +1,55 @@ -import RESTResponse from "../RESTResponse"; +import { RESTResponse } from "../RESTResponse"; import { BloxyHttpError } from "../../../../util/errors/errors"; +export function validStatusMessage(response: RESTResponse): boolean | Error { + const { request, responseData } = response; + const responseOptions = request.requestOptions.responseOptions || {}; + let isValid = true; -export default function validStatusMessage (response: RESTResponse): boolean | Error { - const { request, responseData } = response; - const responseOptions = request.requestOptions.responseOptions || {}; - let isValid = true; + if ( + request.requestOptions.responseOptions && + request.requestOptions.checks?.statusMessage + ) { + const allowedStatusMessages = responseOptions.allowedStatusMessages || []; + const disallowedStatusMessages = + responseOptions.disallowedStatusMessages || []; - if (request.requestOptions.responseOptions && request.requestOptions.checks?.statusMessage) { - const allowedStatusMessages = responseOptions.allowedStatusMessages || []; - const disallowedStatusMessages = responseOptions.disallowedStatusMessages || []; + const isAllowed = allowedStatusMessages.some((statusMessage: string) => + responseData.statusMessage.toLowerCase().includes(statusMessage) + ); + const isDisallowed = disallowedStatusMessages.some( + (statusMessage: string) => + responseData.statusMessage.toLowerCase().includes(statusMessage) + ); - const isAllowed = allowedStatusMessages.some(statusMessage => responseData.statusMessage.toLowerCase() - .includes(statusMessage)); - const isDisallowed = disallowedStatusMessages.some(statusMessage => responseData.statusMessage - .toLowerCase().includes(statusMessage)); - - if (allowedStatusMessages.length > 0) { - // Only these are allowed - if (!isAllowed) { - isValid = false; - } - } else if (allowedStatusMessages.length === 0 && disallowedStatusMessages.length > 0) { - // Only these are disallowed - if (isDisallowed) { - isValid = false; - } - } else if (allowedStatusMessages.length === 0 && disallowedStatusMessages.length === 0) { - // All status are allowed - } + if (allowedStatusMessages.length > 0) { + // Only these are allowed + if (!isAllowed) { + isValid = false; + } + } else if ( + allowedStatusMessages.length === 0 && + disallowedStatusMessages.length > 0 + ) { + // Only these are disallowed + if (isDisallowed) { + isValid = false; + } + } else if ( + allowedStatusMessages.length === 0 && + disallowedStatusMessages.length === 0 + ) { + // All status are allowed } + } - return isValid ? true : new BloxyHttpError({ + return isValid + ? true + : new BloxyHttpError({ statusCode: responseData.statusCode, statusMessage: responseData.statusMessage, message: `Invalid status message detected in response.`, name: "BloxyHttpInvalidStatusMessageError", possibleReasons: [] - }); + }); } - diff --git a/src/controllers/rest/response/index.ts b/src/controllers/rest/response/index.ts index e960e903a..fa4300af3 100644 --- a/src/controllers/rest/response/index.ts +++ b/src/controllers/rest/response/index.ts @@ -1 +1 @@ -export { default } from "./RESTResponse"; +export { RESTResponse } from "./RESTResponse"; diff --git a/src/index.ts b/src/index.ts index bf892f388..f5c2e1ce9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,44 @@ -export { default as Client } from "./client"; +export { Client } from "./client"; + +// Generic Types +export * from "./types/GenericTypes"; +export * from "./types/GenericOptionTypes"; + +// APIs +export * from "./client/apis/AccountInformationAPI"; +export * from "./client/apis/AccountSettingsAPI"; +export * from "./client/apis/AdConfigurationAPI"; +export * from "./client/apis/AssetDeliveryAPI"; +export * from "./client/apis/AuthAPI"; +export * from "./client/apis/AvatarAPI"; +export * from "./client/apis/BadgesAPI"; +export * from "./client/apis/BaseAPI"; +export * from "./client/apis/BillingAPI"; +export * from "./client/apis/CatalogAPI"; +export * from "./client/apis/ChatAPI"; +export * from "./client/apis/ContactsAPI"; +export * from "./client/apis/DataAPI"; +export * from "./client/apis/DevelopAPI"; +export * from "./client/apis/EconomyAPI"; +export * from "./client/apis/EconomyCreatorStatsAPI"; +export * from "./client/apis/EngagementPayoutsAPI"; +export * from "./client/apis/FollowingsAPI"; +export * from "./client/apis/FriendsAPI"; +export * from "./client/apis/GameInternationalizationAPI"; +export * from "./client/apis/GamesAPI"; +export * from "./client/apis/GeneralAPI"; +export * from "./client/apis/GroupsAPI"; +export * from "./client/apis/InventoryAPI"; +export * from "./client/apis/ItemConfigurationAPI"; +export * from "./client/apis/LocaleAPI"; +export * from "./client/apis/MetricsAPI"; +export * from "./client/apis/NotificationsAPI"; +export * from "./client/apis/OtherAPI"; +export * from "./client/apis/PremiumFeaturesAPI"; +export * from "./client/apis/PresenceAPI"; +export * from "./client/apis/PrivateMessagesAPI"; +export * from "./client/apis/PublishAPI"; +export * from "./client/apis/ThumbnailsAPI"; +export * from "./client/apis/TranslationRolesAPI"; +export * from "./client/apis/TwoStepVerificationAPI"; +export * from "./client/apis/UsersAPI"; diff --git a/src/interfaces/APIInterfaces.ts b/src/interfaces/APIInterfaces.ts index b549bcd74..c3af89d35 100644 --- a/src/interfaces/APIInterfaces.ts +++ b/src/interfaces/APIInterfaces.ts @@ -1,7 +1,6 @@ import { Client } from "../index"; - export declare type BaseAPIOptions = { - baseUrl: string; - client: Client; + baseUrl: string; + client: Client; }; diff --git a/src/interfaces/GeneralInterfaces.ts b/src/interfaces/GeneralInterfaces.ts index cc9f46b1a..15bf1274d 100644 --- a/src/interfaces/GeneralInterfaces.ts +++ b/src/interfaces/GeneralInterfaces.ts @@ -1,21 +1,20 @@ -import ClientUser from "../structures/ClientUser"; - +import { ClientUser } from "../old_structures/ClientUser"; export declare type AnyIdentifier = string | number; export declare type UserIdentifier = ClientUser | AnyIdentifier; export enum EnumUserPresence { - "Offline", - "Online", - "In Game", - "In Studio" + "Offline", + "Online", + "In Game", + "In Studio" } export interface UserPresence { - UserPresenceType: "InGame" | "InStudio" | "Online" | "Offline"; - UserLocationType: "Game"; - lastLocation?: string; - placeId?: number; - rootPlaceId?: number; - gameInstanceId?: string; - universeId?: number; - lastOnline?: string; + UserPresenceType: "InGame" | "InStudio" | "Online" | "Offline"; + UserLocationType: "Game"; + lastLocation?: string; + placeId?: number; + rootPlaceId?: number; + gameInstanceId?: string; + universeId?: number; + lastOnline?: string; } diff --git a/src/interfaces/RESTInterfaces.ts b/src/interfaces/RESTInterfaces.ts index 3e306e390..6ddf55486 100644 --- a/src/interfaces/RESTInterfaces.ts +++ b/src/interfaces/RESTInterfaces.ts @@ -1,166 +1,174 @@ -import RESTRequest from "../controllers/rest/request"; -import RESTResponse from "../controllers/rest/response"; +import { RESTRequest } from "../controllers/rest/request"; +import { RESTResponse } from "../controllers/rest/response"; - -export declare type RESTRequester = (requestOptions: RESTRequestOptions) => Promise; -export declare type RESTRequestHandler = (request: RESTRequest) => boolean | Error; -export declare type RESTResponseHandler = (response: RESTResponse) => boolean | Error; +export declare type RESTRequester = ( + requestOptions: RESTRequestOptions +) => Promise; +export declare type RESTRequestHandler = ( + request: RESTRequest +) => boolean | Error; +export declare type RESTResponseHandler = ( + response: RESTResponse +) => boolean | Error; export declare type RESTControllerOptions = { - requester: (requestOptions: RESTRequestOptions) => Promise; - /** - * If specified, the user agent that will be used for the requests - */ - userAgent?: string; - /** - * If specified, the url which the request will be proxied through - */ - proxy?: string; - /** - * The current XCSRF token - */ - xcsrf?: string; - /** - * The time in ms when the xcsrf was last set - */ - xcsrfSet?: number; - /** - * Refresh interval in ms for XCSRF token updating - */ - xcsrfRefreshInterval?: number; - /** - * The amount of retries to be made to refresh XCSRF - * tokens on Token Validation errors - */ - xcsrfRefreshMaxRetries?: number; + requester?: ( + requestOptions: RESTRequestOptions + ) => Promise; + /** + * If specified, the user agent that will be used for the requests + */ + userAgent?: string; + /** + * If specified, the url which the request will be proxied through + */ + proxy?: string; + /** + * The current XCSRF token + */ + xcsrf?: string; + /** + * The time in ms when the xcsrf was last set + */ + xcsrfSet?: number; + /** + * Refresh interval in ms for XCSRF token updating + */ + xcsrfRefreshInterval?: number; + /** + * The amount of retries to be made to refresh XCSRF + * tokens on Token Validation errors + */ + xcsrfRefreshMaxRetries?: number; }; export declare type RESTCreateCookieOptions = { - key: string; - value: string; - domain: string; - hostOnly: boolean; - httpOnly: boolean; + key: string; + value: string; + domain: string; + hostOnly: boolean; + httpOnly: boolean; }; export declare type RESTRequestOptions = { - /** - * The URL to send the request to - */ - url: string; - /** - * The request method to use - */ - method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | string; - /** - * The proxy to use - */ - proxy?: string; - /** - * If the request should follow all redirects - */ - followAllRedirects?: boolean; - /** - * Roblox's "old" verification system with general verification tokens - */ - verification?: string; - /** - * An "overriding" user agent for the request - */ - userAgent?: string; - /** - * Add some custom headers that will override / merge with the "base" headers - */ - headers?: { [key: string]: unknown }; - /** - * The JSON body - */ - json?: unknown[] | { [key: string]: unknown } | string; - body?: unknown; - /** - * The form body - */ - form?: { [key: string]: unknown }; - /** - * The form data body - */ - formData?: { [key: string]: unknown }; - /** - * Any query params? - */ - qs?: { [key: string]: unknown }; - /** - * Sets the state of any checks - */ - checks?: RESTResponseOptions["checks"]; - /** - * If you want to use a "custom" xcsrf token - */ - xcsrf?: string | boolean; - /** - * The optional response options - */ - responseOptions?: RESTResponseOptions; - /** - * If it should throw http errors if the statuscode is != 200 - */ - throwHttpErrors?: boolean; - /** - * If it should exclude the cookies from being included in the requests - */ - excludeCookies?: boolean; + /** + * The URL to send the request to + */ + url: string; + /** + * The request method to use + */ + method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | string; + /** + * The proxy to use + */ + proxy?: string; + /** + * If the request should follow all redirects + */ + followAllRedirects?: boolean; + /** + * Roblox's "old" verification system with general verification tokens + */ + verification?: string; + /** + * An "overriding" user agent for the request + */ + userAgent?: string; + /** + * Add some custom headers that will override / merge with the "base" headers + */ + headers?: { [key: string]: unknown }; + /** + * The JSON body + */ + json?: unknown[] | { [key: string]: unknown } | string | any; + body?: unknown; + /** + * The form body + */ + form?: { [key: string]: unknown }; + /** + * The form data body + */ + formData?: { [key: string]: unknown }; + /** + * Any query params? + */ + qs?: { [key: string]: unknown }; + /** + * Sets the state of any checks + */ + checks?: RESTResponseOptions["checks"]; + /** + * If you want to use a "custom" xcsrf token + */ + xcsrf?: string | boolean; + /** + * The optional response options + */ + responseOptions?: RESTResponseOptions; + /** + * If it should throw http errors if the statuscode is != 200 + */ + throwHttpErrors?: boolean; + /** + * If it should exclude the cookies from being included in the requests + */ + excludeCookies?: boolean; }; export declare type RESTResponseOptions = { - allowedStatusCodes?: number[]; - disallowedStatusCodes?: number[]; - allowedStatusMessages?: string[]; - disallowedStatusMessages?: string[]; - onlyJSON?: boolean; - checks?: { - xcsrf?: boolean; - statusMessage?: boolean; - statusCode?: boolean; - body?: boolean; - captcha?: boolean; - }; + allowedStatusCodes?: number[]; + disallowedStatusCodes?: number[]; + allowedStatusMessages?: string[]; + disallowedStatusMessages?: string[]; + onlyJSON?: boolean; + checks?: { + xcsrf?: boolean; + statusMessage?: boolean; + statusCode?: boolean; + body?: boolean; + captcha?: boolean; + }; }; export declare type RESTResponseDataType = { - body: any; - statusMessage: string; - statusCode: number; - headers: Record; + body: any; + statusMessage: string; + statusCode: number; + headers: Record; }; export const DefaultRESTResponseOptions = { - allowedStatusCodes: [200] + allowedStatusCodes: [200] }; export const DefaultRESTRequestOptions = { - checks: { - xcsrf: true, - statusMessage: true, - statusCode: true, - body: true, - captcha: true - }, - headers: {}, - method: "GET", - responseOptions: DefaultRESTResponseOptions + checks: { + xcsrf: true, + statusMessage: true, + statusCode: true, + body: true, + captcha: true + }, + headers: {}, + method: "GET", + responseOptions: DefaultRESTResponseOptions }; export const DefaultCreateCookieOptions = { - domain: ".roblox.com", - hostOnly: false, - httpOnly: false + domain: ".roblox.com", + hostOnly: false, + httpOnly: false }; export const DefaultRESTControllerOptions = { - userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", - proxy: undefined, - xcsrf: undefined, - xcsrfSet: undefined, - xcsrfRefreshInterval: 5 * 60 * 1000, - xcsrfRefreshMaxRetries: 4 + userAgent: + "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", + proxy: undefined, + xcsrf: undefined, + xcsrfSet: undefined, + xcsrfRefreshInterval: 5 * 60 * 1000, + xcsrfRefreshMaxRetries: 4 }; diff --git a/src/old_structures/Asset.ts b/src/old_structures/Asset.ts new file mode 100644 index 000000000..c6cde5de9 --- /dev/null +++ b/src/old_structures/Asset.ts @@ -0,0 +1,418 @@ +import { Client } from "../client"; +import { CreatorType } from "../util/constants"; +import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; +import { PartialUser, PartialUserOptions } from "./User"; +import { CatalogProductDetails } from "../client/apis/CatalogAPI"; +import { PartialGroup, PartialGroupOptions } from "./Group"; + +export interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new ( + data: PartialGameUniverseOptions, + client: Client + ) => PartialGameUniverse; + PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; +} + +const retrieveStructures = (): Structures => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); + +export interface AssetVersionOptions { + Id: number; + AssetId: number; + VersionNumber: number; + ParentAssetVersionId: number; + CreatorType: unknown; + CreatingUniverseId: number | null; + Created: string; + Updated: string; +} + +export class AssetVersion { + public client: Client; + public id: number; + public assetId: number; + public versionNumber: number; + public parentAssetVersionId: number | null; + public creatorType: CreatorType; + public createdForUniverse: PartialGameUniverse | null; + public creator: PartialUser; + public created: Date; + public updated: Date; + + constructor(data: any, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.Id; + this.assetId = data.AssetId; + this.versionNumber = data.VersionNumber; + this.parentAssetVersionId = data.ParentAssetVersionId; + this.creatorType = data.CreatorType; + this.creator = new structures.PartialUser( + { + id: data.CreatorTargetId + }, + this.client + ); + this.createdForUniverse = data.CreatingUniverseId + ? new structures.PartialGameUniverse( + { + id: data.CreatingUniverseId + }, + client + ) + : null; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + } +} + +export interface BundleOptions { + id: number; + name: string; + description: string; + bundleType: string; + items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + creator: { + id: number; + name: string; + type: string; + }; + product: CatalogProductDetails; +} + +export class Bundle { + public client: Client; + public id: number; + public name: string; + public description: string; + public bundleType: string; + public items: { + owned: boolean; + id: number; + name: string; + type: string; + }[]; + public creatorType: CreatorType; + public creator: PartialUser | PartialGroup; + public product: { + id: number; + type: string; + publicDomain: boolean; + forSale: boolean; + price: number; + premiumPricing: { + discount: number; + price: number; + }; + }; + + constructor(data: BundleOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.bundleType = data.bundleType; + this.items = data.items.map((itemData) => ({ + owned: itemData.owned, + id: itemData.id, + name: itemData.name, + type: itemData.type + })); + this.creatorType = + data.creator.type.toLowerCase() === "group" + ? CreatorType.GROUP + : CreatorType.USER; + this.creator = + this.creatorType === CreatorType.USER + ? new structures.PartialUser( + { + id: data.creator.id, + name: data.creator.name + }, + client + ) + : new structures.PartialGroup( + { + id: data.creator.id, + name: data.creator.name + }, + client + ); + this.product = { + id: data.product.id, + type: data.product.type, + publicDomain: data.product.isPublicDomain, + forSale: data.product.isForSale, + price: data.product.priceInRobux, + premiumPricing: { + discount: data.product.premiumPricing.premiumDiscountPercentage, + price: data.product.premiumPricing.premiumPriceInRobux + } + }; + } +} + +export interface CollectibleAssetOptions { + userAssetId: number; + serialNumber: number | null; + assetId: number; + name: string; + recentAveragePrice: number | null; + originalPrice: number | null; + assetStock: number | null; + buildersClubMembershipType: number; +} + +export class CollectibleAsset { + public client: Client; + public assetId: number; + public userAssetId: number; + public name: string; + public recentAveragePrice: number | null; + public originalPrice: number | null; + public assetStock: number | null; + public buildersClubMembershipType: number; + + constructor(data: CollectibleAssetOptions, client: Client) { + this.client = client; + this.assetId = data.assetId; + this.userAssetId = data.userAssetId; + this.name = data.name; + this.recentAveragePrice = data.recentAveragePrice; + this.originalPrice = data.originalPrice; + this.assetStock = data.assetStock; + this.buildersClubMembershipType = data.buildersClubMembershipType; + } +} + +export type CursorPageOptions = { + limit?: 10 | 25 | 50 | 100; + cursor?: string; + sortOrder?: "Asc" | "Desc"; +}; +type CursorPageResponse = { + data: unknown; + previousPageCursor: string | null; + nextPageCursor: string | null; +}; + +export class CursorPage { + public client: Client; + public options: CursorPageOptions; + public cursors: { + current: string | null; + next: string | null; + previous: string | null; + }; + public data: T[]; + public method: any; + + constructor( + client: Client, + options: CursorPageOptions, + response: CursorPageResponse, + method: any + ) { + this.client = client; + this.options = options; + this.cursors = { + current: options.cursor || null, + next: response.nextPageCursor || null, + previous: response.previousPageCursor || null + }; + this.data = response.data as T[]; + this.method = method; + } + + getNext(newOptions?: CursorPageOptions): Promise> { + if (!this.cursors.next) { + throw new Error( + "Attempted to iterate to next page, but no cursor was presented for the next page" + ); + } + + const options = { + ...this.options, + cursor: this.cursors.next, + ...newOptions + }; + + return this.method(options); + } + + getPrevious(newOptions?: CursorPageOptions): Promise> { + if (!this.cursors.previous) { + throw new Error( + "Attempted to iterate to previous page, but no cursor was presented for the previous page" + ); + } + + const options = { + ...this.options, + cursor: this.cursors.previous, + ...newOptions + }; + + return this.method(options); + } +} + +export interface ProductOptions { + TargetId: number; + ProductType: string; + AssetId: number; + ProductId: number; + Name: string; + Description: string; + AssetTypeId: number; + Creator: { + Id: number; + Name: string; + }; + IconImageAssetId: number; + Created: string; + Updated: string; + PriceInRobux: number; + PriceInTickets: null; + Sales: number; + IsNew: boolean; + IsForSale: boolean; + IsPublicDomain: boolean; + IsLimited: boolean; + IsLimitedUnique: boolean; + Remaining: number | null; + MinimumMembershipLevel: number; +} + +export class Product { + public client: Client; + public id: number; + public type: string; + public assetId: number; + public productId: number; + public name: string; + public description: string; + public assetTypeId: number; + public creator: PartialUser; + public iconImageAssetId: number; + public created: Date; + public updated: Date; + public price: number; + public sales: number; + public isNew: boolean; + public forSale: boolean; + public publicDomain: boolean; + public limited: boolean; + public limitedUnique: boolean; + public remaining: number | null; + public minimumMembershipLevel: number; + + constructor(data: ProductOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.TargetId; + this.type = data.ProductType; + this.assetId = data.AssetId; + this.productId = data.ProductId; + this.name = data.Name; + this.description = data.Description; + this.assetTypeId = data.AssetTypeId; + this.creator = new structures.PartialUser( + { + id: data.Creator.Id, + name: data.Creator.Name + }, + client + ); + this.iconImageAssetId = data.IconImageAssetId; + this.created = new Date(data.Created); + this.updated = new Date(data.Updated); + this.price = data.PriceInRobux; + this.sales = data.Sales; + this.isNew = data.IsNew; + this.forSale = data.IsForSale; + this.publicDomain = data.IsPublicDomain; + this.limited = data.IsLimited; + this.limitedUnique = data.IsLimitedUnique; + this.remaining = data.Remaining || null; + this.minimumMembershipLevel = data.MinimumMembershipLevel; + } +} + +export interface TradeOptions { + id: number; + offers: { + user: { + id: number; + name: string; + displayName: string; + }; + userAssets: CollectibleAssetOptions[]; + robux: number; + }[]; + user: { + id: number; + name: string; + displayName: string; + }; + created: string; + isActive: boolean; + status: "Completed" | string; +} + +export class Trade { + public client: Client; + public id: number; + public offers: { + user: PartialUser; + assets: CollectibleAsset[]; + robux: number; + }[]; + public sender: PartialUser; + public created: Date; + public active: boolean; + public status: string; + + constructor(data: TradeOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser( + { + id: data.user.id, + name: data.user.name + }, + client + ); + this.created = new Date(data.created); + this.active = data.isActive; + this.status = data.status; + this.offers = data.offers.map((offerData) => ({ + robux: offerData.robux, + user: new structures.PartialUser( + { + id: offerData.user.id, + name: offerData.user.name + }, + client + ), + assets: offerData.userAssets.map( + (assetData) => new CollectibleAsset(assetData, client) + ) + })); + } +} diff --git a/src/old_structures/Chat.ts b/src/old_structures/Chat.ts new file mode 100644 index 000000000..a3931aee3 --- /dev/null +++ b/src/old_structures/Chat.ts @@ -0,0 +1,259 @@ +import { Client } from "../client"; +import { PartialUser, PartialUserOptions } from "./User"; +import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; +import { + ChatSendGameLinkMessageOptions, + ChatSendMessageOptions +} from "../client/apis/ChatAPI"; +import { PartialGroup, PartialGroupOptions } from "./Group"; + +interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new ( + data: PartialGameUniverseOptions, + client: Client + ) => PartialGameUniverse; + PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; +} + +const retrieveStructures = (): Structures => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup +}); + +export interface ChatConversationOptions { + id: number; + title: string; + initiator: { + type: "User" | string; + targetId: number; + name: string | null; + displayName: string | null; + }; + hasUnreadMessages: boolean; + participants: { + type: "User" | string; + targetId: number; + name: string; + displayName: string; + }[]; + conversationType: "OneToOneConversation" | string; + conversationTitle: { + titleForViewer: string; + isDefaultTitle: boolean; + }; + lastUpdated: string; + conversationUniverse: number | null; +} + +export class ChatConversation { + public client: Client; + public id: number; + public title: string; + public initiator: PartialUser; + public hasUnreadMessages: boolean; + public members: PartialUser[]; + public type: string; + public conversationTitle: { + forViewer: string; + isDefaultTitle: boolean; + }; + public lastUpdated: Date; + public universe: PartialGameUniverse | null; + + constructor(data: ChatConversationOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.title = data.title; + this.initiator = new structures.PartialUser( + { + id: data.initiator.targetId, + name: data.initiator.name || undefined + }, + client + ); + this.hasUnreadMessages = data.hasUnreadMessages; + this.members = data.participants.map( + (participantData) => + new structures.PartialUser( + { + id: participantData.targetId, + name: participantData.name + }, + client + ) + ); + this.type = data.conversationType; + this.lastUpdated = new Date(data.lastUpdated); + this.universe = data.conversationUniverse + ? new structures.PartialGameUniverse( + { + id: data.conversationUniverse + }, + client + ) + : null; + this.conversationTitle = { + forViewer: data.conversationTitle.titleForViewer, + isDefaultTitle: data.conversationTitle.isDefaultTitle + }; + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getMessages(amount = 100, startId?: string) { + return this.client.chat.getConversationMessages(this.id, amount, startId); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + addUsers(users: number[]) { + return this.client.chat.addUsersToConversation(this.id, users); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + removeUser(userId: number) { + return this.client.chat.removeUserFromConversation(this.id, userId); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markMessageRead(id: string) { + return this.client.chat.markMessageRead(this.id, id); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + markRead() { + return this.client.chat.markConversationsRead([this.id]); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + rename(name: string) { + return this.client.chat.renameGroupConversation(this.id, name); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getUnreadMessages(amount = 100) { + return this.client.chat.getUnreadMessagesInConversations([this.id], amount); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + getLatestMessages(amount = 100) { + return this.client.chat.getLatestMessagesInConversations([this.id], amount); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + resetUniverse() { + return this.client.chat.resetConversationUniverse(this.id); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendGameLinkMessage(options: ChatSendGameLinkMessageOptions) { + return this.client.chat.sendGameLinkMessage(options); + } + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + sendMessage(options: ChatSendMessageOptions) { + return this.client.chat.sendMessage(options); + } +} + +export interface PartialChatConversationOptions { + id: number; + title?: string; +} + +export class PartialChatConversation { + public client: Client; + public id: number; + public title: string | null; + + constructor(data: PartialChatConversationOptions, client: Client) { + this.client = client; + this.id = data.id; + this.title = data.title || null; + } +} + +export interface ChatMessageOptions { + id: string; + senderType: string; + sent: string; + read: boolean; + messageType: "PlainText" | string; + decorators: string[]; + senderTargetId: number; + content: string; + link?: { + type: "Game"; + game: { + universeId: number; + }; + }; + eventBased?: { + type: "SetConversationUniverse"; + setConversationUniverse: { + actorUserId: number; + universeId: number; + }; + }; +} + +export class ChatMessage { + public client: Client; + public id: string; + public sender: PartialUser; + public sentAt: Date; + public type: "PlainText" | string; + public decorators: string[]; + public content: string; + + constructor(data: ChatMessageOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.sender = new structures.PartialUser( + { + id: data.senderTargetId + }, + client + ); + this.sentAt = new Date(data.sent); + this.type = data.messageType; + this.decorators = data.decorators; + this.content = data.content; + } +} + +export interface ChatMessageSentOptions { + content: string; + filteredForReceivers: boolean; + messageId: string; + sent: string; + messageType: "PlainText" | string; + resultType: "Success" | string; + statusMessage: string; +} + +export class ChatMessageSent { + public client: Client; + public content: string; + public filtered: boolean; + public id: string; + public sentAt: Date; + public type: "PlainText" | string; + public result: "Success" | string; + public status: string; + + constructor(data: ChatMessageSentOptions, client: Client) { + this.client = client; + this.id = data.messageId; + this.content = data.content; + this.filtered = data.filteredForReceivers; + this.sentAt = new Date(data.sent); + this.result = data.resultType; + this.status = data.statusMessage; + this.type = data.messageType; + } +} diff --git a/src/old_structures/ClientUser.ts b/src/old_structures/ClientUser.ts new file mode 100644 index 000000000..2b0dea674 --- /dev/null +++ b/src/old_structures/ClientUser.ts @@ -0,0 +1,16 @@ +import { Client } from "../client"; +import { PartialUser } from "./User"; + +export interface ClientUserOptions { + id: number; + name: string; +} + +export class ClientUser extends PartialUser { + public client: Client; + + constructor(data: ClientUserOptions, client: Client) { + super(data, client); + this.client = client; + } +} diff --git a/src/old_structures/Game.ts b/src/old_structures/Game.ts new file mode 100644 index 000000000..3a3654c60 --- /dev/null +++ b/src/old_structures/Game.ts @@ -0,0 +1,540 @@ +import { Client } from "../client"; +import { CreatorType, GameGenre, MorphAvatarType } from "../util/constants"; +import { PartialGroup, PartialGroupOptions } from "./Group"; +import { PartialUser, PartialUserOptions } from "./User"; +import { DevelopGetPlaceStatisticsByTypeOptions } from "../client/apis/DevelopAPI"; +import { GamesGetGameServersByTypeOptions } from "../client/apis/GamesAPI"; + +interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new ( + data: PartialGameUniverseOptions, + client: Client + ) => PartialGameUniverse; + PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; + PartialPlace: new (data: PartialPlaceOptions, client: Client) => PartialPlace; +} + +const retrieveStructures = (): Structures => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse, + PartialGroup: require("./Group").PartialGroup, + PartialPlace: require("./Game").PartialPlace +}); + +export interface GameBadgeBaseOptions { + id: number; + name?: string; +} + +export class GameBadgeBase { + public client: Client; + public id: number; + public name: string | null; + + constructor(data: GameBadgeBaseOptions, client: Client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } +} + +export interface GameBadgeOptions { + id: number; + name: string; + description: string; + displayName: string; + displayDescription: string; + enabled: boolean; + iconImageId: number; + displayIconImageId: number; + created: string; + updated: string; + statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: { + id: number; + name: string; + rootPlaceId: number; + }; +} + +export class GameBadge { + public client: Client; + public id: number; + public name: string; + public description: string; + public displayedDescription: string; + public displayedName: string; + public enabled: boolean; + public iconId: number; + public displayedIconId: number; + public created: Date; + public updated: Date; + public statistics: { + pastDayAwardedCount: number; + awardedCount: number; + winRatePercentage: number; + }; + awardingUniverse: PartialGameUniverse; + + constructor(data: GameBadgeOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.name = data.name; + this.description = data.description; + this.displayedName = data.displayName; + this.displayedDescription = data.displayDescription; + this.enabled = data.enabled; + this.iconId = data.iconImageId; + this.displayedIconId = data.displayIconImageId; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.statistics = { + pastDayAwardedCount: data.statistics.pastDayAwardedCount, + awardedCount: data.statistics.awardedCount, + winRatePercentage: data.statistics.winRatePercentage + }; + this.awardingUniverse = new structures.PartialGameUniverse( + { + id: data.awardingUniverse.id, + rootPlace: { + id: data.awardingUniverse.rootPlaceId + }, + name: data.awardingUniverse.name + }, + client + ); + } +} + +export type PartialGameBadgeOptions = GameBadgeBaseOptions; + +export class PartialGameBadge extends GameBadgeBase { + // Shut up eslint, it's not useless + // eslint-disable-next-line no-useless-constructor + constructor(data: PartialGameBadgeOptions, client: Client) { + super(data, client); + } +} + +export interface GamePassOptions { + id: number; + name: string; + displayName: string; + productId: number; + price: number; +} + +export class GamePass { + public client: Client; + public id: number; + public name: string; + public displayName: string; + public productId: number; + public price: number; + + constructor(data: GamePassOptions, client: Client) { + this.client = client; + this.id = data.id; + this.name = data.name; + this.displayName = data.displayName; + this.productId = data.productId; + this.price = data.price; + } +} + +export interface BasePlaceOptions { + id: number; + name?: string; +} + +export class BasePlace { + public client: Client; + public id: number; + public name: string | null; + + constructor(options: BasePlaceOptions, client: Client) { + this.client = client; + this.id = options.id; + this.name = options.name || null; + } + + getCompatibilities() { + return this.client.apis.developAPI.getPlaceCompatibilities({ + placeId: this.id + }); + } + + updatePlaceConfiguration(options: { name: string; description: string }) { + return this.client.apis.developAPI.updatePlaceConfiguration({ + placeId: this.id, + ...options + }); + } + + getStatistics( + options: Omit + ) { + return this.client.apis.developAPI.getPlaceStatistics({ + placeId: this.id, + ...options + }); + } + + awardBadge(userId: number, badgeId: number) { + return this.client.apis.generalApi.awardBadge({ + placeId: this.id, + badgeId, + userId + }); + } + + getGameServers(options: Omit) { + return this.client.apis.gamesAPI.getGameServersByType({ + placeId: this.id, + ...options + }); + } +} + +export interface PlaceOptions { + placeId: number; + name: string; + url: string; + description: string; + builder: string; + builderId: number; + isPlayable: boolean; + reasonProhibited: string; + universeId: number; + universeRootPlaceId: number; + price: number; + imageToken: string; +} + +export class Place extends BasePlace { + public description: string; + public url: string; + public creatorName: string; + public creatorId: number; + public playable: boolean; + public prohibitedReason: string; + public prohibited: boolean; + public universe: PartialGameUniverse; + public price: number; + public imageToken: string; + + constructor(data: PlaceOptions, client: Client) { + const structures = retrieveStructures(); + + super( + { + id: data.placeId, + name: data.name + }, + client + ); + this.description = data.description; + this.url = data.url; + this.creatorName = data.builder; + this.creatorId = data.builderId; + this.playable = data.isPlayable; + this.prohibitedReason = data.reasonProhibited; + this.prohibited = this.prohibitedReason.toLowerCase() !== "none"; + this.universe = new structures.PartialGameUniverse( + { + id: data.universeId, + rootPlace: { + id: data.universeRootPlaceId + } + }, + client + ); + this.price = data.price; + this.imageToken = data.imageToken; + } +} + +interface PartialPlaceOptions { + id: number; + name?: string | null; +} + +export class PartialPlace extends BasePlace { + constructor(data: PartialPlaceOptions, client: Client) { + super( + { + id: data.id, + name: data.name || undefined + }, + client + ); + } +} + +export interface PartialGameUniverseOptions { + id: number; + name?: string; + rootPlace?: { + id: number; + name?: string | null; + }; +} + +export class PartialGameUniverse { + public client: Client; + public id: number; + public name: string | null; + public rootPlace: PartialPlace | null; + + constructor(data: PartialGameUniverseOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.name = data.name || null; + this.rootPlace = data.rootPlace + ? new structures.PartialPlace( + { + id: data.rootPlace.id, + name: data.rootPlace.name || null + }, + client + ) + : null; + } +} + +export interface GameUniverseOptions { + id: number; + rootPlaceId: number; + name: string; + description: string; + creatorType: string; + creator: { + id: number; + name: string; + }; + price: number; + allowedGearGenres: string[]; + allowedGearCategories: string[]; + playing: number; + visits: number; + maxPlayers: number; + created: string; + updated: string; + studioAccessToApisAllowed: boolean; + createVipServersAllowed: boolean; + universeAvatarType: string; + genre: string; +} + +export class GameUniverse { + public client: Client; + public id: number; + public rootPlace: PartialPlace | null; + public name: string; + public description: string; + public creatorType: CreatorType; + public creator: PartialGroup | PartialUser; + public price: number | null; + public allowedGearGenres: string[]; + public allowedGearCategories: string[]; + public playing: number; + public visits: number; + public maxPlayers: number; + public created: Date; + public updated: Date; + public studioAccessToAPIsEnabled: boolean; + public createVIPServersEnabled: boolean; + public avatarType: MorphAvatarType; + public genre: GameGenre; + + constructor(data: GameUniverseOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.rootPlace = data.rootPlaceId + ? new structures.PartialPlace( + { + id: data.rootPlaceId + }, + client + ) + : null; + this.name = data.name; + this.description = data.description; + this.creatorType = + data.creatorType.toLowerCase() === "group" + ? CreatorType.GROUP + : CreatorType.USER; + this.creator = + this.creatorType === CreatorType.GROUP + ? new structures.PartialGroup( + { + id: data.creator.id, + name: data.creator.name + }, + client + ) + : new structures.PartialUser( + { + id: data.creator.id, + name: data.creator.name + }, + client + ); + this.price = data.price; + this.allowedGearGenres = data.allowedGearGenres; + this.allowedGearCategories = data.allowedGearCategories; + this.playing = data.playing; + this.visits = data.visits; + this.maxPlayers = data.maxPlayers; + this.created = new Date(data.created); + this.updated = new Date(data.updated); + this.studioAccessToAPIsEnabled = data.studioAccessToApisAllowed; + this.createVIPServersEnabled = data.createVipServersAllowed; + this.avatarType = + data.universeAvatarType.toLowerCase() === "morphtor6" + ? MorphAvatarType.R6 + : MorphAvatarType.R15; + this.genre = data.genre as GameGenre; + } +} + +export interface PartialVIPServerOptions { + id: number; +} + +export class PartialVIPServer { + public client: Client; + public id: number; + + constructor(data: PartialVIPServerOptions, client: Client) { + this.client = client; + this.id = data.id; + } +} + +export interface VIPServerOptions { + id: number; + name: string; + game: { + id: number; + name: string; + rootPlace: { + id: number; + name: string; + }; + }; + joinCode: string; + active: boolean; + subscription: { + active: boolean; + expired: boolean; + expirationDate: string; + price: number; + }; + permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: { + id: number; + name: string; + displayName: string; + }[]; + }; +} + +export class VIPServer { + public client: Client; + public id: number; + public name: string; + public game: PartialGameUniverse; + public code: string; + public active: boolean; + public subscription: { + active: boolean; + expired: boolean; + expirationDate: Date; + price: number; + }; + public permissions: { + clanAllowed: boolean; + enemyClanId: number; + friendsAllowed: boolean; + users: PartialUser[]; + }; + + constructor(data: VIPServerOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id; + this.name = data.name; + this.game = new structures.PartialGameUniverse( + { + id: data.game.id, + name: data.game.name, + rootPlace: { + id: data.game.rootPlace.id, + name: data.game.rootPlace.name + } + }, + client + ); + this.active = data.active; + this.code = data.joinCode; + this.subscription = { + active: data.subscription.active, + expired: data.subscription.expired, + expirationDate: new Date(data.subscription.expirationDate), + price: data.subscription.price + }; + this.permissions = { + clanAllowed: data.permissions.clanAllowed, + enemyClanId: data.permissions.enemyClanId, + friendsAllowed: data.permissions.friendsAllowed, + users: data.permissions.users.map( + (userData) => new structures.PartialUser(userData, client) + ) + }; + } +} + +export interface GameMediaDataOptions { + assetTypeId: number; + assetType: "Video" | "Image" | string; + imageId: number | null; + videoHash: string | null; + videoTitle: string | null; + approved: boolean; +} + +export class GameMediaData { + public client: Client; + public assetTypeId: number; + public assetType: "Video" | "Image" | string; + public imageId: number | null; + public videoHash: string | null; + public videoTitle: string | null; + public approved: boolean; + + constructor(data: GameMediaDataOptions, client: Client) { + this.client = client; + this.assetTypeId = data.assetTypeId; + this.assetType = data.assetType; + this.imageId = data.imageId; + this.videoHash = data.videoHash; + this.videoTitle = data.videoTitle; + this.approved = data.approved; + } +} diff --git a/src/old_structures/Group.ts b/src/old_structures/Group.ts new file mode 100644 index 000000000..86882fce3 --- /dev/null +++ b/src/old_structures/Group.ts @@ -0,0 +1,1072 @@ +import { Client } from "../client"; +import { DevelopGetGroupUniversesOptions } from "../client/apis/DevelopAPI"; +import { CursorPage } from "./Asset"; +import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; +import { + EconomyGetGroupRevenueSummaryInTimeFrame, + EconomyGetGroupRevenueSummaryInTimeFrameOptions, + EconomyGetGroupTransactions, + EconomyGetGroupTransactionsOptions +} from "../client/apis/EconomyAPI"; +import { + GroupsAcceptJoinRequest, + GroupsAcceptJoinRequests, + GroupsAcceptJoinRequestsOptions, + GroupsAcceptRelationshipRequest, + GroupsAcceptRelationshipRequests, + GroupsAcceptRelationshipRequestsOptions, + GroupsChangeOwner, + GroupsClaimGroup, + GroupsCreateRelationship, + GroupsCreateRelationshipOptions, + GroupsCreateRole, + GroupsCreateRoleOptions, + GroupsCreateWallPost, + GroupsCreateWallPostOptions, + GroupsDeclineJoinRequest, + GroupsDeclineJoinRequests, + GroupsDeclineRelationshipRequest, + GroupsDeclineRelationshipRequests, + GroupsDeclineRelationshipRequestsOptions, + GroupsDeleteRelationship, + GroupsDeleteRelationshipOptions, + GroupsDeleteRole, + GroupsDeleteSocialLink, + GroupsDeleteWallPost, + GroupsGetAllRolesPermissions, + GroupsGetGroupPayouts, + GroupsGetGroupRelationships, + GroupsGetGroupRelationshipsOptions, + GroupsGetGroupSettings, + GroupsGetGuestPermissions, + GroupsGetJoinRequest, + GroupsGetJoinRequestsOptions, + GroupsGetMembersOptions, + GroupsGetMembersWithRoleOptions, + GroupsGetRelationshipRequests, + GroupsGetRelationshipRequestsOptions, + GroupsGetRolePermissions, + GroupsGetSelfGroupMembership, + GroupsGetSocialLinks, + GroupsGetWallPostsOptions, + GroupsJoinGroup, + GroupsJoinGroupOptions, + GroupsKickMember, + GroupsPayoutMembers, + GroupsPayoutMembersOptions, + GroupsPostSocialLink, + GroupsPostSocialLinkOptions, + GroupsRemovePrimaryGroup, + GroupsSetPrimaryGroup, + GroupsUpdateGroupDescription, + GroupsUpdateGroupIcon, + GroupsUpdateGroupSettings, + GroupsUpdateGroupSettingsOptions, + GroupsUpdateGroupStatus, + GroupsUpdateMember, + GroupsUpdateRecurringPayouts, + GroupsUpdateRecurringPayoutsOptions, + GroupsUpdateRole, + GroupsUpdateRoleOptions, + GroupsUpdateRolePermissions, + GroupsUpdateRolePermissionsOptions, + GroupsUpdateSocialLink, + GroupsUpdateSocialLinkOptions +} from "../client/apis/GroupsAPI"; +import { PartialUser, PartialUserOptions, UserBase } from "./User"; + +interface Structures { + PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; + PartialGameUniverse: new ( + data: PartialGameUniverseOptions, + client: Client + ) => PartialGameUniverse; +} + +const retrieveStructures = (): Structures => ({ + PartialUser: require("./User").PartialUser, + PartialGameUniverse: require("./Game").PartialGameUniverse +}); + +type GroupRelationships = Omit< + GroupsGetGroupRelationships, + "relatedGroups" +> & { + groupId: number; + relationshipType: T; + totalGroupCount: number; + groups: Group[]; + nextRowIndex: number; +}; + +export interface GroupBaseOptions { + id: number; + name?: string; +} + +export class GroupBase { + public client: Client; + public id: number; + public name: string | null; + + constructor(data: GroupBaseOptions, client: Client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + } + + getUniverses( + options?: Omit + ): Promise> { + return this.client.apis.developAPI + .getGroupUniverses({ + ...options, + groupId: this.id + }) + .then((response) => { + const CursorPageClass = require("./Asset").CursorPage; + const structures = retrieveStructures(); + + return new CursorPageClass( + this.client, + options || {}, + { + ...response, + data: response.data.map( + (universeData) => + new structures.PartialGameUniverse( + { + id: universeData.id, + name: universeData.name, + rootPlace: universeData.rootPlaceId + ? { + id: universeData.rootPlaceId + } + : undefined + }, + this.client + ) + ) + }, + this.getUniverses + ); + }); + } + + /** + * Returns whether the authenticated user can manage the group or not + * @returns {Promise} + */ + canSelfManage(): Promise { + return this.client.apis.developAPI + .getSelfManageableGroups() + .then((response) => !!response.data.find((data) => data.id === this.id)); + } + + /** + * Gets the currently available funds in the group + * @returns {Promise} + */ + getFunds(): Promise { + return this.client.apis.economyAPI + .getGroupCurrency({ + groupId: this.id + }) + .then((response) => response.robux); + } + + getRevenueSummaryInTimeFrame( + timeFrame: EconomyGetGroupRevenueSummaryInTimeFrameOptions["timeFrame"] + ): Promise { + return this.client.apis.economyAPI.getGroupRevenueByTime({ + groupId: this.id, + timeFrame + }); + } + + getTransactions( + options: Omit + ): Promise { + return this.client.apis.economyAPI.getGroupTransactions({ + groupId: this.id, + ...options + }); + } + + getAllies( + maxItems = 100, + startItem?: number + ): Promise> { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "allies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => ({ + ...response, + relationshipType: "allies", + groups: response.relatedGroups.map( + (groupData) => new Group(groupData, this.client) + ) + })); + } + + getEnemies( + maxItems = 100, + startItem?: number + ): Promise> { + return this.client.apis.groupsAPI + .getGroupRelationships({ + relationshipType: "enemies", + groupId: this.id, + maxRows: maxItems, + startRowIndex: startItem + }) + .then((response) => ({ + ...response, + relationshipType: "enemies", + groups: response.relatedGroups.map( + (groupData) => new Group(groupData, this.client) + ) + })); + } + + getGroup(): Promise { + return this.client.getGroup(this.id); + } + + getMember(userId: number): Promise { + return this.client.apis.groupsAPI + .getUserGroups({ + userId + }) + .then((response) => { + const foundGroup = response.data.find( + (groupData) => groupData.group.id === this.id + ); + + if (foundGroup) { + // eslint-disable-next-line @typescript-eslint/no-use-before-define + return new GroupMember( + { + id: userId, + role: foundGroup.role, + group: foundGroup.group + }, + this.client + ); + } else { + return null; + } + }); + } + + getIsMember(userId: number): Promise { + console.warn( + `group.getIsMember() is deprecated and may be removed in the future. Please switch to group.getMember` + ); + return this.getMember(userId); + } + + getSettings(): Promise { + return this.client.apis.groupsAPI.getGroupSettings({ + groupId: this.id + }); + } + + updateSettings( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.updateGroupSettings({ + groupId: this.id, + ...options + }); + } + + updateDescription( + description: string + ): Promise { + return this.client.apis.groupsAPI.updateGroupDescription({ + description, + groupId: this.id + }); + } + + updateShout(shout: string): Promise { + return this.client.apis.groupsAPI.updateGroupStatus({ + groupId: this.id, + message: shout + }); + } + + updateIcon(file: unknown): Promise { + return this.client.apis.groupsAPI.updateGroupIcon({ + files: file, + groupId: this.id + }); + } + + declineJoinRequests(userIds: number[]): Promise { + return this.client.apis.groupsAPI.declineJoinRequests({ + groupId: this.id, + userIds + }); + } + + getJoinRequests( + options: Omit + ): Promise> { + const CursorPageClass = require("./Asset").CursorPage; + + return this.client.apis.groupsAPI + .getJoinRequests({ + groupId: this.id, + ...options + }) + .then( + (response) => + new CursorPageClass( + this.client, + options, + response, + this.getJoinRequests + ) + ); + } + + acceptJoinRequests( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.acceptJoinRequests({ + groupId: this.id, + ...options + }); + } + + declineJoinRequest(userId: number): Promise { + return this.client.apis.groupsAPI.declineJoinRequest({ + groupId: this.id, + userId + }); + } + + getJoinRequest(userId: number): Promise { + return this.client.apis.groupsAPI.getJoinRequest({ + groupId: this.id, + userId + }); + } + + acceptJoinRequest(userId: number): Promise { + return this.client.apis.groupsAPI.acceptJoinRequest({ + groupId: this.id, + userId + }); + } + + getSelfMembership(): Promise { + return this.client.apis.groupsAPI.getSelfGroupMembership({ + groupId: this.id + }); + } + + getRoles(): Promise { + return this.client.apis.groupsAPI + .getGroupRoles({ + groupId: this.id + }) + .then((response) => + response.roles.map( + (roleData) => + new GroupRole( + { + group: { + id: this.id, + name: this.name || undefined + }, + ...roleData + }, + this.client + ) + ) + ); + } + + getMembersWithRole( + options: Omit + ): Promise> { + const CursorPageClass = require("./Asset").CursorPage; + + return this.client.apis.groupsAPI + .getMembersWithRole({ + groupId: this.id, + ...options + }) + .then( + (response) => + new CursorPageClass( + this.client, + options, + response, + this.getMembersWithRole + ) + ); + } + + getMembers( + options: Omit + ): Promise> { + const CursorPageClass = require("./Asset").CursorPage; + + return this.client.apis.groupsAPI + .getMembers({ + groupId: this.id, + ...options + }) + .then( + (response) => + new CursorPageClass(this.client, options, response, this.getMembers) + ); + } + + join( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.joinGroup({ + groupId: this.id, + ...options, + captchaProvider: options.captchaProvider || "PROVIDER_ARKOSELABS" + }); + } + + getIsPendingJoin(): Promise { + return this.client.apis.groupsAPI + .getSelfPendingGroupJoins() + .then( + (response) => + (response.data.find((groupData) => groupData.id === this.id) && + true) || + false + ); + } + + changeOwner(userId: number): Promise { + return this.client.apis.groupsAPI.changeGroupOwner({ + groupId: this.id, + userId + }); + } + + claim(): Promise { + return this.client.apis.groupsAPI.claimGroup({ + groupId: this.id + }); + } + + kickMember(userId: number): Promise { + return this.client.apis.groupsAPI.kickMember({ + groupId: this.id, + userId + }); + } + + updateMember(userId: number, roleId: number): Promise { + return this.client.apis.groupsAPI.updateMember({ + groupId: this.id, + roleId, + userId + }); + } + + getPayouts(): Promise { + return this.client.apis.groupsAPI.getGroupPayouts({ + groupId: this.id + }); + } + + payoutMembers( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.payoutMembers({ + groupId: this.id, + ...options + }); + } + + updateRecurringPayouts( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.updateRecurringPayouts({ + groupId: this.id, + ...options + }); + } + + getRelationships( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.getGroupRelationships({ + groupId: this.id, + ...options + }); + } + + declineRelationshipRequests( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.declineRelationshipRequests({ + groupId: this.id, + ...options + }); + } + + getRelationshipRequests( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.getRelationshipRequests({ + groupId: this.id, + ...options + }); + } + + acceptRelationshipRequests( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.acceptRelationshipRequests({ + groupId: this.id, + ...options + }); + } + + deleteRelationship( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.deleteRelationship({ + groupId: this.id, + ...options + }); + } + + createRelationship( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.createRelationship({ + groupId: this.id, + ...options + }); + } + + acceptRelationshipRequest( + type: "enemies" | "allies", + withGroup: number + ): Promise { + return this.client.apis.groupsAPI.acceptRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + + declineRelationshipRequest( + type: "enemies" | "allies", + withGroup: number + ): Promise { + return this.client.apis.groupsAPI.declineRelationshipRequest({ + groupId: this.id, + relationshipType: type || "allies", + withGroup + }); + } + + getRolePermissions(roleId: number): Promise { + return this.client.apis.groupsAPI.getRolePermissions({ + groupId: this.id, + roleId + }); + } + + updateRolePermissions( + roleId: number, + permissions: Omit + ): Promise { + return this.client.apis.groupsAPI.updateRolePermissions({ + groupId: this.id, + roleId, + ...permissions + }); + } + + getGuestPermissions(): Promise { + return this.client.apis.groupsAPI.getGuestPermissions({ + groupId: this.id + }); + } + + getAllRolesPermissions(): Promise { + return this.client.apis.groupsAPI.getAllRolesPermissions({ + groupId: this.id + }); + } + + getSocialLinks(): Promise { + return this.client.apis.groupsAPI.getSocialLinks({ + groupId: this.id + }); + } + + createSocialLink( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.createSocialLink({ + groupId: this.id, + ...options + }); + } + + deleteSocialLink(id: number): Promise { + return this.client.apis.groupsAPI.deleteSocialLink({ + groupId: this.id, + id + }); + } + + updateSocialLink( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.updateSocialLink({ + groupId: this.id, + ...options + }); + } + + getWallPosts( + options: Omit + ): Promise> { + const CursorPageClass = require("./Asset").CursorPage; + + return this.client.apis.groupsAPI + .getWallPosts({ + groupId: this.id, + ...options + }) + .then( + (response) => + new CursorPageClass(this.client, options, response, this.getWallPosts) + ); + } + + createWallPost( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.createWallPost({ + groupId: this.id, + ...options + }); + } + + deleteWallPost(id: number): Promise { + return this.client.apis.groupsAPI.deleteWallPost({ + groupId: this.id, + id + }); + } + + getIsUserPrimaryGroup(userId: number): Promise { + return ( + this.client.apis.groupsAPI + .getUserPrimaryGroup({ + userId + }) + // eslint-disable-next-line @typescript-eslint/no-use-before-define + .then((response) => + response && response.group && response.role + ? new GroupMember( + { + group: response.group, + role: { + id: response.role!.id!, + name: response.role!.name!, + rank: response.role!.rank! + }, + id: userId + }, + this.client + ) + : null + ) + ); + } + + removeAsPrimary(): Promise { + return this.client.apis.groupsAPI.removePrimaryGroup(); + } + + setAsPrimary(): Promise { + return this.client.apis.groupsAPI.setPrimaryGroup({ + groupId: this.id + }); + } + + createRole( + options: Omit + ): Promise { + return this.client.apis.groupsAPI.createRole({ + groupId: this.id, + ...options + }); + } + + deleteRole(roleId: number): Promise { + return this.client.apis.groupsAPI.deleteRole({ + groupId: this.id, + roleId + }); + } + + updateRole( + roleId: number, + options: Omit + ): Promise { + return this.client.apis.groupsAPI.updateRole({ + groupId: this.id, + roleId, + ...options + }); + } +} + +export interface PartialGroupOptions { + id: number; + name?: string; +} + +export class PartialGroup extends GroupBase { + // Shut up eslint, this is not useless either + // eslint-disable-next-line no-useless-constructor + constructor(data: PartialGroupOptions, client: Client) { + super(data, client); + } +} + +export interface GroupMemberOptions { + group: PartialGroupOptions; + name?: string | null; + /** + * The user id + */ + id: number; + role?: { + id: number; + name: string; + rank: number; + }; +} + +export class GroupMember extends UserBase { + public group: PartialGroup; + public role: GroupRole | null; + + constructor(data: GroupMemberOptions, client: Client) { + super( + { + name: data.name, + id: data.id + }, + client + ); + this.group = new PartialGroup(data.group, client); + // eslint-disable-next-line @typescript-eslint/no-use-before-define + this.role = data.role + ? new GroupRole( + { + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + name: this.name || undefined, + id: this.id + } + }, + client + ) + : null; + } +} + +export interface GroupOptions { + id: number; + name: string; + description: string; + owner: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + } | null; + shout: { + body: string; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + created: string; + updated: string; + } | null; + memberCount: number; + isBuildersClubOnly: boolean; + publicEntryAllowed: boolean; + isLocked: boolean; +} + +export class Group extends GroupBase { + public description: string; + public name: string; + public owner: GroupMember | null; + public shout: GroupShout | null; + public memberCount: number; + public isBuildersClubOnly: boolean; + public publicEntryAllowed: boolean; + public isLocked: boolean; + + constructor(data: GroupOptions, client: Client) { + super(data, client); + this.description = data.description; + this.name = data.name; + this.owner = data.owner + ? new GroupMember( + { + id: data.owner.userId, + name: data.owner.username, + group: this + }, + client + ) + : null; + this.shout = data.shout + ? new GroupShout( + { + content: data.shout.body, + creator: { + id: data.shout.poster.userId, + username: data.shout.poster.username + }, + group: { + id: this.id, + name: this.name || undefined + } + }, + client + ) + : null; + this.memberCount = data.memberCount; + this.isBuildersClubOnly = data.isBuildersClubOnly; + this.publicEntryAllowed = data.publicEntryAllowed; + this.isLocked = data.isLocked; + } +} + +export interface GroupJoinRequestOptions { + id?: number; + user: PartialUserOptions; + group: PartialGroupOptions; + created: string; +} + +export class GroupJoinRequest { + public client: Client; + public id: number | null; + public user: PartialUser; + public group: PartialGroup; + public created: Date; + + constructor(data: GroupJoinRequestOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.id = data.id || null; + this.user = new structures.PartialUser(data.user, client); + this.group = new PartialGroup(data.group, client); + this.created = new Date(data.created); + } +} + +export interface GroupRoleOptions { + id?: number; + name?: string; + rank?: number; + group: { + id: number; + name?: string; + }; +} + +export class GroupRole { + public client: Client; + public id: number | null; + public name: string | null; + public rank: number | null; + public group: PartialGroup; + + constructor(data: GroupRoleOptions, client: Client) { + this.client = client; + this.id = data.id || null; + this.name = data.name || null; + this.rank = data.rank || null; + this.group = new PartialGroup( + { + id: data.group.id, + name: data.group.name + }, + client + ); + } +} + +export interface GroupRolePermissionsOptions { + groupId: number; + role: { + id: number; + name: string; + description: string; + rank: number; + memberCount: number; + }; + permissions: { + groupPostsPermissions: { + viewWall: boolean; + postToWall: boolean; + deleteFromWall: boolean; + viewStatus: boolean; + postToStatus: boolean; + }; + groupMembershipPermissions: { + changeRank: boolean; + inviteMembers: boolean; + removeMembers: boolean; + }; + groupManagementPermissions: { + manageRelationships: boolean; + manageClan: boolean; + viewAuditLogs: boolean; + }; + groupEconomyPermissions: { + spendGroupFunds: boolean; + advertiseGroup: boolean; + createItems: boolean; + manageItems: boolean; + addGroupPlaces: boolean; + manageGroupGames: boolean; + viewGroupPayouts: boolean; + }; + }; +} + +export class GroupRolePermissions { + public client: Client; + public group: PartialGroup; + public role: GroupRole; + public permissions: GroupRolePermissionsOptions["permissions"]; + + constructor(data: GroupRolePermissionsOptions, client: Client) { + this.client = client; + this.group = new PartialGroup( + { + id: data.groupId + }, + client + ); + this.role = new GroupRole( + { + id: data.role.id, + name: data.role.name, + rank: data.role.rank, + group: { + id: this.group.id + } + }, + client + ); + this.permissions = data.permissions; + } +} + +export interface GroupShoutOptions { + content: string; + creator: { + id: number; + username: string; + }; + group: { + id: number; + name?: string; + }; +} + +export class GroupShout { + public client: Client; + public content: string; + public creator: PartialUser; + public group: PartialGroup; + + constructor(data: GroupShoutOptions, client: Client) { + const structures = retrieveStructures(); + + this.client = client; + this.content = data.content; + this.creator = new structures.PartialUser(data.creator, client); + this.group = new PartialGroup( + { + id: data.group.id, + name: data.group.name + }, + client + ); + } +} + +export interface GroupWallPostOptions { + id: number; + poster: { + buildersClubMembershipType: string; + userId: number; + username: string; + displayName: string; + }; + group: { + id: number; + name?: string; + }; + body: string; + created: string; + updated: string; +} + +export class GroupWallPost { + public client: Client; + public id: number; + public creator: GroupMember; + public content: string; + public created: Date; + + constructor(data: GroupWallPostOptions, client: Client) { + this.client = client; + this.id = data.id; + this.content = data.body; + this.creator = new GroupMember( + { + group: { + id: data.group.id, + name: data.group.name + }, + id: data.poster.userId, + name: data.poster.username + }, + client + ); + this.created = new Date(data.created); + } +} diff --git a/src/old_structures/User.ts b/src/old_structures/User.ts new file mode 100644 index 000000000..4927aa462 --- /dev/null +++ b/src/old_structures/User.ts @@ -0,0 +1,187 @@ +import { Client } from "../client"; +import { EnumUserPresence } from "../interfaces/GeneralInterfaces"; + +export interface UserBaseOptions { + id: number; + name?: string | null; + displayName?: string; + membership?: boolean; +} + +export class UserBase { + public client: Client; + public id: number; + public name: string | null; + public displayName: string | null; + public membership: unknown; + + constructor(data: UserBaseOptions, client: Client) { + this.client = client; + this.id = data.id; + this.name = data.name || null; + this.displayName = data.displayName || null; + this.membership = data.membership || null; + } +} + +export interface FriendRequestOptions { + description: string; + created: string; + isBanned: boolean; + id: number; + name: string; +} + +export class FriendRequest { + public client: Client; + public user: PartialUser; + public isBanned: boolean; + public created: Date; + public description: string; + + constructor(data: FriendRequestOptions, client: Client) { + this.client = client; + this.user = new PartialUser( + { + id: data.id, + name: data.name + }, + client + ); + this.created = new Date(data.created); + this.description = data.description; + this.isBanned = data.isBanned; + } +} + +export interface PartialUserOptions { + id: number; + name?: string; + displayName?: string; +} + +export class PartialUser extends UserBase { + // Eslint, I'm getting tired of you complaining about useless constructors. + // You are useless + // eslint-disable-next-line no-useless-constructor + constructor(data: PartialUserOptions, client: Client) { + super(data, client); + } +} + +export interface UserOptions { + id: number; + name: string; + displayName: string; + friendsCount: number; + presenceType: EnumUserPresence; + lastLocation: string | null; + userStatus: string | null; + userStatusDate: string | null; + userPlaceId: number | null; + followersCount: number; + followingsCount: number; + isVieweeBlocked: boolean; + isViewerBlocked: boolean; + areFriends: boolean; + canFollow: boolean; + canMessage: boolean; + canFriend: boolean; + canTrade: boolean; + incomingFriendRequest: boolean; + sentFriendRequest: boolean; + canSeeFavorites: boolean; + messagesDisabled: boolean; + canSeeInventory: boolean; + headShotImage: { + final: boolean; + url: string; + retryUrl: string | null; + userId: number; + endpointType: "Avatar" | string; + }; + previousUsernames: string; +} + +export class User extends PartialUser { + public friendsCount: number; + public presenceType: EnumUserPresence; + public lastLocation: string | null; + public status: string | null; + public statusDate: Date | null; + public placeId: number | null; + public followersCount: number; + public followingCount: number; + /** + * If the authenticated user has blocked the user + */ + public isBlocked: boolean; + /** + * If the user has blocked the authenticated user + */ + public hasBlocked: boolean; + /** + * If the authenticated user and the target user are friends + */ + public areFriends: boolean; + public canFollow: boolean; + public canMessage: boolean; + public canFriend: boolean; + /** + * If the authenticated user has sent a friend request to this user + */ + public sentFriendRequest: boolean; + /** + * If the target user has sent a friend request to the authenticated user + */ + public incomingFriendRequest: boolean; + public messagesDisabled: boolean; + public canSeeFavorites: boolean; + public canTrade: boolean; + public canSeeInventory: boolean; + public previousNames: string[]; + public headshotImage: { + final: boolean; + url: string | null; + retryUrl: string | null; + userId: number; + endpointType: "Avatar" | string; + }; + + constructor(data: UserOptions, client: Client) { + super(data, client); + this.friendsCount = data.friendsCount; + this.presenceType = data.presenceType; + this.lastLocation = data.lastLocation || null; + this.status = data.userStatus || null; + const matchedStatusTimestamp = data.userStatusDate + ? data.userStatusDate.match(/\((.*)\)/) + : null; + this.statusDate = matchedStatusTimestamp + ? new Date(parseInt(matchedStatusTimestamp[1])) + : null; + this.placeId = data.userPlaceId; + this.followersCount = data.followersCount; + this.followingCount = data.followingsCount; + this.isBlocked = data.isVieweeBlocked; + this.hasBlocked = data.isViewerBlocked; + this.areFriends = data.areFriends; + this.canFollow = data.canFollow; + this.canMessage = data.canMessage; + this.canFriend = data.canFriend; + this.sentFriendRequest = data.sentFriendRequest; + this.incomingFriendRequest = data.incomingFriendRequest; + this.messagesDisabled = data.messagesDisabled; + this.canSeeFavorites = data.canSeeFavorites; + this.canTrade = data.canTrade; + this.canSeeInventory = data.canSeeInventory; + this.previousNames = data.previousUsernames.split("\r\n"); + this.headshotImage = { + final: data.headShotImage.final, + url: data.headShotImage.url, + retryUrl: data.headShotImage.retryUrl, + userId: data.headShotImage.userId, + endpointType: data.headShotImage.endpointType + }; + } +} diff --git a/src/old_structures/index.ts b/src/old_structures/index.ts new file mode 100644 index 000000000..9f31e7296 --- /dev/null +++ b/src/old_structures/index.ts @@ -0,0 +1,6 @@ +export * from "./Asset"; +export * from "./Chat"; +export * from "./ClientUser"; +export * from "./Game"; +export * from "./Group"; +export * from "./User"; diff --git a/src/structures/Asset.ts b/src/structures/Asset.ts deleted file mode 100644 index d633be788..000000000 --- a/src/structures/Asset.ts +++ /dev/null @@ -1,390 +0,0 @@ -import Client from "../client"; -import { CreatorType } from "../util/constants"; -import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; -import { PartialUser, PartialUserOptions } from "./User"; -import { ProductDetails } from "../client/apis/CatalogAPI"; -import { PartialGroup, PartialGroupOptions } from "./Group"; - - -export interface Structures { - PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; - PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; - PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; -} - - -const retrieveStructures = (): Structures => ({ - PartialUser: require("./User").PartialUser, - PartialGameUniverse: require("./Game").PartialGameUniverse, - PartialGroup: require("./Group").PartialGroup -}); - - -export interface AssetVersionOptions { - Id: number; - AssetId: number; - VersionNumber: number; - ParentAssetVersionId: number; - CreatorType: unknown; - CreatingUniverseId: number | null; - Created: string; - Updated: string; -} - - -export class AssetVersion { - public client: Client; - public id: number; - public assetId: number; - public versionNumber: number; - public parentAssetVersionId: number | null; - public creatorType: CreatorType; - public createdForUniverse: PartialGameUniverse | null; - public creator: PartialUser; - public created: Date; - public updated: Date; - - constructor (data: any, client: Client) { - const structures = retrieveStructures(); - - - this.client = client; - this.id = data.Id; - this.assetId = data.AssetId; - this.versionNumber = data.VersionNumber; - this.parentAssetVersionId = data.ParentAssetVersionId; - this.creatorType = data.CreatorType; - this.creator = new structures.PartialUser({ - id: data.CreatorTargetId - }, this.client); - this.createdForUniverse = data.CreatingUniverseId ? new structures.PartialGameUniverse({ - id: data.CreatingUniverseId - }, client) : null; - this.created = new Date(data.Created); - this.updated = new Date(data.Updated); - } -} - - -export interface BundleOptions { - id: number; - name: string; - description: string; - bundleType: string; - items: { - owned: boolean; - id: number; - name: string; - type: string; - }[]; - creator: { - id: number; - name: string; - type: string; - }; - product: ProductDetails; -} - - -export class Bundle { - public client: Client; - public id: number; - public name: string; - public description: string; - public bundleType: string; - public items: { - owned: boolean; - id: number; - name: string; - type: string; - }[]; - public creatorType: CreatorType; - public creator: PartialUser | PartialGroup; - public product: { - id: number; - type: string; - publicDomain: boolean; - forSale: boolean; - price: number; - premiumPricing: { - discount: number; - price: number; - }; - }; - - constructor (data: BundleOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.name = data.name; - this.description = data.description; - this.bundleType = data.bundleType; - this.items = data.items.map(itemData => ({ - owned: itemData.owned, - id: itemData.id, - name: itemData.name, - type: itemData.type - })); - this.creatorType = data.creator.type.toLowerCase() === "group" ? CreatorType.GROUP : CreatorType.USER; - this.creator = this.creatorType === CreatorType.USER ? new structures.PartialUser({ - id: data.creator.id, - name: data.creator.name - }, client) : new structures.PartialGroup({ - id: data.creator.id, - name: data.creator.name - }, client); - this.product = { - id: data.product.id, - type: data.product.type, - publicDomain: data.product.isPublicDomain, - forSale: data.product.isForSale, - price: data.product.priceInRobux, - premiumPricing: { - discount: data.product.premiumPricing.premiumDiscountPercentage, - price: data.product.premiumPricing.premiumPriceInRobux - } - }; - } -} - - -export interface CollectibleAssetOptions { - userAssetId: number; - serialNumber: number | null; - assetId: number; - name: string; - recentAveragePrice: number | null; - originalPrice: number | null; - assetStock: number | null; - buildersClubMembershipType: number; -} - - -export class CollectibleAsset { - public client: Client; - public assetId: number; - public userAssetId: number; - public name: string; - public recentAveragePrice: number | null; - public originalPrice: number | null; - public assetStock: number | null; - public buildersClubMembershipType: number; - - constructor (data: CollectibleAssetOptions, client: Client) { - this.client = client; - this.assetId = data.assetId; - this.userAssetId = data.userAssetId; - this.name = data.name; - this.recentAveragePrice = data.recentAveragePrice; - this.originalPrice = data.originalPrice; - this.assetStock = data.assetStock; - this.buildersClubMembershipType = data.buildersClubMembershipType; - } -} - - -export type CursorPageOptions = { - limit?: 10 | 25 | 50 | 100; - cursor?: string; - sortOrder?: "Asc" | "Desc"; -} -type CursorPageResponse = { - data: unknown; - previousPageCursor: string | null; - nextPageCursor: string | null; -} - - -export class CursorPage { - public client: Client; - public options: CursorPageOptions; - public cursors: { - current: string | null; - next: string | null; - previous: string | null; - }; - public data: T[]; - public method: any; - - constructor (client: Client, options: CursorPageOptions, response: CursorPageResponse, method: any) { - this.client = client; - this.options = options; - this.cursors = { - current: options.cursor || null, - next: response.nextPageCursor || null, - previous: response.previousPageCursor || null - }; - this.data = response.data as T[]; - this.method = method; - } - - getNext (newOptions?: CursorPageOptions): Promise> { - if (!this.cursors.next) { - throw new Error("Attempted to iterate to next page, but no cursor was presented for the next page"); - } - - const options = { - ...this.options, - cursor: this.cursors.next, - ...newOptions - }; - - return this.method(options); - } - - getPrevious (newOptions?: CursorPageOptions): Promise> { - if (!this.cursors.previous) { - throw new Error("Attempted to iterate to previous page, but no cursor was presented for the previous page"); - } - - const options = { - ...this.options, - cursor: this.cursors.previous, - ...newOptions - }; - - return this.method(options); - } -} - - -export interface ProductOptions { - TargetId: number; - ProductType: string; - AssetId: number; - ProductId: number; - Name: string; - Description: string; - AssetTypeId: number; - Creator: { - Id: number; - Name: string; - }; - IconImageAssetId: number; - Created: string; - Updated: string; - PriceInRobux: number; - PriceInTickets: null; - Sales: number; - IsNew: boolean; - IsForSale: boolean; - IsPublicDomain: boolean; - IsLimited: boolean; - IsLimitedUnique: boolean; - Remaining: number | null; - MinimumMembershipLevel: number; -} - - -export class Product { - public client: Client; - public id: number; - public type: string; - public assetId: number; - public productId: number; - public name: string; - public description: string; - public assetTypeId: number; - public creator: PartialUser; - public iconImageAssetId: number; - public created: Date; - public updated: Date; - public price: number; - public sales: number; - public isNew: boolean; - public forSale: boolean; - public publicDomain: boolean; - public limited: boolean; - public limitedUnique: boolean; - public remaining: number | null; - public minimumMembershipLevel: number; - - constructor (data: ProductOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.TargetId; - this.type = data.ProductType; - this.assetId = data.AssetId; - this.productId = data.ProductId; - this.name = data.Name; - this.description = data.Description; - this.assetTypeId = data.AssetTypeId; - this.creator = new structures.PartialUser({ - id: data.Creator.Id, - name: data.Creator.Name - }, client); - this.iconImageAssetId = data.IconImageAssetId; - this.created = new Date(data.Created); - this.updated = new Date(data.Updated); - this.price = data.PriceInRobux; - this.sales = data.Sales; - this.isNew = data.IsNew; - this.forSale = data.IsForSale; - this.publicDomain = data.IsPublicDomain; - this.limited = data.IsLimited; - this.limitedUnique = data.IsLimitedUnique; - this.remaining = data.Remaining || null; - this.minimumMembershipLevel = data.MinimumMembershipLevel; - } -} - - -export interface TradeOptions { - id: number; - offers: { - user: { - id: number; - name: string; - displayName: string; - }; - userAssets: CollectibleAssetOptions[]; - robux: number; - }[]; - user: { - id: number; - name: string; - displayName: string; - }; - created: string; - isActive: boolean; - status: "Completed" | string; -} - - -export class Trade { - public client: Client; - public id: number; - public offers: { - user: PartialUser; - assets: CollectibleAsset[]; - robux: number; - }[]; - public sender: PartialUser; - public created: Date; - public active: boolean; - public status: string; - - constructor (data: TradeOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.sender = new structures.PartialUser({ - id: data.user.id, - name: data.user.name - }, client); - this.created = new Date(data.created); - this.active = data.isActive; - this.status = data.status; - this.offers = data.offers.map(offerData => ({ - robux: offerData.robux, - user: new structures.PartialUser({ - id: offerData.user.id, - name: offerData.user.name - }, client), - assets: offerData.userAssets.map(assetData => new CollectibleAsset(assetData, client)) - })); - } -} diff --git a/src/structures/BaseUser.ts b/src/structures/BaseUser.ts new file mode 100644 index 000000000..367f3f0c7 --- /dev/null +++ b/src/structures/BaseUser.ts @@ -0,0 +1,335 @@ +import { + AccountInformationPromotionChannels, + AccountInformationRobloxBadges, + Client, + EconomyGetSelfCurrency, + FriendsGetUserFollowers, + FriendsGetUserFriends, + FriendsGetUserFriendsOptions, + ItemType, + PageSortLimit, + PageSortOrder, + PresenceGetUsersPresence, + PrivateMessagesSendMessage, + UsersUserNameHistory +} from ".."; +import { contextCall, CursorPage } from "./CursorPage"; + +export type BaseUserOwnedBadge = { + badgeId: number; + awardedDate: Date; + awardedDateString: string; +}; + +export type BaseUserGroupRole = { + groupId: number; + roleId: number; + rank: number; + roleName: string; +}; + +/** + * Represents a Roblox user ID and gives direct access to various user-related APIs. + */ +export class BaseUser { + #client: Client; + #userId: number; + + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client: Client, userId: number) { + this.#client = client; + this.#userId = userId; + } + + get client() { + return this.#client; + } + + get userId() { + return this.#userId; + } + + /** + * Return the username history of the user. + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getUsernameHistory( + limit: PageSortLimit = 10, + sortOrder: PageSortOrder = "Asc", + cursor?: string + ): Promise> { + return this.client.apis.usersAPI + .getUserNameHistory({ + userId: this.userId + }) + .then( + (response) => + new CursorPage( + { limit, sortOrder, cursor }, + { userId: this.userId }, + response, + contextCall( + this.client.apis.usersAPI, + this.client.apis.usersAPI.getUserNameHistory + ) + ) + ); + } + + /** + * Returns the users current presence. + */ + getPresence(): Promise { + return this.client.apis.presenceAPI + .getUsersPresences({ + userIds: [this.userId] + }) + .then((presence) => presence.userPresences[0]); + } + + /** + * Returns the user's friends. + * @param limit The number of friends to return + * @param cursor The cursor to continue at + */ + getFriends( + userSort?: FriendsGetUserFriendsOptions["userSort"] + ): Promise { + return this.client.apis.friendsAPI.getUserFriends({ + userId: this.userId, + userSort + }); + } + + /** + * Returns the user's robux amount. The BaseUser must be the currently authenticated user, or else this function throws an error. + */ + getCurrency(): Promise { + if (this.client.user?.id !== this.userId) { + throw new Error( + "This function can only be called with the currently authenticated user" + ); + } + return this.client.apis.economyAPI.getSelfCurrency({ userId: this.userId }); + } + + /** + * Returns if the user has Roblox Premium or not. + */ + hasPremium(): Promise { + return this.client.apis.premiumFeaturesAPI.validateUserMembership({ + userId: this.userId + }); + } + + /** + * Returns if the user owns the specified item. + * @param {ItemType} itemType The type of item to check + * @param {number} itemId The ID of the item to check + */ + ownsItem(itemType: ItemType, itemId: number): Promise { + return this.client.apis.inventoryAPI + .getUserItemsByTypeAndTargetId({ + userId: this.userId, + itemType, + itemTargetId: itemId + }) + .then((response) => response.data.length > 0); + } + + /** + * Returns if the user owns the specific asset. + * @param assetId The ID of the asset to check + */ + ownsAsset(assetId: number): Promise { + return this.ownsItem("Asset", assetId); + } + + /** + * Returns if the user owns the specific gamepass. + * @param gamepassId The ID of the gamepass to check + */ + ownsGamepass(gamepassId: number): Promise { + return this.ownsItem("GamePass", gamepassId); + } + + /** + * Returns the date the specified badges got awarded to the user. + * @param badgeIds The badge IDs to check + */ + getBadgeAwardedDates(badgeIds: number[]): Promise { + return this.client.apis.badgesAPI + .getUserBadgesAwardedDates({ + userId: this.userId, + badgeIds + }) + .then((response) => + response.data.map((badge) => ({ + badgeId: badge.badgeId, + awardedDate: new Date(badge.awardedDate), + awardedDateString: badge.awardedDate + })) + ); + } + + /** + * Returns the role of the groups the user is in. + */ + getGroupRoles(): Promise { + return this.client.apis.groupsAPI + .getUserGroups({ + userId: this.userId + }) + .then((response) => + response.data.map((groupMembership) => ({ + groupId: groupMembership.group.id, + roleId: groupMembership.role.id, + rank: groupMembership.role.rank, + roleName: groupMembership.role.name + })) + ); + } + + /** + * Returns the roblox badges the user has. + */ + getRobloxBadges(): Promise { + return this.client.apis.accountInformationAPI.getRobloxBadges({ + userId: this.userId + }); + } + + /** + * Returns the user's promotion channels + */ + getPromotionChannels(): Promise { + return this.client.apis.accountInformationAPI.getUserPromotionChannels({ + userId: this.userId + }); + } + + /** + * Returns the user's friend count + */ + getFriendCount(): Promise { + return this.client.apis.friendsAPI + .getUserFriendsCount({ + userId: this.userId + }) + .then((response) => response.count); + } + + /** + * Returns the user's follower count + */ + getFollowerCount(): Promise { + return this.client.apis.friendsAPI + .getUserFollowersCount({ + userId: this.userId + }) + .then((response) => response.count); + } + + /** + * Returns the user's following count + */ + getFollowingCount(): Promise { + return this.client.apis.friendsAPI + .getUserFollowingCount({ + userId: this.userId + }) + .then((response) => response.count); + } + + /** + * Returns the user's followers + * @param limit The number of followers to return + * @param sortOrder The sort order of the followers + * @param cursor The cursor to continue at + */ + getFollowers( + limit: PageSortLimit = 10, + sortOrder: PageSortOrder = "Asc", + cursor?: string + ): Promise< + CursorPage + > { + return this.client.apis.friendsAPI + .getUserFollowers({ + userId: this.userId, + limit, + sortOrder, + cursor + }) + .then( + (response) => + new CursorPage( + { limit, sortOrder, cursor }, + { userId: this.userId }, + response, + contextCall( + this.client.apis.friendsAPI, + this.client.apis.friendsAPI.getUserFollowers + ) + ) + ); + } + + /** + * Returns the user's followings + * @param limit The number of followings to return + * @param sortOrder The sort order of the followings + * @param cursor The cursor to continue at + */ + getFollowings( + limit: PageSortLimit = 10, + sortOrder: PageSortOrder = "Asc", + cursor?: string + ): Promise< + CursorPage + > { + return this.client.apis.friendsAPI + .getUserFollowing({ + userId: this.userId, + limit, + sortOrder, + cursor + }) + .then( + (response) => + new CursorPage( + { limit, sortOrder, cursor }, + { userId: this.userId }, + response, + contextCall( + this.client.apis.friendsAPI, + this.client.apis.friendsAPI.getUserFollowers + ) + ) + ); + } + + /** + * Sends a private message to the user + * @param recipientId The user ID to send the message to + * @param subject The subject of the message + * @param body The body of the message + */ + sendMessage( + recipientId: number, + subject: string, + body: string + ): Promise { + return this.client.apis.privateMessagesAPI.sendMessage({ + userId: this.userId, + recipientId, + subject, + body + }); + } +} diff --git a/src/structures/Chat.ts b/src/structures/Chat.ts deleted file mode 100644 index b3891718b..000000000 --- a/src/structures/Chat.ts +++ /dev/null @@ -1,270 +0,0 @@ -import Client from "../client"; -import { PartialUser, PartialUserOptions } from "./User"; -import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; -import { SendGameLinkMessageOptions, SendMessageOptions } from "../client/apis/ChatAPI"; -import { PartialGroup, PartialGroupOptions } from "./Group"; - - -interface Structures { - PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; - PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; - PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; -} - - -const retrieveStructures = (): Structures => ({ - PartialUser: require("./User").PartialUser, - PartialGameUniverse: require("./Game").PartialGameUniverse, - PartialGroup: require("./Group").PartialGroup -}); - - -export interface ChatConversationOptions { - id: number; - title: string; - initiator: { - type: "User" | string; - targetId: number; - name: string | null; - displayName: string | null; - }; - hasUnreadMessages: boolean; - participants: { - type: "User" | string; - targetId: number; - name: string; - displayName: string; - }[]; - conversationType: "OneToOneConversation" | string; - conversationTitle: { - titleForViewer: string; - isDefaultTitle: boolean; - }; - lastUpdated: string; - conversationUniverse: number | null; -} - - -export class ChatConversation { - public client: Client; - public id: number; - public title: string; - public initiator: PartialUser; - public hasUnreadMessages: boolean; - public members: PartialUser[]; - public type: string; - public conversationTitle: { - forViewer: string; - isDefaultTitle: boolean; - }; - public lastUpdated: Date; - public universe: PartialGameUniverse | null; - - constructor (data: ChatConversationOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.title = data.title; - this.initiator = new structures.PartialUser({ - id: data.initiator.targetId, - name: data.initiator.name || undefined - }, client); - this.hasUnreadMessages = data.hasUnreadMessages; - this.members = data.participants.map(participantData => new structures.PartialUser({ - id: participantData.targetId, - name: participantData.name - }, client)); - this.type = data.conversationType; - this.lastUpdated = new Date(data.lastUpdated); - this.universe = data.conversationUniverse ? new structures.PartialGameUniverse({ - id: data.conversationUniverse - }, client) : null; - this.conversationTitle = { - forViewer: data.conversationTitle.titleForViewer, - isDefaultTitle: data.conversationTitle.isDefaultTitle - }; - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getMessages (amount = 100, startId?: string) { - return this.client.chat.getConversationMessages( - this.id, - amount, - startId - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - addUsers (users: number[]) { - return this.client.chat.addUsersToConversation( - this.id, - users - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - removeUser (userId: number) { - return this.client.chat.removeUserFromConversation( - this.id, - userId - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - markMessageRead (id: string) { - return this.client.chat.markMessageRead( - this.id, - id - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - markRead () { - return this.client.chat.markConversationsRead([ - this.id - ]); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - rename (name: string) { - return this.client.chat.renameGroupConversation( - this.id, - name - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getUnreadMessages (amount = 100) { - return this.client.chat.getUnreadMessagesInConversations( - [this.id], - amount - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getLatestMessages (amount = 100) { - return this.client.chat.getLatestMessagesInConversations( - [this.id], - amount - ); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - resetUniverse () { - return this.client.chat.resetConversationUniverse(this.id); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - sendGameLinkMessage (options: SendGameLinkMessageOptions) { - return this.client.chat.sendGameLinkMessage(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - sendMessage (options: SendMessageOptions) { - return this.client.chat.sendMessage(options); - } -} - - -export interface PartialChatConversationOptions { - id: number; - title?: string; -} - - -export class PartialChatConversation { - public client: Client; - public id: number; - public title: string | null; - - constructor (data: PartialChatConversationOptions, client: Client) { - this.client = client; - this.id = data.id; - this.title = data.title || null; - } -} - - -export interface ChatMessageOptions { - id: string; - senderType: string; - sent: string; - read: boolean; - messageType: "PlainText" | string; - decorators: string[]; - senderTargetId: number; - content: string; - link?: { - type: "Game"; - game: { - universeId: number; - }; - }; - eventBased?: { - type: "SetConversationUniverse"; - setConversationUniverse: { - actorUserId: number; - universeId: number; - }; - }; -} - - -export class ChatMessage { - public client: Client; - public id: string; - public sender: PartialUser; - public sentAt: Date; - public type: "PlainText" | string; - public decorators: string[]; - public content: string; - - constructor (data: ChatMessageOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.sender = new structures.PartialUser({ - id: data.senderTargetId - }, client); - this.sentAt = new Date(data.sent); - this.type = data.messageType; - this.decorators = data.decorators; - this.content = data.content; - } -} - - -export interface ChatMessageSentOptions { - content: string; - filteredForReceivers: boolean; - messageId: string; - sent: string; - messageType: "PlainText" | string; - resultType: "Success" | string; - statusMessage: string; -} - - -export class ChatMessageSent { - public client: Client; - public content: string; - public filtered: boolean; - public id: string; - public sentAt: Date; - public type: "PlainText" | string; - public result: "Success" | string; - public status: string; - - constructor (data: ChatMessageSentOptions, client: Client) { - this.client = client; - this.id = data.messageId; - this.content = data.content; - this.filtered = data.filteredForReceivers; - this.sentAt = new Date(data.sent); - this.result = data.resultType; - this.status = data.statusMessage; - this.type = data.messageType; - } -} diff --git a/src/structures/ClientUser.ts b/src/structures/ClientUser.ts deleted file mode 100644 index 9217ed5d6..000000000 --- a/src/structures/ClientUser.ts +++ /dev/null @@ -1,275 +0,0 @@ -import Client from "../client"; -import { PartialUser } from "./User"; -import { - UpdateContactUpsellSuppressionOptions, - UpdateTwoStepStatusOptions, - UpdateUserPrivacyOptions, - UpdateUserPromotionChannelsOptions -} from "../client/apis/AccountSettingsAPI"; -import { - DeletePhoneOptions, - ResendPhoneCodeOptions, - SetPhoneNumberOptions, - UpdateUserBirthdateOptions, - VerifyPhoneOptions -} from "../client/apis/AccountInformationAPI"; - - -export interface ClientUserOptions { - id: number; - name: string; -} - - -export default class ClientUser extends PartialUser { - public client: Client; - - constructor (data: ClientUserOptions, client: Client) { - super(data, client); - this.client = client; - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getAppChatPrivacy () { - return this.client.apis.accountSettingsAPI.getAppChatPrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateAppChatPrivacy (privacy: string) { - return this.client.apis.accountSettingsAPI.updateAppChatPrivacy({ - appChatPrivacy: privacy - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getGameChatPrivacy () { - return this.client.apis.accountSettingsAPI.getGameChatPrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateGameChatPrivacy (privacy: string) { - return this.client.apis.accountSettingsAPI.updateGameChatPrivacy({ - gameChatPrivacy: privacy - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getInventoryPrivacy () { - return this.client.apis.accountSettingsAPI.getInventoryPrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateInventoryPrivacy (privacy: string) { - return this.client.apis.accountSettingsAPI.updateInventoryPrivacy({ - inventoryPrivacy: privacy - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getPrivacy () { - return this.client.apis.accountSettingsAPI.getUserPrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updatePrivacy (options: UpdateUserPrivacyOptions) { - return this.client.apis.accountSettingsAPI.updateUserPrivacy(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getPrivacySettingsInfo () { - return this.client.apis.accountSettingsAPI.getUserPrivacySettingsInfo(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getPrivateMessagePrivacy () { - return this.client.apis.accountSettingsAPI.getUserPrivateMessagePrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updatePrivateMessagePrivacy (privacy: string) { - return this.client.apis.accountSettingsAPI.updateUserPrivateMessagePrivacy({ - privateMessagePrivacy: privacy - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getEmailStatus () { - return this.client.apis.accountSettingsAPI.getUserEmailStatus(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateEmail (email: string, password: string) { - return this.client.apis.accountSettingsAPI.updateUserEmail({ - emailAddress: email, - password - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - sendEmailVerification () { - return this.client.apis.accountSettingsAPI.sendEmailVerification(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getWebsiteTheme () { - return this.client.apis.accountSettingsAPI.getWebsiteTheme(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateWebsiteTheme (theme: string) { - return this.client.apis.accountSettingsAPI.updateWebsiteTheme({ - themeType: theme - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getTradePrivacy () { - return this.client.apis.accountSettingsAPI.getUserTradePrivacy(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateTradePrivacy (privacy: string) { - return this.client.apis.accountSettingsAPI.updateUserTradePrivacy({ - tradePrivacy: privacy - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getTradeQualityFilter () { - return this.client.apis.accountSettingsAPI.getUserTradeQualityFilter(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateTradeQualityFilter (quality: string) { - return this.client.apis.accountSettingsAPI.updateUserTradeQualityFilter({ - tradeValue: quality - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateTwoStepStatus (options: UpdateTwoStepStatusOptions) { - return this.client.apis.accountSettingsAPI.updateTwoStepStatus(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getContactUpsell () { - return this.client.apis.accountSettingsAPI.getContactUpsell(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateContactUpsellSuppression (options: UpdateContactUpsellSuppressionOptions) { - return this.client.apis.accountSettingsAPI.updateContactUpsellSuppression(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updatePromotionChannels (options: UpdateUserPromotionChannelsOptions) { - return this.client.apis.accountSettingsAPI.updateUserPromotionChannels(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getBirthdate () { - return this.client.apis.accountInformationAPI.getUserBirthdate(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateBirthdate (options: UpdateUserBirthdateOptions) { - return this.client.apis.accountInformationAPI.updateUserBirthdate(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getProfileDescription () { - return this.client.apis.accountInformationAPI.getUserDescription(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateProfileDescription (description: string) { - return this.client.apis.accountInformationAPI.updateUserDescription({ - description - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getGender () { - return this.client.apis.accountInformationAPI.getUserGender(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - updateGender (gender: number) { - return this.client.apis.accountInformationAPI.updateUserGender({ - gender - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getConsecutiveXboxLoginDays () { - return this.client.apis.accountInformationAPI.getConsecutiveXboxLoginDays(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getVerifiedPhoneNumber () { - return this.client.apis.accountInformationAPI.getVerifiedPhoneNumber(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - setPhoneNumber (options: SetPhoneNumberOptions) { - return this.client.apis.accountInformationAPI.setPhoneNumber(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - deletePhone (options: DeletePhoneOptions) { - return this.client.apis.accountInformationAPI.deletePhone(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - resendPhoneCode (options: ResendPhoneCodeOptions) { - return this.client.apis.accountInformationAPI.resendPhoneCode(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - verifyPhone (options: VerifyPhoneOptions) { - return this.client.apis.accountInformationAPI.verifyPhone(options); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getPromotionChannels () { - return this.client.apis.accountInformationAPI.getSelfPromotionChannels(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - removeStarCodeAffiliate () { - return this.client.apis.accountInformationAPI.removeStarCodeAffiliate(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getStarCodeAffiliate () { - return this.client.apis.accountInformationAPI.getStarCodeAffiliate(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - addStarCodeAffiliate (code: string) { - return this.client.apis.accountInformationAPI.addStarCodeAffiliate({ - code - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - getPasswordStatus () { - return this.client.apis.authAPI.getCurrentUserPasswordStatus(); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - changeUserPassword (newPassword: string, oldPassword: string) { - return this.client.apis.authAPI.changeUserPassword({ - currentPassword: oldPassword, - newPassword - }); - } - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - changeUsername (newUsername: string, password: string) { - return this.client.apis.authAPI.changeUserUsername({ - password, - username: newUsername - }); - } -} diff --git a/src/structures/CursorPage.ts b/src/structures/CursorPage.ts new file mode 100644 index 000000000..1dd6c78db --- /dev/null +++ b/src/structures/CursorPage.ts @@ -0,0 +1,102 @@ +export type CursorPageOptions = { + readonly limit?: 10 | 25 | 50 | 100; + cursor?: string; + readonly sortOrder?: "Asc" | "Desc"; +}; + +type CursorPageResponse = { + data: T[]; + previousPageCursor: string | null; + nextPageCursor: string | null; +}; +type CursorPageState = { + previous: string | null; + current: string | null; + next: string | null; +}; +type CursorPageMethod = ( + options: CursorPageOptions & C +) => Promise>; + +export class CursorPage { + options: CursorPageOptions; + cursors: CursorPageState; + data: T[][] = []; + readonly method: CursorPageMethod; + readonly methodOptions: C; + private currentPage = 0; + + constructor( + options: CursorPageOptions, + methodOptions: C, + response: CursorPageResponse, + method: CursorPageMethod + ) { + this.options = options; + this.cursors = { + previous: response.previousPageCursor, + current: response.nextPageCursor, + next: response.nextPageCursor + }; + this.data[0] = response.data; + this.methodOptions = methodOptions; + this.method = method; + } + + async getNextPage(): Promise { + if (!this.cursors.next) { + throw new Error( + "Attempted to iterate to next page, but no cursor was presented for the next page" + ); + } + + this.currentPage++; + if (this.data[this.currentPage]) return this.data[this.currentPage]; + + this.options.cursor = this.cursors.next; + const result = await this.method({ + ...this.options, + ...this.methodOptions + }); + this.cursors = { + previous: result.previousPageCursor, + current: this.cursors.next, + next: result.nextPageCursor + }; + this.data[this.currentPage] = result.data; + + return result.data; + } + + async getPreviousPage(): Promise { + if (!this.cursors.previous) { + throw new Error( + "Attempted to iterate to previous page, but no cursor was presented for the next page" + ); + } + + this.currentPage--; + if (this.data[this.currentPage]) return this.data[this.currentPage]; + + this.options.cursor = this.cursors.previous; + const result = await this.method({ + ...this.options, + ...this.methodOptions + }); + this.cursors = { + previous: result.previousPageCursor, + current: this.cursors.next, + next: result.nextPageCursor + }; + this.data[this.currentPage] = result.data; + + return result.data; + } +} + +export function contextCall( + context: any, + method: CursorPageMethod +): CursorPageMethod { + return (options: CursorPageOptions & C) => method.call(context, options); +} diff --git a/src/structures/Game.ts b/src/structures/Game.ts deleted file mode 100644 index fb7a35dda..000000000 --- a/src/structures/Game.ts +++ /dev/null @@ -1,519 +0,0 @@ -import Client from "../client"; -import { CreatorType, GameGenre, MorphAvatarType } from "../util/constants"; -import { PartialGroup, PartialGroupOptions } from "./Group"; -import { PartialUser, PartialUserOptions } from "./User"; -import { GetPlaceStatisticsByTypeOptions } from "../client/apis/DevelopAPI"; -import { GetGameServersByTypeOptions } from "../client/apis/GamesAPI"; - - -interface Structures { - PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; - PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; - PartialGroup: new (data: PartialGroupOptions, client: Client) => PartialGroup; - PartialPlace: new (data: PartialPlaceOptions, client: Client) => PartialPlace; -} - - -const retrieveStructures = (): Structures => ({ - PartialUser: require("./User").PartialUser, - PartialGameUniverse: require("./Game").PartialGameUniverse, - PartialGroup: require("./Group").PartialGroup, - PartialPlace: require("./Game").PartialPlace -}); - - -export interface GameBadgeBaseOptions { - id: number; - name?: string; -} - - -export class GameBadgeBase { - public client: Client; - public id: number; - public name: string | null; - - constructor (data: GameBadgeBaseOptions, client: Client) { - this.client = client; - this.id = data.id; - this.name = data.name || null; - } -} - - -export interface GameBadgeOptions { - id: number; - name: string; - description: string; - displayName: string; - displayDescription: string; - enabled: boolean; - iconImageId: number; - displayIconImageId: number; - created: string; - updated: string; - statistics: { - pastDayAwardedCount: number; - awardedCount: number; - winRatePercentage: number; - }; - awardingUniverse: { - id: number; - name: string; - rootPlaceId: number; - }; -} - - -export class GameBadge { - public client: Client; - public id: number; - public name: string; - public description: string; - public displayedDescription: string; - public displayedName: string; - public enabled: boolean; - public iconId: number; - public displayedIconId: number; - public created: Date; - public updated: Date; - public statistics: { - pastDayAwardedCount: number; - awardedCount: number; - winRatePercentage: number; - }; - awardingUniverse: PartialGameUniverse; - - constructor (data: GameBadgeOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.name = data.name; - this.description = data.description; - this.displayedName = data.displayName; - this.displayedDescription = data.displayDescription; - this.enabled = data.enabled; - this.iconId = data.iconImageId; - this.displayedIconId = data.displayIconImageId; - this.created = new Date(data.created); - this.updated = new Date(data.updated); - this.statistics = { - pastDayAwardedCount: data.statistics.pastDayAwardedCount, - awardedCount: data.statistics.awardedCount, - winRatePercentage: data.statistics.winRatePercentage - }; - this.awardingUniverse = new structures.PartialGameUniverse({ - id: data.awardingUniverse.id, - rootPlace: { - id: data.awardingUniverse.rootPlaceId - }, - name: data.awardingUniverse.name - }, client); - } -} - - -export type PartialGameBadgeOptions = GameBadgeBaseOptions; - - -export class PartialGameBadge extends GameBadgeBase { - // Shut up eslint, it's not useless - // eslint-disable-next-line no-useless-constructor - constructor (data: PartialGameBadgeOptions, client: Client) { - super(data, client); - } -} - - -export interface GamePassOptions { - id: number; - name: string; - displayName: string; - productId: number; - price: number; -} - - -export class GamePass { - public client: Client; - public id: number; - public name: string; - public displayName: string; - public productId: number; - public price: number; - - constructor (data: GamePassOptions, client: Client) { - this.client = client; - this.id = data.id; - this.name = data.name; - this.displayName = data.displayName; - this.productId = data.productId; - this.price = data.price; - } -} - - -export interface BasePlaceOptions { - id: number; - name?: string; -} - - -export class BasePlace { - public client: Client; - public id: number; - public name: string | null; - - constructor (options: BasePlaceOptions, client: Client) { - this.client = client; - this.id = options.id; - this.name = options.name || null; - } - - getCompatibilities () { - return this.client.apis.developAPI.getPlaceCompatibilities({ - placeId: this.id - }); - } - - updatePlaceConfiguration (options: { name: string; description: string }) { - return this.client.apis.developAPI.updatePlaceConfiguration({ - placeId: this.id, - ...options - }); - } - - getStatistics (options: Omit) { - return this.client.apis.developAPI.getPlaceStatistics({ - placeId: this.id, - ...options - }); - } - - awardBadge (userId: number, badgeId: number) { - return this.client.apis.generalApi.awardBadge({ - placeId: this.id, - badgeId, - userId - }); - } - - getGameServers (options: Omit) { - return this.client.apis.gamesAPI.getGameServersByType({ - placeId: this.id, - ...options - }); - } -} - - -export interface PlaceOptions { - placeId: number; - name: string; - url: string; - description: string; - builder: string; - builderId: number; - isPlayable: boolean; - reasonProhibited: string; - universeId: number; - universeRootPlaceId: number; - price: number; - imageToken: string; -} - - -export class Place extends BasePlace { - public description: string; - public url: string; - public creatorName: string; - public creatorId: number; - public playable: boolean; - public prohibitedReason: string; - public prohibited: boolean; - public universe: PartialGameUniverse; - public price: number; - public imageToken: string; - - constructor (data: PlaceOptions, client: Client) { - const structures = retrieveStructures(); - - super({ - id: data.placeId, - name: data.name - }, client); - this.description = data.description; - this.url = data.url; - this.creatorName = data.builder; - this.creatorId = data.builderId; - this.playable = data.isPlayable; - this.prohibitedReason = data.reasonProhibited; - this.prohibited = this.prohibitedReason.toLowerCase() !== "none"; - this.universe = new structures.PartialGameUniverse({ - id: data.universeId, - rootPlace: { - id: data.universeRootPlaceId - } - }, client); - this.price = data.price; - this.imageToken = data.imageToken; - } -} - - -interface PartialPlaceOptions { - id: number; - name?: string | null; -} - - -export class PartialPlace extends BasePlace { - constructor (data: PartialPlaceOptions, client: Client) { - super({ - id: data.id, - name: data.name || undefined - }, client); - } -} - - -export interface PartialGameUniverseOptions { - id: number; - name?: string; - rootPlace?: { - id: number; - name?: string | null; - }; -} - - -export class PartialGameUniverse { - public client: Client; - public id: number; - public name: string | null; - public rootPlace: PartialPlace | null; - - constructor (data: PartialGameUniverseOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.name = data.name || null; - this.rootPlace = data.rootPlace ? new structures.PartialPlace({ - id: data.rootPlace.id, - name: data.rootPlace.name || null - }, client) : null; - } -} - - -export interface GameUniverseOptions { - id: number; - rootPlaceId: number; - name: string; - description: string; - creatorType: string; - creator: { - id: number; - name: string; - }; - price: number; - allowedGearGenres: string[]; - allowedGearCategories: string[]; - playing: number; - visits: number; - maxPlayers: number; - created: string; - updated: string; - studioAccessToApisAllowed: boolean; - createVipServersAllowed: boolean; - universeAvatarType: string; - genre: string; -} - - -export class GameUniverse { - public client: Client; - public id: number; - public rootPlace: PartialPlace | null; - public name: string; - public description: string; - public creatorType: CreatorType; - public creator: PartialGroup | PartialUser; - public price: number | null; - public allowedGearGenres: string[]; - public allowedGearCategories: string[]; - public playing: number; - public visits: number; - public maxPlayers: number; - public created: Date; - public updated: Date; - public studioAccessToAPIsEnabled: boolean; - public createVIPServersEnabled: boolean; - public avatarType: MorphAvatarType; - public genre: GameGenre; - - constructor (data: GameUniverseOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.rootPlace = data.rootPlaceId ? new structures.PartialPlace({ - id: data.rootPlaceId - }, client) : null; - this.name = data.name; - this.description = data.description; - this.creatorType = data.creatorType.toLowerCase() === "group" ? CreatorType.GROUP : CreatorType.USER; - this.creator = this.creatorType === CreatorType.GROUP ? new structures.PartialGroup({ - id: data.creator.id, - name: data.creator.name - }, client) : new structures.PartialUser({ - id: data.creator.id, - name: data.creator.name - }, client); - this.price = data.price; - this.allowedGearGenres = data.allowedGearGenres; - this.allowedGearCategories = data.allowedGearCategories; - this.playing = data.playing; - this.visits = data.visits; - this.maxPlayers = data.maxPlayers; - this.created = new Date(data.created); - this.updated = new Date(data.updated); - this.studioAccessToAPIsEnabled = data.studioAccessToApisAllowed; - this.createVIPServersEnabled = data.createVipServersAllowed; - this.avatarType = data.universeAvatarType.toLowerCase() === "morphtor6" ? MorphAvatarType.R6 : MorphAvatarType.R15; - this.genre = data.genre as GameGenre; - } -} - - -export interface PartialVIPServerOptions { - id: number; -} - - -export class PartialVIPServer { - public client: Client; - public id: number; - - constructor (data: PartialVIPServerOptions, client: Client) { - this.client = client; - this.id = data.id; - } -} - - -export interface VIPServerOptions { - id: number; - name: string; - game: { - id: number; - name: string; - rootPlace: { - id: number; - name: string; - }; - }; - joinCode: string; - active: boolean; - subscription: { - active: boolean; - expired: boolean; - expirationDate: string; - price: number; - }; - permissions: { - clanAllowed: boolean; - enemyClanId: number | number; - friendsAllowed: boolean; - users: { - id: number; - name: string; - displayName: string; - }[]; - }; -} - - -export class VIPServer { - public client: Client; - public id: number; - public name: string; - public game: PartialGameUniverse; - public code: string; - public active: boolean; - public subscription: { - active: boolean; - expired: boolean; - expirationDate: Date; - price: number; - }; - public permissions: { - clanAllowed: boolean; - enemyClanId: number; - friendsAllowed: boolean; - users: PartialUser[]; - }; - - constructor (data: VIPServerOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id; - this.name = data.name; - this.game = new structures.PartialGameUniverse({ - id: data.game.id, - name: data.game.name, - rootPlace: { - id: data.game.rootPlace.id, - name: data.game.rootPlace.name - } - }, client); - this.active = data.active; - this.code = data.joinCode; - this.subscription = { - active: data.subscription.active, - expired: data.subscription.expired, - expirationDate: new Date(data.subscription.expirationDate), - price: data.subscription.price - }; - this.permissions = { - clanAllowed: data.permissions.clanAllowed, - enemyClanId: data.permissions.enemyClanId, - friendsAllowed: data.permissions.friendsAllowed, - users: data.permissions.users.map(userData => new structures.PartialUser(userData, client)) - }; - } -} - - -export interface GameMediaDataOptions { - assetTypeId: number; - assetType: "Video" | "Image" | string; - imageId: number | null; - videoHash: string | null; - videoTitle: string | null; - approved: boolean; -} - - -export class GameMediaData { - public client: Client; - public assetTypeId: number; - public assetType: "Video" | "Image" | string; - public imageId: number | null; - public videoHash: string | null; - public videoTitle: string | null; - public approved: boolean; - - constructor (data: GameMediaDataOptions, client: Client) { - this.client = client; - this.assetTypeId = data.assetTypeId; - this.assetType = data.assetType; - this.imageId = data.imageId; - this.videoHash = data.videoHash; - this.videoTitle = data.videoTitle; - this.approved = data.approved; - } -} diff --git a/src/structures/Group.ts b/src/structures/Group.ts deleted file mode 100644 index 50c75a7a1..000000000 --- a/src/structures/Group.ts +++ /dev/null @@ -1,932 +0,0 @@ -import Client from "../client"; -import { GetGroupUniversesOptions } from "../client/apis/DevelopAPI"; -import { CursorPage } from "./Asset"; -import { PartialGameUniverse, PartialGameUniverseOptions } from "./Game"; -import { - GetGroupRevenueSummaryInTimeFrame, - GetGroupRevenueSummaryInTimeFrameOptions, - GetGroupTransactions, - GetGroupTransactionsOptions -} from "../client/apis/EconomyAPI"; -import { - AcceptJoinRequest, - AcceptJoinRequests, - AcceptJoinRequestsOptions, - AcceptRelationshipRequest, - AcceptRelationshipRequests, - AcceptRelationshipRequestsOptions, - ChangeOwner, - ClaimGroup, - CreateRelationship, - CreateRelationshipOptions, - CreateRole, - CreateRoleOptions, - CreateWallPost, - CreateWallPostOptions, - DeclineJoinRequest, - DeclineJoinRequests, - DeclineRelationshipRequest, - DeclineRelationshipRequests, - DeclineRelationshipRequestsOptions, - DeleteRelationship, - DeleteRelationshipOptions, - DeleteRole, - DeleteSocialLink, - DeleteWallPost, - GetAllRolesPermissions, - GetGroupPayouts, - GetGroupRelationships, - GetGroupRelationshipsOptions, - GetGroupSettings, - GetGuestPermissions, - GetJoinRequest, - GetJoinRequestsOptions, - GetMembersOptions, - GetMembersWithRoleOptions, - GetRelationshipRequests, - GetRelationshipRequestsOptions, - GetRolePermissions, - GetSelfGroupMembership, - GetSocialLinks, - GetWallPostsOptions, - JoinGroup, - JoinGroupOptions, - KickMember, - PayoutMembers, - PayoutMembersOptions, - PostSocialLink, - PostSocialLinkOptions, - RemovePrimaryGroup, - SetPrimaryGroup, - UpdateGroupDescription, - UpdateGroupIcon, - UpdateGroupSettings, - UpdateGroupSettingsOptions, - UpdateGroupStatus, - UpdateMember, - UpdateRecurringPayouts, - UpdateRecurringPayoutsOptions, - UpdateRole, - UpdateRoleOptions, - UpdateRolePermissions, - UpdateRolePermissionsOptions, - UpdateSocialLink, - UpdateSocialLinkOptions -} from "../client/apis/GroupsAPI"; -import { PartialUser, PartialUserOptions, UserBase } from "./User"; - - -interface Structures { - PartialUser: new (data: PartialUserOptions, client: Client) => PartialUser; - PartialGameUniverse: new (data: PartialGameUniverseOptions, client: Client) => PartialGameUniverse; -} - - -const retrieveStructures = (): Structures => ({ - PartialUser: require("./User").PartialUser, - PartialGameUniverse: require("./Game").PartialGameUniverse -}); - -type GroupRelationships = Omit & { - groupId: number; - relationshipType: T; - totalGroupCount: number; - groups: Group[]; - nextRowIndex: number; -} - - -export interface GroupBaseOptions { - id: number; - name?: string; -} - - -export class GroupBase { - public client: Client; - public id: number; - public name: string | null; - - constructor (data: GroupBaseOptions, client: Client) { - this.client = client; - this.id = data.id; - this.name = data.name || null; - } - - getUniverses (options?: Omit): Promise> { - return this.client.apis.developAPI.getGroupUniverses({ - ...options, - groupId: this.id - }) - .then(response => { - const CursorPageClass = require("./Asset").CursorPage; - const structures = retrieveStructures(); - - return new CursorPageClass(this.client, options || {}, { - ...response, - data: response.data.map(universeData => new structures.PartialGameUniverse(({ - id: universeData.id, - name: universeData.name, - rootPlace: universeData.rootPlaceId ? { - id: universeData.rootPlaceId - } : undefined - }), this.client)) - }, this.getUniverses); - }); - } - - /** - * Returns whether the authenticated user can manage the group or not - * @returns {Promise} - */ - canSelfManage (): Promise { - return this.client.apis.developAPI.getSelfManageableGroups() - .then(response => !!response.data.find(data => data.id === this.id)); - } - - /** - * Gets the currently available funds in the group - * @returns {Promise} - */ - getFunds (): Promise { - return this.client.apis.economyAPI.getGroupCurrency({ - groupId: this.id - }) - .then(response => response.robux); - } - - getRevenueSummaryInTimeFrame (timeFrame: GetGroupRevenueSummaryInTimeFrameOptions["timeFrame"]): Promise { - return this.client.apis.economyAPI.getGroupRevenueByTime({ - groupId: this.id, - timeFrame - }); - } - - getTransactions (options: Omit): Promise { - return this.client.apis.economyAPI.getGroupTransactions({ - groupId: this.id, - ...options - }); - } - - getAllies (maxItems = 100, startItem?: number): Promise> { - return this.client.apis.groupsAPI.getGroupRelationships({ - relationshipType: "allies", - groupId: this.id, - maxRows: maxItems, - startRowIndex: startItem - }) - .then(response => ({ - ...response, - relationshipType: "allies", - groups: response.relatedGroups.map(groupData => new Group(groupData, this.client)) - })); - } - - getEnemies (maxItems = 100, startItem?: number): Promise> { - return this.client.apis.groupsAPI.getGroupRelationships({ - relationshipType: "enemies", - groupId: this.id, - maxRows: maxItems, - startRowIndex: startItem - }) - .then(response => ({ - ...response, - relationshipType: "enemies", - groups: response.relatedGroups.map(groupData => new Group(groupData, this.client)) - })); - } - - getGroup (): Promise { - return this.client.getGroup(this.id); - } - - getMember (userId: number): Promise { - return this.client.apis.groupsAPI.getUserGroups({ - userId - }) - .then(response => { - const foundGroup = response.data.find(groupData => groupData.group.id === this.id); - - if (foundGroup) { - // eslint-disable-next-line @typescript-eslint/no-use-before-define - return new GroupMember({ - id: userId, - role: foundGroup.role, - group: foundGroup.group - }, this.client); - } else { - return null; - } - }); - } - - getIsMember (userId: number): Promise { - console.warn(`group.getIsMember() is deprecated and may be removed in the future. Please switch to group.getMember`); - return this.getMember(userId); - } - - getSettings (): Promise { - return this.client.apis.groupsAPI.getGroupSettings({ - groupId: this.id - }); - } - - updateSettings (options: Omit): Promise { - return this.client.apis.groupsAPI.updateGroupSettings({ - groupId: this.id, - ...options - }); - } - - updateDescription (description: string): Promise { - return this.client.apis.groupsAPI.updateGroupDescription({ - description, - groupId: this.id - }); - } - - updateShout (shout: string): Promise { - return this.client.apis.groupsAPI.updateGroupStatus({ - groupId: this.id, - message: shout - }); - } - - updateIcon (file: unknown): Promise { - return this.client.apis.groupsAPI.updateGroupIcon({ - files: file, - groupId: this.id - }); - } - - declineJoinRequests (userIds: number[]): Promise { - return this.client.apis.groupsAPI.declineJoinRequests({ - groupId: this.id, - userIds - }); - } - - getJoinRequests (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.groupsAPI.getJoinRequests({ - groupId: this.id, - ...options - }) - .then(response => new CursorPageClass( - this.client, - options, - response, - this.getJoinRequests - )); - } - - acceptJoinRequests (options: Omit): Promise { - return this.client.apis.groupsAPI.acceptJoinRequests({ - groupId: this.id, - ...options - }); - } - - declineJoinRequest (userId: number): Promise { - return this.client.apis.groupsAPI.declineJoinRequest({ - groupId: this.id, - userId - }); - } - - getJoinRequest (userId: number): Promise { - return this.client.apis.groupsAPI.getJoinRequest({ - groupId: this.id, - userId - }); - } - - acceptJoinRequest (userId: number): Promise { - return this.client.apis.groupsAPI.acceptJoinRequest({ - groupId: this.id, - userId - }); - } - - getSelfMembership (): Promise { - return this.client.apis.groupsAPI.getSelfGroupMembership({ - groupId: this.id - }); - } - - getRoles (): Promise { - return this.client.apis.groupsAPI.getGroupRoles({ - groupId: this.id - }) - .then(response => response.roles.map(roleData => new GroupRole({ - group: { - id: this.id, - name: this.name || undefined - }, - ...roleData - }, this.client))); - } - - getMembersWithRole (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.groupsAPI.getMembersWithRole({ - groupId: this.id, - ...options - }) - .then(response => new CursorPageClass( - this.client, - options, - response, - this.getMembersWithRole - )); - } - - getMembers (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.groupsAPI.getMembers({ - groupId: this.id, - ...options - }) - .then(response => new CursorPageClass( - this.client, - options, - response, - this.getMembers - )); - } - - join (options: Omit): Promise { - return this.client.apis.groupsAPI.joinGroup({ - groupId: this.id, - ...options, - captchaProvider: options.captchaProvider || "PROVIDER_ARKOSELABS" - }); - } - - getIsPendingJoin (): Promise { - return this.client.apis.groupsAPI.getSelfPendingGroupJoins() - .then(response => (response.data.find(groupData => groupData.id === this.id) && true) || false); - } - - changeOwner (userId: number): Promise { - return this.client.apis.groupsAPI.changeGroupOwner({ - groupId: this.id, - userId - }); - } - - claim (): Promise { - return this.client.apis.groupsAPI.claimGroup({ - groupId: this.id - }); - } - - kickMember (userId: number): Promise { - return this.client.apis.groupsAPI.kickMember({ - groupId: this.id, - userId - }); - } - - updateMember (userId: number, roleId: number): Promise { - return this.client.apis.groupsAPI.updateMember({ - groupId: this.id, - roleId, - userId - }); - } - - getPayouts (): Promise { - return this.client.apis.groupsAPI.getGroupPayouts({ - groupId: this.id - }); - } - - payoutMembers (options: Omit): Promise { - return this.client.apis.groupsAPI.payoutMembers({ - groupId: this.id, - ...options - }); - } - - updateRecurringPayouts (options: Omit): Promise { - return this.client.apis.groupsAPI.updateRecurringPayouts({ - groupId: this.id, - ...options - }); - } - - getRelationships (options: Omit): Promise { - return this.client.apis.groupsAPI.getGroupRelationships({ - groupId: this.id, - ...options - }); - } - - declineRelationshipRequests (options: Omit): Promise { - return this.client.apis.groupsAPI.declineRelationshipRequests({ - groupId: this.id, - ...options - }); - } - - getRelationshipRequests (options: Omit): Promise { - return this.client.apis.groupsAPI.getRelationshipRequests({ - groupId: this.id, - ...options - }); - } - - acceptRelationshipRequests (options: Omit): Promise { - return this.client.apis.groupsAPI.acceptRelationshipRequests({ - groupId: this.id, - ...options - }); - } - - deleteRelationship (options: Omit): Promise { - return this.client.apis.groupsAPI.deleteRelationship({ - groupId: this.id, - ...options - }); - } - - createRelationship (options: Omit): Promise { - return this.client.apis.groupsAPI.createRelationship({ - groupId: this.id, - ...options - }); - } - - acceptRelationshipRequest (type: "enemies" | "allies", withGroup: number): Promise { - return this.client.apis.groupsAPI.acceptRelationshipRequest({ - groupId: this.id, - relationshipType: type || "allies", - withGroup - }); - } - - declineRelationshipRequest (type: "enemies" | "allies", withGroup: number): Promise { - return this.client.apis.groupsAPI.declineRelationshipRequest({ - groupId: this.id, - relationshipType: type || "allies", - withGroup - }); - } - - getRolePermissions (roleId: number): Promise { - return this.client.apis.groupsAPI.getRolePermissions({ - groupId: this.id, - roleId - }); - } - - updateRolePermissions (roleId: number, permissions: Omit): Promise { - return this.client.apis.groupsAPI.updateRolePermissions({ - groupId: this.id, - roleId, - ...permissions - }); - } - - getGuestPermissions (): Promise { - return this.client.apis.groupsAPI.getGuestPermissions({ - groupId: this.id - }); - } - - getAllRolesPermissions (): Promise { - return this.client.apis.groupsAPI.getAllRolesPermissions({ - groupId: this.id - }); - } - - getSocialLinks (): Promise { - return this.client.apis.groupsAPI.getSocialLinks({ - groupId: this.id - }); - } - - createSocialLink (options: Omit): Promise { - return this.client.apis.groupsAPI.createSocialLink({ - groupId: this.id, - ...options - }); - } - - deleteSocialLink (id: number): Promise { - return this.client.apis.groupsAPI.deleteSocialLink({ - groupId: this.id, - id - }); - } - - updateSocialLink (options: Omit): Promise { - return this.client.apis.groupsAPI.updateSocialLink({ - groupId: this.id, - ...options - }); - } - - getWallPosts (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.groupsAPI.getWallPosts({ - groupId: this.id, - ...options - }) - .then(response => new CursorPageClass( - this.client, - options, - response, - this.getWallPosts - )); - } - - createWallPost (options: Omit): Promise { - return this.client.apis.groupsAPI.createWallPost({ - groupId: this.id, - ...options - }); - } - - deleteWallPost (id: number): Promise { - return this.client.apis.groupsAPI.deleteWallPost({ - groupId: this.id, - id - }); - } - - getIsUserPrimaryGroup (userId: number): Promise { - return this.client.apis.groupsAPI.getUserPrimaryGroup({ - userId - }) - // eslint-disable-next-line @typescript-eslint/no-use-before-define - .then(response => response && response.group && response.role ? new GroupMember({ - group: response.group, - role: { - id: response.role!.id!, - name: response.role!.name!, - rank: response.role!.rank! - }, - id: userId - }, this.client) : null); - } - - removeAsPrimary (): Promise { - return this.client.apis.groupsAPI.removePrimaryGroup(); - } - - setAsPrimary (): Promise { - return this.client.apis.groupsAPI.setPrimaryGroup({ - groupId: this.id - }); - } - - createRole (options: Omit): Promise { - return this.client.apis.groupsAPI.createRole({ - groupId: this.id, - ...options - }); - } - - deleteRole (roleId: number): Promise { - return this.client.apis.groupsAPI.deleteRole({ - groupId: this.id, - roleId - }); - } - - updateRole (roleId: number, options: Omit): Promise { - return this.client.apis.groupsAPI.updateRole({ - groupId: this.id, - roleId, - ...options - }); - } -} - - -export interface PartialGroupOptions { - id: number; - name?: string; -} - - -export class PartialGroup extends GroupBase { - // Shut up eslint, this is not useless either - // eslint-disable-next-line no-useless-constructor - constructor (data: PartialGroupOptions, client: Client) { - super(data, client); - } -} - - -export interface GroupMemberOptions { - group: PartialGroupOptions; - name?: string | null; - /** - * The user id - */ - id: number; - role?: { - id: number; - name: string; - rank: number; - }; -} - - -export class GroupMember extends UserBase { - public group: PartialGroup; - public role: GroupRole | null; - - constructor (data: GroupMemberOptions, client: Client) { - super({ - name: data.name, - id: data.id - }, client); - this.group = new PartialGroup(data.group, client); - // eslint-disable-next-line @typescript-eslint/no-use-before-define - this.role = data.role ? new GroupRole({ - id: data.role.id, - name: data.role.name, - rank: data.role.rank, - group: { - name: this.name || undefined, - id: this.id - } - }, client) : null; - } - - kick (): Promise { - return this.kickFromGroup(this.id); - } -} - - -export interface GroupOptions { - id: number; - name: string; - description: string; - owner: { - buildersClubMembershipType: string; - userId: number; - username: string; - displayName: string; - } | null; - shout: { - body: string; - poster: { - buildersClubMembershipType: string; - userId: number; - username: string; - displayName: string; - }; - created: string; - updated: string; - } | null; - memberCount: number; - isBuildersClubOnly: boolean; - publicEntryAllowed: boolean; - isLocked: boolean; -} - - -export class Group extends GroupBase { - public description: string; - public name: string; - public owner: GroupMember | null; - public shout: GroupShout | null; - public memberCount: number; - public isBuildersClubOnly: boolean; - public publicEntryAllowed: boolean; - public isLocked: boolean; - - constructor (data: GroupOptions, client: Client) { - super(data, client); - this.description = data.description; - this.name = data.name; - this.owner = data.owner ? new GroupMember({ - id: data.owner.userId, - name: data.owner.username, - group: this - }, client) : null; - this.shout = data.shout ? new GroupShout({ - content: data.shout.body, - creator: { - id: data.shout.poster.userId, - username: data.shout.poster.username - }, - group: { - id: this.id, - name: this.name || undefined - } - }, client) : null; - this.memberCount = data.memberCount; - this.isBuildersClubOnly = data.isBuildersClubOnly; - this.publicEntryAllowed = data.publicEntryAllowed; - this.isLocked = data.isLocked; - } -} - - -export interface GroupJoinRequestOptions { - id?: number; - user: PartialUserOptions; - group: PartialGroupOptions; - created: string; -} - - -export class GroupJoinRequest { - public client: Client; - public id: number | null; - public user: PartialUser; - public group: PartialGroup; - public created: Date; - - constructor (data: GroupJoinRequestOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.id = data.id || null; - this.user = new structures.PartialUser(data.user, client); - this.group = new PartialGroup(data.group, client); - this.created = new Date(data.created); - } -} - - -export interface GroupRoleOptions { - id?: number; - name?: string; - rank?: number; - group: { - id: number; - name?: string; - }; -} - - -export class GroupRole { - public client: Client; - public id: number | null; - public name: string | null; - public rank: number | null; - public group: PartialGroup; - - constructor (data: GroupRoleOptions, client: Client) { - this.client = client; - this.id = data.id || null; - this.name = data.name || null; - this.rank = data.rank || null; - this.group = new PartialGroup({ - id: data.group.id, - name: data.group.name - }, client); - } -} - - -export interface GroupRolePermissionsOptions { - groupId: number; - role: { - id: number; - name: string; - description: string; - rank: number; - memberCount: number; - }; - permissions: { - groupPostsPermissions: { - viewWall: boolean; - postToWall: boolean; - deleteFromWall: boolean; - viewStatus: boolean; - postToStatus: boolean; - }; - groupMembershipPermissions: { - changeRank: boolean; - inviteMembers: boolean; - removeMembers: boolean; - }; - groupManagementPermissions: { - manageRelationships: boolean; - manageClan: boolean; - viewAuditLogs: boolean; - }; - groupEconomyPermissions: { - spendGroupFunds: boolean; - advertiseGroup: boolean; - createItems: boolean; - manageItems: boolean; - addGroupPlaces: boolean; - manageGroupGames: boolean; - viewGroupPayouts: boolean; - }; - }; -} - - -export class GroupRolePermissions { - public client: Client; - public group: PartialGroup; - public role: GroupRole; - public permissions: GroupRolePermissionsOptions["permissions"]; - - constructor (data: GroupRolePermissionsOptions, client: Client) { - this.client = client; - this.group = new PartialGroup({ - id: data.groupId - }, client); - this.role = new GroupRole({ - id: data.role.id, - name: data.role.name, - rank: data.role.rank, - group: { - id: this.group.id - } - }, client); - this.permissions = data.permissions; - } -} - - -export interface GroupShoutOptions { - content: string; - creator: { - id: number; - username: string; - }; - group: { - id: number; - name?: string; - }; -} - - -export class GroupShout { - public client: Client; - public content: string; - public creator: PartialUser; - public group: PartialGroup; - - constructor (data: GroupShoutOptions, client: Client) { - const structures = retrieveStructures(); - - this.client = client; - this.content = data.content; - this.creator = new structures.PartialUser(data.creator, client); - this.group = new PartialGroup({ - id: data.group.id, - name: data.group.name - }, client); - } -} - - -export interface GroupWallPostOptions { - id: number; - poster: { - buildersClubMembershipType: string; - userId: number; - username: string; - displayName: string; - }; - group: { - id: number; - name?: string; - }; - body: string; - created: string; - updated: string; -} - - -export class GroupWallPost { - public client: Client; - public id: number; - public creator: GroupMember; - public content: string; - public created: Date; - - constructor (data: GroupWallPostOptions, client: Client) { - this.client = client; - this.id = data.id; - this.content = data.body; - this.creator = new GroupMember({ - group: { - id: data.group.id, - name: data.group.name - }, - id: data.poster.userId, - name: data.poster.username - }, client); - this.created = new Date(data.created); - } -} diff --git a/src/structures/User.ts b/src/structures/User.ts index 6efea37c7..e1e72cc42 100644 --- a/src/structures/User.ts +++ b/src/structures/User.ts @@ -1,712 +1,30 @@ -import Client from "../client"; -import { - GetUserAvatar, - GetUserCurrentlyWearing, - GetUserOutfits, - GetUserOutfitsOptions -} from "../client/apis/AvatarAPI"; -import { DeleteBadgeFromUser, GetUserBadges, GetUserBadgesOptions } from "../client/apis/BadgesAPI"; -import { CursorPage } from "./Asset"; -import { GetUserBundles, GetUserBundlesByType, GetUserBundlesOptions } from "../client/apis/CatalogAPI"; -import { AddUsersToConversation, RemoveUserFromConversation, StartOneToOneConversation } from "../client/apis/ChatAPI"; -import { GetUsersTags, SetPendingUserTag, SetUserTag } from "../client/apis/ContactsAPI"; -import { RemoveUserFromUniverseTeamCreate } from "../client/apis/DevelopAPI"; -import { GetUserResellableAssetCopies } from "../client/apis/EconomyAPI"; -import { - AcceptFriendRequest, - DeclineFriendRequest, - FollowUser, - GetUserFollowers, - GetUserFollowersOptions, - GetUserFollowing, - GetUserFollowingOptions, - GetUserFriendsWithStatuses, - SendFriendRequest, - UnFollowUser, - UnfriendUser -} from "../client/apis/FriendsAPI"; -import { GetJoinRequest, GetUserGroups, GetUserPrimaryGroup, PayoutMembersOptions } from "../client/apis/GroupsAPI"; -import { - GetUserCollectibles, - GetUserCollectiblesOptions, - GetUserInventory, - GetUserInventoryByAssetTypeId, - GetUserInventoryByAssetTypeIdOptions, - GetUserInventoryOptions, - GetUserItemsByTypeAndTargetId, - GetUserItemsByTypeAndTargetIdOptions -} from "../client/apis/InventoryAPI"; -import { - PremiumUpsellCheck, - PremiumUpsellCheckOptions, - ValidateUserMembership -} from "../client/apis/PremiumFeaturesAPI"; -import { GetUsersPresences } from "../client/apis/PresenceAPI"; -import { SendMessage, SendMessageOptions } from "../client/apis/PrivateMessagesAPI"; -import { - GetUsersAvatarBustImages, - GetUsersAvatarBustImagesOptions, - GetUsersAvatarHeadShotsImages, - GetUsersAvatarHeadShotsImagesOptions, - GetUsersFullBodyAvatarImages, - GetUsersFullBodyAvatarImagesOptions -} from "../client/apis/ThumbnailsAPI"; -import { SendTrade, SendTradeOptions } from "../client/apis/TradesAPI"; -import { UpdateUser, UpdateUserAccess } from "../client/apis/TranslationRolesAPI"; -import { EnumUserPresence } from "../interfaces/GeneralInterfaces"; - - -export interface UserBaseOptions { - id: number; - name?: string | null; - displayName?: string; - membership?: boolean; -} - - -export class UserBase { - public client: Client; - public id: number; - public name: string | null; - public displayName: string | null; - public membership: unknown; - - constructor (data: UserBaseOptions, client: Client) { - this.client = client; - this.id = data.id; - this.name = data.name || null; - this.displayName = data.displayName || null; - this.membership = data.membership || null; - } - - getStatus (): Promise { - return this.client.apis.usersAPI.getUserStatus({ - userId: this.id - }) - .then(response => response.status); - } - - getAvatar (): Promise { - return this.client.apis.avatarAPI.getUserAvatar({ - userId: this.id - }); - } - - getCurrentlyWearing (): Promise { - return this.client.apis.avatarAPI.getUserCurrentlyWearing({ - userId: this.id - }); - } - - getOutfits (options: Omit): Promise { - return this.client.apis.avatarAPI.getUserOutfits({ - ...options, - userId: this.id - }); - } - - getBadges (options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.badgesAPI.getUserBadges({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getBadges) as CursorPage); - } - - getBadgesAwardedDates (badges: number[]): Promise<{ id: number; awardedAt: Date }[]> { - return this.client.apis.badgesAPI.getUserBadgesAwardedDates({ - badgeIds: badges, - userId: this.id - }) - .then(response => response.data.map(badgeAwarded => ({ - id: badgeAwarded.badgeId, - awardedAt: new Date(badgeAwarded.awardedDate) - }))); - } - - deleteBadge (badgeId: number): Promise { - return this.client.apis.badgesAPI.deleteBadgeFromUser({ - badgeId, - userId: this.id - }); - } - - getBundles (options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.catalogAPI.getUserBundles({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getBundles)); - } - - getBundlesByType (bundleType: string, options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.catalogAPI.getUserBundlesByType({ - ...options, - userId: this.id, - bundleType - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getBundlesByType)); - } - - addToChatConversation (conversationId: number): Promise { - return this.client.apis.chatAPI.addUsersToConversation({ - conversationId, - participantUserIds: [this.id] - }); - } - - removeFromConversation (conversationId: number): Promise { - return this.client.apis.chatAPI.removeUserFromConversation({ - conversationId, - participantUserId: this.id - }); - } - - startConversation (): Promise { - return this.client.apis.chatAPI.startOneToOneConversation({ - participantUserId: this.id - }); - } - - getTag (): Promise { - return this.client.apis.contactsAPI.getUsersTags({ - targetUserIds: [this.id] - }) - .then(response => response[0]); - } - - setPendingTag (tag: string): Promise { - return this.client.apis.contactsAPI.setPendingUserTag({ - userTag: tag, - targetUserId: this.id - }); - } - - setTag (tag: string): Promise { - return this.client.apis.contactsAPI.setUserTag({ - targetUserId: this.id, - userTag: tag - }); - } - - removeFromTeamCreate (universeId: number): Promise { - return this.client.apis.developAPI.removeUserFromUniverseTeamCreate({ - userId: this.id, - universeId - }); - } - - getResellableAssetCopies (assetId: number): Promise { - return this.client.apis.economyAPI.getUserResellableAssetCopies({ - assetId, - userId: this.id - }); - } - - getFollowers (options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.friendsAPI.getUserFollowers({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getFollowers)); - } - - getFollowersCount (): Promise { - return this.client.apis.friendsAPI.getUserFollowersCount({ - userId: this.id - }) - .then(response => response.count); - } - - getFollowing (options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.friendsAPI.getUserFollowing({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getFollowing)); - } - - getFollowingCount (): Promise { - return this.client.apis.friendsAPI.getUserFollowingCount({ - userId: this.id - }) - .then(response => response.count); - } - - getFriends (): Promise { - return this.client.apis.friendsAPI.getUserFriends({ - userId: this.id - }) - .then(response => response.data.map(friendRequest => new FriendRequest(friendRequest, this.client))); - } - - getFriendsCount (): Promise { - return this.client.apis.friendsAPI.getUserFriendsCount({ - userId: this.id - }) - .then(data => data.count); - } - - getFriendsWithStatuses (userIds: number[]): Promise { - return this.client.apis.friendsAPI.getUserFriendsWithStatuses({ - userId: this.id, - withUserIds: userIds - }); - } - - follow (): Promise { - return this.client.apis.friendsAPI.followUser({ - userId: this.id - }); - } - - friend (source?: string): Promise { - return this.client.apis.friendsAPI.sendFriendRequest({ - source: source || "Unknown", - userId: this.id - }); - } - - unFollow (): Promise { - return this.client.apis.friendsAPI.unFollowUser({ - userId: this.id - }); - } - - unfriend (): Promise { - return this.client.apis.friendsAPI.unfriendUser({ - userId: this.id - }); - } - - acceptFriendRequest (): Promise { - return this.client.apis.friendsAPI.acceptFriendRequest({ - userId: this.id - }); - } - - declineFriendRequest (): Promise { - return this.client.apis.friendsAPI.declineFriendRequest({ - userId: this.id - }); - } - - canInviteToVIPServer (): Promise { - return this.client.apis.gamesAPI.canSelfInviteUserToVIPServer({ - userId: this.id - }) - .then(response => response.canInvite); - } - - awardBadge (badgeId: number, placeId: number): Promise { - return this.client.apis.generalApi.awardBadge({ - badgeId, - placeId, - userId: this.id - }) - .then(response => response as unknown as string); - } - - isFollowedByUser (userId: number): Promise { - return this.client.apis.generalApi.isUserFollowing({ - userId, - followUserId: this.id - }); - } - - getGroups (): Promise { - return this.client.apis.groupsAPI.getUserGroups({ - userId: this.id - }); - } - - ownsAsset (assetId: number): Promise { - return this.client.apis.generalApi.userOwnsAsset({ - userId: this.id, - assetId - }); - } - - block (): Promise { - return this.client.apis.generalApi.blockUser({ - userId: this.id - }); - } - - unblock (): Promise { - return this.client.apis.generalApi.unblockUser({ - userId: this.id - }); - } - - canManageAsset (assetId: number): Promise { - return this.client.apis.generalApi.userCanManageAsset({ - assetId, - userId: this.id - }); - } - - acceptJoinRequestInGroup (groupId: number): Promise { - return this.client.apis.groupsAPI.acceptJoinRequest({ - groupId, - userId: this.id - }); - } - - declineJoinRequestInGroup (groupId: number): Promise { - return this.client.apis.groupsAPI.declineJoinRequest({ - groupId, - userId: this.id - }); - } - - getJoinRequestInGroup (groupId: number): Promise { - return this.client.apis.groupsAPI.getJoinRequest({ - groupId, - userId: this.id - }); - } - - setGroupOwner (groupId: number): Promise { - return this.client.apis.groupsAPI.changeGroupOwner({ - groupId, - userId: this.id - }); - } - - kickFromGroup (groupId: number): Promise { - return this.client.apis.groupsAPI.kickMember({ - groupId: groupId, - userId: this.id - }); - } - - updateMemberInGroup (groupId: number, roleId: number): Promise { - return this.client.apis.groupsAPI.updateMember({ - groupId, - roleId, - userId: this.id - }); - } - - payoutUserFromGroup (options: { - groupId: number; - type: PayoutMembersOptions["type"]; - amount: number; - }): Promise { - return this.client.apis.groupsAPI.payoutMembers({ - type: options.type, - groupId: options.groupId, - users: [ - { - userId: this.id, - amount: options.amount - } - ] - }); - } - - deleteGroupWallPosts (groupId: number): Promise { - return this.client.apis.groupsAPI.deleteUserWallPosts({ - groupId, - userId: this.id - }); - } - - getPrimaryGroup (): Promise { - return this.client.apis.groupsAPI.getUserPrimaryGroup({ - userId: this.id - }); - } - - getCollectibles (options?: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.inventoryAPI.getUserCollectibles({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options || {}, response, this.getCollectibles)); - } - - getItemsByTypeAndTargetId (itemType: GetUserItemsByTypeAndTargetIdOptions["itemType"], id: number): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.inventoryAPI.getUserItemsByTypeAndTargetId({ - itemType, - itemTargetId: id, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, {}, response, this.getItemsByTypeAndTargetId)); - } - - getInventory (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.inventoryAPI.getUserInventory({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options, response, this.getInventory)); - } - - getInventoryByAssetTypeId (options: Omit): Promise> { - const CursorPageClass = require("./Asset").CursorPage; - - return this.client.apis.inventoryAPI.getUserInventoryByAssetTypeId({ - ...options, - userId: this.id - }) - .then(response => new CursorPageClass(this.client, options, response, this.getInventoryByAssetTypeId)); - } - - getUser (): Promise { - return this.client.getUser(this.id); - } - - getPremiumMembership (): Promise { - return this.client.apis.premiumFeaturesAPI.validateUserMembership({ - userId: this.id - }); - } - - upsellPremiumCheck (options: Omit): Promise { - return this.client.apis.premiumFeaturesAPI.premiumUpsellCheck({ - ...options, - userId: this.id - }); - } - - getPresence (): Promise { - return this.client.apis.presenceAPI.getUsersPresences({ - userIds: [this.id] - }) - .then(response => response.userPresences[0]); - } - - sendMessage (options: Omit): Promise { - return this.client.apis.privateMessagesAPI.sendMessage({ - ...options, - userId: this.id - }); - } - - getFullBodyAvatarImage (options: Omit): Promise { - return this.client.apis.thumbnailsAPI.getUsersFullBodyAvatarImages({ - ...options, - userIds: [this.id] - }) - .then(response => response.data[0]); - } - - getAvatarBustImage (options: Omit): Promise { - return this.client.apis.thumbnailsAPI.getUsersAvatarBustImages({ - ...options, - userIds: [this.id] - }) - .then(response => response.data[0]); - } - - getAvatarHeadShotImage (options: Omit): Promise { - return this.client.apis.thumbnailsAPI.getUsersAvatarHeadShotImages({ - ...options, - userIds: [this.id] - }) - .then(response => response.data[0]); - } - - getCanTrade (): Promise { - return this.client.apis.tradesAPI.canTradeWith({ - userId: this.id - }) - .then(response => response.canTrade); - } - - sendTrade (offers: Omit[]): Promise { - return this.client.apis.tradesAPI.sendTrade({ - offers: offers.map(offerData => ({ - userId: this.id, - robux: offerData.robux, - userAssetIds: offerData.userAssetIds - })) - }); - } - - updateTranslationGameAccess (options: Omit): Promise { - return this.client.apis.translationRolesAPI.updateUserAccess({ - ...options, - userId: this.id - }); - } -} - - -export interface FriendRequestOptions { - description: string; - created: string; - isBanned: boolean; - id: number; - name: string; -} - - -export class FriendRequest { - public client: Client; - public user: PartialUser; - public isBanned: boolean; - public created: Date; - public description: string; - - constructor (data: FriendRequestOptions, client: Client) { - this.client = client; - this.user = new PartialUser({ - id: data.id, - name: data.name - }, client); - this.created = new Date(data.created); - this.description = data.description; - this.isBanned = data.isBanned; - } -} - - -export interface PartialUserOptions { - id: number; - name?: string; - displayName?: string; -} - - -export class PartialUser extends UserBase { - // Eslint, I'm getting tired of you complaining about useless constructors. - // You are useless - // eslint-disable-next-line no-useless-constructor - constructor (data: PartialUserOptions, client: Client) { - super(data, client); - } -} - - -export interface UserOptions { - id: number; - name: string; - displayName: string; - friendsCount: number; - presenceType: EnumUserPresence; - lastLocation: string | null; - userStatus: string | null; - userStatusDate: string | null; - userPlaceId: number | null; - followersCount: number; - followingsCount: number; - isVieweeBlocked: boolean; - isViewerBlocked: boolean; - areFriends: boolean; - canFollow: boolean; - canMessage: boolean; - canFriend: boolean; - canTrade: boolean; - incomingFriendRequest: boolean; - sentFriendRequest: boolean; - canSeeFavorites: boolean; - messagesDisabled: boolean; - canSeeInventory: boolean; - headShotImage: { - final: boolean; - url: string; - retryUrl: string | null; - userId: number; - endpointType: "Avatar" | string; - }; - previousUsernames: string; -} - - -export class User extends PartialUser { - public friendsCount: number; - public presenceType: EnumUserPresence; - public lastLocation: string | null; - public status: string | null; - public statusDate: Date | null; - public placeId: number | null; - public followersCount: number; - public followingCount: number; - /** - * If the authenticated user has blocked the user - */ - public isBlocked: boolean; - /** - * If the user has blocked the authenticated user - */ - public hasBlocked: boolean; - /** - * If the authenticated user and the target user are friends - */ - public areFriends: boolean; - public canFollow: boolean; - public canMessage: boolean; - public canFriend: boolean; - /** - * If the authenticated user has sent a friend request to this user - */ - public sentFriendRequest: boolean; - /** - * If the target user has sent a friend request to the authenticated user - */ - public incomingFriendRequest: boolean; - public messagesDisabled: boolean; - public canSeeFavorites: boolean; - public canTrade: boolean; - public canSeeInventory: boolean; - public previousNames: string[]; - public headshotImage: { - final: boolean; - url: string | null; - retryUrl: string | null; - userId: number; - endpointType: "Avatar" | string; - }; - - constructor (data: UserOptions, client: Client) { - super(data, client); - this.friendsCount = data.friendsCount; - this.presenceType = data.presenceType; - this.lastLocation = data.lastLocation || null; - this.status = data.userStatus || null; - const matchedStatusTimestamp = data.userStatusDate ? data.userStatusDate.match(/\((.*)\)/) : null; - this.statusDate = matchedStatusTimestamp ? new Date(parseInt(matchedStatusTimestamp[1])) : null; - this.placeId = data.userPlaceId; - this.followersCount = data.followersCount; - this.followingCount = data.followingsCount; - this.isBlocked = data.isVieweeBlocked; - this.hasBlocked = data.isViewerBlocked; - this.areFriends = data.areFriends; - this.canFollow = data.canFollow; - this.canMessage = data.canMessage; - this.canFriend = data.canFriend; - this.sentFriendRequest = data.sentFriendRequest; - this.incomingFriendRequest = data.incomingFriendRequest; - this.messagesDisabled = data.messagesDisabled; - this.canSeeFavorites = data.canSeeFavorites; - this.canTrade = data.canTrade; - this.canSeeInventory = data.canSeeInventory; - this.previousNames = data.previousUsernames.split("\r\n"); - this.headshotImage = { - final: data.headShotImage.final, - url: data.headShotImage.url, - retryUrl: data.headShotImage.retryUrl, - userId: data.headShotImage.userId, - endpointType: data.headShotImage.endpointType - }; - } +import { Client, UsersGetUserById } from ".."; +import { BaseUser } from "./BaseUser"; + +type UserConstructorData = UsersGetUserById; + +/** + * Represents a roblox user + */ +export class User extends BaseUser { + readonly name: string; + readonly displayName: string; + readonly externalAppDisplayName: string; + readonly isBanned: boolean; + readonly description: string; + readonly created: Date; + + /** + * @param {Client} client The Bloxy Client + * @param {number} userId The user ID + */ + constructor(client: Client, data: UserConstructorData) { + super(client, data.id); + this.name = data.name; + this.displayName = data.displayName; + this.externalAppDisplayName = data.externalAppDisplayName; + this.isBanned = data.isBanned; + this.description = data.description; + this.created = new Date(data.created); + } } diff --git a/src/types/GenericOptionTypes.ts b/src/types/GenericOptionTypes.ts new file mode 100644 index 000000000..1e15acf40 --- /dev/null +++ b/src/types/GenericOptionTypes.ts @@ -0,0 +1,43 @@ +export type UserIdOption = { + userId: number; +}; +export type UserIdsOption = { + userIds: number[]; +}; +export type PlaceIdOption = { + placeId: number; +}; +export type PlaceIdsOption = { + placeIds: number[]; +}; +export type UniverseIdOption = { + universeId: number; +}; +export type UniverseIdsOption = { + universeIds: number[]; +}; +export type AssetIdOption = { + assetId: number; +}; +export type AssetIdsOption = { + assetIds: number[]; +}; +export type GroupIdOption = { + groupId: number; +}; +export type GroupIdsOption = { + groupIds: number[]; +}; +export type SortOption = { + sortOrder?: "Asc" | "Desc"; + limit?: 10 | 25 | 50 | 100; + cursor?: string; +}; +export type UsernamePasswordOption = { + username: string; + password: string; +}; +export type PageSortOrder = SortOption["sortOrder"]; +export type PageSortLimit = SortOption["limit"]; +export type PageSortCursor = SortOption["cursor"]; +export type ItemType = "Asset" | "GamePass" | "Badge" | "Bundle"; diff --git a/src/types/GenericTypes.ts b/src/types/GenericTypes.ts new file mode 100644 index 000000000..38ca45fbf --- /dev/null +++ b/src/types/GenericTypes.ts @@ -0,0 +1,16 @@ +export type Privacy = + | "NoOne" + | "Friends" + | "Following" + | "Followers" + | "AllUsers"; + +export type ISOString = string; +export type CursorData = { + previousPageCursor?: string; + nextPageCursor?: string; + data: T; +}; +export type SuccessResponse = { + success: boolean; +}; diff --git a/src/util/constants.ts b/src/util/constants.ts index 5c31e1e5c..8f1c8dc04 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -1,68 +1,76 @@ // All naming conventions Roblox uses for identifier types (userId, groupId, etc.) export const identifierNames = { - userId: [ - "ProfileUserId", "UserId", "userId", "userid", "PlayerId", "playerId", "playerid", - "targetUserId", "ID", "id", "Id", "targetID"], - groupId: [ - "GroupId", "groupId", "Groupid", "Id", "ID", "id" - ], - name: [ - "Name", "name" - ], - username: [ - "ProfileUserName", "Username", "username", "userName", "UserName", "Name", "name" - ], - friendsCount: [ - "numFriends", "NumFriends", "numfriends", "FriendsCount" - ] + userId: [ + "ProfileUserId", + "UserId", + "userId", + "userid", + "PlayerId", + "playerId", + "playerid", + "targetUserId", + "ID", + "id", + "Id", + "targetID" + ], + groupId: ["GroupId", "groupId", "Groupid", "Id", "ID", "id"], + name: ["Name", "name"], + username: [ + "ProfileUserName", + "Username", + "username", + "userName", + "UserName", + "Name", + "name" + ], + friendsCount: ["numFriends", "NumFriends", "numfriends", "FriendsCount"] }; export const StatusCodeReasons = { - 400: [ - "Bad Request (invalid values provided)", - "Invalid body type (content-type) sent", - "Bloxy sent an invalid request (from faulty code, feel free to check it out and submit an issue / PR)", - "(Roblox's fault for not saying) All data provided was valid but you don't have access to view the response or the requested data" - ], - 401: [ - "You're not logged in (use .login on the client to log in)", - "The cookie was not provided in the request, or invalid cookie provided" - ], - 403: [ - "A captcha is required", - "You don't have the proper permissions", - "You're not authorized" - ], - 404: [ - "Invalid request method (i.e. POST instead of GET)", - "Resource removed / updated to another route", - "You're not logged in (use .login on the client to log in)" - ], - 429: [ - "You're sending too many requests. Roblox has rate limits in place to prevent abuse", - "Your IP has sent too many requests" - ], - 500: [ - "Roblox is down", - "There is an error in Roblox's API handler (causing a server error)", - "Invalid body provided which results in the API failing" - ] + 400: [ + "Bad Request (invalid values provided)", + "Invalid body type (content-type) sent", + "Bloxy sent an invalid request (from faulty code, feel free to check it out and submit an issue / PR)", + "(Roblox's fault for not saying) All data provided was valid but you don't have access to view the response or the requested data" + ], + 401: [ + "You're not logged in (use .login on the client to log in)", + "The cookie was not provided in the request, or invalid cookie provided" + ], + 403: [ + "A captcha is required", + "You don't have the proper permissions", + "You're not authorized" + ], + 404: [ + "Invalid request method (i.e. POST instead of GET)", + "Resource removed / updated to another route", + "You're not logged in (use .login on the client to log in)" + ], + 429: [ + "You're sending too many requests. Roblox has rate limits in place to prevent abuse", + "Your IP has sent too many requests" + ], + 500: [ + "Roblox is down", + "There is an error in Roblox's API handler (causing a server error)", + "Invalid body provided which results in the API failing" + ] }; - export enum CreatorType { - USER = 1, - GROUP = 2 + USER = 1, + GROUP = 2 } - export enum MorphAvatarType { - R6 = "MorphToR6", - R15 = "MorphToR15" + R6 = "MorphToR6", + R15 = "MorphToR15" } - export enum GameGenre { - FPS = "FPS" + FPS = "FPS" } diff --git a/src/util/converter.ts b/src/util/converter.ts index 27ff53d4c..10ad110b2 100644 --- a/src/util/converter.ts +++ b/src/util/converter.ts @@ -1,15 +1,20 @@ // Misc. "type" converter -export function generalIdentifierToNumber (identifier: string | number): number { - if (typeof identifier === "string") { - return Number(identifier); - } else { - return identifier; - } +export function generalIdentifierToNumber(identifier: string | number): number { + if (typeof identifier === "string") { + return Number(identifier); + } else { + return identifier; + } } -export function convertObjectToValue (dataObject: Record, namingConventions: string[]): unknown { - // eslint-disable-next-line security/detect-object-injection - return namingConventions.map(name => dataObject[name] || null) - .find(value => !!value) as unknown; +/* eslint-disable security/detect-object-injection */ +export function convertObjectToValue( + dataObject: Record, + namingConventions: string[] +): unknown { + // eslint-disable-next-line security/detect-object-injection + return namingConventions + .map((name) => dataObject[name] || null) + .find((value) => !!value) as unknown; } diff --git a/src/util/errors/errors.ts b/src/util/errors/errors.ts index ac6a62799..73d66dfd0 100644 --- a/src/util/errors/errors.ts +++ b/src/util/errors/errors.ts @@ -1,27 +1,37 @@ import { StatusCodeReasons } from "../constants"; - interface BloxyHttpErrorOptions { - message: string; - name?: string; - statusMessage: string; - statusCode: number; - possibleReasons: string[]; + message: string; + name?: string; + statusMessage: string; + statusCode: number; + possibleReasons: string[]; } - export class BloxyHttpError extends Error { - public statusCode: number; - public statusMessage: string; + public statusCode: number; + public statusMessage: string; - constructor (options: BloxyHttpErrorOptions) { - const statusRelatedIssues = StatusCodeReasons[options.statusCode as keyof typeof StatusCodeReasons] || []; - options.possibleReasons = [...options.possibleReasons, ...statusRelatedIssues]; - const revisedMessage = `\n\n${options.message} | Status code: ${options.statusCode}, status message: ${options.statusMessage}. ${options.possibleReasons.length > 0 ? `Possible reasons:\n${options.possibleReasons.map(r => `- ${r}`) - .join("\n")}\n\n` : ""}`; - super(revisedMessage); - this.name = options.name || "BloxyHttpError"; - this.statusCode = options.statusCode; - this.statusMessage = options.statusMessage; - } + constructor (options: BloxyHttpErrorOptions) { + const statusRelatedIssues + = StatusCodeReasons[options.statusCode as keyof typeof StatusCodeReasons] + || []; + options.possibleReasons = [ + ...options.possibleReasons, + ...statusRelatedIssues + ]; + const revisedMessage = `\n\n${options.message} | Status code: ${ + options.statusCode + }, status message: ${options.statusMessage}. ${ + options.possibleReasons.length > 0 + ? `Possible reasons:\n${options.possibleReasons + .map((r) => `- ${r}`) + .join("\n")}\n\n` + : "" + }`; + super(revisedMessage); + this.name = options.name || "BloxyHttpError"; + this.statusCode = options.statusCode; + this.statusMessage = options.statusMessage; + } } diff --git a/src/util/errors/index.ts b/src/util/errors/index.ts index b0b612346..ea2b39da0 100644 --- a/src/util/errors/index.ts +++ b/src/util/errors/index.ts @@ -1,8 +1,7 @@ import { default as messages } from "./messages"; import * as errors from "./errors"; - export default { - messages, - errors + messages, + errors }; diff --git a/src/util/errors/messages.ts b/src/util/errors/messages.ts index 4fa80d32d..19b4cbc89 100644 --- a/src/util/errors/messages.ts +++ b/src/util/errors/messages.ts @@ -1,3 +1,3 @@ export default { - hello: "world" + hello: "world" }; diff --git a/src/util/utilFunctions.ts b/src/util/utilFunctions.ts index 5ecb997e1..23072c785 100644 --- a/src/util/utilFunctions.ts +++ b/src/util/utilFunctions.ts @@ -1,27 +1,32 @@ /* eslint-disable security/detect-object-injection */ -export const utilMergeDeep = (baseObject: Record, newObject: Record) => { - const target = {}; - // Merge the object into the target object - const internalMerger = (obj: Record) => { - for (const prop in obj) { - // eslint-disable-next-line no-prototype-builtins - if (obj.hasOwnProperty(prop)) { - if (Object.prototype.toString.call(obj[prop]) === "[object Object]") { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - target[prop] = utilMergeDeep(target[prop] as Record, obj[prop]); - } else { - // Otherwise, do a regular merge - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - target[prop] = obj[prop]; - } - } +export function utilMergeDeep< + B extends Record, + N extends Record +>(baseObject: B, newObject: N): B & N { + const target = {} as B & N; + // Merge the object into the target object + const internalMerger = (obj: Record) => { + for (const prop in obj) { + // eslint-disable-next-line no-prototype-builtins + if (obj.hasOwnProperty(prop)) { + if (Object.prototype.toString.call(obj[prop]) === "[object Object]") { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + target[prop] = utilMergeDeep( + target[prop] as Record, + obj[prop] + ); + } else { + // Otherwise, do a regular merge + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + target[prop] = obj[prop]; } - }; + } + } + }; + internalMerger(baseObject); + internalMerger(newObject); - internalMerger(baseObject); - internalMerger(newObject); - - return target; -}; + return target; +} diff --git a/tests/apis/AccountInformationAPI.test.js b/tests/apis/AccountInformationAPI.test.js deleted file mode 100644 index 9bf519b40..000000000 --- a/tests/apis/AccountInformationAPI.test.js +++ /dev/null @@ -1,46 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const Joi = require("joi"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing AccountInformationAPI", function () { - const birthdateSchema = Joi.object({ - birthMonth: Joi.number(), - birthDay: Joi.number(), - birthYear: Joi.number() - }); - - it("should retrieve the birthdate", async function () { - const data = await client.apis.accountInformationAPI.getUserBirthdate(); - - return expect(birthdateSchema.validate(data)) - .not - .toHaveProperty("error"); - }); - - it("should update the birthdate", async function () { - return expect(client.apis.accountInformationAPI.updateUserBirthdate({ - birthDay: 1, - birthMonth: 1, - birthYear: 1990 - })) - .resolves - .not - .toThrow(); - }); -}); diff --git a/tests/apis/AccountSettingsAPI.test.js b/tests/apis/AccountSettingsAPI.test.js deleted file mode 100644 index 7cc4a80ed..000000000 --- a/tests/apis/AccountSettingsAPI.test.js +++ /dev/null @@ -1,224 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing AccountSettingsAPI", function () { - it("should return settings groups", async function () { - const data = await client.apis.accountSettingsAPI.getSettingsGroups(); - - return expect(data) - .toBeDefined(); - }); - - it("should return app chat privacy", async function () { - const appChatPrivacy = await client.apis.accountSettingsAPI.getAppChatPrivacy(); - - return expect(appChatPrivacy) - .toStrictEqual({ - appChatPrivacy: "NoOne" - }); - }); - - it("should update app chat privacy", function () { - return expect(client.apis.accountSettingsAPI.updateAppChatPrivacy({ - appChatPrivacy: "NoOne" - })) - .resolves - .not - .toThrow(); - }); - - it("should return game chat privacy", function () { - return expect(client.apis.accountSettingsAPI.getGameChatPrivacy()) - .resolves - .toStrictEqual({ - gameChatPrivacy: "AllUsers" - }); - }); - - it("should update game chat privacy", function () { - return expect(client.apis.accountSettingsAPI.updateGameChatPrivacy({ - gameChatPrivacy: "AllUsers" - })) - .resolves - .not - .toThrow(); - }); - - it("should get inventory privacy", function () { - return expect(client.apis.accountSettingsAPI.getInventoryPrivacy()) - .resolves - .toStrictEqual({ - inventoryPrivacy: "AllUsers" - }); - }); - - it("should update inventory privacy", function () { - return expect(client.apis.accountSettingsAPI.updateInventoryPrivacy({ - inventoryPrivacy: "AllUsers" - })) - .resolves - .not - .toThrow(); - }); - - it("should get user privacy", function () { - return expect(client.apis.accountSettingsAPI.getUserPrivacy()) - .resolves - .toStrictEqual({ - phoneDiscovery: "AllUsers" - }); - }); - - it("should update user privacy", function () { - return expect(client.apis.accountSettingsAPI.updateUserPrivacy({ - phoneDiscovery: "AllUsers" - })) - .resolves - .not - .rejects; - }); - - it("should get privacy settings info", function () { - return expect(client.apis.accountSettingsAPI.getUserPrivacySettingsInfo()) - .resolves - .toStrictEqual({ - isPhoneDiscoveryEnabled: false - }); - }); - - it("should get private message privacy", function () { - return expect(client.apis.accountSettingsAPI.getUserPrivateMessagePrivacy()) - .resolves - .toStrictEqual({ - privateMessagePrivacy: "All" - }); - }); - - it("should update the message privacy", function () { - return expect(client.apis.accountSettingsAPI.updateUserPrivateMessagePrivacy({ - privateMessagePrivacy: "All" - })) - .resolves - .not - .toThrow(); - }); - - it("should get email status", function () { - return expect(client.apis.accountSettingsAPI.getUserEmailStatus()) - .resolves - .toStrictEqual({ - emailAddress: "o*****************@awdrt.net", - verified: true - }); - }); - - it("should fail to send email verification (as it's verified already)", function () { - return expect(client.apis.accountSettingsAPI.sendEmailVerification()) - .rejects - .toThrow(); - }); - - it("should get website theme", function () { - return expect(client.apis.accountSettingsAPI.getWebsiteTheme()) - .resolves - .toStrictEqual({ - themeType: "Light" - }); - }); - - it("should update the website theme", function () { - return expect(client.apis.accountSettingsAPI.updateWebsiteTheme({ - themeType: "Light" - })) - .resolves - .not - .toThrow(); - }); - - it("should get website themes", function () { - return expect(client.apis.accountSettingsAPI.getWebsiteThemes()) - .resolves - .toMatchObject({ - data: ["Light", "Dark"] - }); - }); - - it("should get trade privacy", function () { - return expect(client.apis.accountSettingsAPI.getUserTradePrivacy()) - .resolves - .toStrictEqual({ - tradePrivacy: "All" - }); - }); - - it("should update the trade privacy", function () { - return expect(client.apis.accountSettingsAPI.updateUserTradePrivacy({ - tradePrivacy: "All" - })) - .rejects - .toThrowError("not have permission") - }); - - it("should get trade quality filter", function () { - return expect(client.apis.accountSettingsAPI.getUserTradeQualityFilter()) - .resolves - .toStrictEqual({ - tradeValue: "None" - }); - }); - - it("should update the trade quality filter", function () { - return expect(client.apis.accountSettingsAPI.updateUserTradeQualityFilter({ - tradeValue: "None" - })) - .rejects - .toThrowError("not have permission"); - }); - - it("should get contact upsell", function () { - return expect(client.apis.accountSettingsAPI.getContactUpsell()) - .resolves - .toStrictEqual({ - upsellScreenType: "None" - }); - }); - - it("should update contact upsell suppression", function () { - return expect(client.apis.accountSettingsAPI.updateContactUpsellSuppression({ - suppress: "None" - })) - .resolves - .not - .toThrow(); - }); - - it("should update promotion channels", function () { - return expect(client.apis.accountSettingsAPI.updateUserPromotionChannels({ - promotionChannelsVisibilityPrivacy: "AllUsers", - youtube: "https://youtube.com/a", - twitter: "@1Noobest", - twitch: "https://twitch.tv/Visualizeme", - facebook: "https://facebook.com/yes" - })) - .resolves - .not - .toThrow(); - }); - -}); diff --git a/tests/apis/AuthAPI.test.js b/tests/apis/AuthAPI.test.js deleted file mode 100644 index 5f3ed47c8..000000000 --- a/tests/apis/AuthAPI.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("test AuthAPI", function () { - it("should return password status", function () { - return expect(client.apis.authAPI.getCurrentUserPasswordStatus()) - .resolves - .toStrictEqual({ - valid: true - }) - }); -}); diff --git a/tests/apis/AvatarAPI.test.js b/tests/apis/AvatarAPI.test.js deleted file mode 100644 index 0f6767062..000000000 --- a/tests/apis/AvatarAPI.test.js +++ /dev/null @@ -1,40 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing AvatarAPI", function () { - it("should wear asset", function () { - expect(client.apis.avatarAPI.wearAssetOnAvatar({ - assetId: 102611803 - })) - .resolves - .toStrictEqual({ - success: true - }) - }); - - it("should set avatar type", function () { - expect(client.apis.avatarAPI.setSelfAvatarType({ - playerAvatarType: "R6" - })) - .resolves - .toStrictEqual({ - success: true - }) - }); -}); diff --git a/tests/apis/BadgesAPI.test.js b/tests/apis/BadgesAPI.test.js deleted file mode 100644 index 9e0184ea4..000000000 --- a/tests/apis/BadgesAPI.test.js +++ /dev/null @@ -1,34 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing BadgesAPI", function () { - it("should retrieve badge info", function () { - expect(client.apis.badgesAPI.getBadge({ - badgeId: 2124564087 - })) - .resolves - .toStrictEqual({ - id: 2124564087, - created: "2020-06-20T13:45:20.717-05:00", - awardingUniverse: { - id: 111958650 - } - }); - }); -}); diff --git a/tests/apis/BillingAPI.test.js b/tests/apis/BillingAPI.test.js deleted file mode 100644 index 6a4dec02d..000000000 --- a/tests/apis/BillingAPI.test.js +++ /dev/null @@ -1,29 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing BillingAPI", function () { - it("should retrieve developer exchange rate", function () { - return expect(client.apis.billingAPI.getDeveloperExchangeRate()) - .resolves - .toMatchObject({ - rate: 0.0035, - "currency-code": "USD" - }); - }); -}); diff --git a/tests/apis/CatalogAPI.test.js b/tests/apis/CatalogAPI.test.js deleted file mode 100644 index caf3198ff..000000000 --- a/tests/apis/CatalogAPI.test.js +++ /dev/null @@ -1,122 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing CatalogAPI", function () { - it("should retrieve bundle info", function () { - return expect(client.apis.catalogAPI.getBundleDetails({ - bundleId: 192 - })) - .resolves - .toMatchObject({ - id: 192, - bundleType: "BodyParts", - product: { - id: 369653841 - }, - creator: { - id: 1 - } - }); - }); - - it("should retrieve bundle info in bulk", function () { - return expect(client.apis.catalogAPI.getMultiBundleDetails({ - bundleIds: [192] - })) - .resolves - .toMatchObject([ - { - id: 192, - bundleType: "BodyParts" - } - ]); - }); - - it("should retrieve categories", function () { - expect(client.apis.catalogAPI.getCategories()) - .resolves - .toStrictEqual({ - Featured: 0, - All: 1, - Collectibles: 2, - Clothing: 3, - BodyParts: 4, - Gear: 5, - Models: 6, - Plugins: 7, - Decals: 8, - Audio: 9, - Meshes: 10, - Accessories: 11, - AvatarAnimations: 12, - CommunityCreations: 13, - Video: 14, - Recommended: 15 - }); - }); - - it("should retrieve sub-categories", function () { - expect(client.apis.catalogAPI.getSubCategories()) - .resolves - .toStrictEqual({ - Featured: 0, - All: 1, - Collectibles: 2, - Clothing: 3, - BodyParts: 4, - Gear: 5, - Models: 6, - Plugins: 7, - Decals: 8, - Hats: 9, - Faces: 10, - Packages: 11, - Shirts: 12, - Tshirts: 13, - Pants: 14, - Heads: 15, - Audio: 16, - RobloxCreated: 17, - Meshes: 18, - Accessories: 19, - HairAccessories: 20, - FaceAccessories: 21, - NeckAccessories: 22, - ShoulderAccessories: 23, - FrontAccessories: 24, - BackAccessories: 25, - WaistAccessories: 26, - AvatarAnimations: 27, - ClimbAnimations: 28, - FallAnimations: 30, - IdleAnimations: 31, - JumpAnimations: 32, - RunAnimations: 33, - SwimAnimations: 34, - WalkAnimations: 35, - AnimationPackage: 36, - Bundles: 37, - AnimationBundles: 38, - EmoteAnimations: 39, - CommunityCreations: 40, - Video: 41, - Recommended: 51 - }) - }); -}); diff --git a/tests/apis/ChatAPI.test.js b/tests/apis/ChatAPI.test.js deleted file mode 100644 index 7747fee13..000000000 --- a/tests/apis/ChatAPI.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing ChatAPI", function () { - it("should retreive badge info", function () { - - }); -}); diff --git a/tests/apis/DevelopAPI.test.js b/tests/apis/DevelopAPI.test.js deleted file mode 100644 index dfcabac22..000000000 --- a/tests/apis/DevelopAPI.test.js +++ /dev/null @@ -1,254 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const schemas = require("../util/schemas"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); -const Joi = require("joi"); - -describe("testing DevelopAPI", function () { - beforeAll(() => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`${new Date()} logged in!`); - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }) - .catch(e => { - console.log(`Error: ${e}`); - }); - }); - - let firstUniverseFound; - - it("fetching first universe found..", async () => { - console.log(`${new Date()} fetching universes..`); - firstUniverseFound = await client.apis.developAPI.getSelfUniverses({ - sortOrder: "Desc", - limit: 10 - }) - .catch(e => e) - .then(response => { - return response.data[0]; - }) - .catch(e => { - throw new Error(`Failed to retrieve first universe! ${e}`); - }); - }); - - describe("testing standalone APIs", function () { - it("should return game templates, verifying the default Baseplate one", async function () { - const templates = await client.apis.developAPI.getGameTemplates(); - - return expect(templates) - .toContainEqual({ - gameTemplateType: "Generic", - hasTutorials: false, - universe: { - id: 28220420, - name: "Baseplate", - description: "", - isArchived: false, - rootPlaceId: 95206881, - isActive: true, - privacyType: "Public", - creatorType: "User", - creatorTargetId: 998796, - creatorName: "Templates", - created: "2013-11-01T03:47:14.07-05:00", - updated: "2019-07-08T11:53:21.81-05:00" - } - }); - }); - it("should attempt to publish game update notification and fail", function () { - const d = client.apis.developAPI.publishGameUpdateNotification({ - gameUpdateText: `hi`, - universeId: 1350045202 - }); - - expect(d) - .rejects - .toThrow("Only one update allowed per week"); - }); - it("should get game's update history", async function () { - const d = await client.apis.developAPI.getGameUpdatesHistory({ - universeId: 1350045202 - }); - - console.log(d); - - expect(true) - .toBe(true); - }); - it("should get multiple plugins' information", async function () { - const d = await client.apis.developAPI.getMultiPlugins({ - pluginIds: [6158541297, 6216851661] - }); - const multiPluginsSchema = Joi.object({ - data: Joi.array() - .items(schemas.PluginDataSchema) - }); - - expect(multiPluginsSchema.validate(d)) - .not - .toHaveProperty("error"); - }); - it("should search universes", async function () { - const d = await client.apis.developAPI.searchUniverses({ - q: { - creator: "user" - } - }); - const schema = Joi.object({ - previousPageCursor: Joi.allow(Joi.string(), null), - nextPageCursor: Joi.allow(Joi.string(), null), - data: Joi.array() - .items(schemas.SearchUniverseDataSchema) - }); - - expect(schema.validate(d)) - .not - .toHaveProperty("error"); - }); - }); - - describe("testing universe-related APIs", () => { - /* - it(`should create a developer product in the first universe`, async function () { - await firstUniverseFound; - - const createdProduct = await client.apis.developAPI.createDeveloperProduct({ - universeId: firstUniverseFound.id, - priceInRobux: 10, - name: `Test${("123").repeat(Math.floor(Math.random() * 30))} - music${("").repeat(Math.floor(Math.random() * 30))} ${(".").repeat(Math.floor(Math.random() * 50))}`, - iconImageAssetId: 5874994712, - description: `A developer product automatically created using bloxy at ${new Date().toISOString()}` - }) - .catch(e => e); - - console.log(createdProduct); - expect(createdProduct) - .toHaveProperty("id"); - expect(createdProduct) - .toHaveProperty("name"); - expect(createdProduct) - .toHaveProperty("Description"); - expect(createdProduct) - .toHaveProperty("shopId"); - expect(createdProduct) - .toHaveProperty("iconImageAssetId"); - }); - */ - - it("should deactivate the universe", async function () { - await firstUniverseFound; - return expect( - client.apis.developAPI.deactivateUniverse({ - universeId: firstUniverseFound.id - }) - ) - .resolves - .not - .toThrow(); - }); - - it("should activate the universe", async function () { - await firstUniverseFound; - return expect( - client.apis.developAPI.activateUniverse({ - universeId: firstUniverseFound.id - }) - ) - .resolves - .not - .toThrow(); - }); - it("should filter \"fuck\"", function () { - return expect( - client.apis.developAPI.filterGameUpdateNotificationText({ - text: `fuck` - }) - ) - .resolves - .toMatchObject({ - filteredGameUpdateText: "####", - isFiltered: true, - moderationLevel: 3 - }); - }); - it("should not filter", function () { - return expect( - client.apis.developAPI.filterGameUpdateNotificationText({ - text: "roblox" - }) - ) - .resolves - .toMatchObject({ - filteredGameUpdateText: "roblox", - isFiltered: false, - moderationLevel: 1 - }); - }); - it("should get places in the universe found and root place id should be in one of them", async function () { - await firstUniverseFound; - return expect( - client.apis.developAPI.getPlacesInUniverse({ - universeId: firstUniverseFound.id - }) - ) - .resolves - .toMatchObject({ - data: [ - { - id: firstUniverseFound.rootPlaceId, - universeId: firstUniverseFound.id, - name: firstUniverseFound.name, - description: firstUniverseFound.description - } - ] - }); - }); - it("should test place statistics", async function () { - await firstUniverseFound; - return expect( - client.apis.developAPI.getPlaceStatistics({ - placeId: firstUniverseFound.rootPlaceId, - type: "Revenue", - granularity: "Hourly" - }) - ) - .resolves - .toMatchObject({ - placeId: firstUniverseFound.rootPlaceId, - dataType: 0, - dataGranularity: 0, - data: { - Total: { - type: "Total", - data: {} - } - } - }); - }); - it("should retrieve root place compatibilities", async function () { - jest.setTimeout(15000); - await firstUniverseFound; - const retrievedCompatibilities = await client.apis.developAPI.getPlaceCompatibilities({ - placeId: firstUniverseFound.rootPlaceId - }); - - expect(retrievedCompatibilities.Compatibilities) - .toContainEqual({ - crashRatePercentage: "NaN", - platformName: "iPhone 11 Pro Max", - status: "Unknown" - }); - - }); - }); -}); diff --git a/tests/apis/TwoStepVerification.test.js b/tests/apis/TwoStepVerification.test.js deleted file mode 100644 index adc2def59..000000000 --- a/tests/apis/TwoStepVerification.test.js +++ /dev/null @@ -1,92 +0,0 @@ -const TEST_COOKIE = require("../getCookie"); -const bloxy = require("../../dist"); -const faker = require("faker"); -const client = new bloxy.Client({ - credentials: { - cookie: TEST_COOKIE - } -}); -const { wait } = require("../util"); - -beforeAll(async () => { - return client.login( - TEST_COOKIE - ) - .then(clientUser => { - console.log(`Using test account ${clientUser.id} with name ${clientUser.name}`); - }); -}); - -describe("testing TwoStepVerificationAPI", function () { - it("should retrieve metadata", function () { - return expect( - client.apis.twpStepVerification.getMetaData({ - userId: client.user.id - }) - ) - .resolves - .toStrictEqual({ - twoStepVerificationEnabled: true, - authenticatorEnabled: false, - authenticatorQrCodeSize: "420x420", - emailCodeLength: 6, - authenticatorCodeLength: 6 - }); - }); - - it("should retrieve user twostep configuration", function () { - return expect( - client.apis.twpStepVerification.getConfiguration({ - userId: client.user.id - }) - ) - .resolves - .toStrictEqual({ - primaryMediaType: null, - methods: [] - }); - }); - - it("should error when attepmting to verify, as it's not implemented yet", function () { - return expect( - client.apis.twpStepVerification.verifyWithAuthenticator({ - challengeId: "a", - actionType: "b", - code: "c" - }) - ) - .rejects - .toThrowError("Two step verification is currently under maintenance."); - }); - - it("should error when attempting to disable authenticator, as it's WIP", function () { - return expect( - client.apis.twpStepVerification.disableAuthenticator({ - password: "" - }) - ) - .rejects - .toThrowError("Two step verification is currently under maintenance."); - }); - - it("should error when attempting to enable authenticator, as it's WIP", function () { - return expect( - client.apis.twpStepVerification.enableAuthenticator({ - userId: client.user.id - }) - ) - .rejects - .toThrowError("Two step verification is currently under maintenance."); - }); - - it("should error when attempting to verify and enable, as it's WIP", function () { - return expect( - client.apis.twpStepVerification.verifyAuthenticatorSetup({ - code: "a", - setupToken: "b" - }) - ) - .rejects - .toThrowError("Two step verification is currently under maintenance."); - }); -}); diff --git a/tests/getCookie.js b/tests/getCookie.js deleted file mode 100644 index 512d690c9..000000000 --- a/tests/getCookie.js +++ /dev/null @@ -1,8 +0,0 @@ -const TEST_COOKIE = process.env.TEST_COOKIE; - -if (!TEST_COOKIE) { - console.error(`Failed to start tests, the test cookie was not provided!`); -} - -module.exports = TEST_COOKIE.slice(1) - .substr(0, TEST_COOKIE.length - 2); diff --git a/tests/index.js b/tests/index.js deleted file mode 100644 index d00cb3e78..000000000 --- a/tests/index.js +++ /dev/null @@ -1,19 +0,0 @@ -const cookie = require("./getCookie"); - -(async () => { - const Bloxy = require("../dist"); - const client = new Bloxy.Client({ - credentials: { - cookie - } - }); - await client.login(); - console.log(`Logged in as ${client.user.name}`); - - - const friends = await client.apis.friendsAPI.getUserFriendsOnline({ - userId: 18442032 - }); - - console.log(friends.data.map(x => x.userPresence)); -})(); diff --git a/tests/internal/client.spec.ts b/tests/internal/client.spec.ts new file mode 100644 index 000000000..574660728 --- /dev/null +++ b/tests/internal/client.spec.ts @@ -0,0 +1,84 @@ +import { expect } from "chai"; +import { utilMergeDeep } from "../../dist/util/utilFunctions"; +import { generalIdentifierToNumber } from "../../dist/util/converter"; +import * as bloxy from "../../dist"; + +describe("Bloxy", function () { + describe("Exporting of the client", function () { + it("should export anything", function () { + expect(bloxy).to.exist; + }); + it("should export Client", function () { + expect(bloxy.Client).to.exist; + }); + }); + describe("Creation of the client", function () { + it("should not error without any options", function () { + expect(function () { + new bloxy.Client(); + }).to.not.throw; + }); + it("should not error with empty options", function () { + expect(function () { + new bloxy.Client({}); + }).to.not.throw; + }); + it("should not error with empty credentials options", function () { + expect(function () { + new bloxy.Client({ credentials: {} }); + }).to.not.throw; + }); + it("should not error with empty rest options", function () { + expect(function () { + new bloxy.Client({ rest: {} }); + }).to.not.throw; + }); + }); + describe("utilDeepMerge", function () { + it("should merge two objects and let the last object be dominating", function () { + const merger1 = { + hello: "world", + world: { + hello: "world" + } + }; + const merger2 = { + hello: "bye", + world: { + hi: "there" + } + }; + const expectedObj = { + hello: "bye", + world: { + hello: "world", + hi: "there" + } + }; + const merged = utilMergeDeep(merger1, merger2); + expect(merged).to.deep.equal(expectedObj); + }); + }); + describe("converter", () => { + it("should convert string to number using #generalIdentifierToNumber", function () { + expect(generalIdentifierToNumber("5")).to.equal(5); + expect(generalIdentifierToNumber(5)).to.equal(5); + }); + }); + describe("Testing login of Client", function () { + it("should error because of no credentials provided", function () { + const client = new bloxy.Client(); + expect(function () { + client.login(); + }).to.throw; + }); + it("should error with an invalid cookie", function () { + const client = new bloxy.Client({ + credentials: { cookie: "invalid" } + }); + expect(function () { + client.login(); + }).to.throw; + }); + }); +}); diff --git a/tests/internal/client/client.test.js b/tests/internal/client/client.test.js deleted file mode 100644 index 04cb2444b..000000000 --- a/tests/internal/client/client.test.js +++ /dev/null @@ -1,99 +0,0 @@ -const { utilMergeDeep } = require("../../../dist/util/utilFunctions"); -const converter = require("../../../dist/util/converter"); - - -const bloxy = require("../../../dist"); -const TEST_COOKIE = require("../../getCookie"); - - -describe("testing client", function () { - describe("testing creation of client", function () { - it("should have .Client property", function () { - expect(bloxy) - .toBeDefined(); - expect(bloxy.Client) - .toBeDefined(); - }); - - describe("should be created without erroring without client options", function () { - it("should not error without any options", function () { - expect(() => new bloxy.Client()) - .not - .toThrow(); - }); - it("should not error with empty options", function () { - expect(() => new bloxy.Client({})) - .not - .toThrow(); - }); - it("should not error with empty credentials options", function () { - expect(() => new bloxy.Client({ credentials: {} })) - .not - .toThrow(); - }); - it("should not error with empty rest options", function () { - expect(() => new bloxy.Client({ rest: {} })) - .not - .toThrow(); - }); - }); - }); - describe("testing misc internal functions", function () { - it("should merge two objects and let the last object be dominating", async function () { - const merger1 = { - hello: "world", - world: { - hello: "world" - } - }; - const merger2 = { - hello: "bye", - world: { - hi: "there" - } - }; - const expectObj = { - hello: "bye", - world: { - hello: "world", - hi: "there" - } - }; - - const merged = utilMergeDeep(merger1, merger2); - - expect(merged) - .toStrictEqual(expectObj); - }); - it("should convert string to number using converter.generalIdentifierToNumber", async function () { - expect( - converter.generalIdentifierToNumber("5") - ) - .toStrictEqual(5); - expect( - converter.generalIdentifierToNumber(5) - ) - .toStrictEqual(5); - }); - }); - - describe("testing login function of client", function () { - it("should error because of no credentials provided", function () { - const client = new bloxy.Client(); - expect(client.login()) - .rejects - .toThrow(); - }); - it("should error because invalid cookie", function () { - const client = new bloxy.Client({ - credentials: { - cookie: "test" - } - }); - - expect(client.login()) - .rejects - .toThrow(); - }); - }); -}); diff --git a/tests/internal/client/datastoremanager.test.js b/tests/internal/client/datastoremanager.test.js deleted file mode 100644 index 7abab452e..000000000 --- a/tests/internal/client/datastoremanager.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const bloxy = require("../../../dist"); -const TEST_COOKIE = require("../../getCookie"); - - -const unauthenticatedClient = new bloxy.Client(); -const authenticatedClient = new bloxy.Client(); - -beforeAll(async () => { - await authenticatedClient.login(TEST_COOKIE) - .then(user => { - console.log(`Logged in as ${user.id} with name ${user.name}`); - }); -}); - -describe("testing datastore manager", function () { - describe("ensuring construction of instance is optimal", function () { - it("should error when not logged in", function () { - expect( - unauthenticatedClient.dataStoreManager.getDataStore.bind(undefined, 1, "y") - ) - .toThrow(); - }); - }); -}); diff --git a/tests/internal/datastoremanager.spec.ts b/tests/internal/datastoremanager.spec.ts new file mode 100644 index 000000000..26858832e --- /dev/null +++ b/tests/internal/datastoremanager.spec.ts @@ -0,0 +1,66 @@ +import { Client } from "../../dist"; +import { expect } from "chai"; +import { GlobalDataStore } from "../../dist/client/lib/DataStoreManager/structures/GlobalDataStore"; +import {} from "mocha"; + +const authenticatedClient = new Client(); +const unauthenticatedClient = new Client(); + +before(async () => { + const authenticatedUser = await authenticatedClient.login( + process.env.ROBLOSECURITY + ); + console.log( + `Logged in as ${authenticatedUser.name} (${authenticatedUser.id})` + ); +}); + +describe("DataStoreManager", function () { + describe("Unauthorized client", function () { + it("should error when accessing a datastore", function () { + expect(() => + unauthenticatedClient.dataStoreManager.getDataStore(1, "test") + ).to.throw; + }); + }); + describe("Authorized client", function () { + let dataStore!: GlobalDataStore; + it("should get the datastore", function () { + dataStore = authenticatedClient.dataStoreManager.getDataStore( + 8406754815, + "test" + ); + expect(dataStore).to.exist; + }); + it("should write to the datastore", async function () { + this.slow(1000); + expect(dataStore, "DataStore does not exist, did the previous test fail?") + .to.exist; + expect( + await (async function () { + dataStore.setAsync("testKey", "testValue"); + })() + ).to.not.throw; + }); + it("should read the datastore", async function () { + this.slow(1000); + expect(dataStore, "DataStore does not exist, did the previous test fail?") + .to.exist; + let value!: string; + expect( + await (async function () { + const returnedValue = JSON.parse( + (await dataStore.getAsync("testKey")) as string + ); + value = returnedValue; + })() + ).to.not.throw; + expect(value).to.equal("testValue"); + }); + it("should error when accessing a datastore without permissions", async function () { + expect(function () { + authenticatedClient.dataStoreManager.getDataStore(1, "test"); + }).to.throw; + }); + }); +}); diff --git a/tests/util.js b/tests/util.js deleted file mode 100644 index e9d668357..000000000 --- a/tests/util.js +++ /dev/null @@ -1 +0,0 @@ -module.exports.wait = (time) => new Promise(resolve => setTimeout(resolve, time * 1000)); diff --git a/tests/util/schemas.js b/tests/util/schemas.js deleted file mode 100644 index 49d2ccdfc..000000000 --- a/tests/util/schemas.js +++ /dev/null @@ -1,49 +0,0 @@ -const Joi = require("joi"); - -exports.GameUniverseSchema = Joi.object({ - id: Joi.number(), - rootPlaceId: Joi.number(), - name: Joi.string(), - description: Joi.string(), - creatorType: Joi.string(), - creator: Joi.object({ - id: Joi.number(), - name: Joi.string(), - }), - price: Joi.number(), - allowedGearGenres: Joi.array().items(Joi.string()), - allowedGearCategories: Joi.array().items(Joi.string()), - playing: Joi.number(), - visits: Joi.number(), - maxPlayers: Joi.number(), - created: Joi.string(), - updated: Joi.string(), - studioAccessToApisAllowed: Joi.bool(), - createVipServersAllowed: Joi.bool(), - universeAvatarType: Joi.string(), - genre: Joi.string(), -}); -exports.SearchUniverseDataSchema = Joi.object({ - id: Joi.number(), - rootPlaceId: Joi.number(), - name: Joi.string(), - description: Joi.string(), - isArchived: Joi.bool(), - isActive: Joi.bool(), - privacyType: Joi.string(), - creatorType: Joi.string(), - creatorTargetId: Joi.number(), - creatorName: Joi.string(), - created: Joi.string(), - updated: Joi.string() -}) - -exports.PluginDataSchema = Joi.object({ - id: Joi.number(), - name: Joi.string(), - description: Joi.string().allow(""), - commentsEnabled: Joi.bool(), - versionId: Joi.number(), - created: Joi.string(), - updated: Joi.string() -}); diff --git a/tests/util/schemas.ts b/tests/util/schemas.ts new file mode 100644 index 000000000..d9d9b48c2 --- /dev/null +++ b/tests/util/schemas.ts @@ -0,0 +1,48 @@ +import Joi from "joi"; + +export const GameUniverseSchema = Joi.object({ + id: Joi.number(), + rootPlaceId: Joi.number(), + name: Joi.string(), + description: Joi.string(), + creatorType: Joi.string(), + creator: Joi.object({ + id: Joi.number(), + name: Joi.string() + }), + price: Joi.number(), + allowedGearGenres: Joi.array().items(Joi.string()), + allowedGearCategories: Joi.array().items(Joi.string()), + playing: Joi.number(), + visits: Joi.number(), + maxPlayers: Joi.number(), + created: Joi.string(), + updated: Joi.string(), + studioAccessToApisAllowed: Joi.bool(), + createVipServersAllowed: Joi.bool(), + universeAvatarType: Joi.string(), + genre: Joi.string() +}); +export const SearchUniverseDataSchema = Joi.object({ + id: Joi.number(), + rootPlaceId: Joi.number(), + name: Joi.string(), + description: Joi.string(), + isArchived: Joi.bool(), + isActive: Joi.bool(), + privacyType: Joi.string(), + creatorType: Joi.string(), + creatorTargetId: Joi.number(), + creatorName: Joi.string(), + created: Joi.string(), + updated: Joi.string() +}); +export const PluginDataSchema = Joi.object({ + id: Joi.number(), + name: Joi.string(), + description: Joi.string().allow(""), + commentsEnabled: Joi.bool(), + versionId: Joi.number(), + created: Joi.string(), + updated: Joi.string() +}); diff --git a/tsconfig.json b/tsconfig.json index f254350e8..f218c06fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,99 +1,91 @@ { - "compilerOptions": { - "types": [ - "node" - ], - /* Basic Options */ - // "incremental": true, - /* Enable incremental compilation */ - "target": "ES6", - /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", - /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, - /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist", - /* Redirect output structure to the directory. */ - "rootDir": "./src", - /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - "removeComments": false, - /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - "importHelpers": true, - /* Import emit helpers from 'tslib'. */ - "downlevelIteration": true, - /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "compilerOptions": { + "types": ["node", "mocha"], + /* Basic Options */ + // "incremental": true, + /* Enable incremental compilation */ + "target": "ES6", + /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", + /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true, + /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "./dist", + /* Redirect output structure to the directory. */ + "rootDir": "./src", + /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + "removeComments": false, + /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + "importHelpers": true, + /* Import emit helpers from 'tslib'. */ + "downlevelIteration": true, + /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true, - /* Enable all strict type-checking options. */ - "noImplicitAny": true, - /* Raise error on expressions and declarations with an implied 'any' type. */ - "strictNullChecks": true, - /* Enable strict null checks. */ - "strictFunctionTypes": true, - /* Enable strict checking of function types. */ - "strictBindCallApply": true, - /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - "strictPropertyInitialization": true, - /* Enable strict checking of property initialization in classes. */ - "noImplicitThis": true, - /* Raise error on 'this' expressions with an implied 'any' type. */ - "alwaysStrict": true, - /* Parse in strict mode and emit "use strict" for each source file. */ + /* Strict Type-Checking Options */ + "strict": true, + /* Enable all strict type-checking options. */ + "noImplicitAny": true, + /* Raise error on expressions and declarations with an implied 'any' type. */ + "strictNullChecks": true, + /* Enable strict null checks. */ + "strictFunctionTypes": true, + /* Enable strict checking of function types. */ + "strictBindCallApply": true, + /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "strictPropertyInitialization": true, + /* Enable strict checking of property initialization in classes. */ + "noImplicitThis": true, + /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true, + /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - "noUnusedLocals": true, - /* Report errors on unused locals. */ - "noUnusedParameters": true, - /* Report errors on unused parameters. */ - "noImplicitReturns": true, - /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, - /* Report errors for fallthrough cases in switch statement. */ + /* Additional Checks */ + "noUnusedLocals": true, + /* Report errors on unused locals. */ + "noUnusedParameters": true, + /* Report errors on unused parameters. */ + "noImplicitReturns": true, + /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true, + /* Report errors for fallthrough cases in switch statement. */ - /* Module Resolution Options */ - "moduleResolution": "node", - /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true - /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, - /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + /* Module Resolution Options */ + "moduleResolution": "node", + /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true + /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, + /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - }, - "compileOnSave": true, - "exclude": [ - "dist", - "node_modules", - ".circleci" - ], - "include": [ - "src" - ] + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + }, + "compileOnSave": true, + "exclude": ["dist", "node_modules", ".circleci"], + "include": ["src"] } diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 000000000..cd1484cf3 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,9 @@ +{ + "entryPoints": "src/index.ts", + "out": "docs", + "plugin": "typedoc-plugin-markdown", + "hideBreadcrumbs": true, + "namedAnchors": true, + "excludeExternals": false, + "entryPointStrategy": "expand" +}