UNPKG

openblox

Version:

Roblox API Wrapper For Both Classic And OpenCloud APIs.

126 lines (125 loc) 4.77 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var economy_exports = {}; __export(economy_exports, { assetResaleData: () => assetResaleData, assetResaleTaxRate: () => assetResaleTaxRate, assetResellers: () => assetResellers, authedUserAssetResellableCopies: () => authedUserAssetResellableCopies, authedUserCurrency: () => authedUserCurrency, authedUserDevExCashOutInfo: () => authedUserDevExCashOutInfo, authedUserEconomyMetadata: () => authedUserEconomyMetadata, groupCanAddFunds: () => groupCanAddFunds, groupCurrency: () => groupCurrency, groupLatestAddedFundsData: () => groupLatestAddedFundsData, groupPayoutsUserEligibility: () => groupPayoutsUserEligibility, groupRevenueSummary: () => groupRevenueSummary, groupTransactionHistory: () => groupTransactionHistory }); module.exports = __toCommonJS(economy_exports); var import_apiGroup = require("../../apiGroup"); const { createApiMethod } = (0, import_apiGroup.createApiGroup)({ name: "ClassicEconomy", baseUrl: "https://economy.roblox.com" }); const assetResaleData = createApiMethod(async ({ assetId }) => ({ method: "GET", path: `/v1/assets/${assetId}/resale-data`, name: `assetResaleData` })); const assetResellers = createApiMethod(async ({ assetId, limit, cursor }) => ({ method: "GET", path: `/v1/assets/${assetId}/resellers`, searchParams: { limit, cursor }, name: `assetResellers`, formatRawDataFn: ({ data }) => data })); const authedUserAssetResellableCopies = createApiMethod(async ({ userId, assetId }) => ({ method: "GET", path: `/v1/assets/${assetId}/users/${userId}/resellable-copies`, name: `authedUserAssetResellableCopies`, formatRawDataFn: ({ data }) => data })); const assetResaleTaxRate = createApiMethod(async () => ({ method: "GET", path: `/v1/resale-tax-rate`, name: `assetResaleTaxData` })); const authedUserDevExCashOutInfo = createApiMethod(async () => ({ method: "GET", path: `/v1/developer-exchange/info`, name: `authedUserDevExCashOutInfo` })); const groupCanAddFunds = createApiMethod(async ({ groupId }) => ({ method: "GET", path: `/v1/groups/${groupId}/addfunds/allowed`, name: `groupCanAddFunds` })); const groupLatestAddedFundsData = createApiMethod(async ({ groupId }) => ({ method: "GET", path: `/v1/groups/${groupId}/addfunds/latest`, name: `groupCanAddFunds` })); const groupCurrency = createApiMethod(async ({ groupId }) => ({ method: "GET", path: `/v1/groups/${groupId}/currency`, name: `groupCurrency` })); const authedUserCurrency = createApiMethod(async () => ({ method: "GET", path: `/v1/user/currency`, name: `authedUserCurrency` })); const groupRevenueSummary = createApiMethod(async ({ groupId, timeFrame }) => ({ method: "GET", path: `/v1/groups/${groupId}/revenue/summary/${timeFrame}`, name: `groupRevenueSummary` })); const groupPayoutsUserEligibility = createApiMethod(async ({ groupId, userIds }) => ({ method: "GET", path: `/v1/groups/${groupId}/users-payout-eligibility`, searchParams: userIds.map((id) => `userIds=${id}`).join("&"), name: `groupPayoutsUserEligibility`, formatRawDataFn: ({ usersGroupPayoutEligibility }) => usersGroupPayoutEligibility })); const groupTransactionHistory = createApiMethod(async ({ groupId, transactionType }) => ({ method: "GET", path: `/v2/groups/${groupId}/transactions`, searchParams: { transactionType, limit: 10 }, name: `groupTransactionHistory`, formatRawDataFn: ({ data }) => data })); const authedUserEconomyMetadata = createApiMethod(async () => ({ method: "GET", path: `/v2/metadata`, name: `authedUserEconomyMetadata` })); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { assetResaleData, assetResaleTaxRate, assetResellers, authedUserAssetResellableCopies, authedUserCurrency, authedUserDevExCashOutInfo, authedUserEconomyMetadata, groupCanAddFunds, groupCurrency, groupLatestAddedFundsData, groupPayoutsUserEligibility, groupRevenueSummary, groupTransactionHistory });