From 7f8f71478425178573816a1b9c72c9181285a5e6 Mon Sep 17 00:00:00 2001 From: Cameron Campbell Date: Sat, 12 Oct 2024 04:10:57 +0100 Subject: [PATCH] added legacy develop and groups apis --- docs/buildDocs.ts | 4 +- docs/docs.json | 63 ++++----- package.json | 2 +- src/apis/apiGroup/apiGroup.ts | 21 ++- src/apis/apiGroup/apiGroup.types.ts | 6 +- src/apis/classic/badges/badges.ts | 22 +-- src/apis/classic/catalog/catalog.ts | 42 +++--- src/apis/classic/develop/develop.ts | 56 ++++---- .../developerProducts/developerProducts.ts | 14 +- src/apis/classic/economy/economy.ts | 28 ++-- src/apis/classic/friends/friends.ts | 44 +++--- src/apis/classic/gamePasses/gamePasses.ts | 10 +- src/apis/classic/games/games.ts | 48 +++---- src/apis/classic/groups/groups.ts | 126 +++++++++--------- .../classic/organizations/organizations.ts | 34 ++--- .../premiumFeatures/premiumFeatures.ts | 6 +- src/apis/classic/shareLinks/shareLinks.ts | 4 +- .../classic/subscriptions/subscriptions.ts | 14 +- src/apis/classic/talent/talent.ts | 10 +- src/apis/classic/thumbnails/thumbnails.ts | 42 +++--- src/apis/classic/universes/universes.ts | 4 +- src/apis/classic/users/users.ts | 32 ++--- .../classic/virtualEvents/virtualEvents.ts | 18 +-- src/apis/cloud/assets/assets.ts | 14 +- src/apis/cloud/creatorStore/creatorStore.ts | 8 +- src/apis/cloud/engine/engine.ts | 8 +- src/apis/cloud/experiences/experiences.ts | 14 +- src/apis/cloud/groups/groups.ts | 16 +-- src/apis/cloud/index.ts | 4 + src/apis/cloud/inventory/inventory.ts | 4 +- src/apis/cloud/legacyBadges/legacyBadges.ts | 26 +--- src/apis/cloud/legacyDevelop/index.ts | 1 + src/apis/cloud/legacyDevelop/legacyDevelop.ts | 99 ++++++++++++++ .../legacyFollowings/legacyFollowings.ts | 10 +- src/apis/cloud/legacyGroups/index.ts | 1 + src/apis/cloud/legacyGroups/legacyGroups.ts | 114 ++++++++++++++++ src/apis/cloud/luauExecution/luauExecution.ts | 8 +- src/apis/cloud/memoryStores/memoryStores.ts | 20 +-- src/apis/cloud/messaging/messaging.ts | 4 +- src/apis/cloud/oauth/oauth.ts | 7 +- .../orderedDataStores_V1.ts | 14 +- .../orderedDataStores_V2.ts | 14 +- .../standardDataStores_V1.ts | 18 +-- .../standardDataStores_V2.ts | 20 +-- src/apis/cloud/subscriptions/subscriptions.ts | 4 +- .../userRestrictions/userRestrictions.ts | 10 +- src/apis/cloud/users/users.ts | 8 +- 47 files changed, 652 insertions(+), 444 deletions(-) create mode 100644 src/apis/cloud/legacyDevelop/index.ts create mode 100644 src/apis/cloud/legacyDevelop/legacyDevelop.ts create mode 100644 src/apis/cloud/legacyGroups/index.ts create mode 100644 src/apis/cloud/legacyGroups/legacyGroups.ts diff --git a/docs/buildDocs.ts b/docs/buildDocs.ts index 8860911..f62d171 100644 --- a/docs/buildDocs.ts +++ b/docs/buildDocs.ts @@ -162,7 +162,9 @@ const buildDocsForApis = async (apis: Directory[], apisName: "classic" | "cloud" for (const method of methods) { const methodName = method.getName() - allJsDocData[apisName][apiName][methodName] = await getJsDocData(method) + try { + allJsDocData[apisName][apiName][methodName] = await getJsDocData(method) + } catch {} } } } diff --git a/docs/docs.json b/docs/docs.json index 6d40278..a8e0e6f 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -810,39 +810,8 @@ ] } }, - "legacyBadges": { - "updateBadge": { - "description": "Updates a badge.", - "tags": { - "endpoint": "PATCH /v1/badges/{badgeId}", - "example": "const { data: success } = await LegacyBadgesApi.updateBadge({ badgeId: 2124533401, description: \"hello\" });", - "exampleData": "", - "exampleRawBody": "{}\n" - }, - "params": [ - { - "name": "badgeId", - "type": "Identifier", - "description": "The ID of the badge to update." - }, - { - "name": "name?", - "type": "string", - "description": "The new name for the badge." - }, - { - "name": "description?", - "type": "string", - "description": "The new description for the badge." - }, - { - "name": "enabled?", - "type": "boolean", - "description": "If the badge is to enabled." - } - ] - } - }, + "legacyBadges": {}, + "legacyDevelop": {}, "legacyFollowings": { "universeFollowingsForUser": { "description": "Gets all universes that a user is following.", @@ -924,6 +893,7 @@ ] } }, + "legacyGroups": {}, "luauExecution": { "executeLuau": { "description": "Executes a roblox luau script for a given place.", @@ -3394,11 +3364,11 @@ } ] }, - "updateTeamCreateSettingsForUniverse": { + "setTeamCreateSettingsForUniverse": { "description": "Updates team create settings for a universe.", "tags": { "endpoint": "PATCH /v1/universes/{universeId}/teamcreate", - "example": "const { data: success } = await ClassicDevelopApi.updateTeamCreateSettingsForUniverse({\n universeId: 6069031486,\n isEnabled: false,\n});", + "example": "const { data: success } = await ClassicDevelopApi.setTeamCreateSettingsForUniverse({\n universeId: 6069031486,\n isEnabled: false,\n});", "exampleData": "", "exampleRawBody": "{}\n" }, @@ -4300,10 +4270,31 @@ } ] }, + "groupPayoutsUserEligibility": { + "description": "Gets the group payout eligibility for a group of users.", + "tags": { + "endpoint": "GET /v1/groups/{groupId}/users-payout-eligibility", + "example": "const { data: eligibility } = await ClassicEconomyApi.groupPayoutsUserEligibility({\n groupId: 14941564,\n userIds: [1412728377],\n});", + "exampleData": "{ \"1412728377\": \"Eligible\" }\n", + "exampleRawBody": "{ usersGroupPayoutEligibility: { \"1412728377\": \"Eligible\" } }\n" + }, + "params": [ + { + "name": "groupId", + "type": "Identifier", + "description": "The ID of the group." + }, + { + "name": "userIds", + "type": "ArrayNonEmptyIfConst", + "description": "The userIds to check for payout eligibility." + } + ] + }, "groupTransactionHistory": { "description": "Gets transaction history for a particular group.", "tags": { - "endpoint": "GET /v1/group/${groupId}/transactions", + "endpoint": "GET /v2/group/${groupId}/transactions", "example": "const { data: transactions } = await ClassicEconomyApi.groupTransactionHistory({\n groupId: 5850082,\n transactionType: \"Sale\",\n});", "exampleData": "[\n {\n id: 14289110391,\n idHash: \"L1HiwSO1f1e68Xh1d50b91\",\n created: \"2022-07-09T21:35:43.013Z\",\n isPending: false,\n agent: { id: 473747714, type: \"User\", name: \"LoremIpsum\" },\n details: {\n id: 1116381,\n name: \"Buy 100 Coins\",\n type: \"DeveloperProduct\",\n place: {\n placeId: 1121711941,\n universeId: 8681831361,\n name: \"LoremIpsumGame\",\n },\n },\n currency: { amount: 0, type: \"Robux\" },\n purchaseToken: null,\n },\n]\n", "exampleRawBody": "{\n previousPageCursor: null,\n nextPageCursor: \"eyJrZXkiOjEwLCJzb3J0T3JkZXIiOiJBc2MiLCJwYWdpbmdEaXJlY3Rpb24iOiJGb3J3YXJkIiwicGFnZU51bWJlciI6MiwiZGlzY3JpbWluYXRvciI6Imdyb3VwSWQ6NTg1MDA4MnRyYW5zYWN0aW9uVHlwZTpTYWxlIiwiY291bnQiOjEwfQpiYzljYmU0OTFiNjlmNTBmZDBiMGM3YzJmZTVlN2RkMGNlZjY5ZTQ4ZTRiODViZDNiMzBlZGM0NDNiZDMxMmU0\",\n data: [\n {\n id: 14289110391,\n idHash: \"L1HiwSO1f1e68Xh1d50b91\",\n created: \"2022-07-09T21:35:43.013Z\",\n isPending: false,\n agent: { id: 473747714, type: \"User\", name: \"LoremIpsum\" },\n details: {\n id: 1116381,\n name: \"Buy 100 Coins\",\n type: \"DeveloperProduct\",\n place: {\n placeId: 1121711941,\n universeId: 8681831361,\n name: \"LoremIpsumGame\",\n },\n },\n currency: { amount: 0, type: \"Robux\" },\n purchaseToken: null,\n },\n ],\n}\n" diff --git a/package.json b/package.json index b00a79f..f548250 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "openblox", "description": "Roblox API Wrapper For Both Classic And OpenCloud APIs.", "type": "commonjs", - "version": "1.0.54", + "version": "1.0.56", "license": "MIT", "bugs": { "url": "https://github.com/MightyPart/openblox/issues" diff --git a/src/apis/apiGroup/apiGroup.ts b/src/apis/apiGroup/apiGroup.ts index 01c9c7d..bc31bea 100644 --- a/src/apis/apiGroup/apiGroup.ts +++ b/src/apis/apiGroup/apiGroup.ts @@ -110,9 +110,9 @@ const pollForResponse = async (url: string, operationPath: string, cloudKey: str ////////////////////////////////////////////////////////////////////////////////// -export const createApiGroup: CreateApiGroupFn = ({ name:groupName, baseUrl, defaultGetCursors:groupDefaultGetCursors }) => ( +export const createApiGroup: CreateApiGroupFn = ({ name:groupName, baseUrl, defaultGetCursors:groupDefaultGetCursors }) => ({ // createApiMethod. - (handlerFn) => { + createApiMethod: (handlerFn) => { const handlerFnArgs = getParams(handlerFn) const handlerFnCursorArg = handlerFnArgs.includes("cursor") ? "cursor" : @@ -121,7 +121,7 @@ export const createApiGroup: CreateApiGroupFn = ({ name:groupName, baseUrl, defa const thisDefaultGetCursors = groupDefaultGetCursors ?? defaultGetCursors - return async function callApiMethod(args) { + const createCallApiMethod = (_baseUrl: UrlSecure = baseUrl): CallApiMethod => async function(args) { const overrides = this const cookie = overrides?.cookie || config?.cookie const cloudKey = overrides?.cloudKey || config?.cloudKey @@ -135,7 +135,7 @@ export const createApiGroup: CreateApiGroupFn = ({ name:groupName, baseUrl, defa let formattedSearchParams = formatSearchParams(searchParams) if (applyFieldMask && body && isObject(body)) formattedSearchParams += `&updateMask=${objectToFieldMask(body as Record)}` - const url: UrlSecure = `${baseUrl}${path}${formattedSearchParams ? `?${new URLSearchParams(formattedSearchParams).toString()}` : ""}` + const url: UrlSecure = `${_baseUrl}${path}${formattedSearchParams ? `?${new URLSearchParams(formattedSearchParams).toString()}` : ""}` // Adds credentials to headers. if (cookie || cloudKey || oauthToken) { @@ -179,5 +179,16 @@ export const createApiGroup: CreateApiGroupFn = ({ name:groupName, baseUrl, defa return await main() } + + const callApiMethod = createCallApiMethod(); + + // To handle legacy open cloud endpoints which use classic endpoints but with different base urls. + (callApiMethod as any)._deriveWithDifferentBaseUrl = (baseUrl: UrlSecure) => createCallApiMethod(baseUrl) + + return callApiMethod + }, + + addExistingApiMethod: >(method: Method): Method => { + return (method as any)._deriveWithDifferentBaseUrl(baseUrl) } -) \ No newline at end of file +}) diff --git a/src/apis/apiGroup/apiGroup.types.ts b/src/apis/apiGroup/apiGroup.types.ts index f4d7917..c5fbb19 100644 --- a/src/apis/apiGroup/apiGroup.types.ts +++ b/src/apis/apiGroup/apiGroup.types.ts @@ -10,7 +10,11 @@ type ApiGroupProps = { defaultGetCursors?: (rawData: any) => ([ previous: string | null, next: string | null ]) } -export type CreateApiGroupFn = (props: ApiGroupProps) => AddApiMethodFn +export type CreateApiGroupFn = (props: ApiGroupProps) => { + createApiMethod: AddApiMethodFn, + + addExistingApiMethod: >(method: Method) => Method +} // ------------------------------------------------------------------------------------------------------------------- diff --git a/src/apis/classic/badges/badges.ts b/src/apis/classic/badges/badges.ts index 4404413..43e5bcd 100644 --- a/src/apis/classic/badges/badges.ts +++ b/src/apis/classic/badges/badges.ts @@ -14,7 +14,7 @@ import type { PrettifiedBadgeAwardedDateForUserData, PrettifiedBadgeInfoData, Pr // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicBadgesApi", baseUrl: "https://badges.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicBadgesApi", baseUrl: "https://badges.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -33,7 +33,7 @@ const addApiMethod = createApiGroup({ name: "ClassicBadgesApi", baseUrl: "https: * @exampleData {"id":2124533401,"name":"Tutorial Done","description":"Tutorial Lol","displayName":"Tutorial Done","displayDescription":"Tutorial Lol","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653Z","updated":"2023-08-26T12:43:15.280Z","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}} * @exampleRawBody {"id":2124533401,"name":"Tutorial Done","description":"Tutorial Lol","displayName":"Tutorial Done","displayDescription":"Tutorial Lol","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653Z","updated":"2023-08-26T12:43:15.280Z","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}} */ -export const badgeInfo = addApiMethod(async ( +export const badgeInfo = createApiMethod(async ( { badgeId }: { badgeId: BadgeId } ): ApiMethod, PrettifiedBadgeInfoData> => ({ method: "GET", @@ -60,7 +60,7 @@ export const badgeInfo = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const updateBadge = addApiMethod(async ( +export const updateBadge = createApiMethod(async ( { badgeId, name, description, enabled }: { badgeId: Identifier, name?: string, description?: string, enabled?: boolean } ): ApiMethod<{}, boolean> => ({ method: "PATCH", @@ -80,7 +80,7 @@ export const updateBadge = addApiMethod(async ( * @exampleData {"badgeCreationPrice":100,"maxBadgeNameLength":50,"maxBadgeDescriptionLength":1000} * @exampleRawBody {"badgeCreationPrice":100,"maxBadgeNameLength":50,"maxBadgeDescriptionLength":1000} */ -export const badgesMetadata = addApiMethod(async ( +export const badgesMetadata = createApiMethod(async ( ): ApiMethod<{ badgeCreationPrice: number, maxBadgeNameLength: number, maxBadgeDescriptionLength: number }> => ({ method: "GET", path: `/v1/badges/metadata`, @@ -101,7 +101,7 @@ export const badgesMetadata = addApiMethod(async ( * @exampleData [{"id":2124533401,"name":"Tutorial Done","description":"true","displayName":"Tutorial Done","displayDescription":"true","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653Z","updated":"2024-07-16T22:34:44.021Z","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"eyJrZXkiOiJpZF8yendBQUFYSGo2OEVkem42aHpwayIsInNvcnRPcmRlciI6IkFzYyIsInBhZ2luZ0RpcmVjdGlvbiI6IkZvcndhcmQiLCJwYWdlTnVtYmVyIjoyLCJkaXNjcmltaW5hdG9yIjoidW5pdmVyc2VJZDoxNjg1ODMxMzY3IiwiY291bnQiOjEwfQplMzk4ODQzNTg5NGYxNzU4MTk1YmVlNWFhMDE5NTI1MmJiMjdhZDRiYzU5YzE3NjNjNjg3M2UxYmExNDdkMWZh","data":[{"id":2124533401,"name":"Tutorial Done","description":"true","displayName":"Tutorial Done","displayDescription":"true","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653+00:00","updated":"2024-07-16T22:34:44.021+00:00","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}}]} */ -export const badgesForUniverse = addApiMethod(async ( +export const badgesForUniverse = createApiMethod(async ( { universeId, limit, sortOrder, cursor }: { universeId: UniverseId, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod, PrettifiedPaginatedBadgesData> => ({ method: "GET", @@ -126,7 +126,7 @@ export const badgesForUniverse = addApiMethod(async => ({ method: "GET", @@ -148,7 +148,7 @@ export const freeBadgesLeftForUniverse = addApiMethod(async ( * @exampleData [{"id":2124533401,"name":"Tutorial Done","description":"true","displayName":"Tutorial Done","displayDescription":"true","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653Z","updated":"2024-07-16T22:34:44.021Z","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"eyJrZXkiOiJpZF8yendBQUFYSGo2OEVkem42aHpwayIsInNvcnRPcmRlciI6IkFzYyIsInBhZ2luZ0RpcmVjdGlvbiI6IkZvcndhcmQiLCJwYWdlTnVtYmVyIjoyLCJkaXNjcmltaW5hdG9yIjoidW5pdmVyc2VJZDoxNjg1ODMxMzY3IiwiY291bnQiOjEwfQplMzk4ODQzNTg5NGYxNzU4MTk1YmVlNWFhMDE5NTI1MmJiMjdhZDRiYzU5YzE3NjNjNjg3M2UxYmExNDdkMWZh","data":[{"id":2124533401,"name":"Tutorial Done","description":"true","displayName":"Tutorial Done","displayDescription":"true","enabled":true,"iconImageId":5316501478,"displayIconImageId":5316501478,"created":"2020-05-05T08:20:10.653+00:00","updated":"2024-07-16T22:34:44.021+00:00","statistics":{"pastDayAwardedCount":0,"awardedCount":394,"winRatePercentage":0},"awardingUniverse":{"id":1685831367,"name":"RoCamping","rootPlaceId":4922741943}}]} */ -export const userBadges = addApiMethod(async ( +export const userBadges = createApiMethod(async ( { userId, limit, sortOrder, cursor }: { userId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -177,7 +177,7 @@ export const userBadges = addApiMethod(async ( * @exampleData 2020-11-15T18:51:30.604Z * @exampleRawBody {"badgeId":2124533401,"awardedDate":"2020-11-15T18:51:30.604064Z"} */ -export const badgeAwardedDateForUser = addApiMethod(async ( +export const badgeAwardedDateForUser = createApiMethod(async ( { badgeId, userId }: { badgeId: BadgeId, userId: Identifier } ): ApiMethod, PrettifiedBadgeAwardedDateForUserData> => ({ method: "GET", @@ -202,7 +202,7 @@ export const badgeAwardedDateForUser = addApiMethod(async ( +export const badgesAwardedDatesForUser = createApiMethod(async ( { badgeIds, userId }: { badgeIds: ArrayNonEmptyIfConst, userId: Identifier } ): ApiMethod, PrettifiedBadgesAwardedDatesForUserData> => ({ method: "GET", @@ -225,7 +225,7 @@ export const badgesAwardedDatesForUser = addApiMethod(async => ({ method: "DELETE", @@ -246,7 +246,7 @@ export const removeBadgeFromUser = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserRemoveBadge = addApiMethod(async ( +export const authenticatedUserRemoveBadge = createApiMethod(async ( { badgeId }: { badgeId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", diff --git a/src/apis/classic/catalog/catalog.ts b/src/apis/classic/catalog/catalog.ts index 4cc9ca4..647aa9f 100644 --- a/src/apis/classic/catalog/catalog.ts +++ b/src/apis/classic/catalog/catalog.ts @@ -14,7 +14,7 @@ import type { BundleType, MinimalBundle, PrettifiedAssetFavoritesCountData, Pret // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicCatalog", baseUrl: "https://catalog.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicCatalog", baseUrl: "https://catalog.roblox.com" }) const bundleTypeNameToId = { "BodyParts": 1, @@ -60,7 +60,7 @@ const formatBatchCatalogIds = (assetIds: ArrayNonEmptyIfConst | Fals * @exampleData {"2":3,"3":9,"8":11,"10":6,"11":3,"12":3,"13":8,"17":4,"18":4,"19":11,"38":7,"40":10,"41":11,"42":11,"43":11,"44":11,"45":11,"46":11,"47":11,"48":12,"50":12,"51":12,"52":12,"53":12,"54":12,"55":12,"61":12,"62":14,"64":3,"65":3,"66":3,"67":3,"68":3,"69":3,"70":3,"71":3,"72":3} * @exampleRawBody {"2":3,"3":9,"8":11,"10":6,"11":3,"12":3,"13":8,"17":4,"18":4,"19":11,"38":7,"40":10,"41":11,"42":11,"43":11,"44":11,"45":11,"46":11,"47":11,"48":12,"50":12,"51":12,"52":12,"53":12,"54":12,"55":12,"61":12,"62":14,"64":3,"65":3,"66":3,"67":3,"68":3,"69":3,"70":3,"71":3,"72":3} */ -export const assetIdsToCatalogCategoryIds = addApiMethod(async ( +export const assetIdsToCatalogCategoryIds = createApiMethod(async ( ): ApiMethod<{ [Key: Identifier]: Identifier }> => ({ method: "GET", path: `/v1/asset-to-category`, @@ -76,7 +76,7 @@ export const assetIdsToCatalogCategoryIds = addApiMethod(async ( * @exampleData {"2":55,"3":16,"8":54,"10":6,"11":56,"12":57,"13":8,"17":15,"18":10,"19":5,"38":7,"40":18,"41":20,"42":21,"43":22,"44":23,"45":24,"46":25,"47":26,"48":28,"50":30,"51":31,"52":32,"53":33,"54":34,"55":35,"61":39,"62":41,"64":58,"65":59,"66":60,"67":61,"68":62,"69":63,"70":64,"71":64,"72":65} * @exampleRawBody {"2":55,"3":16,"8":54,"10":6,"11":56,"12":57,"13":8,"17":15,"18":10,"19":5,"38":7,"40":18,"41":20,"42":21,"43":22,"44":23,"45":24,"46":25,"47":26,"48":28,"50":30,"51":31,"52":32,"53":33,"54":34,"55":35,"61":39,"62":41,"64":58,"65":59,"66":60,"67":61,"68":62,"69":63,"70":64,"71":64,"72":65} */ -export const assetIdsToCatalogSubCategoryIds = addApiMethod(async ( +export const assetIdsToCatalogSubCategoryIds = createApiMethod(async ( ): ApiMethod<{ [Key: Identifier]: Identifier }> => ({ method: "GET", path: `/v1/asset-to-subcategory`, @@ -92,7 +92,7 @@ export const assetIdsToCatalogSubCategoryIds = addApiMethod(async ( * @exampleData {"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,"LayeredClothing":16,"Characters":17} * @exampleRawBody {"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,"LayeredClothing":16,"Characters":17} */ -export const catalogCategories = addApiMethod(async ( +export const catalogCategories = createApiMethod(async ( ): ApiMethod<{ [Key: string]: Identifier }> => ({ method: "GET", path: `/v1/categories`, @@ -108,7 +108,7 @@ export const catalogCategories = addApiMethod(async ( * @exampleData {"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,"BodyPartsBundles":37,"AnimationBundles":38,"EmoteAnimations":39,"CommunityCreations":40,"Video":41,"Recommended":51,"LayeredClothing":52,"AllBundles":53,"HeadAccessories":54,"ClassicTShirts":55,"ClassicShirts":56,"ClassicPants":57,"TShirtAccessories":58,"ShirtAccessories":59,"PantsAccessories":60,"JacketAccessories":61,"SweaterAccessories":62,"ShortsAccessories":63,"ShoesBundles":64,"DressSkirtAccessories":65,"DynamicHeads":66} * @exampleRawBody {"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,"BodyPartsBundles":37,"AnimationBundles":38,"EmoteAnimations":39,"CommunityCreations":40,"Video":41,"Recommended":51,"LayeredClothing":52,"AllBundles":53,"HeadAccessories":54,"ClassicTShirts":55,"ClassicShirts":56,"ClassicPants":57,"TShirtAccessories":58,"ShirtAccessories":59,"PantsAccessories":60,"JacketAccessories":61,"SweaterAccessories":62,"ShortsAccessories":63,"ShoesBundles":64,"DressSkirtAccessories":65,"DynamicHeads":66} */ -export const catalogSubCategories = addApiMethod(async ( +export const catalogSubCategories = createApiMethod(async ( ): ApiMethod<{ [Key: string]: Identifier }> => ({ method: "GET", path: `/v1/subcategories`, @@ -131,7 +131,7 @@ export const catalogSubCategories = addApiMethod(async ( * @exampleData [{"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":null,"price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":"85283800-cf57-4870-9a02-141945b9cbfd","price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}]} */ -export const bundlesAssetIsIn = addApiMethod(async ( +export const bundlesAssetIsIn = createApiMethod(async ( { assetId, limit, sortOrder, cursor }: { assetId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -153,7 +153,7 @@ export const bundlesAssetIsIn = addApiMethod(async ( * @exampleData {"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":null,"price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}} * @exampleRawBody {"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":"85283800-cf57-4870-9a02-141945b9cbfd","price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}} */ -export const bundleInfo = addApiMethod(async ( +export const bundleInfo = createApiMethod(async ( { bundleId }: { bundleId: BundleId } ): ApiMethod, PrettifiedBundle> => ({ method: "GET", @@ -175,7 +175,7 @@ export const bundleInfo = addApiMethod(async ( * @exampleData [{"id":598,"name":"Elemental Crystal Golem","description":"The light of an Elemental is controlled by its summoner, so its pretty much like a giant glowing mood ring. ","bundleType":"BodyParts","items":[{"id":4504227797,"name":"Elemental Crystal Golem - Left Arm","type":"Asset"},{"id":4504228958,"name":"Elemental Crystal Golem - Left Leg","type":"Asset"},{"id":4504228453,"name":"Elemental Crystal Golem - Right Arm","type":"Asset"},{"id":4504229658,"name":"Elemental Crystal Golem - Right Leg","type":"Asset"},{"id":4504230246,"name":"Elemental Crystal Golem - Torso","type":"Asset"},{"id":4504231783,"name":"Elemental Crystal Golem - Shoulder Rock","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":1791810588,"name":"Elemental Crystal Golem","type":"UserOutfit"},{"id":15057738572,"name":"Elemental Crystal Golem - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452708388,"name":"Elemental Crystal Golem - Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":1066235020906534,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":400,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"5529c928-ca35-4fba-91d8-9b63f81a1ae2","collectibleProductId":null,"price":400,"lowestPrice":400,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}] * @exampleRawBody {"data":[{"id":598,"name":"Elemental Crystal Golem","description":"The light of an Elemental is controlled by its summoner, so its pretty much like a giant glowing mood ring. ","bundleType":"BodyParts","items":[{"id":4504227797,"name":"Elemental Crystal Golem - Left Arm","type":"Asset"},{"id":4504228958,"name":"Elemental Crystal Golem - Left Leg","type":"Asset"},{"id":4504228453,"name":"Elemental Crystal Golem - Right Arm","type":"Asset"},{"id":4504229658,"name":"Elemental Crystal Golem - Right Leg","type":"Asset"},{"id":4504230246,"name":"Elemental Crystal Golem - Torso","type":"Asset"},{"id":4504231783,"name":"Elemental Crystal Golem - Shoulder Rock","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":1791810588,"name":"Elemental Crystal Golem","type":"UserOutfit"},{"id":15057738572,"name":"Elemental Crystal Golem - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452708388,"name":"Elemental Crystal Golem - Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":1066235020906534,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":400,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"5529c928-ca35-4fba-91d8-9b63f81a1ae2","collectibleProductId":"b503d9a7-c446-4e16-90ab-644c272e8543","price":400,"lowestPrice":400,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}]} */ -export const recommendationsForBundle = addApiMethod(async ( +export const recommendationsForBundle = createApiMethod(async ( { bundleId, amount }: { bundleId: Identifier, amount?: number } ): ApiMethod<{ data: RawBundle[] }, PrettifiedBundle[]> => ({ method: "GET", @@ -197,7 +197,7 @@ export const recommendationsForBundle = addApiMethod(async ( * @exampleData [{"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":null,"price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}] * @exampleRawBody [{"id":429,"name":"Magma Fiend","description":"He's got hot blood, with a temperature of nine hundred and three.","bundleType":"BodyParts","items":[{"id":2608534881,"name":"Magma Fiend - Left Arm","type":"Asset"},{"id":2608536258,"name":"Magma Fiend - Left Leg","type":"Asset"},{"id":2608537440,"name":"Magma Fiend - Right Arm","type":"Asset"},{"id":2608538559,"name":"Magma Fiend - Right Leg","type":"Asset"},{"id":2608539495,"name":"Magma Fiend - Torso","type":"Asset"},{"id":2510230574,"name":"Rthro Climb","type":"Asset"},{"id":2510233257,"name":"Rthro Fall","type":"Asset"},{"id":2510235063,"name":"Rthro Idle","type":"Asset"},{"id":2510236649,"name":"Rthro Jump","type":"Asset"},{"id":2510238627,"name":"Rthro Run","type":"Asset"},{"id":2510240941,"name":"Rthro Swim","type":"Asset"},{"id":2510242378,"name":"Rthro Walk","type":"Asset"},{"id":474312030,"name":"Magma Fiend","type":"UserOutfit"},{"id":12726967427,"name":"Magma Fiend - Head","type":"Asset"},{"id":11573370910,"name":"Anime - Mood","type":"Asset"},{"id":23452425262,"name":"Magma Fiend Head","type":"UserOutfit"}],"creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true},"product":{"id":7219806593957530,"type":"productType","isPublicDomain":false,"isForSale":true,"priceInRobux":300,"isFree":false,"noPriceText":null},"collectibleItemDetail":{"collectibleItemId":"e036077b-ed8d-4bf1-9193-4e64bbc86978","collectibleProductId":"85283800-cf57-4870-9a02-141945b9cbfd","price":300,"lowestPrice":300,"lowestResalePrice":0,"totalQuantity":0,"unitsAvailable":0,"saleLocation":{"saleLocationType":"ShopAndAllExperiences","saleLocationTypeId":5,"universeIds":[],"enabledUniverseIds":[]},"hasResellers":false,"saleStatus":"OnSale","quantityLimitPerUser":null,"offSaleDeadline":null,"collectibleItemType":"NonLimited","lowestAvailableResaleProductId":null,"lowestAvailableResaleItemInstanceId":null,"resaleRestriction":"Disabled"}}] */ -export const bundlesInfo = addApiMethod(async ( +export const bundlesInfo = createApiMethod(async ( { bundleIds }: { bundleIds: ArrayNonEmptyIfConst } ): ApiMethod[], PrettifiedBundle[]> => ({ method: "GET", @@ -221,7 +221,7 @@ export const bundlesInfo = addApiMethod(async ( * @exampleData [{"id":290,"name":"Football Player","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":71,"name":"Wild Starr","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":238,"name":"Man ","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":81,"name":"Superhero Animation Pack","bundleType":"AvatarAnimations","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":109,"name":"ROBLOX Boy","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":338,"name":"Knights of Redcliff: Paladin","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":321,"name":"City Life Man","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":337,"name":"City Life Woman","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":339,"name":"The High Seas: Beatrix The Pirate Queen","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":350,"name":"Dark Age Apprentice","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"191961467_1_6d4452377c2b2297df45ff633660d10b","data":[{"id":290,"name":"Football Player","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":71,"name":"Wild Starr","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":238,"name":"Man ","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":81,"name":"Superhero Animation Pack","bundleType":"AvatarAnimations","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":109,"name":"ROBLOX Boy","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":338,"name":"Knights of Redcliff: Paladin","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":321,"name":"City Life Man","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":337,"name":"City Life Woman","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":339,"name":"The High Seas: Beatrix The Pirate Queen","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":350,"name":"Dark Age Apprentice","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}}]} */ -export const bundlesOwnedByUser = addApiMethod(async ( +export const bundlesOwnedByUser = createApiMethod(async ( { userId, limit, sortOrder, cursor }: { userId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -247,7 +247,7 @@ export const bundlesOwnedByUser = addApiMethod(async ( * @exampleData [{"id":2043,"name":"Billy","bundleType":"BodyParts","creator":{"id":1755732316,"name":"mPhase","type":"User","hasVerifiedBadge":true}},{"id":942,"name":"Gil by Guilded","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":573,"name":"Oliver","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":572,"name":"Summer","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":239,"name":"Woman","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":510,"name":"Eleven’s Mall Outfit","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":502,"name":"FC Barcelona: Elite Playmaker","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":504,"name":"FC Barcelona: Elite Striker","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":364,"name":"NFL Super Bowl LIII – Los Angeles Rams","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":394,"name":"Simple Robo","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"eyJrZXkiOjIzNTUwNjI0NSwic29ydE9yZGVyIjoiRGVzYyIsInBhZ2luZ0RpcmVjdGlvbiI6IkZvcndhcmQiLCJwYWdlTnVtYmVyIjoyLCJkaXNjcmltaW5hdG9yIjoidXNlcklkOjQ1MzQ4MjgxYnVuZGxlVHlwZTpCb2R5UGFydHMiLCJjb3VudCI6MTB9CmExMTc4NzRhNTM0ZWVhNWY3NzM1OTdjOGVjZGU4NjczMDVhMGJhYTVhMjQ5NTk4OGQyZjc4NmU1NzM3NTVhMzk=","data":[{"id":2043,"name":"Billy","bundleType":"BodyParts","creator":{"id":1755732316,"name":"mPhase","type":"User","hasVerifiedBadge":true}},{"id":942,"name":"Gil by Guilded","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":573,"name":"Oliver","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":572,"name":"Summer","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":239,"name":"Woman","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":510,"name":"Eleven’s Mall Outfit","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":502,"name":"FC Barcelona: Elite Playmaker","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":504,"name":"FC Barcelona: Elite Striker","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":364,"name":"NFL Super Bowl LIII – Los Angeles Rams","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}},{"id":394,"name":"Simple Robo","bundleType":"BodyParts","creator":{"id":1,"name":"Roblox","type":"User","hasVerifiedBadge":true}}]} */ -export const bundlesOfTypeOwnedByUser = addApiMethod(async ( +export const bundlesOfTypeOwnedByUser = createApiMethod(async ( { userId, bundleType, limit, sortOrder, cursor }: { userId: Identifier, bundleType: Type, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod, MinimalBundle[]> => ({ @@ -272,7 +272,7 @@ export const bundlesOfTypeOwnedByUser = addApiMethod(async => ({ method: "GET", @@ -291,7 +291,7 @@ export const assetFavoritesCount = addApiMethod(async ( * @exampleData 520250 * @exampleRawBody 520250 */ -export const bundleFavoritesCount = addApiMethod(async ( +export const bundleFavoritesCount = createApiMethod(async ( { bundleId }: { bundleId: Identifier } ): ApiMethod => ({ method: "GET", @@ -311,7 +311,7 @@ export const bundleFavoritesCount = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authedUserRemoveAssetFavorite = addApiMethod(async ( +export const authedUserRemoveAssetFavorite = createApiMethod(async ( { userId, assetId }: { userId: Identifier, assetId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -333,7 +333,7 @@ export const authedUserRemoveAssetFavorite = addApiMethod(async ( * @exampleData {"assetId":2608539495,"userId":45348281,"created":"2024-07-30T15:00:39.540Z"} * @exampleRawBody {"assetId":2608539495,"userId":45348281,"created":"2024-07-30T15:00:39.540Z"} */ -export const authedUserGetAssetFavorite = addApiMethod(async ( +export const authedUserGetAssetFavorite = createApiMethod(async ( { userId, assetId }: { userId: UserId, assetId: AssetId } ): ApiMethod, PrettifiedAssetFavoritesCountData> => ({ method: "GET", @@ -355,7 +355,7 @@ export const authedUserGetAssetFavorite = addApiMethod(async ( +export const authedUserCreateAssetFavorite = createApiMethod(async ( { userId, assetId }: { userId: UserId, assetId: AssetId } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -377,7 +377,7 @@ export const authedUserCreateAssetFavorite = addApiMethod(async => ({ method: "DELETE", @@ -398,7 +398,7 @@ export const authedUserRemoveBundleFavorite = addApiMethod(async ( * @exampleData {"bundleId":429,"userId":45348281,"created":"2024-07-30T23:23:36.501Z"} * @exampleRawBody {"bundleId":429,"userId":45348281,"created":"2024-07-30T23:23:36.501Z"} */ -export const authedUserGetBundleFavorite = addApiMethod(async ( +export const authedUserGetBundleFavorite = createApiMethod(async ( { userId, bundleId }: { userId: UserId, bundleId: BundleId } ): ApiMethod, PrettifiedBundleFavoritesCountData> => ({ method: "GET", @@ -420,7 +420,7 @@ export const authedUserGetBundleFavorite = addApiMethod(async ( +export const authedUserCreateBundleFavorite = createApiMethod(async ( { userId, bundleId }: { userId: UserId, bundleId: AssetId } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -443,7 +443,7 @@ export const authedUserCreateBundleFavorite = addApiMethod(async ( +export const authedUserFavoritedBundlesOfType = createApiMethod(async ( { userId, bundleType, cursor, isPrevious }: ObjectPrettify< { userId: Identifier, bundleType: BType } & @@ -472,7 +472,7 @@ export const authedUserFavoritedBundlesOfType = addApiMethod(async ( +export const catalogBatchInfo = createApiMethod(async ( { assetIds, bundleIds }: ObjectEither< { assetIds: ArrayNonEmptyIfConst }, diff --git a/src/apis/classic/develop/develop.ts b/src/apis/classic/develop/develop.ts index 154e133..908ff8e 100644 --- a/src/apis/classic/develop/develop.ts +++ b/src/apis/classic/develop/develop.ts @@ -14,7 +14,7 @@ import type { SortOrder } from "../../../utils/utils.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicDevelop", baseUrl: "https://develop.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicDevelop", baseUrl: "https://develop.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ const addApiMethod = createApiGroup({ name: "ClassicDevelop", baseUrl: "https:// * @exampleData [{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":28220420,"name":"Baseplate","description":null,"isArchived":false,"rootPlaceId":95206881,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2013-11-01T08:47:14.070Z","updated":"2023-05-02T22:03:01.107Z"}},{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":2464612126,"name":"Classic Baseplate","description":null,"isArchived":false,"rootPlaceId":6560363541,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2021-03-24T00:56:45.957Z","updated":"2021-04-16T18:55:13.820Z"}},{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":28223770,"name":"Flat Terrain","description":null,"isArchived":false,"rootPlaceId":95206192,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2013-11-01T08:47:18.013Z","updated":"2023-05-02T22:17:58.570Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":6106389365,"name":"Laser Tag","description":null,"isArchived":false,"rootPlaceId":17823019220,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-06-11T21:29:12.993Z","updated":"2024-06-20T16:58:40.577Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":6106388692,"name":"FPS System","description":null,"isArchived":false,"rootPlaceId":17823017290,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-06-11T21:28:57.433Z","updated":"2024-06-20T16:58:54.493Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":5557500170,"name":"Racing","description":null,"isArchived":false,"rootPlaceId":16078915506,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-01-22T19:47:42.920Z","updated":"2024-01-29T17:39:18.837Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":202770430,"name":"Village","description":null,"isArchived":false,"rootPlaceId":520390648,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-10-10T21:32:42.780Z","updated":"2023-05-03T23:39:56.663Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":93411794,"name":"Castle","description":null,"isArchived":false,"rootPlaceId":203810088,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-01-14T21:46:11.363Z","updated":"2023-05-03T23:46:03.850Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":138962641,"name":"Suburban","description":null,"isArchived":false,"rootPlaceId":366130569,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-02-20T00:02:36.483Z","updated":"2023-05-03T23:45:29.983Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":107387509,"name":"Pirate Island","description":null,"isArchived":false,"rootPlaceId":264719325,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-07-01T22:54:38.927Z","updated":"2023-05-03T23:49:39.753Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":93412282,"name":"Obby","description":null,"isArchived":false,"rootPlaceId":203812057,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-01-14T21:51:25.830Z","updated":"2023-05-03T23:50:57.623Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":142606178,"name":"Starting Place","description":null,"isArchived":false,"rootPlaceId":379736082,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-03-09T19:04:30.723Z","updated":"2023-05-04T00:09:23.643Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":115791780,"name":"Line Runner","description":null,"isArchived":false,"rootPlaceId":301530843,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-09-28T22:16:52.420Z","updated":"2023-05-04T00:10:55.837Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":3760683948,"name":"Concert","description":null,"isArchived":false,"rootPlaceId":10275826693,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2022-07-19T00:42:50.713Z","updated":"2023-05-03T23:14:32.480Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":4594822820,"name":"Modern City","description":null,"isArchived":false,"rootPlaceId":13165709401,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2023-04-17T18:33:52.930Z","updated":"2023-04-17T23:24:03.373Z"}}] * @exampleRawBody {"data":[{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":28220420,"name":"Baseplate","description":null,"isArchived":false,"rootPlaceId":95206881,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2013-11-01T08:47:14.07Z","updated":"2023-05-02T22:03:01.107Z"}},{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":2464612126,"name":"Classic Baseplate","description":null,"isArchived":false,"rootPlaceId":6560363541,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2021-03-24T00:56:45.957Z","updated":"2021-04-16T18:55:13.82Z"}},{"gameTemplateType":"Generic","hasTutorials":false,"universe":{"id":28223770,"name":"Flat Terrain","description":null,"isArchived":false,"rootPlaceId":95206192,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2013-11-01T08:47:18.013Z","updated":"2023-05-02T22:17:58.57Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":6106389365,"name":"Laser Tag","description":null,"isArchived":false,"rootPlaceId":17823019220,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-06-11T21:29:12.993Z","updated":"2024-06-20T16:58:40.577Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":6106388692,"name":"FPS System","description":null,"isArchived":false,"rootPlaceId":17823017290,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-06-11T21:28:57.433Z","updated":"2024-06-20T16:58:54.493Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":5557500170,"name":"Racing","description":null,"isArchived":false,"rootPlaceId":16078915506,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2024-01-22T19:47:42.92Z","updated":"2024-01-29T17:39:18.837Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":202770430,"name":"Village","description":null,"isArchived":false,"rootPlaceId":520390648,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-10-10T21:32:42.78Z","updated":"2023-05-03T23:39:56.663Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":93411794,"name":"Castle","description":null,"isArchived":false,"rootPlaceId":203810088,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-01-14T21:46:11.363Z","updated":"2023-05-03T23:46:03.85Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":138962641,"name":"Suburban","description":null,"isArchived":false,"rootPlaceId":366130569,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-02-20T00:02:36.483Z","updated":"2023-05-03T23:45:29.983Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":107387509,"name":"Pirate Island","description":null,"isArchived":false,"rootPlaceId":264719325,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-07-01T22:54:38.927Z","updated":"2023-05-03T23:49:39.753Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":93412282,"name":"Obby","description":null,"isArchived":false,"rootPlaceId":203812057,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-01-14T21:51:25.83Z","updated":"2023-05-03T23:50:57.623Z"}},{"gameTemplateType":"Theme","hasTutorials":true,"universe":{"id":142606178,"name":"Starting Place","description":null,"isArchived":false,"rootPlaceId":379736082,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2016-03-09T19:04:30.723Z","updated":"2023-05-04T00:09:23.643Z"}},{"gameTemplateType":"Gameplay","hasTutorials":false,"universe":{"id":115791780,"name":"Line Runner","description":null,"isArchived":false,"rootPlaceId":301530843,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2015-09-28T22:16:52.42Z","updated":"2023-05-04T00:10:55.837Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":3760683948,"name":"Concert","description":null,"isArchived":false,"rootPlaceId":10275826693,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2022-07-19T00:42:50.713Z","updated":"2023-05-03T23:14:32.48Z"}},{"gameTemplateType":"Theme","hasTutorials":false,"universe":{"id":4594822820,"name":"Modern City","description":null,"isArchived":false,"rootPlaceId":13165709401,"isActive":true,"privacyType":"Public","creatorType":"User","creatorTargetId":998796,"creatorName":"Templates","created":"2023-04-17T18:33:52.93Z","updated":"2023-04-17T23:24:03.373Z"}}]} */ -export const gameTemplates = addApiMethod(async ( +export const gameTemplates = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/gametemplates`, @@ -57,7 +57,7 @@ export const gameTemplates = addApiMethod(async ( * @exampleData [{"id":1651554338,"name":"Ninjas Unleashed: Legion","description":"No secret projects here\r\nScriptor/Game Designer - NamelessGuy2005\r\nBuilder/Animator - Flaroh\r\n","isArchived":false,"rootPlaceId":4857762148,"isActive":false,"privacyType":"Private","creatorType":"Group","creatorTargetId":5850082,"creatorName":"MightyPart Games","created":"2020-04-04T13:17:08.120Z","updated":"2020-04-20T15:37:55.803Z"}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":1651554338,"name":"Ninjas Unleashed: Legion","description":"No secret projects here\r\nScriptor/Game Designer - NamelessGuy2005\r\nBuilder/Animator - Flaroh\r\n","isArchived":false,"rootPlaceId":4857762148,"isActive":false,"privacyType":"Private","creatorType":"Group","creatorTargetId":5850082,"creatorName":"MightyPart Games","created":"2020-04-04T13:17:08.12Z","updated":"2020-04-20T15:37:55.803Z"}]} */ -export const groupUniverses = addApiMethod(async ( +export const groupUniverses = createApiMethod(async ( { groupId, isArchived, limit, sortOrder, cursor }: { groupId: GroupId, isArchived?: boolean, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod, PrettifiedGroupUniversesData> => ({ @@ -88,7 +88,7 @@ export const groupUniverses = addApiMethod(async ( * @exampleData [{"id":45348281,"name":"MightyPart","displayName":"Mighty"}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":45348281,"name":"MightyPart","displayName":"Mighty"}]} */ -export const teamCreateActiveMembers = addApiMethod(async ( +export const teamCreateActiveMembers = createApiMethod(async ( { placeId, limit, cursor }: { placeId: Identifier, limit?: 10 | 25 | 50 | 100, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -110,7 +110,7 @@ export const teamCreateActiveMembers = addApiMethod(async ( * @exampleData {"isEnabled":true} * @exampleRawBody {"isEnabled":true} */ -export const teamCreateSettingsForUniverse = addApiMethod(async ( +export const teamCreateSettingsForUniverse = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ isEnabled: boolean }> => ({ method: "GET", @@ -126,17 +126,17 @@ export const teamCreateSettingsForUniverse = addApiMethod(async ( * @param universeId The ID of the universe to update team create settings for. * @param isEnabled If team create should be enabled. * - * @example const { data:success } = await ClassicDevelopApi.updateTeamCreateSettingsForUniverse({ universeId: 6069031486, isEnabled: false }) + * @example const { data:success } = await ClassicDevelopApi.setTeamCreateSettingsForUniverse({ universeId: 6069031486, isEnabled: false }) * @exampleData true * @exampleRawBody {} */ -export const updateTeamCreateSettingsForUniverse = addApiMethod(async ( +export const setTeamCreateSettingsForUniverse = createApiMethod(async ( { universeId, isEnabled }: { universeId: Identifier, isEnabled: boolean } ): ApiMethod<{}, boolean> => ({ method: "PATCH", path: `/v1/universes/${universeId}/teamcreate`, body: { isEnabled }, - name: `updateTeamCreateSettingsForUniverse`, + name: `setTeamCreateSettingsForUniverse`, formatRawDataFn: dataIsSuccess })) @@ -152,7 +152,7 @@ export const updateTeamCreateSettingsForUniverse = addApiMethod(async ( * @exampleData {"6069031486":{"isEnabled":false}} * @exampleRawBody {"data":[{"id":6069031486,"isEnabled":false}]} */ -export const teamCreateSettingsForUniverses = addApiMethod(async ( +export const teamCreateSettingsForUniverses = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedTeamCreateSettingsForUniversesData> => ({ method: "GET", @@ -175,7 +175,7 @@ export const teamCreateSettingsForUniverses = addApiMethod(async => ({ method: "DELETE", @@ -199,7 +199,7 @@ export const teamCreateRemoveUsersAccessForUniverse = addApiMethod(async ( * @exampleData {"18407509477":{"created":"2024-07-09T10:44:37.523Z","updated":"2024-07-09T10:44:37.523Z","name":"PropertyLab [PRE-ALPHA V0.0.0]","description":"A modernised plugin explorer for Roblox.","commentsEnabled":false,"versionId":24376570646}} * @exampleRawBody {"data":[{"id":18407509477,"name":"PropertyLab [PRE-ALPHA V0.0.0]","description":"A modernised plugin explorer for Roblox.","commentsEnabled":false,"versionId":24376570646,"created":"2024-07-09T10:44:37.523Z","updated":"2024-07-09T10:44:37.523Z"}]} */ -export const pluginsInfo = addApiMethod(async ( +export const pluginsInfo = createApiMethod(async ( { pluginIds }: { pluginIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedPluginsInfoData> => ({ method: "GET", @@ -228,7 +228,7 @@ export const pluginsInfo = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const updatePlugin = addApiMethod(async ( +export const updatePlugin = createApiMethod(async ( { pluginId, name, description, commentsEnabled }: { pluginId: Identifier, name?: string, description?: string, commentsEnabled?: boolean } ): ApiMethod<{}, boolean> => ({ method: "PATCH", @@ -252,7 +252,7 @@ export const updatePlugin = addApiMethod(async ( * @exampleData {"id":6069031486,"name":"MightyPart's Place: 06032024_1","description":null,"isArchived":false,"rootPlaceId":17718644108,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart","created":"2024-06-03T09:42:56.270Z","updated":"2024-06-03T09:42:56.270Z"} * @exampleRawBody {"id":6069031486,"name":"MightyPart's Place: 06032024_1","description":null,"isArchived":false,"rootPlaceId":17718644108,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart","created":"2024-06-03T09:42:56.27Z","updated":"2024-06-03T09:42:56.27Z"} */ -export const universeInfo = addApiMethod(async ( +export const universeInfo = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod, PrettifiedUniverseInfo> => ({ method: "GET", @@ -276,7 +276,7 @@ export const universeInfo = addApiMethod(async ( * @exampleData {"canManage":true,"canCloudEdit":true} * @exampleRawBody {"canManage":true,"canCloudEdit":true} */ -export const authenticatedUserPermissionsForUniverse = addApiMethod(async ( +export const authenticatedUserPermissionsForUniverse = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ canManage: boolean, canCloudEdit: boolean }> => ({ method: "GET", @@ -298,7 +298,7 @@ export const authenticatedUserPermissionsForUniverse = addApiMethod(async ( * @exampleData [{"id":11969698031,"universeId":6026274246,"name":"MightyPart's Place Number: 140","description":""}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":11969698031,"universeId":6026274246,"name":"MightyPart's Place Number: 140","description":""}]} */ -export const universePlaces = addApiMethod(async ( +export const universePlaces = createApiMethod(async ( { universeId, isUniverseCreation, limit, sortOrder, cursor }: { universeId: UniverseId, isUniverseCreation?: boolean, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod, PrettifiedUniversePlacesData> => ({ @@ -321,7 +321,7 @@ export const universePlaces = addApiMethod(async * @exampleData {"6069031486":{"created":"2024-06-03T09:42:56.270Z","updated":"2024-06-03T09:42:56.270Z","name":"MightyPart's Place: 06032024_1","description":null,"isArchived":false,"rootPlaceId":17718644108,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart"}} * @exampleRawBody {"data":[{"id":6069031486,"name":"MightyPart's Place: 06032024_1","description":null,"isArchived":false,"rootPlaceId":17718644108,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart","created":"2024-06-03T09:42:56.27Z","updated":"2024-06-03T09:42:56.27Z"}]} */ -export const universesInfo = addApiMethod(async ( +export const universesInfo = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedUniversesInfoData> => ({ method: "GET", @@ -345,7 +345,7 @@ export const universesInfo = addApiMethod(async ( * @exampleData {"6069031486":{"canManage":true,"canCloudEdit":true}} * @exampleRawBody {"data":[{"universeId":6069031486,"canManage":true,"canCloudEdit":true}]} */ -export const authenticatedUserPermissionsForUniverses = addApiMethod(async ( +export const authenticatedUserPermissionsForUniverses = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod< RawAuthenticatedUserPermissionsForUniversesData, PrettifiedAuthenticatedUserPermissionsForUniversesData @@ -371,7 +371,7 @@ export const authenticatedUserPermissionsForUniverses = addApiMethod(async ( +export const universeConfiguration = createApiMethod(async ( { universeId }: { universeId: UniverseId } ): ApiMethod> => ({ method: "GET", @@ -407,7 +407,7 @@ export const universeConfiguration = addApiMethod(async => ({ method: "GET", @@ -468,7 +468,7 @@ export const vipServerConfigurationForUniverse = addApiMethod(async ( * @exampleData [{"id":5850082,"name":"MightyPart Games"}] * @exampleRawBody {"data":[{"id":5850082,"name":"MightyPart Games"}]} */ -export const authenticatedUserGroupsCanManage = addApiMethod(async ( +export const authenticatedUserGroupsCanManage = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/user/groups/canmanage`, @@ -486,7 +486,7 @@ export const authenticatedUserGroupsCanManage = addApiMethod(async ( * @exampleData [{"id":5850082,"name":"MightyPart Games"}] * @exampleRawBody {"data":[{"id":5850082,"name":"MightyPart Games"}]} */ -export const authenticatedUserGroupsCanManageGamesOrItems = addApiMethod(async ( +export const authenticatedUserGroupsCanManageGamesOrItems = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/user/groups/canmanagegamesoritems`, @@ -509,7 +509,7 @@ export const authenticatedUserGroupsCanManageGamesOrItems = addApiMethod(async ( * @exampleData [{"id":43387735,"name":"parrrty's Place Number: 2","description":"parrrty's Place","isArchived":false,"rootPlaceId":122862800,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart","created":"2013-11-01T13:47:47.813Z","updated":"2019-04-04T13:32:49.633Z"}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":43387735,"name":"parrrty's Place Number: 2","description":"parrrty's Place","isArchived":false,"rootPlaceId":122862800,"isActive":false,"privacyType":"Private","creatorType":"User","creatorTargetId":45348281,"creatorName":"MightyPart","created":"2013-11-01T13:47:47.813Z","updated":"2019-04-04T13:32:49.633Z"}]} */ -export const authenticatedUserUniverses = addApiMethod(async ( +export const authenticatedUserUniverses = createApiMethod(async ( { isArchived, limit, sortOrder, cursor }: { isArchived?: boolean, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -539,7 +539,7 @@ export const authenticatedUserUniverses = addApiMethod(async ( * @exampleData {"id":16349154726,"universeId":5638577595,"name":"New name!","description":""} * @exampleRawBody {"id":16349154726,"universeId":5638577595,"name":"New name!","description":""} */ -export const updatePlaceConfiguration_V1 = addApiMethod(async < +export const updatePlaceConfiguration_V1 = createApiMethod(async < PlaceId extends Identifier, Name extends string, Description extends string >( { placeId, name, description }: { placeId: PlaceId, name?: Name, description?: Description } @@ -563,7 +563,7 @@ export const updatePlaceConfiguration_V1 = addApiMethod(async < * @exampleData {"maxPlayerCount":50,"socialSlotType":"Automatic","customSocialSlotsCount":15,"allowCopying":false,"currentSavedVersion":1537,"isAllGenresAllowed":true,"allowedGearTypes":[],"maxPlayersAllowed":700,"id":16349154726,"universeId":5638577595,"name":"New name!","description":"","isRootPlace":true} * @exampleRawBody {"maxPlayerCount":50,"socialSlotType":"Automatic","customSocialSlotsCount":15,"allowCopying":false,"currentSavedVersion":1537,"isAllGenresAllowed":true,"allowedGearTypes":[],"maxPlayersAllowed":700,"id":16349154726,"universeId":5638577595,"name":"New name!","description":"","isRootPlace":true} */ -export const placeConfiguration = addApiMethod(async ( +export const placeConfiguration = createApiMethod(async ( { placeId }: { placeId: PlaceId } ): ApiMethod> => ({ method: "GET", @@ -584,7 +584,7 @@ export const placeConfiguration = addApiMethod(async => ({ method: "DELETE", diff --git a/src/apis/classic/developerProducts/developerProducts.ts b/src/apis/classic/developerProducts/developerProducts.ts index f347f35..b9520b0 100644 --- a/src/apis/classic/developerProducts/developerProducts.ts +++ b/src/apis/classic/developerProducts/developerProducts.ts @@ -14,7 +14,7 @@ import type { PrettifiedDeveloperProductCreatorDetails, PrettifiedDeveloperProdu // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicDeveloperProducts", baseUrl: "https://apis.roblox.com/developer-products" }) +const { createApiMethod } = createApiGroup({ name: "ClassicDeveloperProducts", baseUrl: "https://apis.roblox.com/developer-products" }) ////////////////////////////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ const prettifyMinimalDeveloperProduct = ( * @exampleData {"productId":995087849,"productTypeId":4,"isPublicDomain":false,"isForSale":true,"priceInRobux":95,"premiumPriceInRobux":null,"robloxProductId":null,"targetId":3848620,"assetTypeId":null,"creatorId":1536374574,"assetGenres":0,"assetCategories":0,"affiliateFeePercentage":null,"isNew":false,"created":"2020-05-29T11:49:09.08Z","updated":"2024-07-22T05:33:16.827Z"} * @exampleRawBody {"id":995087849,"productTypeId":4,"isPublicDomain":false,"isForSale":true,"priceInRobux":95,"premiumPriceInRobux":null,"robloxProductId":null,"targetId":3848620,"assetTypeId":null,"creatorId":1536374574,"assetGenres":0,"assetCategories":0,"affiliateFeePercentage":null,"isNew":false,"created":"2020-05-29T11:49:09.08Z","updated":"2024-07-22T05:33:16.827Z"} */ -export const developerProductInfo = addApiMethod(async ( +export const developerProductInfo = createApiMethod(async ( { developerProductId }: { developerProductId: DeveloperProductId } ): ApiMethod, PrettifiedDeveloperProductInfoData> => ({ method: "GET", @@ -60,7 +60,7 @@ export const developerProductInfo = addApiMethod(async => ({ method: "GET", @@ -91,7 +91,7 @@ export const developerProductsForUniverse = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const updateDeveloperProduct = addApiMethod(async ( +export const updateDeveloperProduct = createApiMethod(async ( { universeId, developerProductId, name, description, priceInRobux }: { universeId: Identifier, developerProductId: Identifier, name?: string, description?: string, priceInRobux?: number } ): ApiMethod<{}, boolean> => ({ @@ -118,7 +118,7 @@ export const updateDeveloperProduct = addApiMethod(async ( * @exampleData 18760547825 * @exampleRawBody {"imageAssetId":18760547825} */ -export const updateDeveloperProductIcon = addApiMethod(async ( +export const updateDeveloperProductIcon = createApiMethod(async ( { developerProductId, icon }: { developerProductId: Identifier, icon: string | File } ): ApiMethod<{ imageAssetId: 18760543954 }, Identifier> => ({ method: "POST", @@ -147,7 +147,7 @@ export const updateDeveloperProductIcon = addApiMethod(async ( * @exampleData {"id":60558911,"name":"50 Coins","description":"Lorem Ipsum","shopId":1685930453,"iconImageAssetId":null} * @exampleRawBody {"id":60558911,"name":"50 Coins","Description":"Lorem Ipsum","shopId":1685930453,"iconImageAssetId":null} */ -export const createDeveloperProduct = addApiMethod(async ( +export const createDeveloperProduct = createApiMethod(async ( { universeId, name, description, priceInRobux }: { universeId: Identifier, name: string, description: string, priceInRobux: number } ): ApiMethod => ({ method: "POST", @@ -172,7 +172,7 @@ export const createDeveloperProduct = addApiMethod(async ( * @exampleData {"displayName":"Starterpackk","displayDescription":null,"displayIconImageAssetId":5106354357,"priceInformation":{"defaultPriceInRobux":95,"isInActivePriceOptimizationExperiment":false},"targetId":3848620,"productType":"Developer Product","assetId":0,"productId":995087849,"name":"Starterpackk","description":null,"assetTypeId":0,"creator":{"id":0,"name":null,"creatorType":null,"creatorTargetId":0},"iconImageAssetId":5106354357,"created":"2020-05-29T11:49:09.08Z","updated":"2024-07-22T05:33:16.827Z","priceInRobux":null,"premiumPriceInRobux":null,"priceInTickets":null,"isNew":false,"isForSale":true,"isPublicDomain":false,"isLimited":false,"isLimitedUnique":false,"remaining":null,"sales":null,"minimumMembershipLevel":0} * @exampleRawBody {"DisplayName":"Starterpackk","DisplayDescription":null,"DisplayIconImageAssetId":5106354357,"PriceInformation":{"defaultPriceInRobux":95,"isInActivePriceOptimizationExperiment":false},"TargetId":3848620,"ProductType":"Developer Product","AssetId":0,"ProductId":995087849,"Name":"Starterpackk","Description":null,"AssetTypeId":0,"Creator":{"Id":0,"Name":null,"CreatorType":null,"CreatorTargetId":0},"IconImageAssetId":5106354357,"Created":"2020-05-29T11:49:09.08Z","Updated":"2024-07-22T05:33:16.827Z","PriceInRobux":null,"PremiumPriceInRobux":null,"PriceInTickets":null,"IsNew":false,"IsForSale":true,"IsPublicDomain":false,"IsLimited":false,"IsLimitedUnique":false,"Remaining":null,"Sales":null,"MinimumMembershipLevel":0} */ -export const developerProductCreatorDetails = addApiMethod(async ( +export const developerProductCreatorDetails = createApiMethod(async ( { developerProductProductId }: { developerProductProductId: Identifier } ): ApiMethod => ({ method: "GET", diff --git a/src/apis/classic/economy/economy.ts b/src/apis/classic/economy/economy.ts index 170186a..6328b4c 100644 --- a/src/apis/classic/economy/economy.ts +++ b/src/apis/classic/economy/economy.ts @@ -12,7 +12,7 @@ import type { AssetResaleData, AssetResellerData, AuthedUserDevExCashOutInfoData // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicEconomy", baseUrl: "https://economy.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicEconomy", baseUrl: "https://economy.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -31,7 +31,7 @@ const addApiMethod = createApiGroup({ name: "ClassicEconomy", baseUrl: "https:// * @exampleData {"assetStock":null,"sales":11412,"numberRemaining":null,"recentAveragePrice":261565,"originalPrice":null,"priceDataPoints":[{"value":271997,"date":"2024-07-30T00:00:00Z"}],"volumeDataPoints":[{"value":2,"date":"2024-07-30T00:00:00Z"}]} * @exampleRawBody {"assetStock":null,"sales":11412,"numberRemaining":null,"recentAveragePrice":261565,"originalPrice":null,"priceDataPoints":[{"value":271997,"date":"2024-07-30T00:00:00Z"}],"volumeDataPoints":[{"value":2,"date":"2024-07-30T00:00:00Z"}]} */ -export const assetResaleData = addApiMethod(async ( +export const assetResaleData = createApiMethod(async ( { assetId }: { assetId: Identifier } ): ApiMethod => ({ method: "GET", @@ -52,7 +52,7 @@ export const assetResaleData = addApiMethod(async ( * @exampleData [{"userAssetId":482809968,"seller":{"hasVerifiedBadge":false,"id":4159620298,"type":"User","name":"AnimatedObjects"},"price":280000,"serialNumber":null}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"eyJzdGFydEluZGV4IjoxMCwiZGlzY3JpbWluYXRvciI6ImFzc2V0SWQ6MTM2NTc2NyIsImNvdW50IjoxMH0KYTlmMDVlNGMxZGYwMDMwMjAwOWQ5ODFjMzk5MTY2OWJmNDU1MTljNDQ2OWEzZTZmMGI2NzE0NTgwOWE4NWQzZQ==","data":[{"userAssetId":482809968,"seller":{"hasVerifiedBadge":false,"id":4159620298,"type":"User","name":"AnimatedObjects"},"price":280000,"serialNumber":null}]} */ -export const assetResellers = addApiMethod(async ( +export const assetResellers = createApiMethod(async ( { assetId, limit, cursor }: { assetId: Identifier, limit?: 10 | 25 | 50 | 100, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -75,7 +75,7 @@ export const assetResellers = addApiMethod(async ( * @exampleData [{"userAssetId":45867931761,"seller":{"hasVerifiedBadge":false,"id":45348281,"type":"User","name":"MightyPart"},"price":null,"serialNumber":null,"isOnHold":false}] * @exampleRawBody {"data":[{"userAssetId":45867931761,"seller":{"hasVerifiedBadge":false,"id":45348281,"type":"User","name":"MightyPart"},"price":null,"serialNumber":null,"isOnHold":false}]} */ -export const authedUserAssetResellableCopies = addApiMethod(async ( +export const authedUserAssetResellableCopies = createApiMethod(async ( { userId, assetId }: { userId: Identifier, assetId: Identifier } ): ApiMethod<{ data: AssetResellerData[] }, AssetResellerData[]> => ({ method: "GET", @@ -94,7 +94,7 @@ export const authedUserAssetResellableCopies = addApiMethod(async ( * @exampleData {"taxRate":0.3,"minimumFee":1} * @exampleRawBody {"taxRate":0.3,"minimumFee":1} */ -export const assetResaleTaxRate = addApiMethod(async ( +export const assetResaleTaxRate = createApiMethod(async ( ): ApiMethod<{ taxRate: number, minimumFee: number }> => ({ method: "GET", path: `/v1/resale-tax-rate`, @@ -112,7 +112,7 @@ export const assetResaleTaxRate = addApiMethod(async ( * @exampleData {"hasCurrencyOperationError":false,"currencyOperationErrorMessage":"","showOnlyExchangeRates":true,"emailIsVerified":true,"isImbursementBlacklistUser":false,"canProceedToCashout":false,"showProgressBar":false,"percentRobux":1,"minRobuxToCashOut":30000,"maxRobuxCanCashOut":20000000000,"lastImbursementStatus":null,"lastImbursementSubmissionDate":null,"conversionPercent":0.0035} * @exampleRawBody {"hasCurrencyOperationError":false,"currencyOperationErrorMessage":"","showOnlyExchangeRates":true,"emailIsVerified":true,"isImbursementBlacklistUser":false,"canProceedToCashout":false,"showProgressBar":false,"percentRobux":1,"minRobuxToCashOut":30000,"maxRobuxCanCashOut":20000000000,"lastImbursementStatus":null,"lastImbursementSubmissionDate":null,"conversionPercent":0.0035} */ -export const authedUserDevExCashOutInfo = addApiMethod(async ( +export const authedUserDevExCashOutInfo = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/developer-exchange/info`, @@ -132,7 +132,7 @@ export const authedUserDevExCashOutInfo = addApiMethod(async ( * @exampleData false * @exampleRawBody false */ -export const groupCanAddFunds = addApiMethod(async ( +export const groupCanAddFunds = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod => ({ method: "GET", @@ -151,7 +151,7 @@ export const groupCanAddFunds = addApiMethod(async ( * @exampleData {"transactionDate":null,"rateLimitInDays":30} * @exampleRawBody {"transactionDate":null,"rateLimitInDays":30} */ -export const groupLatestAddedFundsData = addApiMethod(async ( +export const groupLatestAddedFundsData = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod<{ transactionDate: ISODateTime | null, rateLimitInDays: number }> => ({ method: "GET", @@ -170,7 +170,7 @@ export const groupLatestAddedFundsData = addApiMethod(async ( * @exampleData {"robux":0} * @exampleRawBody {"robux":0} */ -export const groupCurrency = addApiMethod(async ( +export const groupCurrency = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod<{ robux: number} > => ({ method: "GET", @@ -187,7 +187,7 @@ export const groupCurrency = addApiMethod(async ( * @exampleData {"robux":0} * @exampleRawBody {"robux":0} */ -export const authedUserCurrency = addApiMethod(async ( +export const authedUserCurrency = createApiMethod(async ( ): ApiMethod<{ robux: number }> => ({ method: "GET", path: `/v1/user/currency`, @@ -208,7 +208,7 @@ export const authedUserCurrency = addApiMethod(async ( * @exampleData {"recurringRobuxStipend":0,"itemSaleRobux":0,"purchasedRobux":0,"tradeSystemRobux":0,"pendingRobux":0,"groupPayoutRobux":0,"individualToGroupRobux":0,"premiumPayouts":0,"groupPremiumPayouts":0,"adjustmentRobux":0,"immersiveAdPayouts":0,"subscriptionPayouts":0,"subscriptionClawbacks":0,"isShowImmersiveAdPayoutSummaryOnZeroEnabled":false,"commissionRobux":0,"publishingAdvanceRebates":0} * @exampleRawBody {"recurringRobuxStipend":0,"itemSaleRobux":0,"purchasedRobux":0,"tradeSystemRobux":0,"pendingRobux":0,"groupPayoutRobux":0,"individualToGroupRobux":0,"premiumPayouts":0,"groupPremiumPayouts":0,"adjustmentRobux":0,"immersiveAdPayouts":0,"subscriptionPayouts":0,"subscriptionClawbacks":0,"isShowImmersiveAdPayoutSummaryOnZeroEnabled":false,"commissionRobux":0,"publishingAdvanceRebates":0} */ -export const groupRevenueSummary = addApiMethod(async ( +export const groupRevenueSummary = createApiMethod(async ( { groupId, timeFrame }: { groupId: Identifier, timeFrame: "Day" | "Week" | "Month" | "Year" } ): ApiMethod => ({ method: "GET", @@ -231,7 +231,7 @@ export const groupRevenueSummary = addApiMethod(async ( * @exampleData {"1412728377":"Eligible"} * @exampleRawBody {"usersGroupPayoutEligibility":{"1412728377":"Eligible"}} */ -export const groupPayoutsUserEligibility = addApiMethod(async ( +export const groupPayoutsUserEligibility = createApiMethod(async ( { groupId, userIds }: { groupId: Identifier, userIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedUserGroupPayoutEligibilityData> => ({ method: "GET", @@ -262,7 +262,7 @@ export const groupPayoutsUserEligibility = addApiMethod(async ( +export const groupTransactionHistory = createApiMethod(async ( { groupId, transactionType }: { groupId: Identifier, transactionType: Type, limit?: 10 | 25 | 50 | 100, cursor?: string } ): ApiMethod, PrettifiedGroupTransactionHistoryData> => ({ method: "GET", @@ -285,7 +285,7 @@ export const groupTransactionHistory = addApiMethod(async => ({ method: "GET", path: `/v2/metadata`, diff --git a/src/apis/classic/friends/friends.ts b/src/apis/classic/friends/friends.ts index f90b347..c2eb345 100644 --- a/src/apis/classic/friends/friends.ts +++ b/src/apis/classic/friends/friends.ts @@ -14,7 +14,7 @@ import type { SortOrder } from "../../../utils/utils.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicFriends", baseUrl: "https://friends.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicFriends", baseUrl: "https://friends.roblox.com" }) const userSortNameToId = { Alphabetical: 0, @@ -46,7 +46,7 @@ const friendshipOriginSourceTypeNameToId = { * @exampleData {"isFriendsFilterBarEnabled":true,"isFriendsPageSortExperimentEnabled":false,"isFriendsUserDataStoreCacheEnabled":true,"frequentFriendSortRollout":0,"userName":null,"displayName":null} * @exampleRawBody {"isFriendsFilterBarEnabled":true,"isFriendsPageSortExperimentEnabled":false,"isFriendsUserDataStoreCacheEnabled":true,"frequentFriendSortRollout":0,"userName":null,"displayName":null} */ -export const friendsMetadata = addApiMethod(async ( +export const friendsMetadata = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/metadata`, method: "GET", @@ -61,7 +61,7 @@ export const friendsMetadata = addApiMethod(async ( * @exampleData 47 * @exampleRawBody {"count":47} */ -export const authenticatedUserFriendsCount = addApiMethod(async ( +export const authenticatedUserFriendsCount = createApiMethod(async ( ): ApiMethod<{ count: number }, number> => ({ path: `/v1/my/friends/count`, method: "GET", @@ -82,7 +82,7 @@ export const authenticatedUserFriendsCount = addApiMethod(async ( * @exampleData [ { "friendRequest": { "sentAt": "2024-03-24T02:25:33.095Z", "senderId": 5635371081, "sourceUniverseId": 2549415383, "originSourceType": "InGame", "contactName": null }, "mutualFriendsList": [], "hasVerifiedBadge": false, "description": "", "created": "2024-03-04T15:20:32.033Z", "isBanned": false, "externalAppDisplayName": null, "id": 5635371081, "name": "loremIpsum", "displayName": "loremIpsum"} ] * @exampleRawBody { "previousPageCursor": null, "nextPageCursor": "638366615689560000-0_1_bcccef3d2c3547470ca9dc3072eedfec", "data": [ { "friendRequest": { "sentAt": "2024-03-24T02:25:33.095Z", "senderId": 5635371081, "sourceUniverseId": 2549415383, "originSourceType": "InGame", "contactName": null }, "mutualFriendsList": [], "hasVerifiedBadge": false, "description": "", "created": "2024-03-04T15:20:32.033Z", "isBanned": false, "externalAppDisplayName": null, "id": 5635371081, "name": "loremIpsum", "displayName": "loremIpsum"} ] } */ -export const authenticatedUserFriendRequests = addApiMethod(async ( +export const authenticatedUserFriendRequests = createApiMethod(async ( { limit, sortOrder, cursor }: { limit?: 10 | 18 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ path: `/v1/my/friends/requests`, @@ -105,7 +105,7 @@ export const authenticatedUserFriendRequests = addApiMethod(async ( * @exampleData 82 * @exampleRawBody {"count":82} */ -export const authenticatedUserFriendRequestsCount = addApiMethod(async ( +export const authenticatedUserFriendRequestsCount = createApiMethod(async ( ): ApiMethod<{ count: number }, number> => ({ path: `/v1/user/friend-requests/count`, method: "GET", @@ -125,7 +125,7 @@ export const authenticatedUserFriendRequestsCount = addApiMethod(async ( * @exampleData [{"isOnline":true,"presenceType":1,"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":1,"hasVerifiedBadge":false,"description":null,"created":"0001-01-01T05:52:00Z","isBanned":false,"externalAppDisplayName":null,"id":1999518862,"name":"Ipsum","displayName":"Lorem"}] * @exampleRawBody {"data":[{"isOnline":true,"presenceType":1,"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":1,"hasVerifiedBadge":false,"description":null,"created":"0001-01-01T05:52:00Z","isBanned":false,"externalAppDisplayName":null,"id":1999518862,"name":"Ipsum","displayName":"Lorem"}]} */ -export const friendsList = addApiMethod(async ( +export const friendsList = createApiMethod(async ( { userId, userSort }: { userId: Identifier, userSort?: FriendsUserSort } ): ApiMethod => ({ path: `/v1/users/${userId}/friends`, @@ -148,7 +148,7 @@ export const friendsList = addApiMethod(async ( * @exampleData 47 * @exampleRawBody {"count":47} */ -export const friendsCount = addApiMethod(async ( +export const friendsCount = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{ count: number }, number> => ({ path: `/v1/users/${userId}/friends/count`, @@ -171,7 +171,7 @@ export const friendsCount = addApiMethod(async ( * @exampleData [{"id":2820974191,"hasVerifiedBadge":false},{"id":29992184,"hasVerifiedBadge":true}] * @exampleRawBody {"PreviousCursor":null,"PageItems":[{"id":2820974191,"hasVerifiedBadge":false},{"id":29992184,"hasVerifiedBadge":true}],"NextCursor":"MTk5OTIxODE2MiYxNzYxMjQwMTYmMg==","HasMore":null} */ -export const findFriends = addApiMethod(async ( +export const findFriends = createApiMethod(async ( { userId, userSort, limit, cursor }: { userId: Identifier, userSort?: FriendsUserSort, limit?: number, cursor?: string } ): ApiMethod => ({ path: `/v1/users/${userId}/friends/find`, @@ -195,7 +195,7 @@ export const findFriends = addApiMethod(async ( * @exampleData [{"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":201,"hasVerifiedBadge":false,"description":null,"created":"0001-01-01T05:51:00.000Z","isBanned":false,"externalAppDisplayName":null,"id":5275218436,"name":"loremIpsum","displayName":"LoremIpsum"}] * @exampleRawBody {"data":[{"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":201,"hasVerifiedBadge":false,"description":null,"created":"0001-01-01T05:51:00.000Z","isBanned":false,"externalAppDisplayName":null,"id":5275218436,"name":"loremIpsum","displayName":"LoremIpsum"}]} */ -export const inactiveFriends = addApiMethod(async ( +export const inactiveFriends = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -217,7 +217,7 @@ export const inactiveFriends = addApiMethod(async ( * @exampleData [{"userPresence":{"lastLocation":"Simulator Simulator X 99 360","placeId":223715525,"rootPlaceId":221718525,"gameInstanceId":"acd149a6-d1ed-49d7-aa08-643d62cb3068","universeId":93141687,"lastOnline":"2024-05-20T14:34:40.820Z","userPresenceType":"InGame","userLocationType":"Game"},"id":2966800574,"name":"loremIpsum","displayName":"LoremIpsum"}] * @exampleRawBody {"data":[{"userPresence":{"lastLocation":"Simulator Simulator X 99 360","placeId":223715525,"rootPlaceId":221718525,"gameInstanceId":"acd149a6-d1ed-49d7-aa08-643d62cb3068","universeId":93141687,"lastOnline":"2024-05-20T14:34:40.820Z","userPresenceType":"InGame","userLocationType":"Game"},"id":2966800574,"name":"loremIpsum","displayName":"LoremIpsum"}]} */ -export const onlineFriends = addApiMethod(async ( +export const onlineFriends = createApiMethod(async ( { userId, userSort }: { userId: Identifier, userSort?: Exclude } ): ApiMethod => ({ method: "GET", @@ -251,7 +251,7 @@ export const onlineFriends = addApiMethod(async ( * @exampleData [{"id":2027974391,"hasVerifiedBadge":false},{"id":176144016,"hasVerifiedBadge":false},{"id":3116019601,"hasVerifiedBadge":false}] * @exampleRawBody {"PreviousCursor":null,"PageItems":[{"id":2027974391,"hasVerifiedBadge":false},{"id":176144016,"hasVerifiedBadge":false},{"id":3116019601,"hasVerifiedBadge":false}],"NextCursor":null,"HasMore":null} */ -export const friendsSearch = addApiMethod(async ( +export const friendsSearch = createApiMethod(async ( { userId, query, userSort, limit, cursor }: { userId: Identifier, query: string, userSort?: Exclude, limit?: number, cursor?: string } ): ApiMethod => ({ @@ -277,7 +277,7 @@ export const friendsSearch = addApiMethod(async ( * @exampleData {"2655994471":"Friends"} * @exampleRawBody {"data":[{"id":2655994471,"status":"Friends"}]} */ -export const friendsStatuses = addApiMethod(async ( +export const friendsStatuses = createApiMethod(async ( { userId, relatedUserIds }: { userId: Identifier, relatedUserIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedFriendsStatusesData> => ({ @@ -298,7 +298,7 @@ export const friendsStatuses = addApiMethod(async => ({ method: "POST", path: `/v1/user/friend-requests/decline-all`, @@ -318,7 +318,7 @@ export const authenticatedUserDeclineAllFriendRequests = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserAcceptFriendRequest = addApiMethod(async ( +export const authenticatedUserAcceptFriendRequest = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -339,7 +339,7 @@ export const authenticatedUserAcceptFriendRequest = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserDeclineFriendRequest = addApiMethod(async ( +export const authenticatedUserDeclineFriendRequest = createApiMethod(async ( { requesterUserId }: { requesterUserId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -364,7 +364,7 @@ export const authenticatedUserDeclineFriendRequest = addApiMethod(async ( * @exampleData {"success":true,"isCaptchaRequired":false} * @exampleRawBody {"success":true,"isCaptchaRequired":false} */ -export const authenticatedUserRequestFriendship = addApiMethod(async ( +export const authenticatedUserRequestFriendship = createApiMethod(async ( { userId, originSourceType }: { userId: Identifier, originSourceType?: FriendshipOriginSourceType } ): ApiMethod<{ success: boolean, isCaptchaRequired: boolean }> => ({ method: "POST", @@ -383,7 +383,7 @@ export const authenticatedUserRequestFriendship = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserUnfriend = addApiMethod(async ( +export const authenticatedUserUnfriend = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -409,7 +409,7 @@ export const authenticatedUserUnfriend = addApiMethod(async ( * @exampleData [{"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":201,"hasVerifiedBadge":true,"description":null,"created":"0001-01-01T05:51:00.000Z","isBanned":false,"externalAppDisplayName":null,"id":156,"name":"builderman","displayName":"builderman"}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"745831147_1_1e210d709f013f76846a9e2517aa7263","data":[{"isDeleted":false,"friendFrequentScore":0,"friendFrequentRank":201,"hasVerifiedBadge":true,"description":null,"created":"0001-01-01T05:51:00.000Z","isBanned":false,"externalAppDisplayName":null,"id":156,"name":"builderman","displayName":"builderman"}]} */ -export const userFollowers = addApiMethod(async ( +export const userFollowers = createApiMethod(async ( { userId, limit, sortOrder, cursor }: { userId: Identifier, limit?: 10 | 18 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -432,7 +432,7 @@ export const userFollowers = addApiMethod(async ( * @exampleData 510 * @exampleRawBody { count: 510 } */ -export const userFollowersCount = addApiMethod(async ( +export const userFollowersCount = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{ count: number }, number> => ({ path: `/v1/users/${userId}/followers/count`, @@ -456,7 +456,7 @@ export const userFollowersCount = addApiMethod(async ( * @exampleData * @exampleRawBody */ -export const userFollowings = addApiMethod(async ( +export const userFollowings = createApiMethod(async ( { userId, limit, sortOrder, cursor }: { userId: Identifier, limit: 10 | 18 | 25 | 50 | 100, sortOrder: SortOrder, cursor: string } ): ApiMethod => ({ @@ -477,7 +477,7 @@ export const userFollowings = addApiMethod(async ( * @exampleData 337 * @exampleRawBody { count: 337 } */ -export const userFollowingsCount = addApiMethod(async ( +export const userFollowingsCount = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{ count: number }, number> => ({ method: "GET", @@ -497,7 +497,7 @@ export const userFollowingsCount = addApiMethod(async ( * @exampleData {"2655994471":{"isFollowing":false,"isFollowed":false}} * @exampleRawBody {"followings":[{"isFollowing":false,"isFollowed":false,"userId":2655994471}]} */ -export const authenticatedUserFollowingsExist = addApiMethod(async ( +export const authenticatedUserFollowingsExist = createApiMethod(async ( { userIds }: { userIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedAuthenticatedUserFollowingsExistData> => ({ method: "POST", diff --git a/src/apis/classic/gamePasses/gamePasses.ts b/src/apis/classic/gamePasses/gamePasses.ts index d59e97a..b6090d0 100644 --- a/src/apis/classic/gamePasses/gamePasses.ts +++ b/src/apis/classic/gamePasses/gamePasses.ts @@ -13,7 +13,7 @@ import { readFile } from "../../../file" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicGamePasses", baseUrl: "https://apis.roblox.com/game-passes" }) +const { createApiMethod } = createApiGroup({ name: "ClassicGamePasses", baseUrl: "https://apis.roblox.com/game-passes" }) ////////////////////////////////////////////////////////////////////////////////// @@ -31,7 +31,7 @@ const addApiMethod = createApiGroup({ name: "ClassicGamePasses", baseUrl: "https * @exampleData "targetId":9260480,"productType":"Game Pass","assetId":0,"productId":979386303,"name":"Donate","description":"null","assetTypeId":0,"creator":{"id":1536374574,"name":"MightyPart Games","creatorType":"Group","creatorTargetId":5850082},"iconImageAssetId":5316458121,"created":"2020-05-01T15:05:21.543Z","updated":"2020-07-09T13:08:21.133Z","priceInRobux":15,"priceInTickets":null,"sales":6,"isNew":false,"isForSale":true,"isPublicDomain":false,"isLimited":false,"isLimitedUnique":false,"remaining":null,"minimumMembershipLevel":0} * @exampleRawBody {"TargetId":9260480,"ProductType":"Game Pass","AssetId":0,"ProductId":979386303,"Name":"Donate","Description":"null","AssetTypeId":0,"Creator":{"Id":1536374574,"Name":"MightyPart Games","CreatorType":"Group","CreatorTargetId":5850082},"IconImageAssetId":5316458121,"Created":"2020-05-01T15:05:21.543Z","Updated":"2020-07-09T13:08:21.133Z","PriceInRobux":15,"PriceInTickets":null,"Sales":6,"IsNew":false,"IsForSale":true,"IsPublicDomain":false,"IsLimited":false,"IsLimitedUnique":false,"Remaining":null,"MinimumMembershipLevel":0} */ -export const gamePassInfo = addApiMethod(async ( +export const gamePassInfo = createApiMethod(async ( { gamePassId }: { gamePassId: GamePassId } ): ApiMethod, PrettifiedGamePassInfo> => ({ method: "GET", @@ -57,7 +57,7 @@ export const gamePassInfo = addApiMethod(async ( * @exampleData [{"gamePassId":11546631,"name":"Donate Pluss","description":"nulll","isForSale":true,"iconAssetId":18759297002,"placeId":4922741943,"createdTimestamp":"2020-09-01T00:15:17.79Z","updatedTimestamp":"2024-08-02T00:43:10.541Z","priceInformation":{"defaultPriceInRobux":250,"isInActivePriceOptimizationExperiment":false,"isInActiveDiscountCampaign":false,"discountPercentage":0},"productId":1084063256}] * @exampleRawBody {"gamePasses":[{"gamePassId":11546631,"name":"Donate Pluss","description":"nulll","isForSale":true,"iconAssetId":18759297002,"placeId":4922741943,"createdTimestamp":"2020-09-01T00:15:17.79Z","updatedTimestamp":"2024-08-02T00:43:10.541Z","priceInformation":{"defaultPriceInRobux":250,"isInActivePriceOptimizationExperiment":false,"isInActiveDiscountCampaign":false,"discountPercentage":0},"productId":1084063256}],"cursor":"id_2zwAAAXRHBJkezgCwMAc"} */ -export const gamePassesForUniverse = addApiMethod(async ( +export const gamePassesForUniverse = createApiMethod(async ( { universeId, limit = 10, cursor }: { universeId: Identifier, limit?: number, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -86,7 +86,7 @@ export const gamePassesForUniverse = addApiMethod(async ( * @exampleData true * @exampleRawBody "" */ -export const updateGamePass = addApiMethod(async ( +export const updateGamePass = createApiMethod(async ( { gamePassId, name, description, icon, price, isForSale }: { gamePassId: Identifier, name?: string, description?: string, icon?: string | File, price?: number, isForSale?: boolean } ): ApiMethod<"", boolean> => ({ @@ -120,7 +120,7 @@ export const updateGamePass = addApiMethod(async ( * @exampleData 810182288 * @exampleRawBody {"gamePassId":810182288} */ -export const createGamePass = addApiMethod(async ( +export const createGamePass = createApiMethod(async ( { universeId, name, description, icon }: { universeId: Identifier, name: string, description: string, icon?: string | File } ): ApiMethod<{ gamePassId: Identifier }, Identifier> => { return ({ diff --git a/src/apis/classic/games/games.ts b/src/apis/classic/games/games.ts index b9632fb..65bdc7c 100644 --- a/src/apis/classic/games/games.ts +++ b/src/apis/classic/games/games.ts @@ -14,7 +14,7 @@ import type { FormattedAuthedUserPrivateServersForPlace, FormattedAuthedUserSpot // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicGames", baseUrl: "https://games.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicGames", baseUrl: "https://games.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -29,7 +29,7 @@ const addApiMethod = createApiGroup({ name: "ClassicGames", baseUrl: "https://ga * @exampleData {"1685831367":{"rootPlaceId":4922741943,"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","sourceName":"RoCamping","sourceDescription":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","creator":{"id":5850082,"name":"MightyPart Games","type":"Group","isRNVAccount":false,"hasVerifiedBadge":false},"price":null,"allowedGearGenres":["Adventure"],"allowedGearCategories":[],"isGenreEnforced":true,"copyingAllowed":false,"playing":0,"visits":2718,"maxPlayers":4,"created":"2020-04-20T15:36:20.927Z","updated":"2024-05-23T20:51:29.867Z","studioAccessToApisAllowed":false,"createVipServersAllowed":false,"universeAvatarType":"MorphToR15","genre":"Adventure","isAllGenre":false,"isFavoritedByUser":true,"favoritedCount":97}} * @exampleRawBody {"data":[{"id":1685831367,"rootPlaceId":4922741943,"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","sourceName":"RoCamping","sourceDescription":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","creator":{"id":5850082,"name":"MightyPart Games","type":"Group","isRNVAccount":false,"hasVerifiedBadge":false},"price":null,"allowedGearGenres":["Adventure"],"allowedGearCategories":[],"isGenreEnforced":true,"copyingAllowed":false,"playing":0,"visits":2718,"maxPlayers":4,"created":"2020-04-20T15:36:20.927Z","updated":"2024-05-23T20:51:29.867Z","studioAccessToApisAllowed":false,"createVipServersAllowed":false,"universeAvatarType":"MorphToR15","genre":"Adventure","isAllGenre":false,"isFavoritedByUser":true,"favoritedCount":97}]} */ -export const universesInfo = addApiMethod(async ( +export const universesInfo = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, FormattedGamesInfoData> => ({ method: "GET", @@ -54,7 +54,7 @@ export const universesInfo = addApiMethod(async ( * @exampleData {"1685831367":{"isForSale":false,"productId":0,"price":null,"sellerId":1536374574}} * @exampleRawBody {"data":[{"universeId":1685831367,"isForSale":false,"productId":0,"price":null,"sellerId":1536374574}]} */ -export const universesProductInfo = addApiMethod(async ( +export const universesProductInfo = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, FormattedGamesProductInfo> => ({ method: "GET", @@ -74,7 +74,7 @@ export const universesProductInfo = addApiMethod(async => ({ method: "GET", path: `/v1/games/list-spotlight`, @@ -94,7 +94,7 @@ export const authedUserSpotlightedGames = addApiMethod(async ( * @exampleData {"4922741943":{"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","sourceName":"RoCamping","sourceDescription":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0","url":"https://www.roblox.com/games/4922741943/RoCamping","builder":"MightyPart Games","builderId":5850082,"hasVerifiedBadge":false,"isPlayable":true,"reasonProhibited":"None","universeId":1685831367,"universeRootPlaceId":4922741943,"price":0,"imageToken":"T_4922741943_678b"}} * @exampleRawBody [{"placeId":4922741943,"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","sourceName":"RoCamping","sourceDescription":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0","url":"https://www.roblox.com/games/4922741943/RoCamping","builder":"MightyPart Games","builderId":5850082,"hasVerifiedBadge":false,"isPlayable":true,"reasonProhibited":"None","universeId":1685831367,"universeRootPlaceId":4922741943,"price":0,"imageToken":"T_4922741943_678b"}] */ -export const placesInfo = addApiMethod(async ( +export const placesInfo = createApiMethod(async ( { placeIds }: { placeIds: ArrayNonEmptyIfConst } ): ApiMethod, FormattedPlacesInfoData> => ({ method: "GET", @@ -116,7 +116,7 @@ export const placesInfo = addApiMethod(async ( * @exampleData {"1685831367":{"playabilityStatus":"Playable","isPlayable":true}} * @exampleRawBody [{"playabilityStatus":"Playable","isPlayable":true,"universeId":1685831367}] */ -export const authedUserGamesPlayabilityStatuses = addApiMethod(async ( +export const authedUserGamesPlayabilityStatuses = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, FormattedUserGamesPlayabilityStatusesData> => ({ method: "GET", @@ -141,7 +141,7 @@ export const authedUserGamesPlayabilityStatuses = addApiMethod(async => ({ method: "GET", @@ -170,7 +170,7 @@ export const recommendationsFromUniverse = addApiMethod(async ( * @exampleData [{"maxPlayers":10,"playerTokens":[],"players":[],"name":"TAG GANG","vipServerId":10262938,"owner":{"hasVerifiedBadge":false,"id":45348281,"name":"MightyPart","displayName":"Mighty"}}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"maxPlayers":10,"playerTokens":[],"players":[],"name":"TAG GANG","vipServerId":10262938,"owner":{"hasVerifiedBadge":false,"id":45348281,"name":"MightyPart","displayName":"Mighty"}}]} */ -export const authedUserPrivateServersForPlace = addApiMethod(async ( +export const authedUserPrivateServersForPlace = createApiMethod(async ( { placeId, limit, sortOrder, cursor }: { placeId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -197,7 +197,7 @@ export const authedUserPrivateServersForPlace = addApiMethod(async ( * @exampleData [{"id":"1cf0594e-196a-469d-a9f8-ac0c7a1a0c89","maxPlayers":10,"playing":6,"playerTokens":["7532A11338571C5B914711CECB920A9C","576940A121EC4A28EDF1A984FB4D40BA","4AC528DB8689F636EE495A31219B4156","DC41B4724EC46B0D561458B378C52A25","FB9F483ACD1B0C22A916F12F2B8C5EE5"],"players":[],"fps":59.942818,"ping":82},{"id":"3a492d51-1b28-4f5b-92f5-ea7f8eb81a05","maxPlayers":10,"playing":4,"playerTokens":["4FA1CB5B5D01574AB7E1A1AEFA683894","DE71FC497ACEA320A57B2E168AF851ED","0B9CB48166467EE29E89564A7A9CCB68","13FCCCF441B16EFF86C938D8440FB9F0"],"players":[],"fps":59.995846,"ping":216},{"id":"3333da7e-8a94-464a-b749-9162404c3f71","maxPlayers":10,"playing":3,"playerTokens":["D98666B566AD7834D20A02A7C4554E22","EB2D522809D8F87E41778ABEF349F305","97A0BA814C637D44F2A3E1A8AD190837"],"players":[],"fps":59.955658,"ping":138}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":"1cf0594e-196a-469d-a9f8-ac0c7a1a0c89","maxPlayers":10,"playing":6,"playerTokens":["7532A11338571C5B914711CECB920A9C","576940A121EC4A28EDF1A984FB4D40BA","4AC528DB8689F636EE495A31219B4156","DC41B4724EC46B0D561458B378C52A25","FB9F483ACD1B0C22A916F12F2B8C5EE5"],"players":[],"fps":59.942818,"ping":82},{"id":"3a492d51-1b28-4f5b-92f5-ea7f8eb81a05","maxPlayers":10,"playing":4,"playerTokens":["4FA1CB5B5D01574AB7E1A1AEFA683894","DE71FC497ACEA320A57B2E168AF851ED","0B9CB48166467EE29E89564A7A9CCB68","13FCCCF441B16EFF86C938D8440FB9F0"],"players":[],"fps":59.995846,"ping":216},{"id":"3333da7e-8a94-464a-b749-9162404c3f71","maxPlayers":10,"playing":3,"playerTokens":["D98666B566AD7834D20A02A7C4554E22","EB2D522809D8F87E41778ABEF349F305","97A0BA814C637D44F2A3E1A8AD190837"],"players":[],"fps":59.955658,"ping":138}]} */ -export const placeServerList = addApiMethod(async ( +export const placeServerList = createApiMethod(async ( { placeId, serverType, excludeFullGames, limit, sortOrder, cursor }: { placeId: Identifier, serverType: "Friends" | "Public", excludeFullGames?: boolean, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -222,7 +222,7 @@ export const placeServerList = addApiMethod(async ( * @exampleData true * @exampleRawBody {"isFavorited":true} */ -export const authedUserUniverseIsFavorited = addApiMethod(async ( +export const authedUserUniverseIsFavorited = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ isFavorited: boolean }, boolean> => ({ method: "GET", @@ -244,7 +244,7 @@ export const authedUserUniverseIsFavorited = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authedUserUniverseSetFavorite = addApiMethod(async ( +export const authedUserUniverseSetFavorite = createApiMethod(async ( { universeId, status }: { universeId: Identifier, status: boolean } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -266,7 +266,7 @@ export const authedUserUniverseSetFavorite = addApiMethod(async ( * @exampleData 0 * @exampleRawBody {"favoritesCount":0} */ -export const universeFavoritesCount = addApiMethod(async ( +export const universeFavoritesCount = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ favoritesCount: number }, number> => ({ method: "GET", @@ -292,7 +292,7 @@ export const universeFavoritesCount = addApiMethod(async ( * @exampleData [{"id":9063647,"name":"Campers Club","displayName":"Campers Club","productId":975542678,"price":350,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":9260419,"name":"Support Us","displayName":"Support Us","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":false},{"id":9260480,"name":"Donate","displayName":"Donate","productId":979386303,"price":15,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":9820606,"name":"Starterpack","displayName":"Starterpack","productId":995094227,"price":100,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":11546631,"name":"Donate Plusss","displayName":"Donate Plusss","productId":1084063256,"price":250,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":false},{"id":880904271,"name":"Name!!!","displayName":"Name!!!","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880843288,"name":"Name!!!1","displayName":"Name!!!1","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880933261,"name":"name!","displayName":"name!","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880882288,"name":"My Pass","displayName":"My Pass","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880670566,"name":"My Pass","displayName":"My Pass","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true}] * @exampleRawBody {"previousPageCursor":"id_2zwAAAXGZdoHHzgCKTN8","nextPageCursor":null,"data":[{"id":9063647,"name":"Campers Club","displayName":"Campers Club","productId":975542678,"price":350,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":9260419,"name":"Support Us","displayName":"Support Us","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":false},{"id":9260480,"name":"Donate","displayName":"Donate","productId":979386303,"price":15,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":9820606,"name":"Starterpack","displayName":"Starterpack","productId":995094227,"price":100,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":true},{"id":11546631,"name":"Donate Plusss","displayName":"Donate Plusss","productId":1084063256,"price":250,"sellerName":"MightyPart Games","sellerId":1536374574,"isOwned":false},{"id":880904271,"name":"Name!!!","displayName":"Name!!!","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880843288,"name":"Name!!!1","displayName":"Name!!!1","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880933261,"name":"name!","displayName":"name!","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880882288,"name":"My Pass","displayName":"My Pass","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true},{"id":880670566,"name":"My Pass","displayName":"My Pass","productId":null,"price":null,"sellerName":"MightyPart Games","sellerId":null,"isOwned":true}]} */ -export const universeGamePasses = addApiMethod(async ( +export const universeGamePasses = createApiMethod(async ( { universeId, limit = 100, sortOrder, cursor }: { universeId: Identifier, limit?: number, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -316,7 +316,7 @@ export const universeGamePasses = addApiMethod(async ( * @exampleData {"canVote":false,"userVote":true,"reasonForNotVoteable":"PlayGame"} * @exampleRawBody {"canVote":false,"userVote":true,"reasonForNotVoteable":"PlayGame"} */ -export const authedUserUniverseVoteStatus = addApiMethod(async ( +export const authedUserUniverseVoteStatus = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ canVote: boolean, userVote: boolean, reasonForNotVoteable: "PlayGame" | "" }> => ({ method: "GET", @@ -334,7 +334,7 @@ export const authedUserUniverseVoteStatus = addApiMethod(async ( * @exampleData {"1685831367":{"upVotes":78,"downVotes":14}} * @exampleRawBody "data":[{"id":1685831367,"upVotes":78,"downVotes":14}]} */ -export const universesVoteStatus = addApiMethod(async ( +export const universesVoteStatus = createApiMethod(async ( { universeIds }: { universeIds: ArrayNonEmptyIfConst } ): ApiMethod, FormattedniversesVoteStatusData> => ({ method: "GET", @@ -357,7 +357,7 @@ export const universesVoteStatus = addApiMethod(async => ({ method: "PATCH", @@ -381,7 +381,7 @@ export const authedUserSetUniverseUpvote = addApiMethod(async ( * @exampleData true * @exampleRawBody {"privateServersEnabled": true} */ -export const vipServersAllowedForUniverse = addApiMethod(async ( +export const vipServersAllowedForUniverse = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod<{ privateServersEnabled: boolean }, boolean> => ({ method: "GET", @@ -402,7 +402,7 @@ export const vipServersAllowedForUniverse = addApiMethod(async ( * @exampleData {"canInvite":false,"doesOwnerPrivacyRestrictJoins":false,"inviteResponseType":4} * @exampleRawBody {"canInvite":false,"doesOwnerPrivacyRestrictJoins":false,"inviteResponseType":4} */ -export const authedUserCanUserBeInvitedToVipServer = addApiMethod(async ( +export const authedUserCanUserBeInvitedToVipServer = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod<{ canInvite: boolean, doesOwnerPrivacyRestrictJoins: boolean, inviteResponseType: number }> => ({ method: "GET", @@ -421,7 +421,7 @@ export const authedUserCanUserBeInvitedToVipServer = addApiMethod(async ( * @exampleData {"id":1630945839,"name":"Testing","game":{"id":6430220996,"name":"Get Id","rootPlace":{"id":18980972074,"name":"Get Id"}},"joinCode":"70420354791950165689950670608627","active":true,"subscription":{"active":false,"expired":false,"expirationDate":"2024-09-17T15:49:02.8879762Z","price":null,"canRenew":false,"hasInsufficientFunds":false,"hasRecurringProfile":true,"hasPriceChanged":true},"permissions":{"clanAllowed":false,"enemyClanId":null,"friendsAllowed":false,"users":[]},"voiceSettings":{"enabled":false},"link":"https://www.roblox.com/games/18980972074?privateServerLinkCode=70420354791950165689950670608627"} * @exampleRawBody {"id":1630945839,"name":"Testing","game":{"id":6430220996,"name":"Get Id","rootPlace":{"id":18980972074,"name":"Get Id"}},"joinCode":"70420354791950165689950670608627","active":true,"subscription":{"active":false,"expired":false,"expirationDate":"2024-09-17T15:49:02.8879762Z","price":null,"canRenew":false,"hasInsufficientFunds":false,"hasRecurringProfile":true,"hasPriceChanged":true},"permissions":{"clanAllowed":false,"enemyClanId":null,"friendsAllowed":false,"users":[]},"voiceSettings":{"enabled":false},"link":"https://www.roblox.com/games/18980972074?privateServerLinkCode=70420354791950165689950670608627"} */ -export const vipServerInfo = addApiMethod(async ( +export const vipServerInfo = createApiMethod(async ( { vipServerId }: { vipServerId: VipServerId } ): ApiMethod> => ({ method: "GET", @@ -443,7 +443,7 @@ export const vipServerInfo = addApiMethod(async * @exampleData {"id":1630945839,"name":"New Name","game":{"id":6430220996,"name":"Get Id","rootPlace":{"id":18980972074,"name":"Get Id"}},"joinCode":"70420354791950165689950670608627","active":true,"subscription":{"active":false,"expired":false,"expirationDate":"2024-09-17T15:49:02.8879762Z","price":null,"canRenew":false,"hasInsufficientFunds":false,"hasRecurringProfile":true,"hasPriceChanged":true},"permissions":{"clanAllowed":false,"enemyClanId":null,"friendsAllowed":false,"users":[]},"voiceSettings":{"enabled":false},"link":"https://www.roblox.com/games/18980972074?privateServerLinkCode=70420354791950165689950670608627"} * @exampleRawBody {"id":1630945839,"name":"New Name","game":{"id":6430220996,"name":"Get Id","rootPlace":{"id":18980972074,"name":"Get Id"}},"joinCode":"70420354791950165689950670608627","active":true,"subscription":{"active":false,"expired":false,"expirationDate":"2024-09-17T15:49:02.8879762Z","price":null,"canRenew":false,"hasInsufficientFunds":false,"hasRecurringProfile":true,"hasPriceChanged":true},"permissions":{"clanAllowed":false,"enemyClanId":null,"friendsAllowed":false,"users":[]},"voiceSettings":{"enabled":false},"link":"https://www.roblox.com/games/18980972074?privateServerLinkCode=70420354791950165689950670608627"} */ -export const updateVipServer = addApiMethod(async < +export const updateVipServer = createApiMethod(async < VipServerId extends Identifier, Name extends string, Active extends boolean >( { vipServerId, name, newJoinCode, active }: @@ -467,7 +467,7 @@ export const updateVipServer = addApiMethod(async < * @exampleData { "enabled": true } * @exampleRawBody { "enabled": true } */ -export const updateVipServerVoiceSettings = addApiMethod(async ( +export const updateVipServerVoiceSettings = createApiMethod(async ( { vipServerId, enabled }: { vipServerId: Identifier, enabled: boolean } ): ApiMethod<{ enabled: Enabled }> => ({ method: "PATCH", @@ -489,7 +489,7 @@ export const updateVipServerVoiceSettings = addApiMethod(async => ({ method: "GET", @@ -514,7 +514,7 @@ export const universeMedia = addApiMethod(async ( * @exampleData [{"id":2721703342,"name":"RoCamping 2","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":7061026197,"type":"Place"},"created":"2021-07-07T18:50:52.77Z","updated":"2021-10-09T15:01:02.147Z","placeVisits":189},{"id":2148864919,"name":"Nomadic","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5967892302,"type":"Place"},"created":"2020-11-17T18:17:58.37Z","updated":"2020-11-17T18:18:01.38Z","placeVisits":0},{"id":1864457335,"name":"RoCamping but it's 100 players","description":"NOTE: This is a meme game, we don't really update this game\r\n\r\nALSO NOTE: I sure it'll be chaotic if you play in a full server.\r\n\r\nRoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5323662969,"type":"Place"},"created":"2020-07-10T14:59:42.607Z","updated":"2020-07-11T01:02:53.91Z","placeVisits":1},{"id":1840468091,"name":"RO-FACTOR","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5255036322,"type":"Place"},"created":"2020-06-29T16:57:48.19Z","updated":"2021-10-09T15:00:45.08Z","placeVisits":109},{"id":1685831367,"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":4922741943,"type":"Place"},"created":"2020-04-20T20:36:21.117Z","updated":"2022-05-27T16:36:40.1Z","placeVisits":2721},{"id":1651554338,"name":"Ninjas Unleashed: Legion","description":"No secret projects here\r\nScriptor/Game Designer - NamelessGuy2005\r\nBuilder/Animator - Flaroh\r\n","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":4857762148,"type":"Place"},"created":"2020-04-04T13:17:08.12Z","updated":"2020-04-20T15:37:55.803Z","placeVisits":16}] * @exampleRawBody {"previousPageCursor":"0_2_f7e8a87d65742375fdea66bbd6c77728","nextPageCursor":null,"data":[{"id":2721703342,"name":"RoCamping 2","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":7061026197,"type":"Place"},"created":"2021-07-07T18:50:52.77Z","updated":"2021-10-09T15:01:02.147Z","placeVisits":189},{"id":2148864919,"name":"Nomadic","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5967892302,"type":"Place"},"created":"2020-11-17T18:17:58.37Z","updated":"2020-11-17T18:18:01.38Z","placeVisits":0},{"id":1864457335,"name":"RoCamping but it's 100 players","description":"NOTE: This is a meme game, we don't really update this game\r\n\r\nALSO NOTE: I sure it'll be chaotic if you play in a full server.\r\n\r\nRoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5323662969,"type":"Place"},"created":"2020-07-10T14:59:42.607Z","updated":"2020-07-11T01:02:53.91Z","placeVisits":1},{"id":1840468091,"name":"RO-FACTOR","description":null,"creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":5255036322,"type":"Place"},"created":"2020-06-29T16:57:48.19Z","updated":"2021-10-09T15:00:45.08Z","placeVisits":109},{"id":1685831367,"name":"RoCamping","description":"RoCamping is a fun adventure game where the end-goal is to create the best camp ever. Gather resources, chop down trees, go down caves and much more! Start your journey today!\r\n\r\nNOTE: RoCamping is still in BETA so expect there to be glitches, if you find a glitch then don't hesitate to join our group and report it there.\r\n\r\nCurrent Version: BETA v3,0\r\n\r\nalvinblox","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":4922741943,"type":"Place"},"created":"2020-04-20T20:36:21.117Z","updated":"2022-05-27T16:36:40.1Z","placeVisits":2721},{"id":1651554338,"name":"Ninjas Unleashed: Legion","description":"No secret projects here\r\nScriptor/Game Designer - NamelessGuy2005\r\nBuilder/Animator - Flaroh\r\n","creator":{"id":5850082,"type":"Group"},"rootPlace":{"id":4857762148,"type":"Place"},"created":"2020-04-04T13:17:08.12Z","updated":"2020-04-20T15:37:55.803Z","placeVisits":16}]} */ -export const groupGames = addApiMethod(async ( +export const groupGames = createApiMethod(async ( { groupId , accessFilter, limit, sortOrder, cursor }: { groupId: GroupId, accessFilter?: 1 | 2 | 4, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod, FormattedGroupGamesData> => ({ @@ -540,7 +540,7 @@ export const groupGames = addApiMethod(async ( * @exampleData [{"id":6430220996,"name":"Get Id","description":"","creator":{"id":45348281,"type":"User"},"rootPlace":{"id":18980972074,"type":"Place"},"created":"2024-08-17T12:47:01.458Z","updated":"2024-08-17T12:48:42.181Z","placeVisits":0},{"id":6041794959,"name":"Octree Terrain","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":17642363611,"type":"Place"},"created":"2024-05-28T03:10:40.847Z","updated":"2024-08-14T09:24:03.800Z","placeVisits":0},{"id":5638577595,"name":"New name!","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":16349154726,"type":"Place"},"created":"2024-02-13T02:39:58.590Z","updated":"2024-07-17T23:48:51.577Z","placeVisits":7},{"id":5587129688,"name":"InventorySystem","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":16175332793,"type":"Place"},"created":"2024-01-30T14:49:01.037Z","updated":"2024-01-30T14:58:18.877Z","placeVisits":0},{"id":5529979812,"name":"ChunkLoader","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15995287896,"type":"Place"},"created":"2024-01-15T16:42:51.047Z","updated":"2024-01-16T17:27:36.540Z","placeVisits":0},{"id":5411380627,"name":"Tiny Glade Recreation","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15666536580,"type":"Place"},"created":"2023-12-17T19:16:33.380Z","updated":"2023-12-19T19:00:58.817Z","placeVisits":6},{"id":5243131845,"name":"Test Game","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15208361152,"type":"Place"},"created":"2023-10-29T16:03:43.603Z","updated":"2023-10-29T16:04:15.920Z","placeVisits":0},{"id":5097539509,"name":"DatastoreTest1","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":14790444893,"type":"Place"},"created":"2023-09-16T10:55:13.767Z","updated":"2023-09-19T09:51:54.117Z","placeVisits":0},{"id":5076006380,"name":"DynamicTerrain","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":14724555168,"type":"Place"},"created":"2023-09-09T06:54:43.173Z","updated":"2023-09-20T19:28:02.660Z","placeVisits":0},{"id":4621449053,"name":"TerrainGen15","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":13257759048,"type":"Place"},"created":"2023-04-26T12:48:16.137Z","updated":"2023-05-20T21:33:10.770Z","placeVisits":0}] * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":"10_1_7a425d1039a04d17a68f267f83ee3d41","data":[{"id":6430220996,"name":"Get Id","description":"","creator":{"id":45348281,"type":"User"},"rootPlace":{"id":18980972074,"type":"Place"},"created":"2024-08-17T12:47:01.4582503Z","updated":"2024-08-17T12:48:42.1812674Z","placeVisits":0},{"id":6041794959,"name":"Octree Terrain","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":17642363611,"type":"Place"},"created":"2024-05-28T03:10:40.847Z","updated":"2024-08-14T09:24:03.8Z","placeVisits":0},{"id":5638577595,"name":"New name!","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":16349154726,"type":"Place"},"created":"2024-02-13T02:39:58.59Z","updated":"2024-07-17T23:48:51.577Z","placeVisits":7},{"id":5587129688,"name":"InventorySystem","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":16175332793,"type":"Place"},"created":"2024-01-30T14:49:01.037Z","updated":"2024-01-30T14:58:18.877Z","placeVisits":0},{"id":5529979812,"name":"ChunkLoader","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15995287896,"type":"Place"},"created":"2024-01-15T16:42:51.047Z","updated":"2024-01-16T17:27:36.54Z","placeVisits":0},{"id":5411380627,"name":"Tiny Glade Recreation","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15666536580,"type":"Place"},"created":"2023-12-17T19:16:33.38Z","updated":"2023-12-19T19:00:58.817Z","placeVisits":6},{"id":5243131845,"name":"Test Game","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":15208361152,"type":"Place"},"created":"2023-10-29T16:03:43.603Z","updated":"2023-10-29T16:04:15.92Z","placeVisits":0},{"id":5097539509,"name":"DatastoreTest1","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":14790444893,"type":"Place"},"created":"2023-09-16T10:55:13.767Z","updated":"2023-09-19T09:51:54.117Z","placeVisits":0},{"id":5076006380,"name":"DynamicTerrain","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":14724555168,"type":"Place"},"created":"2023-09-09T06:54:43.173Z","updated":"2023-09-20T19:28:02.66Z","placeVisits":0},{"id":4621449053,"name":"TerrainGen15","description":null,"creator":{"id":45348281,"type":"User"},"rootPlace":{"id":13257759048,"type":"Place"},"created":"2023-04-26T12:48:16.137Z","updated":"2023-05-20T21:33:10.77Z","placeVisits":0}]} */ -export const userGames = addApiMethod(async ( +export const userGames = createApiMethod(async ( { userId, limit, sortOrder, cursor }: { userId: Identifier, limit?: 10 | 25 | 50, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ path: `/v2/users/${userId}/games`, diff --git a/src/apis/classic/groups/groups.ts b/src/apis/classic/groups/groups.ts index fdba279..24fdc36 100644 --- a/src/apis/classic/groups/groups.ts +++ b/src/apis/classic/groups/groups.ts @@ -15,7 +15,7 @@ import type { SortOrder } from "../../../utils/utils.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicGroups", baseUrl: "https://groups.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicGroups", baseUrl: "https://groups.roblox.com" }) ///////////////////////////////////////////////////////////////////////////////// @@ -30,7 +30,7 @@ const addApiMethod = createApiGroup({ name: "ClassicGroups", baseUrl: "https://g * @exampleData "6533473338141704368" * @exampleRawBody {"groupId":15842838,"contentType":"event","contentId":"6533473338141704368"} */ -export const featuredEvent = addApiMethod(async ( +export const featuredEvent = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod<{ groupId: GroupId, contentType: "event", contentId: Identifier }, Identifier> => ({ method: "GET", @@ -53,7 +53,7 @@ export const featuredEvent = addApiMethod(async ( * @exampleData 5904751593700196492 * @exampleRawBody {"groupId":15842838,"contentType":"event","contentId":"6533473338141704368"} */ -export const setFeaturedEvent = addApiMethod(async ( +export const setFeaturedEvent = createApiMethod(async ( { groupId, eventId }: { groupId: Identifier, eventId: EventId } ): ApiMethod<{ groupId: GroupId, contentType: "event", contentId: EventId }, EventId> => ({ method: "POST", @@ -75,7 +75,7 @@ export const setFeaturedEvent = addApiMethod(async ( +export const removeFeaturedEvent = createApiMethod(async ( { groupId, eventId }: { groupId: Identifier, eventId: EventId } ): ApiMethod<"", boolean> => ({ method: "DELETE", @@ -101,7 +101,7 @@ export const removeFeaturedEvent = addApiMethod(async ( +export const groupInfo = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod, PrettifiedGroupInfoData> => ({ method: "GET", @@ -132,7 +132,7 @@ export const groupInfo = addApiMethod(async ( * @exampleData { previousPageCursor: null, nextPageCursor: null, data: [ { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 6333562, TargetGroupName: "Mine Ways Talk Show" }, created: "2020-05-18T12:06:34Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 5257567, TargetGroupName: "The X1 Team" }, created: "2020-05-13T13:52:57Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 5894486, TargetGroupName: "Sky-Blox Studio" }, created: "2020-05-13T13:52:56Z" } ] } * @exampleRawBody [ { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 6333562, targetGroupName: "Mine Ways Talk Show" }, created: "2020-05-18T12:06:34Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 5257567, targetGroupName: "The X1 Team" }, created: "2020-05-13T13:52:57Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 5894486, targetGroupName: "Sky-Blox Studio" }, created: "2020-05-13T13:52:56Z" } ] */ -export const groupAuditLogs = addApiMethod(async ( +export const groupAuditLogs = createApiMethod(async ( { groupId, actionType, userId, limit, sortOrder, cursor }: { groupId: Identifier, actionType?: GroupAuditLogActionType, userId?: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -165,7 +165,7 @@ export const groupAuditLogs = addApiMethod(async ( * @exampleData [ { name: "Nameless Game Studio", created: 2022-01-06T00:01:47.193Z } ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: null, data: [ { name: "Nameless Game Studio", created: "2022-01-06T00:01:47.193Z" } ] } */ -export const groupNameHistory = addApiMethod(async ( +export const groupNameHistory = createApiMethod(async ( { groupId, limit, sortOrder, cursor }: { groupId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -194,7 +194,7 @@ export const groupNameHistory = addApiMethod(async ( * @exampleData { isApprovalRequired: true, isBuildersClubRequired: false, areEnemiesAllowed: true, areGroupFundsVisible: false, areGroupGamesVisible: true, isGroupNameChangeEnabled: true } * @exampleRawBody { isApprovalRequired: true, isBuildersClubRequired: false, areEnemiesAllowed: true, areGroupFundsVisible: false, areGroupGamesVisible: true, isGroupNameChangeEnabled: true } */ -export const groupSettings = addApiMethod(async ( +export const groupSettings = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod => ({ method: "GET", @@ -222,7 +222,7 @@ export const groupSettings = addApiMethod(async ( * @exampleData boolean * @exampleRawBody {} */ -export const setGroupSettings = addApiMethod(async ( +export const setGroupSettings = createApiMethod(async ( { groupId, newSettings }: { groupId: Identifier, newSettings: GroupSettingsData } ): ApiMethod => ({ method: "PATCH", @@ -243,7 +243,7 @@ export const setGroupSettings = addApiMethod(async ( * @exampleData { groupConfiguration: { nameMaxLength: 50, descriptionMaxLength: 1000, iconMaxFileSizeMb: 20, cost: 100, isUsingTwoStepWebviewComponent: true }, recurringPayoutsConfiguration: { maxPayoutPartners: 20 }, roleConfiguration: { nameMaxLength: 100, descriptionMaxLength: 1000, limit: 40, cost: 25, minRank: 0, maxRank: 255 }, groupNameChangeConfiguration: { cost: 100, cooldownInDays: 90, ownershipCooldownInDays: 90 }, isPremiumPayoutsEnabled: true, isDefaultEmblemPolicyEnabled: true } * @exampleRawBody { groupConfiguration: { nameMaxLength: 50, descriptionMaxLength: 1000, iconMaxFileSizeMb: 20, cost: 100, isUsingTwoStepWebviewComponent: true }, recurringPayoutsConfiguration: { maxPayoutPartners: 20 }, roleConfiguration: { nameMaxLength: 100, descriptionMaxLength: 1000, limit: 40, cost: 25, minRank: 0, maxRank: 255 }, groupNameChangeConfiguration: { cost: 100, cooldownInDays: 90, ownershipCooldownInDays: 90 }, isPremiumPayoutsEnabled: true, isDefaultEmblemPolicyEnabled: true } */ -export const groupsConfigMetadata = addApiMethod(async ( +export const groupsConfigMetadata = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/groups/configuration/metadata`, @@ -262,7 +262,7 @@ export const groupsConfigMetadata = addApiMethod(async ( * @exampleRawBody { groupLimit: 100, currentGroupCount: 57, groupStatusMaxLength: 255, groupPostMaxLength: 500, isGroupWallNotificationsEnabled: false, groupWallNotificationsSubscribeIntervalInMilliseconds: 60000, areProfileGroupsHidden: false, isGroupDetailsPolicyEnabled: true, showPreviousGroupNames: true } */ -export const groupsMetadata = addApiMethod(async ( +export const groupsMetadata = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/groups/metadata`, @@ -282,7 +282,7 @@ export const groupsMetadata = addApiMethod(async ( * @exampleData { "5850082": { canViewGroup: true } } * @exampleRawBody { groups: [ { canViewGroup: true, groupId: 5850082 } ] } */ -export const groupsPolicyInfo = addApiMethod(async ( +export const groupsPolicyInfo = createApiMethod(async ( { groupIds }: { groupIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedGroupPolicyInfoData> => ({ method: "POST", @@ -307,7 +307,7 @@ export const groupsPolicyInfo = addApiMethod(async ( * @exampleData "Hello World!" * @exampleRawBody { newDescription: "Hello World!" } */ -export const setGroupDescription = addApiMethod(async ( +export const setGroupDescription = createApiMethod(async ( { groupId, newDescription }: { groupId: Identifier, newDescription: NewDescription } ): ApiMethod<{ newDescription: NewDescription }, NewDescription> => ({ method: "PATCH", @@ -332,7 +332,7 @@ export const setGroupDescription = addApiMethod(async ( +export const setGroupShout = createApiMethod(async ( { groupId, newShout }: { groupId: Identifier, newShout: NewShout } ): ApiMethod, PrettifiedGroupShoutData> => ({ method: "PATCH", @@ -360,7 +360,7 @@ export const setGroupShout = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const setGroupIcon = addApiMethod(async ( +export const setGroupIcon = createApiMethod(async ( { groupId, newIcon }: { groupId: Identifier, newIcon: string | File } ): ApiMethod<{}, boolean> => ({ method: "PATCH", @@ -389,7 +389,7 @@ export const setGroupIcon = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const batchDeclineGroupJoinRequests = addApiMethod(async ( +export const batchDeclineGroupJoinRequests = createApiMethod(async ( { groupId, userIds }: { groupId: Identifier, userIds: ArrayNonEmptyIfConst } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -416,7 +416,7 @@ export const batchDeclineGroupJoinRequests = addApiMethod(async ( * @exampleData [ { requester: { hasVerifiedBadge: false, userId: 2655994471, username: "MightyPartJr", displayName: "MightyPartJr" }, created: 2023-09-12T09:35:49.287Z } ] * @exampleRawBody [ { requester: { hasVerifiedBadge: false, userId: 2655994471, username: "MightyPartJr", displayName: "MightyPartJr" }, created: "2023-09-12T09:35:49.287Z" } ] */ -export const groupJoinRequests = addApiMethod(async ( +export const groupJoinRequests = createApiMethod(async ( { groupId, limit, sortOrder, cursor }: { groupId: Identifier, limit?: 10|25|50|100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -440,7 +440,7 @@ export const groupJoinRequests = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const batchAcceptGroupJoinRequests = addApiMethod(async ( +export const batchAcceptGroupJoinRequests = createApiMethod(async ( { groupId, userIds }: { groupId: Identifier, userIds: ArrayNonEmptyIfConst } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -465,7 +465,7 @@ export const batchAcceptGroupJoinRequests = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const declineGroupJoinRequest = addApiMethod(async ( +export const declineGroupJoinRequest = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -489,7 +489,7 @@ export const declineGroupJoinRequest = addApiMethod(async ( * @exampleData { requester: { hasVerifiedBadge: false, userId: 2655994471, username: "MightyPartJr", displayName: "MightyPartJr" }, created: 2023-09-12T11:31:18.933Z } * @exampleRawBody { requester: { hasVerifiedBadge: false, userId: 2655994471, username: "MightyPartJr", displayName: "MightyPartJr" }, created: "2023-09-12T11:31:18.933Z" } */ -export const groupJoinRequestInfo = addApiMethod(async ( +export const groupJoinRequestInfo = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: UserId } ): ApiMethod, PrettifiedGroupJoinRequestForUser> => ({ method: "GET", @@ -515,7 +515,7 @@ export const groupJoinRequestInfo = addApiMethod(async => ({ method: "POST", @@ -537,7 +537,7 @@ export const acceptGroupJoinRequest = addApiMethod(async ( * @exampleData { groupId: 5850082, isPrimary: false, isPendingJoin: false, userRole: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, permissions: { groupPostsPermissions: { viewWall: true, postToWall: true, deleteFromWall: true, viewStatus: true, postToStatus: true }, groupMembershipPermissions: { changeRank: true, inviteMembers: true, removeMembers: true }, groupManagementPermissions: { manageRelationships: true, manageClan: true, viewAuditLogs: true }, groupEconomyPermissions: { spendGroupFunds: true, advertiseGroup: true, createItems: true, manageItems: true, addGroupPlaces: true, manageGroupGames: true, viewGroupPayouts: true, viewAnalytics: true }, groupOpenCloudPermissions: { useCloudAuthentication: true, administerCloudAuthentication: true } }, areGroupGamesVisible: true, areGroupFundsVisible: false, areEnemiesAllowed: true, canConfigure: true } * @exampleRawBody { groupId: 5850082, isPrimary: false, isPendingJoin: false, userRole: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, permissions: { groupPostsPermissions: { viewWall: true, postToWall: true, deleteFromWall: true, viewStatus: true, postToStatus: true }, groupMembershipPermissions: { changeRank: true, inviteMembers: true, removeMembers: true }, groupManagementPermissions: { manageRelationships: true, manageClan: true, viewAuditLogs: true }, groupEconomyPermissions: { spendGroupFunds: true, advertiseGroup: true, createItems: true, manageItems: true, addGroupPlaces: true, manageGroupGames: true, viewGroupPayouts: true, viewAnalytics: true }, groupOpenCloudPermissions: { useCloudAuthentication: true, administerCloudAuthentication: true } }, areGroupGamesVisible: true, areGroupFundsVisible: false, areEnemiesAllowed: true, canConfigure: true } */ -export const authenticatedUserGroupMembershipInfo = addApiMethod(async ( +export const authenticatedUserGroupMembershipInfo = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod> => ({ method: "GET", @@ -556,7 +556,7 @@ export const authenticatedUserGroupMembershipInfo = addApiMethod(async ( +export const groupRoles = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod, PrettifiedAllRolesForGroupData> => ({ method: "GET", @@ -582,7 +582,7 @@ export const groupRoles = addApiMethod(async ( * @exampleData [ { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" } ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: null, data: [ { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" } ] } */ -export const groupMembersWithRole = addApiMethod(async ( +export const groupMembersWithRole = createApiMethod(async ( { groupId, roleSetId, limit, sortOrder, cursor }: { groupId: Identifier, roleSetId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -609,7 +609,7 @@ export const groupMembersWithRole = addApiMethod(async ( * @exampleData [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } } ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: "3023291639_1_8ba111cfa4097b6dd27d851a15353a1f", data: [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } } ] } */ -export const groupMembers = addApiMethod(async ( +export const groupMembers = createApiMethod(async ( { groupId, limit, sortOrder, cursor }: { groupId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -632,7 +632,7 @@ export const groupMembers = addApiMethod(async ( * @exampleData [ { id: 5850082, name: "lorem ipsum", description: "", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: false, hasVerifiedBadge: false } ] * @exampleRawBody { data: [ { id: 5850082, name: "lorem ipsum", description: "", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: false, hasVerifiedBadge: false } ] } */ -export const authenticatedUserPendingGroups = addApiMethod(async ( +export const authenticatedUserPendingGroups = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/user/groups/pending`, @@ -658,7 +658,7 @@ export const authenticatedUserPendingGroups = addApiMethod(async ( * @exampleData [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, groups: [ { group: { id: 5850082, name: "Lorem ipsum", description: "Lorem ipsum dolor sit amet.", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 45348281, name: "MightyPart", rank: 1 } } ] } ] * @exampleRawBody { data: [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, groups: [ { group: { id: 5850082, name: "Lorem ipsum", description: "Lorem ipsum dolor sit amet.", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 45348281, name: "MightyPart", rank: 1 } } ] } ] } */ -export const groupsThatUsersFriendsAreIn = addApiMethod(async ( +export const groupsThatUsersFriendsAreIn = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -687,7 +687,7 @@ export const groupsThatUsersFriendsAreIn = addApiMethod(async ( * @exampleData [ { group: { id: 5855434, name: "MightyPart Games", description: "Lorem ipsum dolor sit amet...", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: 'MightyPart' }, shout: null, memberCount: 102, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 5855434, name: "MightyPart", rank: 1 } } ] * @exampleRawBody { data: [ { group: { id: 5855434, name: "MightyPart Games", description: "Lorem ipsum dolor sit amet...", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: 'MightyPart' }, shout: null, memberCount: 102, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 5855434, name: "MightyPart", rank: 1 } } ] } */ -export const allGroupRolesForUser_V1 = addApiMethod(async ( +export const allGroupRolesForUser_V1 = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -715,7 +715,7 @@ export const allGroupRolesForUser_V1 = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const removeGroupMember = addApiMethod(async ( +export const removeGroupMember = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -740,7 +740,7 @@ export const removeGroupMember = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const updateGroupMemberRole = addApiMethod(async ( +export const updateGroupMemberRole = createApiMethod(async ( { groupId, userId, roleId }: { groupId: Identifier, userId: Identifier, roleId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "PATCH", @@ -766,7 +766,7 @@ export const updateGroupMemberRole = addApiMethod(async ( * @exampleData { canUseRecurringPayout: true, canUseOneTimePayout: true } * @exampleRawBody { canUseRecurringPayout: true, canUseOneTimePayout: true } */ -export const groupPayoutRestrictionsInfo = addApiMethod(async ( +export const groupPayoutRestrictionsInfo = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod => ({ method: "GET", @@ -787,7 +787,7 @@ export const groupPayoutRestrictionsInfo = addApiMethod(async ( * @exampleData [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, percentage: 50 } ] * @exampleRawBody { data: [ { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, percentage: 50 } ] } */ -export const groupPayoutsInfo = addApiMethod(async ( +export const groupPayoutsInfo = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod => ({ method: "GET", @@ -815,7 +815,7 @@ export const groupPayoutsInfo = addApiMethod(async ( * @exampleData { groupId: 5850082, relationshipType: "Allies", totalGroupCount: 2, relatedGroups: [ { id: 50, name: "Lorem Ipsum", description: "Hello World", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, memberCount: 38, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false } ] } * @exampleRawBody { groupId: 5850082, relationshipType: "Allies", totalGroupCount: 2, relatedGroups: [ { id: 50, name: "Lorem Ipsum", description: "Hello World", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, memberCount: 38, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false } ], nextRowIndex: 1 } */ -export const groupRelationships = addApiMethod(async ( +export const groupRelationships = createApiMethod(async ( { groupId, groupRelationshipType, maxRows = 10, startRowIndex = 0 }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, maxRows?: number, startRowIndex?: number } ): ApiMethod, PrettifiedGroupRelationshipsData> => ({ @@ -853,7 +853,7 @@ export const groupRelationships = addApiMethod(async => ({ @@ -884,7 +884,7 @@ export const batchDeclineGroupRelationshipRequests = addApiMethod(async ( * @exampleData { groupId: 5850082, relationshipType: "Allies", totalGroupCount: 2, relatedGroups: [ { id: 50, name: "Lorem Ipsum", description: "Hello World", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, memberCount: 38, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false } ] } * @exampleRawBody { groupId: 5850082, relationshipType: "Allies", totalGroupCount: 2, relatedGroups: [ { id: 50, name: "Lorem Ipsum", description: "Hello World", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, memberCount: 38, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false } ], nextRowIndex: 1 } */ -export const groupRelationshipRequests = addApiMethod(async ( +export const groupRelationshipRequests = createApiMethod(async ( { groupId, groupRelationshipType, maxRows = 10, startRowIndex = 0 }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, maxRows?: number, startRowIndex?: number } ): ApiMethod, PrettifiedGroupRelationshipsData> => ({ @@ -922,7 +922,7 @@ export const groupRelationshipRequests = addApiMethod(async => ({ @@ -949,7 +949,7 @@ export const batchAcceptGroupRelationshipRequests = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const removeGroupRelationship = addApiMethod(async ( +export const removeGroupRelationship = createApiMethod(async ( { groupId, groupRelationshipType, relatedGroupId }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, relatedGroupId: Identifier } ): ApiMethod<{}, boolean> => ({ @@ -975,7 +975,7 @@ export const removeGroupRelationship = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const requestGroupRelationship = addApiMethod(async ( +export const requestGroupRelationship = createApiMethod(async ( { groupId, groupRelationshipType, relatedGroupId }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, relatedGroupId: Identifier } ): ApiMethod<{}, boolean> => ({ @@ -1001,7 +1001,7 @@ export const requestGroupRelationship = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const declineGroupRelationshipRequest = addApiMethod(async ( +export const declineGroupRelationshipRequest = createApiMethod(async ( { groupId, groupRelationshipType, relatedGroupId }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, relatedGroupId: Identifier } ): ApiMethod<{}, boolean> => ({ @@ -1027,7 +1027,7 @@ export const declineGroupRelationshipRequest = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const acceptGroupRelationshipRequest = addApiMethod(async ( +export const acceptGroupRelationshipRequest = createApiMethod(async ( { groupId, groupRelationshipType, relatedGroupId }: { groupId: Identifier, groupRelationshipType: GroupRelationshipType, relatedGroupId: Identifier } ): ApiMethod<{}, boolean> => ({ @@ -1054,7 +1054,7 @@ export const acceptGroupRelationshipRequest = addApiMethod(async ( * @exampleData { groupId: 5850082, role: { id: 38353814, name: "Guest", description: "A non-group member.", rank: 0 }, permissions: { groupPostsPermissions: { viewWall: true, postToWall: false, deleteFromWall: false, viewStatus: false, postToStatus: false }, groupMembershipPermissions: { changeRank: false, inviteMembers: false, removeMembers: false }, groupManagementPermissions: { manageRelationships: false, manageClan: false, viewAuditLogs: false }, groupEconomyPermissions: { spendGroupFunds: false, advertiseGroup: false, createItems: false, manageItems: false, addGroupPlaces: false, manageGroupGames: false, viewGroupPayouts: false, viewAnalytics: false }, groupOpenCloudPermissions: { useCloudAuthentication: false, administerCloudAuthentication: false } } } * @exampleRawBody { groupId: 5850082, role: { id: 38353814, name: "Guest", description: "A non-group member.", rank: 0 }, permissions: { groupPostsPermissions: { viewWall: true, postToWall: false, deleteFromWall: false, viewStatus: false, postToStatus: false }, groupMembershipPermissions: { changeRank: false, inviteMembers: false, removeMembers: false }, groupManagementPermissions: { manageRelationships: false, manageClan: false, viewAuditLogs: false }, groupEconomyPermissions: { spendGroupFunds: false, advertiseGroup: false, createItems: false, manageItems: false, addGroupPlaces: false, manageGroupGames: false, viewGroupPayouts: false, viewAnalytics: false }, groupOpenCloudPermissions: { useCloudAuthentication: false, administerCloudAuthentication: false } } } */ -export const groupPermissionsForRole = addApiMethod(async ( +export const groupPermissionsForRole = createApiMethod(async ( { groupId, roleSetId }: { groupId: GroupId, roleSetId: RoleSetId } ): ApiMethod> => ({ method: "GET", @@ -1080,7 +1080,7 @@ export const groupPermissionsForRole = addApiMethod(async ( +export const setGroupRolePermissions = createApiMethod(async ( { groupId, roleSetId, permissions }: { groupId: GroupId, roleSetId: RoleSetId, permissions: GroupRolePermissions } ): ApiMethod<{}, boolean> => ({ @@ -1105,7 +1105,7 @@ export const setGroupRolePermissions = addApiMethod(async ( +export const groupGuestRolePermissions = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod> => ({ method: "GET", @@ -1126,7 +1126,7 @@ export const groupGuestRolePermissions = addApiMethod(async ( +export const groupPermissionsForAllRoles = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod, PrettifiedGroupPermissionsForAllRoles> => ({ method: "GET", @@ -1151,7 +1151,7 @@ export const groupPermissionsForAllRoles = addApiMethod(async => ({ method: "GET", @@ -1180,7 +1180,7 @@ export const groupSocialLinks = addApiMethod(async ( * @exampleData { id: 10791942, type: "Twitch", url: "https://twitch.tv/fooBar", title: "Follow My Twitch" } * @exampleRawBody { id: 10791942, type: "Twitch", url: "https://twitch.tv/fooBar", title: "Follow My Twitch" } */ -export const addGroupSocialLink = addApiMethod(async ( +export const addGroupSocialLink = createApiMethod(async ( { groupId, newSocial }: { groupId: Identifier, newSocial: NewSocial } ): ApiMethod> => ({ method: "POST", @@ -1203,7 +1203,7 @@ export const addGroupSocialLink = addApiMethod(async => ({ method: "DELETE", @@ -1232,7 +1232,7 @@ export const removeGroupSocialLink = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const updateGroupSocialLink = addApiMethod(async ( +export const updateGroupSocialLink = createApiMethod(async ( { groupId, socialLinkId, newSocial }: { groupId: Identifier, socialLinkId: SocialLinkId, newSocial: NewSocial } ): ApiMethod> => ({ method: "PATCH", @@ -1259,7 +1259,7 @@ export const updateGroupSocialLink = addApiMethod(async ( +export const groupWallPosts_V1 = createApiMethod(async ( { groupId, limit, sortOrder, cursor }: { groupId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -1287,7 +1287,7 @@ export const groupWallPosts_V1 = addApiMethod(async => ({ method: "POST", @@ -1309,7 +1309,7 @@ export const authenticatedUserSubscribeToGroupWallNotificationEvents = addApiMet * @exampleData true * @exampleRawBody {} */ -export const removeGroupWallPost = addApiMethod(async ( +export const removeGroupWallPost = createApiMethod(async ( { groupId, wallPostId }: { groupId: Identifier, wallPostId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -1333,7 +1333,7 @@ export const removeGroupWallPost = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const removeAllGroupWallPostsMadeByUser = addApiMethod(async ( +export const removeAllGroupWallPostsMadeByUser = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "DELETE", @@ -1360,7 +1360,7 @@ export const removeAllGroupWallPostsMadeByUser = addApiMethod(async ( * @exampleData [ { id: 5850082, name: 'MightyPart Games', description: 'Welcome to my amazing group', memberCount: 102, previousName: 'Nameless Game Studio', publicEntryAllowed: true, created: '2020-03-29T18:15:20.1Z', updated: '2023-09-14T06:34:36.243Z', hasVerifiedBadge: false } ] * @exampleRawBody { keyword: 'MightyPart Games', previousPageCursor: null, nextPageCursor: 'eyJzdGFydEluZGV4IjoxMCwiZGlzY3JpbWluYXRvciI6ImtleXdvcmQ6TWlnaHR5UGFydCBHYW1lcyIsImNvdW50IjoxMH0KOTIwMGU5MzQwMTBlM2IzOTBlNmU3M2E3MzJkNzhhYzRkZjU1ZGM2ZGEwNWUwMDRjMmM1ZmRmZDlhMzk3YjRhNA==', data: [ { id: 5850082, name: 'MightyPart Games', description: 'Welcome to my amazing group', memberCount: 102, previousName: 'Nameless Game Studio', publicEntryAllowed: true, created: '2020-03-29T18:15:20.1Z', updated: '2023-09-14T06:34:36.243Z', hasVerifiedBadge: false } ] } */ -export const groupSearch = addApiMethod(async ( +export const groupSearch = createApiMethod(async ( { keyword, prioritizeExactMatch, limit, cursor }: { keyword: string, prioritizeExactMatch?: boolean, limit?: 10 | 25 | 50 | 100, cursor?: string } ): ApiMethod => ({ @@ -1387,7 +1387,7 @@ export const groupSearch = addApiMethod(async ( * @exampleData [ { id: 5850082, name: 'MightyPart Games', memberCount: 102, hasVerifiedBadge: false } ] * @exampleRawBody { data: [ { id: 5850082, name: 'MightyPart Games', memberCount: 102, hasVerifiedBadge: false } ] } */ -export const groupLookupSearch = addApiMethod(async ( +export const groupLookupSearch = createApiMethod(async ( { groupName }: { groupName: string } ): ApiMethod => ({ method: "GET", @@ -1408,7 +1408,7 @@ export const groupLookupSearch = addApiMethod(async ( * @exampleData { suggestedGroupKeywords: [ 'Experience Studios', 'Building', 'Roleplaying', 'Fan' ], showFriendsGroupsSort: true } * @exampleRawBody { SuggestedGroupKeywords: [ 'Experience Studios', 'Building', 'Roleplaying', 'Fan' ], ShowFriendsGroupsSort: true } */ -export const groupSearchMetadata = addApiMethod(async ( +export const groupSearchMetadata = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/groups/search/metadata`, @@ -1431,7 +1431,7 @@ export const groupSearchMetadata = addApiMethod(async ( * @exampleData { '38353811': { groupId: 5850082, name: 'NamelessGuy2005 - Scriptor', rank: 255 } } * @exampleRawBody { data: [ { groupId: 5850082, id: 38353811, name: 'NamelessGuy2005 - Scriptor', rank: 255 } ] } */ -export const groupRolesFromIds = addApiMethod(async ( +export const groupRolesFromIds = createApiMethod(async ( { roleIds }: { roleIds: ArrayNonEmptyIfConst } ): ApiMethod, PrettifiedGroupRolesFromIdsData> => ({ method: "GET", @@ -1456,7 +1456,7 @@ export const groupRolesFromIds = addApiMethod(async ( * @exampleData { group: { id: 5850082, name: "MightyPart Games", description: "Welcome to my amazing group", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } } * @exampleRawBody { group: { id: 5850082, name: "MightyPart Games", description: "Welcome to my amazing group", owner: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, shout: null, isBuildersClubOnly: false, publicEntryAllowed: true, hasVerifiedBadge: false }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } } */ -export const primaryGroupForUser = addApiMethod(async ( +export const primaryGroupForUser = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -1480,7 +1480,7 @@ export const primaryGroupForUser = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserRemovePrimaryGroup = addApiMethod(async ( +export const authenticatedUserRemovePrimaryGroup = createApiMethod(async ( ): ApiMethod<{}, boolean> => ({ method: "DELETE", path: `/v1/user/groups/primary`, @@ -1501,7 +1501,7 @@ export const authenticatedUserRemovePrimaryGroup = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserSetPrimaryGroup = addApiMethod(async ( +export const authenticatedUserSetPrimaryGroup = createApiMethod(async ( { groupId }: { groupId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -1533,7 +1533,7 @@ export const authenticatedUserSetPrimaryGroup = addApiMethod(async ( * @exampleData { id: 38353813, name: "Mighty Member", description: "A regular group member.", rank: 2, memberCount: 94 } * @exampleRawBody { id: 38353813, name: "Mighty Member", description: "A regular group member.", rank: 2, memberCount: 94 } */ -export const updateGroupRoleSet = addApiMethod(async ( +export const updateGroupRoleSet = createApiMethod(async ( { groupId, roleSetId, newData }: { groupId: Identifier, roleSetId: Identifier, newData: NewRoleData } ): ApiMethod> => ({ method: "PATCH", @@ -1556,7 +1556,7 @@ export const updateGroupRoleSet = addApiMethod(async ( +export const groupsInfo = createApiMethod(async ( { groupIds }: { groupIds: GroupId[] } ): ApiMethod, PrettifiedGroupIdsToGroupsInfoData> => ({ method: "GET", @@ -1580,7 +1580,7 @@ export const groupsInfo = addApiMethod(async ( * @exampleData [ { group: { id: 5850082, name: "MightyPart Games", memberCount: 108, hasVerifiedBadge: false }, role: { id: 5850082, name: "Mighty Member", rank: 100 } } ] * @exampleRawBody { data: [ { group: { id: 5850082, name: "MightyPart Games", memberCount: 108, hasVerifiedBadge: false }, role: { id: 5850082, name: "Mighty Member", rank: 100 } } ] } */ -export const allGroupRolesForUser_v2 = addApiMethod(async ( +export const allGroupRolesForUser_v2 = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -1608,7 +1608,7 @@ export const allGroupRolesForUser_v2 = addApiMethod(async ( * @exampleData [ { id: 2724986278, poster: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353813, name: "Mighty Member", rank: 1 } }, body: "Lorem ipsum dolor sit amet.", created: 2022-11-19T16:30:38.197Z, updated: 2022-11-19T16:30:38.197Z } ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: "2549745135_1_00ad0f026ca1d251093fc548c366b7ea", data: [ { id: 2724986278, poster: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353813, name: "Mighty Member", rank: 1 } }, body: "Lorem ipsum dolor sit amet.", created: 2022-11-19T16:30:38.197Z, updated: 2022-11-19T16:30:38.197Z } ] } */ -export const groupWallPosts_V2 = addApiMethod(async ( +export const groupWallPosts_V2 = createApiMethod(async ( { groupId, limit, sortOrder, cursor }: { groupId: Identifier, limit?: 10 | 25 | 50 | 100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ method: "GET", diff --git a/src/apis/classic/organizations/organizations.ts b/src/apis/classic/organizations/organizations.ts index edbb20a..707625e 100644 --- a/src/apis/classic/organizations/organizations.ts +++ b/src/apis/classic/organizations/organizations.ts @@ -13,7 +13,7 @@ import type { OrgInfoForGroupData, OrgMemberPermissionsData, OrgRoleColor, Overw // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicOrganizations", baseUrl: "https://apis.roblox.com/orgs" }) +const { createApiMethod } = createApiGroup({ name: "ClassicOrganizations", baseUrl: "https://apis.roblox.com/orgs" }) const permissionsCategory = { manageMembers: "Organization", @@ -36,7 +36,7 @@ const permissionsCategory = { * @exampleData { id: "4244556007738484576", groupId: "15842838" } * @exampleRawBody { id: "4244556007738484576", groupId: "15842838" } */ -export const orgInfoForGroup = addApiMethod(async ( +export const orgInfoForGroup = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod> => ({ method: "GET", @@ -58,7 +58,7 @@ export const orgInfoForGroup = addApiMethod(async ( * @exampleData [{"id":"2011766837304130930","organizationId":"4244556007738484576","name":"New Role 7275","color":"Green","updatedTime":"2024-05-31T02:34:51.832Z"},{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.823Z"},{"id":"3456593169348895666","organizationId":"4244556007738484576","name":"Tester","color":"Teal","updatedTime":"2024-05-31T01:24:02.827Z"}] * @exampleRawBody {"roles":[{"id":"2011766837304130930","organizationId":"4244556007738484576","name":"New Role 7275","color":"Green","updatedTime":"2024-05-31T02:34:51.8329242Z"},{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.8238408Z"},{"id":"3456593169348895666","organizationId":"4244556007738484576","name":"Tester","color":"Teal","updatedTime":"2024-05-31T01:24:02.8271342Z"}],"pageToken":""} */ -export const orgRoles = addApiMethod(async ( +export const orgRoles = createApiMethod(async ( { orgId, limit = 10, cursor }: { orgId: OrgId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedOrgRolesData> => ({ method: "GET", @@ -88,7 +88,7 @@ export const orgRoles = addApiMethod(async ( * @exampleData [{"category":"Organization","operation":"ManageMembers","enabled":false},{"category":"Organization","operation":"ManageRoles","enabled":false},{"category":"Organization","operation":"Configure","enabled":false},{"category":"Experience","operation":"Play","enabled":false},{"category":"Experience","operation":"Edit","enabled":false},{"category":"Experience","operation":"ViewAnalytics","enabled":false}] * @exampleRawBody {"permissions":[{"category":"Organization","operation":"ManageMembers","enabled":false},{"category":"Organization","operation":"ManageRoles","enabled":false},{"category":"Organization","operation":"Configure","enabled":false},{"category":"Experience","operation":"Play","enabled":false},{"category":"Experience","operation":"Edit","enabled":false},{"category":"Experience","operation":"ViewAnalytics","enabled":false}]} */ -export const orgRolePermissions = addApiMethod(async ( +export const orgRolePermissions = createApiMethod(async ( { orgId, roleId }: { orgId: Identifier, roleId: Identifier } ): ApiMethod => ({ method: "GET", @@ -112,7 +112,7 @@ export const orgRolePermissions = addApiMethod(async ( * @exampleData {"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime": 2024-05-31T01:24:02.823Z} * @exampleRawBody {"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.823Z"} */ -export const orgRoleMetadata = addApiMethod(async ( +export const orgRoleMetadata = createApiMethod(async ( { orgId, roleId }: { orgId: OrgId, roleId: RoleId } ): ApiMethod, PrettifiedOrgRoleMetadataData> => ({ method: "GET", @@ -145,7 +145,7 @@ export const orgRoleMetadata = addApiMethod(async => ({ method: "PATCH", @@ -178,7 +178,7 @@ export const overwriteOrgRolePermissions = addApiMethod(async ( * @exampleData [{"userId":"45348281","roles":[{"id":"4500991930780611394","organizationId":"4244556007738484576","name":"Orange","color":"Orange","updatedTime":2024-05-31T03:13:24.753Z}]}] * @exampleRawBody {"users":[{"userId":"45348281","roles":[{"id":"4500991930780611394","organizationId":"4244556007738484576","name":"Orange","color":"Orange","updatedTime":"2024-05-31T03:13:24.7539993Z"}]}],"pageToken":""} */ -export const orgRoleMembers = addApiMethod(async ( +export const orgRoleMembers = createApiMethod(async ( { orgId, roleId, limit = 10, cursor }: { orgId: Identifier, roleId: Identifier, limit?: number, cursor?: string } ): ApiMethod, PrettifiedOrgMembersData> => ({ method: "GET", @@ -211,7 +211,7 @@ export const orgRoleMembers = addApiMethod(async ( * @exampleData [{"userId":"45348281","roles":[{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.823Z"}]}] * @exampleRawBody {"users":[{"userId":"45348281","roles":[{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.8238408Z"}]}],"pageToken":""} */ -export const orgMembers = addApiMethod(async ( +export const orgMembers = createApiMethod(async ( { orgId, limit = 10, cursor }: { orgId: OrgId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedOrgMembersData> => ({ method: "GET", @@ -244,7 +244,7 @@ export const orgMembers = addApiMethod(async ( * @exampleData [{"id":"7659171709868310756","organizationId":"4244556007738484576","recipientUserId":"2655994471","senderUserId":"45348281","invitationStatusType":"Open","updatedTime":"2024-05-31T04:30:08.713Z"}] * @exampleRawBody {"invitations":[{"id":"7659171709868310756","organizationId":"4244556007738484576","recipientUserId":"2655994471","senderUserId":"45348281","invitationStatusType":"Open","updatedTime":"2024-05-31T04:30:08.713Z"}],"pageToken":""} */ -export const orgInvitations = addApiMethod(async ( +export const orgInvitations = createApiMethod(async ( { orgId, limit = 500, cursor }: { orgId: OrgId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedOrgInvitations> => ({ method: "GET", @@ -274,7 +274,7 @@ export const orgInvitations = addApiMethod(async ( * @exampleData [{"userId":"45348281","roles":[{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.823Z"}]}] * @exampleRawBody {"users":[{"userId":"45348281","roles":[{"id":"914257001913009232","organizationId":"4244556007738484576","name":"Developer","color":"LightOrange","updatedTime":"2024-05-31T01:24:02.8238408Z"}]}],"pageToken":""} */ -export const createOrgInvitation = addApiMethod(async ( +export const createOrgInvitation = createApiMethod(async ( { orgId, userId }: { orgId: OrgId, userId: UserId } ): ApiMethod, PrettifiedCreateOrgInvitationData> => ({ method: "POST", @@ -299,7 +299,7 @@ export const createOrgInvitation = addApiMethod(async => ({ method: "DELETE", @@ -321,7 +321,7 @@ export const removeOrgInvitation = addApiMethod(async ( * @exampleData {"isOwner":true,"canConfigureOrganization":true,"canManageRoles":true,"canManageMembers":true,"canViewAnalytics":true,"canPlayExperiences":true,"canEditExperiences":true} * @exampleRawBody {"isOwner":true,"canConfigureOrganization":true,"canManageRoles":true,"canManageMembers":true,"canViewAnalytics":true,"canPlayExperiences":true,"canEditExperiences":true} */ -export const orgMemberPermissions = addApiMethod(async ( +export const orgMemberPermissions = createApiMethod(async ( { orgId, userId }: { orgId: Identifier, userId: Identifier } ): ApiMethod => ({ method: "GET", @@ -345,7 +345,7 @@ export const orgMemberPermissions = addApiMethod(async ( * @exampleData { success: true } * @exampleRawBody true */ -export const giveRoleToOrgMember = addApiMethod(async ( +export const giveRoleToOrgMember = createApiMethod(async ( { orgId, userId, roleId }: { orgId: Identifier, userId: Identifier, roleId: Identifier } ): ApiMethod<{ success: boolean }, boolean> => ({ method: "POST", @@ -371,7 +371,7 @@ export const giveRoleToOrgMember = addApiMethod(async ( * @exampleData { success: true } * @exampleRawBody true */ -export const removeRoleFromOrgMember = addApiMethod(async ( +export const removeRoleFromOrgMember = createApiMethod(async ( { orgId, userId, roleId }: { orgId: Identifier, userId: Identifier, roleId: Identifier } ): ApiMethod<{ success: boolean }, boolean> => ({ method: "DELETE", @@ -397,7 +397,7 @@ export const removeRoleFromOrgMember = addApiMethod(async ( * @exampleData {"id":"4508567586590971666","organizationId":"4244556007738484576","name":"Admin","color":"LightOrange","updatedTime":2024-05-31T03:25:37.841Z} * @exampleRawBody {"id":"4508567586590971666","organizationId":"4244556007738484576","name":"Admin","color":"LightOrange","updatedTime":"2024-05-31T03:25:37.8410158Z"} */ -export const createOrgRole = addApiMethod(async ( +export const createOrgRole = createApiMethod(async ( { orgId, roleName, roleColor }: { orgId: OrgId, roleName: RoleName, roleColor: RoleColor } ): ApiMethod, PrettifiedCreateOrgRoleData> => ({ method: "POST", @@ -425,7 +425,7 @@ export const createOrgRole = addApiMethod(async ( { orgId, roleId, roleName, roleColor }: { orgId: OrgId, roleId: RoleId, roleName: RoleName, roleColor: RoleColor } @@ -453,7 +453,7 @@ export const updateOrgRole = addApiMethod(async < * @exampleData true * @exampleRawBody { success: true } */ - export const deleteOrgRole = addApiMethod(async ( + export const deleteOrgRole = createApiMethod(async ( { orgId, roleId }: { orgId: Identifier, roleId: Identifier } ): ApiMethod<{ success: boolean }, boolean> => ({ method: "DELETE", diff --git a/src/apis/classic/premiumFeatures/premiumFeatures.ts b/src/apis/classic/premiumFeatures/premiumFeatures.ts index c759841..c5af186 100644 --- a/src/apis/classic/premiumFeatures/premiumFeatures.ts +++ b/src/apis/classic/premiumFeatures/premiumFeatures.ts @@ -13,7 +13,7 @@ import type { PrettifiedUserSubscriptionsData, RawUserSubscriptionsData } from " // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicPremiumFeatures", baseUrl: "https://premiumFeatures.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicPremiumFeatures", baseUrl: "https://premiumFeatures.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -27,7 +27,7 @@ const addApiMethod = createApiGroup({ name: "ClassicPremiumFeatures", baseUrl: " * @exampleData true * @exampleRawBody true */ -export const userHasPremium = addApiMethod(async ( +export const userHasPremium = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ path: `/v1/users/${userId}/validate-membership`, @@ -45,7 +45,7 @@ export const userHasPremium = addApiMethod(async ( * @exampleData {"subscriptionProductModel":{"premiumFeatureId":505,"subscriptionTypeName":"RobloxPremium450","robuxStipendAmount":450,"isLifetime":false,"expiration":2024-08-15T15:04:28.326Z,"renewal":2024-08-12T15:04:28.326Z,"created":2014-02-14T16:20:38.117Z,"purchasePlatform":"isIosApp","subscriptionName":"Roblox Premium 450"}} * @exampleRawBody {"subscriptionProductModel":{"premiumFeatureId":505,"subscriptionTypeName":"RobloxPremium450","robuxStipendAmount":450,"isLifetime":false,"expiration":"2024-08-15T15:04:28.326Z","renewal":"2024-08-12T15:04:28.326Z","created":"2014-02-14T16:20:38.117Z","purchasePlatform":"isIosApp","subscriptionName":"Roblox Premium 450"}} */ -export const userSubscriptions = addApiMethod(async ( +export const userSubscriptions = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod => ({ path: `/v1/users/${userId}/subscriptions`, diff --git a/src/apis/classic/shareLinks/shareLinks.ts b/src/apis/classic/shareLinks/shareLinks.ts index 738c353..f71597a 100644 --- a/src/apis/classic/shareLinks/shareLinks.ts +++ b/src/apis/classic/shareLinks/shareLinks.ts @@ -11,7 +11,7 @@ import type { ShareLinkInfo } from "./shareLinks.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicShareLinks", baseUrl: "https://apis.roblox.com/sharelinks" }) +const { createApiMethod } = createApiGroup({ name: "ClassicShareLinks", baseUrl: "https://apis.roblox.com/sharelinks" }) ////////////////////////////////////////////////////////////////////////////////// @@ -25,7 +25,7 @@ const addApiMethod = createApiGroup({ name: "ClassicShareLinks", baseUrl: "https * @exampleData {"experienceInviteData":null,"friendInviteData":null,"notificationExperienceInviteData":null,"profileLinkResolutionResponseData":null,"screenshotInviteData":null,"privateServerInviteData":{"status":"Valid","ownerUserId":45348281,"universeId":6430220996,"privateServerId":1630945839,"linkCode":"67771413747491684286858666824242","placeId":18980972074},"experienceDetailsInviteData":null,"avatarItemDetailsData":null,"contentPostData":null,"experienceAffiliateData":null} * @exampleRawBody {"experienceInviteData":null,"friendInviteData":null,"notificationExperienceInviteData":null,"profileLinkResolutionResponseData":null,"screenshotInviteData":null,"privateServerInviteData":{"status":"Valid","ownerUserId":45348281,"universeId":6430220996,"privateServerId":1630945839,"linkCode":"67771413747491684286858666824242","placeId":18980972074},"experienceDetailsInviteData":null,"avatarItemDetailsData":null,"contentPostData":null,"experienceAffiliateData":null} */ -export const shareLinkInfo = addApiMethod(async ( +export const shareLinkInfo = createApiMethod(async ( { shareLinkId }: { shareLinkId: string } ): ApiMethod => ({ method: "POST", diff --git a/src/apis/classic/subscriptions/subscriptions.ts b/src/apis/classic/subscriptions/subscriptions.ts index ed5a79a..1569e78 100644 --- a/src/apis/classic/subscriptions/subscriptions.ts +++ b/src/apis/classic/subscriptions/subscriptions.ts @@ -14,7 +14,7 @@ import type { AuthenticatedUserSubscriptionsPermissionsForUniverseData, Prettifi // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicSubscriptions", baseUrl: "https://apis.roblox.com/experience-subscriptions" }) +const { createApiMethod } = createApiGroup({ name: "ClassicSubscriptions", baseUrl: "https://apis.roblox.com/experience-subscriptions" }) const subscriptionTypeToId: { [key in SubscriptionType]: number } = { "Durable": 3, @@ -60,7 +60,7 @@ const subscriptionIdToPrice: { [key in SubscriptionBasePriceId]: SubsriptionPric * @exampleData {"id":"8517167288618319987","universeId":5795192361,"shopId":5795481121,"name":"Cool Subscription","description":"Lorem ipsum dolor sit amet.","imageAssetId":0,"periodType":"Monthly","developerSubscriptionProductType":"Durable","productStatusType":1,"initialActivationTimestampMs":null,"createdTimestampMs":1713322834753,"updatedTimestampMs":1713322834753} * @exampleRawBody {"developerSubscription":{"id":"8517167288618319987","universeId":5795192361,"shopId":5795481121,"name":"Cool Subscription","description":"Lorem ipsum dolor sit amet.","imageAssetId":0,"periodType":1,"developerSubscriptionProductType":3,"productStatusType":1,"initialActivationTimestampMs":null,"createdTimestampMs":1713322834753,"updatedTimestampMs":1713322834753}} */ -export const createSubscription = addApiMethod(async < +export const createSubscription = createApiMethod(async < UniverseId extends Identifier, Name extends string, Description extends string, Type extends SubscriptionType >( { universeId, name, description, type, price }: { universeId: UniverseId, name: Name, description: Description, type: Type, price: SubsriptionPrice } @@ -94,7 +94,7 @@ export const createSubscription = addApiMethod(async < * @exampleData true * @exampleRawBody { status: true } */ -export const setSubscriptionIcon = addApiMethod(async ( +export const setSubscriptionIcon = createApiMethod(async ( { universeId, subscriptionId, actingUserId, icon }: { universeId: Identifier, subscriptionId: Identifier, actingUserId: Identifier, icon: string | File } ): ApiMethod<{ status: boolean }, boolean> => ({ path: `/v1/experiences/${universeId}/experience-subscriptions/${subscriptionId}/upload-image`, @@ -120,7 +120,7 @@ export const setSubscriptionIcon = addApiMethod(async ( * @exampleData [{"id":"3656348821302804581","universeId":5795192361,"name":"Testing","description":"Lorem ipsum dolor sit amet.","imageAssetId":17095512680,"periodType":"Monthly","productType":"Consumable","productStatusType":1,"basePriceId":"919c5912-7de8-413c-9756-d4265b3cbd3a","initialActivationTimestampMs":0,"createdTimestampMs":1712783803427,"updatedTimestampMs":1712783804047,"basePrice":"$2.99"}] * @exampleRawBody {"developerSubscriptions":[{"id":"3656348821302804581","universeId":5795192361,"name":"Testing","description":"Lorem ipsum dolor sit amet.","imageAssetId":17095512680,"periodType":1,"productType":1,"productStatusType":1,"basePriceId":"919c5912-7de8-413c-9756-d4265b3cbd3a","initialActivationTimestampMs":0,"createdTimestampMs":1712783803427,"updatedTimestampMs":1712783804047}],"previousCursor":"id_2Ac8yvfXhfKwAZQ","nextCursor":"id_2Ac8yvfXhfKwAZQ","hasMoreResults":false} */ -export const subscriptionsForUniverse = addApiMethod(async ( +export const subscriptionsForUniverse = createApiMethod(async ( { universeId, resultsPerPage, cursor }: { universeId: UniverseId, resultsPerPage?: number, cursor?: string } ): ApiMethod, PrettifiedSubscriptionsForUniverseData> => ({ path: `/v1/experiences/${universeId}/experience-subscriptions`, @@ -153,7 +153,7 @@ export const subscriptionsForUniverse = addApiMethod(async ( +export const subscriptionInfo = createApiMethod(async ( { universeId, subscriptionId }: { universeId: UniverseId, subscriptionId: SubscriptionId } ): ApiMethod, PrettifiedSubscriptionInfoData> => ({ path: `/v1/experiences/${universeId}/experience-subscriptions/${subscriptionId}`, @@ -179,7 +179,7 @@ export const subscriptionInfo = addApiMethod(async => ({ path: `/v1/experiences/${universeId}/experience-subscriptions/prices`, @@ -207,7 +207,7 @@ export const subscriptionsPriceTiersForUniverse = addApiMethod(async ( * @exampleData { canUserEditExperienceSubscription: true } * @exampleRawBody { canUserEditExperienceSubscription: true } */ -export const authenticatedUserSubscriptionsPermissionsForUniverse = addApiMethod(async ( +export const authenticatedUserSubscriptionsPermissionsForUniverse = createApiMethod(async ( { universeId }: { universeId: Identifier } ): ApiMethod => ({ path: `/v1/experiences/${universeId}/experience-subscriptions/permission`, diff --git a/src/apis/classic/talent/talent.ts b/src/apis/classic/talent/talent.ts index 27a31d5..41366df 100644 --- a/src/apis/classic/talent/talent.ts +++ b/src/apis/classic/talent/talent.ts @@ -14,7 +14,7 @@ import type { SortOrder } from "../../../utils/utils.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicTalent", baseUrl: "https://apis.roblox.com/talent" }) +const { createApiMethod } = createApiGroup({ name: "ClassicTalent", baseUrl: "https://apis.roblox.com/talent" }) ////////////////////////////////////////////////////////////////////////////////// @@ -28,7 +28,7 @@ const addApiMethod = createApiGroup({ name: "ClassicTalent", baseUrl: "https://a * @exampleData {"creatorUserId":45348281,"createdUtc":"2021-08-13T01:21:19.146Z","updatedUtc":"2024-05-05T01:24:58.442Z","isPublic":true,"isContactAllowed":false,"creatorDescription":"Lorem ipsum dolor sit amet.","isOpenToWork":false,"interestDescription":"","linkTypes":["DeveloperForum","Roblox","Twitter"],"preferredContactLinkType":"DeveloperForum","socialLinks":[],"jobTypes":[],"skillTypes":["Programmer"],"requiresAction":"NoAction"} * @exampleRawBody {"data":[{"creatorUserId":45348281,"createdUtc":"2021-08-13T01:21:19.1463527Z","updatedUtc":"2024-05-05T01:24:58.4421938Z","isPublic":true,"isContactAllowed":false,"creatorDescription":"Lorem ipsum dolor sit amet.","isOpenToWork":false,"interestDescription":"","linkTypes":["DeveloperForum","Roblox","Twitter"],"preferredContactLinkType":"DeveloperForum","socialLinks":[],"jobTypes":[],"skillTypes":["Programmer"],"requiresAction":"NoAction"}]} */ -export const creatorProfile = addApiMethod(async ( +export const creatorProfile = createApiMethod(async ( { userId }: { userId: UserId } ): ApiMethod, PrettifiedCreatorProfileData> => ({ path: `/v1/users/${userId}/profile`, @@ -54,7 +54,7 @@ export const creatorProfile = addApiMethod(async ( * @exampleData [{"experienceId":21126,"creatorUserId":45348281,"createdUtc":"2022-01-16T16:09:30.161Z","updatedUtc":"2022-07-29T12:23:28.866Z","projectName":"RoCamping","experienceDescription":"RoCamping was my first game, it was a survival game where you built a shelter and tried to survive. My role was the manage the project as well as script and create the UI .","jobRole":"Programmer & UI Designer","teamName":"","experienceMedia":[],"experienceLinks":["[The Game](https://www.roblox.com/games/4922741943/RoCamping)"],"teamId":null,"robloxExperienceIds":[],"robloxAssetIds":[],"startedUtc":"2020-03-31T23:00:00.000Z","endedUtc":"2020-09-30T23:00:00.000Z","isCurrent":false}] * @exampleRawBody {"data":[{"experienceId":21126,"creatorUserId":45348281,"createdUtc":"2022-01-16T16:09:30.1614813Z","updatedUtc":"2022-07-29T12:23:28.8660325Z","projectName":"RoCamping","experienceDescription":"RoCamping was my first game, it was a survival game where you built a shelter and tried to survive. My role was the manage the project as well as script and create the UI .","jobRole":"Programmer & UI Designer","teamName":"","experienceMedia":[],"experienceLinks":["[The Game](https://www.roblox.com/games/4922741943/RoCamping)"],"teamId":null,"robloxExperienceIds":[],"robloxAssetIds":[],"startedUtc":"2020-03-31T23:00:00Z","endedUtc":"2020-09-30T23:00:00Z","isCurrent":false}],"nextPageCursor":null,"previousPageCursor":null} */ -export const creatorExperiences = addApiMethod(async ( +export const creatorExperiences = createApiMethod(async ( { userId, sortOrder, limit, cursor }: { userId: UserId, sortOrder?: SortOrder, limit?: number, cursor?: string } ): ApiMethod => ({ path: `/v1/users/${userId}/experiences`, @@ -82,7 +82,7 @@ export const creatorExperiences = addApiMethod(async * @exampleData {"data":[{"userId":45348281,"isVerified":false}]} * @exampleRawBody false */ -export const creatorIsIdVerified = addApiMethod(async ( +export const creatorIsIdVerified = createApiMethod(async ( { userId }: { userId: UserId } ): ApiMethod, boolean> => ({ path: `/v1/users/verification`, @@ -107,7 +107,7 @@ export const creatorIsIdVerified = addApiMethod(async => ({ diff --git a/src/apis/classic/thumbnails/thumbnails.ts b/src/apis/classic/thumbnails/thumbnails.ts index 70815fb..da11ab4 100644 --- a/src/apis/classic/thumbnails/thumbnails.ts +++ b/src/apis/classic/thumbnails/thumbnails.ts @@ -13,7 +13,7 @@ import type { AssetAnimatedThumbnailData, AssetSize, AvatarsFullThumbnailsSize, // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicThumbnails", baseUrl: "https://thumbnails.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicThumbnails", baseUrl: "https://thumbnails.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -33,7 +33,7 @@ const addApiMethod = createApiGroup({ name: "ClassicThumbnails", baseUrl: "https * @exampleData { "7229442422": { state: "Completed", imageUrl: "https://tr.rbxcdn.com/7da8e78d9e2e303f0122c355f19f66d5/420/420/Image/Png" } } * @exampleRawBody { data: [ { targetId: 7229442422, state: "Completed", imageUrl: "https://tr.rbxcdn.com/7da8e78d9e2e303f0122c355f19f66d5/420/420/Image/Png" } ] } */ -export const assetsThumbnails = addApiMethod(async ( +export const assetsThumbnails = createApiMethod(async ( { assetIds, returnPolicy = "PlaceHolder", size, format = "WebP", isCircular }: { assetIds: ArrayNonEmptyIfConst, returnPolicy?: ThumbnailReturnPolicy, size: AssetSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod => ({ @@ -57,7 +57,7 @@ export const assetsThumbnails = addApiMethod(async ( * @exampleData { targetId: 6768917255, state: "Completed", imageUrl: 'https://t2.rbxcdn.com/30ac72dfa05dff91baae9b8c0f9049e3' } * @exampleRawBody { targetId: 6768917255, state: "Completed", imageUrl: 'https://t2.rbxcdn.com/30ac72dfa05dff91baae9b8c0f9049e3' } */ -export const asset3dThumbnail = addApiMethod(async ( +export const asset3dThumbnail = createApiMethod(async ( { assetId }: { assetId: AssetId } ): ApiMethod> => ({ method: "GET", @@ -77,7 +77,7 @@ export const asset3dThumbnail = addApiMethod(async ( * @exampleData { targetId: 6768917255, state: "Completed", imageUrl: null } * @exampleRawBody { targetId: 6768917255, state: "Completed", imageUrl: null } */ -export const assetAnimatedThumbnail = addApiMethod(async ( +export const assetAnimatedThumbnail = createApiMethod(async ( { assetId }: { assetId: AssetId } ): ApiMethod> => ({ method: "GET", @@ -102,7 +102,7 @@ export const assetAnimatedThumbnail = addApiMethod(async ( +export const badgesThumbnails = createApiMethod(async ( { badgeIds, format = "WebP", isCircular }: { badgeIds: ArrayNonEmptyIfConst, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ method: "GET", @@ -132,7 +132,7 @@ export const badgesThumbnails = addApiMethod(async ( * @exampleData { "181": { state: "Completed", imageUrl: "https://tr.rbxcdn.com/12ff41b547ee75865bb60d0f3ae5508b/420/420/Avatar/Png" } } * @exampleRawBody { data: [ { targetId: 181, state: "Completed", imageUrl: "https://tr.rbxcdn.com/12ff41b547ee75865bb60d0f3ae5508b/420/420/Avatar/Png" } ] } */ -export const bundlesThumbnails = addApiMethod(async ( +export const bundlesThumbnails = createApiMethod(async ( { bundleIds, size="420x420", format = "WebP", isCircular }: { bundleIds: ArrayNonEmptyIfConst, size?: BundleSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -160,7 +160,7 @@ export const bundlesThumbnails = addApiMethod(async ( +export const developerProductsThumbnails = createApiMethod(async ( { developerProductIds, size = "420x420", format = "WebP", isCircular }: { developerProductIds: ArrayNonEmptyIfConst, size?: DeveloperProductSize, format?: ThumbnailFormat, isCircular?: boolean } @@ -189,7 +189,7 @@ export const developerProductsThumbnails = addApiMethod(async ( +export const gamePassesThumbnails = createApiMethod(async ( { gamePassIds, format = "WebP", isCircular }: { gamePassIds: ArrayNonEmptyIfConst, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -218,7 +218,7 @@ export const gamePassesThumbnails = addApiMethod(async ( +export const gameThumbnailsFromIds = createApiMethod(async ( { universeId, thumbnailIds, size = "480x270", format = "WebP", isCircular }: { universeId: Identifier, thumbnailIds: ArrayNonEmptyIfConst, size?: GameThumbnailSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -246,7 +246,7 @@ export const gameThumbnailsFromIds = addApiMethod(async ( +/*export const gamesIcons = createApiMethod(async ( { universeIds, returnPolicy, size = "256x256", format = "WebP", isCircular }: { universeIds: ArrayNonEmptyIfConst, returnPolicy?: ThumbnailReturnPolicy, size?: GamesIconSize, format?: ThumbnailFormat, isCircular?: boolean @@ -276,7 +276,7 @@ export const gameThumbnailsFromIds = addApiMethod(async ( +export const gamesThumbnails = createApiMethod(async ( { universeIds, countPerUniverse, defaults, size = "480x270", format = "WebP", isCircular }: { universeIds: ArrayNonEmptyIfConst, countPerUniverse?: number, defaults?: boolean, @@ -311,7 +311,7 @@ export const gamesThumbnails = addApiMethod(async ( +export const groupsEmblems = createApiMethod(async ( { groupIds, size = "420x420", format = "WebP", isCircular }: { groupIds: ArrayNonEmptyIfConst, size?: GroupEmblemSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -335,7 +335,7 @@ export const groupsEmblems = addApiMethod(async ( * @exampleData { isWebappUseCacheEnabled: false, webappCacheExpirationTimspan: "00:00:00" } * @exampleRawBody { isWebappUseCacheEnabled: false, webappCacheExpirationTimspan: "00:00:00" } */ -export const thumbnailsMetadata = addApiMethod(async ( +export const thumbnailsMetadata = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/metadata`, @@ -360,7 +360,7 @@ export const thumbnailsMetadata = addApiMethod(async ( * @exampleData { "4922741943": { state: "Completed", imageUrl: "https://tr.rbxcdn.com/7c1bf96fefde7b761e7b86bedf6fdca3/512/512/Image/Png" } } * @exampleRawBody { data: [ { targetId: 4922741943, state: "Completed", imageUrl: "https://tr.rbxcdn.com/7c1bf96fefde7b761e7b86bedf6fdca3/512/512/Image/Png" } ] } */ -export const placesIcons = addApiMethod(async ( +export const placesIcons = createApiMethod(async ( { placeIds, returnPolicy, size = "256x256", format = "WebP", isCircular }: { placeIds: ArrayNonEmptyIfConst, returnPolicy?: ThumbnailReturnPolicy, size?: GamesIconSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -389,7 +389,7 @@ export const placesIcons = addApiMethod(async ( * @exampleData { "45348281": { state: "Completed", imageUrl: "https://tr.rbxcdn.com/b91cd7a2d531a50be786e08c7739c56a/150/150/Avatar/Png" } } * @exampleRawBody { data: [ { targetId: 45348281, state: "Completed", imageUrl: "https://tr.rbxcdn.com/b91cd7a2d531a50be786e08c7739c56a/150/150/Avatar/Png" } ] } */ -export const avatarsFullThumbnails = addApiMethod(async ( +export const avatarsFullThumbnails = createApiMethod(async ( { userIds, size = "420x420", format = "WebP", isCircular }: { userIds: ArrayNonEmptyIfConst, size?: AvatarsFullThumbnailsSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -415,7 +415,7 @@ export const avatarsFullThumbnails = addApiMethod(async ( +export const avatarsBustsThumbnails = createApiMethod(async ( { userIds, size = "420x420", format = "WebP", isCircular }: { userIds: ArrayNonEmptyIfConst, size?: AvatarsFullThumbnailsSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -442,7 +442,7 @@ export const avatarsBustsThumbnails = addApiMethod(async ( +export const avatarsHeadshotsThumbnails = createApiMethod(async ( { userIds, size = "420x420", format = "WebP", isCircular }: { userIds: ArrayNonEmptyIfConst, size?: AvatarsFullThumbnailsSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -465,7 +465,7 @@ export const avatarsHeadshotsThumbnails = addApiMethod(async ( +export const avatar3dThumbnail = createApiMethod(async ( { userId }: { userId: UserId } ): ApiMethod> => ({ method: "GET", @@ -488,7 +488,7 @@ export const avatar3dThumbnail = addApiMethod(async ( * @exampleData { targetId: 110540093, state: "Completed", imageUrl: "https://t7.rbxcdn.com/24eea0d840fe712230943a3bead4659a" } * @exampleRawBody { targetId: 110540093, state: "Completed", imageUrl: "https://t7.rbxcdn.com/24eea0d840fe712230943a3bead4659a" } */ -export const outfit3dThumbnail = addApiMethod(async ( +export const outfit3dThumbnail = createApiMethod(async ( { outfitId }: { outfitId: OutfitId } ): ApiMethod> => ({ method: "GET", @@ -511,7 +511,7 @@ export const outfit3dThumbnail = addApiMethod(async ( +export const outfitsThumbnails = createApiMethod(async ( { outfitIds, size = "420x420", format = "WebP", isCircular }: { outfitIds: ArrayNonEmptyIfConst, size?: OutfitSize, format?: ThumbnailFormat, isCircular?: boolean } ): ApiMethod, PrettifiedThumbnailsData> => ({ @@ -546,7 +546,7 @@ export const outfitsThumbnails = addApiMethod(async ( +export const batchThumbnails = createApiMethod(async ( { requests }: { requests: BReq[] } ): ApiMethod> => ({ method: "POST", diff --git a/src/apis/classic/universes/universes.ts b/src/apis/classic/universes/universes.ts index 7df3d7e..878b954 100644 --- a/src/apis/classic/universes/universes.ts +++ b/src/apis/classic/universes/universes.ts @@ -11,7 +11,7 @@ import type { ApiMethod } from "../../apiGroup" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicUniverses", baseUrl: "https://apis.roblox.com/universes" }) +const { createApiMethod } = createApiGroup({ name: "ClassicUniverses", baseUrl: "https://apis.roblox.com/universes" }) ////////////////////////////////////////////////////////////////////////////////// @@ -25,7 +25,7 @@ const addApiMethod = createApiGroup({ name: "ClassicUniverses", baseUrl: "https: * @exampleData 5638577595 * @exampleRawBody {"universeId":5638577595} */ -export const universeIdFromPlaceId = addApiMethod(async ( +export const universeIdFromPlaceId = createApiMethod(async ( { placeId }: { placeId: Identifier } ): ApiMethod<{ universeId: Identifier }, Identifier> => ({ path: `/v1/places/${placeId}/universe`, diff --git a/src/apis/classic/users/users.ts b/src/apis/classic/users/users.ts index 5b6d981..f208ad0 100644 --- a/src/apis/classic/users/users.ts +++ b/src/apis/classic/users/users.ts @@ -14,7 +14,7 @@ import type { AuthenticatedUserInfoData, PrettifiedAuthenticatedUserAgeBracketDa // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicUsers", baseUrl: "https://users.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "ClassicUsers", baseUrl: "https://users.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -29,7 +29,7 @@ const addApiMethod = createApiGroup({ name: "ClassicUsers", baseUrl: "https://us * @exampleData 2005-02-03T00:00:00.000Z * @exampleRawBody { birthMonth: 2, birthDay: 3, birthYear: 2005 } */ -export const authenticatedUserBirthdate = addApiMethod(async ( +export const authenticatedUserBirthdate = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/birthdate`, method: "GET", @@ -48,7 +48,7 @@ export const authenticatedUserBirthdate = addApiMethod(async ( * @exampleData Lorem ipsum dolor sit amet consectetur adipiscing elit. * @exampleRawBody { description: "Lorem ipsum dolor sit amet consectetur adipiscing elit." } */ -export const authenticatedUserDescription = addApiMethod(async ( +export const authenticatedUserDescription = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/description`, method: "GET", @@ -67,7 +67,7 @@ export const authenticatedUserDescription = addApiMethod(async ( * @exampleData Male * @exampleRawBody { gender: 2 } */ -export const authenticatedUserGender = addApiMethod(async ( +export const authenticatedUserGender = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/gender`, method: "GET", @@ -92,7 +92,7 @@ export const authenticatedUserGender = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const validateDisplayNameForNewUser = addApiMethod(async ( +export const validateDisplayNameForNewUser = createApiMethod(async ( { displayName, birthdate }: { displayName: string, birthdate: ISODateTime | Date } ): ApiMethod<{}, boolean> => ({ path: `/v1/display-names/validate`, @@ -116,7 +116,7 @@ export const validateDisplayNameForNewUser = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const validateDisplayNameForExistingUser = addApiMethod(async ( +export const validateDisplayNameForExistingUser = createApiMethod(async ( { userId, displayName }: { userId: Identifier, displayName: string } ): ApiMethod<{}, boolean> => ({ path: `/v1/users/${userId}/display-names/validate`, @@ -140,7 +140,7 @@ export const validateDisplayNameForExistingUser = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const authenticatedUserSetDisplayName = addApiMethod(async ( +export const authenticatedUserSetDisplayName = createApiMethod(async ( { userId, newDisplayName }: { userId: Identifier, newDisplayName: string } ): ApiMethod<{}, boolean> => ({ path: `/v1/users/${userId}/display-names`, @@ -165,7 +165,7 @@ export const authenticatedUserSetDisplayName = addApiMethod(async ( * @exampleData { description: "Lorem ipsum dolor sit amet consectetur adipiscing elit.", created: 2013-07-13T07:50:00.083Z, isBanned: false, externalAppDisplayName: null, hasVerifiedBadge: false, id: 45348281, name: "MightyPart", displayName: "MightyPart" } * @exampleRawBody { description: "Lorem ipsum dolor sit amet consectetur adipiscing elit.", created: "2013-07-13T07:50:00.083Z", isBanned: false, externalAppDisplayName: null, hasVerifiedBadge: false, id: 45348281, name: "MightyPart", displayName: "MightyPart" } */ -export const userInfo = addApiMethod(async ( +export const userInfo = createApiMethod(async ( { userId }: { userId: UserId } ): ApiMethod, PrettifiedUserInfoData> => ({ path: `/v1/users/${userId}`, @@ -185,7 +185,7 @@ export const userInfo = addApiMethod(async ( * @exampleData { id: 45348281, name: "MightyPart", displayName: "MightyPart" } * @exampleRawBody { id: 45348281, name: "MightyPart", displayName: "MightyPart" } */ -export const authenticatedUserInfo = addApiMethod(async ( +export const authenticatedUserInfo = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/users/authenticated`, method: "GET", @@ -202,7 +202,7 @@ export const authenticatedUserInfo = addApiMethod(async ( * @exampleData 13+ * @exampleRawBody { ageBracket: 0 } */ -export const authenticatedUserAgeBracket = addApiMethod(async ( +export const authenticatedUserAgeBracket = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/users/authenticated/age-bracket`, method: "GET", @@ -222,7 +222,7 @@ export const authenticatedUserAgeBracket = addApiMethod(async ( * @exampleData DE * @exampleRawBody { countryCode: "DE" } */ -export const authenticatedUserCountryCode = addApiMethod(async ( +export const authenticatedUserCountryCode = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/users/authenticated/country-code`, method: "GET", @@ -241,7 +241,7 @@ export const authenticatedUserCountryCode = addApiMethod(async ( * @exampleData [ "BetaTester" ] * @exampleRawBody { roles: [ "BetaTester" ] } */ -export const authenticatedUserRoles = addApiMethod(async ( +export const authenticatedUserRoles = createApiMethod(async ( ): ApiMethod => ({ path: `/v1/users/authenticated/roles`, method: "GET", @@ -262,7 +262,7 @@ export const authenticatedUserRoles = addApiMethod(async ( * @exampleData { MightyPart: { hasVerifiedBadge: false, id: 45348281, name: "MightyPart", displayName: "MightyPart" } } * @exampleRawBody { data: [ { requestedUsername: "MightyPart", hasVerifiedBadge: false, id: 45348281, name: "MightyPart", displayName: "MightyPart" } ] } */ -export const usersInfoFromNames = addApiMethod(async ( +export const usersInfoFromNames = createApiMethod(async ( { usernames, excludeBannedUsers = false }: { usernames: ArrayNonEmptyIfConst, excludeBannedUsers?: boolean } ): ApiMethod, PrettifiedUsernamesToUsersInfoData> => ({ path: `/v1/usernames/users`, @@ -288,7 +288,7 @@ export const usersInfoFromNames = addApiMethod(async ( * @exampleData { "45348281": { hasVerifiedBadge: false, name: "MightyPart", displayName: "MightyPart" } } * @exampleRawBody { data: [ { hasVerifiedBadge: false, id: 45348281, name: "MightyPart", displayName: "MightyPart" } ] } */ -export const usersInfoFromIds = addApiMethod(async ( +export const usersInfoFromIds = createApiMethod(async ( { userIds, excludeBannedUsers }: { userIds: ArrayNonEmptyIfConst, excludeBannedUsers?: boolean } ): ApiMethod, PrettifiedUserIdsToUsersInfoData> => ({ path: `/v1/users`, @@ -320,7 +320,7 @@ export const usersInfoFromIds = addApiMethod(async ( * @exampleData [ "NamelessGuy2005", "parrrty" ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: null, data: [ { name: "NamelessGuy2005" }, { name: "parrrty" } ] } */ -export const usernameHistory = addApiMethod(async ( +export const usernameHistory = createApiMethod(async ( { userId, limit, sortOrder, cursor } :{ userId: Identifier, limit?: 10|25|50|100, sortOrder?: SortOrder, cursor?: string } ): ApiMethod => ({ @@ -349,7 +349,7 @@ export const usernameHistory = addApiMethod(async ( * @exampleData [ { "previousUsernames": [ "parrrty", "NamelessGuy2005" ], "hasVerifiedBadge": false, "id": 45348281, "name": "MightyPart", "displayName": "MightyPart" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 2655994471, "name": "MightyPartJr", "displayName": "MightyPartJr" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 109174199, "name": "MightyPartyAnimal", "displayName": "jonny" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 151051171, "name": "MightyPartygirl101", "displayName": "india" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 3886457808, "name": "mightypartxl", "displayName": "mightypartxl" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 31488865, "name": "mightypartyrocker101", "displayName": "mightypartyrocker101" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 35463215, "name": "mightyparty3", "displayName": "mightyparty3" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 152196440, "name": "MightyPartygirl234", "displayName": "MightyPartygirl234" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 141415414, "name": "MightyPartygod49", "displayName": "MightyPartygod49" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 153951993, "name": "Mightypartylove", "displayName": "Mightypartylove" } ] * @exampleRawBody { previousPageCursor: null, nextPageCursor: 'eyJzdGFydEluZGV4IjoxMCwiZGlzY3JpbWluYXRvciI6ImtleXdvcmQ6TWlnaHR5UGFydCIsImNvdW50IjoxMH0KNzU4ZDExMWU1NjYwZGI1YWQ3ZDk4ZTJhMzI3ZTQzNjA0ZjdkYzI0NGRjODlkMWY1YjczMDBjY2E3NDI4YmMxOQ==', data: [ { "previousUsernames": [ "parrrty", "NamelessGuy2005" ], "hasVerifiedBadge": false, "id": 45348281, "name": "MightyPart", "displayName": "MightyPart" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 2655994471, "name": "MightyPartJr", "displayName": "MightyPartJr" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 109174199, "name": "MightyPartyAnimal", "displayName": "jonny" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 151051171, "name": "MightyPartygirl101", "displayName": "india" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 3886457808, "name": "mightypartxl", "displayName": "mightypartxl" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 31488865, "name": "mightypartyrocker101", "displayName": "mightypartyrocker101" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 35463215, "name": "mightyparty3", "displayName": "mightyparty3" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 152196440, "name": "MightyPartygirl234", "displayName": "MightyPartygirl234" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 141415414, "name": "MightyPartygod49", "displayName": "MightyPartygod49" }, { "previousUsernames": [], "hasVerifiedBadge": false, "id": 153951993, "name": "Mightypartylove", "displayName": "Mightypartylove" } ] } */ -export const userSearch = addApiMethod(async ( +export const userSearch = createApiMethod(async ( { keyword, limit, cursor } :{ keyword: string, limit?: 10|25|50|100, cursor?: string } ): ApiMethod => ({ diff --git a/src/apis/classic/virtualEvents/virtualEvents.ts b/src/apis/classic/virtualEvents/virtualEvents.ts index b887893..773ba10 100644 --- a/src/apis/classic/virtualEvents/virtualEvents.ts +++ b/src/apis/classic/virtualEvents/virtualEvents.ts @@ -13,7 +13,7 @@ import type { AuthenticatedUserEventPermissionsForHostData, EventCategory, Event // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "ClassicVirtualEventsApi", baseUrl: "https://apis.roblox.com/virtual-events" }) +const { createApiMethod } = createApiGroup({ name: "ClassicVirtualEventsApi", baseUrl: "https://apis.roblox.com/virtual-events" }) ////////////////////////////////////////////////////////////////////////////////// @@ -41,7 +41,7 @@ const prettifyEvent = (event: VirtualEvent) => { * @exampleData {"id":"5904751593700196492","title":"My Cool Event Of Epic Awesomeness","displayTitle":"My Cool Event Of Epic Awesomeness","description":"hello","displayDescription":"hello","eventTime":{"startUtc":"2024-07-12T19:18:00.000Z","endUtc":"2024-07-13T20:30:00.000Z"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-12T19:01:41.661Z","updatedUtc":"2024-07-13T20:29:50.734Z","eventCategories":[{"category":"activity","rank":0},{"category":"systemUpdate","rank":1}],"thumbnails":[{"mediaId":18459197740,"rank":0}],"allThumbnailsCreated":false,"userRsvpStatus":"going"} * @exampleRawBody {"id":"5904751593700196492","title":"My Cool Event Of Epic Awesomeness","displayTitle":"My Cool Event Of Epic Awesomeness","description":"hello","displayDescription":"hello","eventTime":{"startUtc":"2024-07-12T19:18:00.000Z","endUtc":"2024-07-13T20:30:00.000Z"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-12T19:01:41.661Z","updatedUtc":"2024-07-13T20:29:50.734Z","eventCategories":[{"category":"activity","rank":0},{"category":"systemUpdate","rank":1}],"thumbnails":[{"mediaId":18459197740,"rank":0}],"allThumbnailsCreated":false,"userRsvpStatus":"going"} */ -export const eventInfo = addApiMethod(async ( +export const eventInfo = createApiMethod(async ( { eventId }: { eventId: Identifier } ): ApiMethod, PrettifiedVirtualEventsData> => ({ path: `/v1/virtual-events/${eventId}`, @@ -76,7 +76,7 @@ export const eventInfo = addApiMethod(async ( * @exampleData {"id":"6533473338141704368","title":"Event Name","displayTitle":null,"description":"Description","displayDescription":null,"eventTime":{"startUtc":"2024-08-14T00:46:54.000Z","endUtc":"2024-08-14T01:46:54.000Z"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"unpublished","createdUtc":"2024-07-14T00:35:35.487Z","updatedUtc":"2024-07-14T00:35:35.487Z","eventCategories":[{"category":"contentUpdate","rank":0},{"category":"activity","rank":1}],"thumbnails":null,"allThumbnailsCreated":false} * @exampleRawBody {"id":"6533473338141704368","title":"Event Name","displayTitle":null,"description":"Description","displayDescription":null,"eventTime":{"startUtc":"2024-08-14T00:46:54+00:00","endUtc":"2024-08-14T01:46:54+00:00"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"unpublished","createdUtc":"2024-07-14T00:35:35.487+00:00","updatedUtc":"2024-07-14T00:35:35.487+00:00","eventCategories":[{"category":"contentUpdate","rank":0},{"category":"activity","rank":1}],"thumbnails":null,"allThumbnailsCreated":false} */ -export const createEvent = addApiMethod(async < +export const createEvent = createApiMethod(async < Title extends string, Description extends string, StartTime extends ISODateTime | Date, EndTime extends ISODateTime | Date, UniverseId extends Identifier, GroupId extends Identifier, @@ -128,7 +128,7 @@ export const createEvent = addApiMethod(async < -export const updateEvent = addApiMethod(async < +export const updateEvent = createApiMethod(async < SecondaryCategory extends (PrimaryCategory extends undefined ? undefined : Exclude @@ -172,7 +172,7 @@ export const updateEvent = addApiMethod(async < * @exampleData { isUpdated: true } * @exampleRawBody true */ -export const publishEvent = addApiMethod(async ( +export const publishEvent = createApiMethod(async ( { eventId }: { eventId: Identifier } ): ApiMethod<{ isUpdated: boolean }, boolean> => ({ method: "PATCH", @@ -194,7 +194,7 @@ export const publishEvent = addApiMethod(async ( * @exampleData [{"userId":45348281,"rsvpStatus":"going","shouldSeeNotificationsUpsellModal":false}] * @exampleRawBody {"nextPageCursor":"","previousPageCursor":"","data":[{"userId":45348281,"rsvpStatus":"going","shouldSeeNotificationsUpsellModal":false}]} */ -export const eventRsvps = addApiMethod(async ( +export const eventRsvps = createApiMethod(async ( { eventId, limit, cursor }: { eventId: Identifier, limit?: 25, cursor?: string } ): ApiMethod => ({ method: "GET", @@ -216,7 +216,7 @@ export const eventRsvps = addApiMethod(async ( * @exampleData {"none":0,"going":1,"maybeGoing":0,"notGoing":0} * @exampleRawBody {"counters":{"none":0,"going":1,"maybeGoing":0,"notGoing":0}} */ -export const eventRsvpCounters = addApiMethod(async ( +export const eventRsvpCounters = createApiMethod(async ( { eventId }: { eventId: Identifier } ): ApiMethod => ({ method: "GET", @@ -238,7 +238,7 @@ export const eventRsvpCounters = addApiMethod(async ( * @exampleData {"maxPermissionLevel":"edit"} * @exampleRawBody {"maxPermissionLevel":"edit"} */ -export const authenticatedUserEventPermissionsForHost = addApiMethod(async ( +export const authenticatedUserEventPermissionsForHost = createApiMethod(async ( { userId, groupId }: ObjectEither<{ userId: Identifier }, { groupId: Identifier }> ): ApiMethod => ({ method: "GET", @@ -265,7 +265,7 @@ export const authenticatedUserEventPermissionsForHost = addApiMethod(async ( * @exampleData [{"id":"5904751593700196492","title":"My Cool Event Of Epic Awesomeness","displayTitle":null,"description":"hello","displayDescription":null,"eventTime":{"startUtc":"2024-07-12T19:18:00.000Z","endUtc":"2024-07-13T20:30:00.000Z"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-12T19:01:41.661Z","updatedUtc":"2024-07-13T20:29:50.734Z","eventCategories":null,"thumbnails":[{"mediaId":18459197740,"rank":0}],"allThumbnailsCreated":false},{"id":"3425484122702479513","title":"Test","displayTitle":null,"description":"lol","displayDescription":null,"eventTime":{"startUtc":"2024-07-13T21:27:32.656Z","endUtc":"2024-07-13T22:27:32.656Z"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-13T20:27:52.493Z","updatedUtc":"2024-07-13T20:27:52.967Z","eventCategories":null,"thumbnails":null,"allThumbnailsCreated":false}] * @exampleRawBody {"nextPageCursor":"","previousPageCursor":"","data":[{"id":"5904751593700196492","title":"My Cool Event Of Epic Awesomeness","displayTitle":null,"description":"hello","displayDescription":null,"eventTime":{"startUtc":"2024-07-12T19:18:00+00:00","endUtc":"2024-07-13T20:30:00+00:00"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-12T19:01:41.661+00:00","updatedUtc":"2024-07-13T20:29:50.734+00:00","eventCategories":null,"thumbnails":[{"mediaId":18459197740,"rank":0}],"allThumbnailsCreated":false},{"id":"3425484122702479513","title":"Test","displayTitle":null,"description":"lol","displayDescription":null,"eventTime":{"startUtc":"2024-07-13T21:27:32.656+00:00","endUtc":"2024-07-13T22:27:32.656+00:00"},"host":{"hostName":"Bloxfolio","hasVerifiedBadge":false,"hostType":"group","hostId":15842838},"universeId":6255645791,"eventStatus":"active","createdUtc":"2024-07-13T20:27:52.493+00:00","updatedUtc":"2024-07-13T20:27:52.967+00:00","eventCategories":null,"thumbnails":null,"allThumbnailsCreated":false}]} */ -export const authenticatedUserEvents = addApiMethod(async ( +export const authenticatedUserEvents = createApiMethod(async ( { groupId, filterBy, sortOrder, sortBy, fromUtc, limit, cursor }: { groupId: GroupId, filterBy?: "upcoming" | "past" | "drafts", sortOrder?: "desc" | "asc", diff --git a/src/apis/cloud/assets/assets.ts b/src/apis/cloud/assets/assets.ts index 01091f7..b4647cc 100644 --- a/src/apis/cloud/assets/assets.ts +++ b/src/apis/cloud/assets/assets.ts @@ -13,7 +13,7 @@ import { readFile } from "../../../file" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Assets", baseUrl: "https://apis.roblox.com/assets" }) +const { createApiMethod } = createApiGroup({ name: "Assets", baseUrl: "https://apis.roblox.com/assets" }) const assetsDefaultFields = "assetType,assetId,creationContext,description,displayName,path,revisionId,revisionCreateTime,moderationResult,icon,previews,state" ////////////////////////////////////////////////////////////////////////////////// @@ -70,7 +70,7 @@ const formDataWithAssetFile = async ( * @exampleData {"path":"assets/16989283104","revisionId":"1","revisionCreateTime":"2024-04-02T22:57:45.953Z","assetId":"16989283104","displayName":"suzanne","assetType":"Model","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"},"previews":[]} * @exampleRawBody {"path":"assets/16989283104","revisionId":"1","revisionCreateTime":"2024-04-02T22:57:45.953Z","assetId":"16989283104","displayName":"suzanne","assetType":"Model","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"},"previews":[]} */ -export const assetInfo = addApiMethod(async ( +export const assetInfo = createApiMethod(async ( { assetId, fields }: { assetId: AssetId, fields?: Field[] } ): ApiMethod, PrettifiedAsset> => ({ method: "GET", @@ -103,7 +103,7 @@ export const assetInfo = addApiMethod(async ( @@ -220,7 +220,7 @@ export const updateAsset = addApiMethod(async < * @exampleData {"path":"assets/18508967120/versions/1","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"}} * @exampleRawBody {"path":"assets/18508967120/versions/1","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"}} */ -export const assetOfVersion = addApiMethod(async ( +export const assetOfVersion = createApiMethod(async ( { assetId, version }: { assetId: AssetId, version: Version } ): ApiMethod> => ({ method: "GET", @@ -241,7 +241,7 @@ export const assetOfVersion = addApiMethod(async ( +export const assetVersions = createApiMethod(async ( { assetId, limit, cursor }: { assetId: AssetId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedAssetVersionsData> => ({ method: "GET", @@ -264,7 +264,7 @@ export const assetVersions = addApiMethod(async ( * @exampleData {"path":"assets/18494719558/versions/2","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"}} * @exampleRawBody {"path":"assets/18494719558/versions/2","creationContext":{"creator":{"userId":"45348281"}},"moderationResult":{"moderationState":"Approved"}} */ -export const rollbackAssetVersion = addApiMethod(async ( +export const rollbackAssetVersion = createApiMethod(async ( { assetId, version }: { assetId: AssetId, version: Version } ): ApiMethod> => ({ method: "POST", diff --git a/src/apis/cloud/creatorStore/creatorStore.ts b/src/apis/cloud/creatorStore/creatorStore.ts index bd72b70..0e1161f 100644 --- a/src/apis/cloud/creatorStore/creatorStore.ts +++ b/src/apis/cloud/creatorStore/creatorStore.ts @@ -11,7 +11,7 @@ import type { CreatorStoreProduct_NewProductData, CreatorStoreProduct_OnlyOneId, // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "CreatorStore", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "CreatorStore", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ const addApiMethod = createApiGroup({ name: "CreatorStore", baseUrl: "https://ap * @exampleData {"path":"creator-store-products/CreatorMarketplaceAsset-Model-16989381169","displayName":"monkey","description":"","basePrice":{"currencyCode":"USD","quantity":{"significand":0,"exponent":0}},"purchasePrice":{"currencyCode":"USD","quantity":{"significand":0,"exponent":0}},"published":false,"restrictions":[],"purchasable":false,"userSeller":"45348281","modelAssetId":"16989381169"} * @exampleRawBody {"path":"creator-store-products/CreatorMarketplaceAsset-Model-16989381169","displayName":"monkey","description":"","basePrice":{"currencyCode":"USD","quantity":{"significand":0,"exponent":0}},"purchasePrice":{"currencyCode":"USD","quantity":{"significand":0,"exponent":0}},"published":false,"restrictions":[],"purchasable":false,"userSeller":"45348281","modelAssetId":"16989381169"} */ -export const creatorStoreProductInfo = addApiMethod(async ( +export const creatorStoreProductInfo = createApiMethod(async ( { modelAssetId, pluginAssetId, audioAssetId, decalAssetId, meshPartAssetId, videoAssetId, fontFamilyAssetId }: IdInfo ): ApiMethod> => { const [productType, productId]: [ CreatorStoreProduct_Type, any ] = ( @@ -71,7 +71,7 @@ export const creatorStoreProductInfo = addApiMethod(async ( +export const instanceInfo = createApiMethod(async ( { universeId, placeId, instanceId }: { universeId: UniverseId, placeId: PlaceId, instanceId: InstanceId } ): ApiMethod, PrettifiedInstanceData> => ({ method: "GET", @@ -61,7 +61,7 @@ export const instanceInfo = addApiMethod(async ( +export const instanceChildren = createApiMethod(async ( { universeId, placeId, instanceId, limit, cursor }: { universeId: UniverseId, placeId: PlaceId, instanceId: InstanceId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedInstanceChildrenData> => ({ @@ -107,7 +107,7 @@ export const instanceChildren = addApiMethod(async ( +export const updateInstance = createApiMethod(async ( { universeId, placeId, instanceId, newData }: { universeId: UniverseId, placeId: PlaceId, instanceId: InstanceId, diff --git a/src/apis/cloud/experiences/experiences.ts b/src/apis/cloud/experiences/experiences.ts index e66b5e6..9e8363c 100644 --- a/src/apis/cloud/experiences/experiences.ts +++ b/src/apis/cloud/experiences/experiences.ts @@ -14,7 +14,7 @@ import type { PrettifiedPlaceInfoData, PrettifiedUniverseInfoData, PrettifiedUpd // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Experiences", baseUrl: "https://apis.roblox.com" }) +const { createApiMethod } = createApiGroup({ name: "Experiences", baseUrl: "https://apis.roblox.com" }) ////////////////////////////////////////////////////////////////////////////////// @@ -38,7 +38,7 @@ function isPlaceFileBufferXml(buffer: Buffer): boolean { * @exampleData {"path":"universes/5795192361","createTime":"2024-03-25T10:42:46.360Z","updateTime":"2024-03-25T10:42:46.360Z","displayName":"MightyPart's Place Number: 201","description":"","user":"users/45348281","visibility":"PRIVATE","voiceChatEnabled":false,"ageRating":"AGE_RATING_UNSPECIFIED","desktopEnabled":true,"mobileEnabled":true,"tabletEnabled":true,"consoleEnabled":false,"vrEnabled":true} * @exampleRawBody {"path":"universes/5795192361","createTime":"2024-03-25T10:42:46.360Z","updateTime":"2024-03-25T10:42:46.360Z","displayName":"MightyPart's Place Number: 201","description":"","user":"users/45348281","visibility":"PRIVATE","voiceChatEnabled":false,"ageRating":"AGE_RATING_UNSPECIFIED","desktopEnabled":true,"mobileEnabled":true,"tabletEnabled":true,"consoleEnabled":false,"vrEnabled":true} */ -export const universeInfo = addApiMethod(async ( +export const universeInfo = createApiMethod(async ( { universeId }: { universeId: UniverseId } ): ApiMethod, PrettifiedUniverseInfoData> => ({ path: `/cloud/v2/universes/${universeId}`, @@ -83,7 +83,7 @@ export const universeInfo = addApiMethod(async ( * @exampleData {"path":"universes/5795192361","createTime":"2024-03-25T10:42:46.360Z","updateTime":"2024-03-25T10:42:46.360Z","displayName":"MightyPart's Place Number: 201","description":"","user":"users/45348281","visibility":"PRIVATE","voiceChatEnabled":false,"ageRating":"AGE_RATING_UNSPECIFIED","desktopEnabled":true,"mobileEnabled":true,"tabletEnabled":true,"consoleEnabled":false,"vrEnabled":true} * @exampleRawBody {"path":"universes/5795192361","createTime":"2024-03-25T10:42:46.360Z","updateTime":"2024-03-25T10:42:46.360Z","displayName":"MightyPart's Place Number: 201","description":"","user":"users/45348281","visibility":"PRIVATE","voiceChatEnabled":false,"ageRating":"AGE_RATING_UNSPECIFIED","desktopEnabled":true,"mobileEnabled":true,"tabletEnabled":true,"consoleEnabled":false,"vrEnabled":true} */ -export const updateUniverse = addApiMethod(async < +export const updateUniverse = createApiMethod(async < UniverseId extends Identifier, DisplayName extends string, Description extends string, Visibility extends UniverseVisibility, VoiceChatEnabled extends boolean, AgeRating extends UniverseAgeRating, DesktopEnabled extends boolean, MobileEnabled extends boolean, TabletEnabled extends boolean, ConsoleEnabled extends boolean, @@ -126,7 +126,7 @@ export const updateUniverse = addApiMethod(async < * @exampleData {} * @exampleRawBody {} */ -export const restartUniverseServers = addApiMethod(async ( +export const restartUniverseServers = createApiMethod(async ( { universeId }: { universeId: UniverseId } ): ApiMethod<{}> => ({ path: `/cloud/v2/universes/${universeId}:restartServers`, @@ -147,7 +147,7 @@ export const restartUniverseServers = addApiMethod(async ( +export const placeInfo = createApiMethod(async ( { universeId, placeId: PlaceId }: { universeId: UniverseId, placeId: PlaceId } ): ApiMethod, PrettifiedPlaceInfoData> => ({ path: `/cloud/v2/universes/${universeId}/places/${PlaceId}`, @@ -178,7 +178,7 @@ export const placeInfo = addApiMethod(async ( @@ -216,7 +216,7 @@ export const updatePlace = addApiMethod(async < * @exampleData 26 * @exampleRawBody { "versionNumber": 26 } */ -export const publishPlace = addApiMethod(async ( +export const publishPlace = createApiMethod(async ( { universeId, placeId, versionType, placeFile }: { universeId: Identifier, placeId: Identifier, diff --git a/src/apis/cloud/groups/groups.ts b/src/apis/cloud/groups/groups.ts index fbfb6fc..e9c88b0 100644 --- a/src/apis/cloud/groups/groups.ts +++ b/src/apis/cloud/groups/groups.ts @@ -13,7 +13,7 @@ import type { GroupMembers_Filter, GroupMembers_WildcardFilter, PrettifiedGroupI // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Users", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "Users", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -49,7 +49,7 @@ const formatGroupMembersFilters = (groupId: Identifier | "-", filter: GroupMembe * @exampleData {"path":"groups/5850082","createTime":"2020-03-29T18:15:20.100Z","updateTime":"2024-05-12T13:17:41.639Z","id":"5850082","displayName":"MightyPart Games","description":"Hello World!","owner":"users/45348281","memberCount":99,"publicEntryAllowed":true,"locked":false,"verified":false} * @exampleRawBody {"path":"groups/5850082","createTime":"2020-03-29T18:15:20.100Z","updateTime":"2024-05-12T13:17:41.639132600Z","id":"5850082","displayName":"MightyPart Games","description":"Hello World!","owner":"users/45348281","memberCount":99,"publicEntryAllowed":true,"locked":false,"verified":false} */ -export const groupInfo = addApiMethod(async ( +export const groupInfo = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod, PrettifiedGroupInfoData> => ({ path: `/v2/groups/${groupId}`, @@ -76,7 +76,7 @@ export const groupInfo = addApiMethod(async ( * @exampleData [{"path":"groups/5850082/memberships/NDUzNDgyODE","createTime":"2020-03-29T18:15:20.020Z","updateTime":"2023-09-15T07:03:50.583Z","user":"users/45348281","role":"groups/5850082/roles/38353811"}] * @exampleRawBody {"groupMemberships":[{"path":"groups/5850082/memberships/NDUzNDgyODE","createTime":"2020-03-29T18:15:20.020Z","updateTime":"2023-09-15T07:03:50.583Z","user":"users/45348281","role":"groups/5850082/roles/38353811"}],"nextPageToken":""} */ -export const groupMembers = addApiMethod(async < +export const groupMembers = createApiMethod(async < GroupId extends Identifier | "-", const Filter extends GroupId extends "-" ? ObjectPrettify : ObjectPrettify, @@ -122,7 +122,7 @@ export const groupMembers = addApiMethod(async < * @exampleData [{"path":"groups/5850082/roles/38353811","createTime":"2020-03-29T13:15:20.020Z","updateTime":"2020-09-20T08:04:35.850Z","id":"38353811","displayName":"NamelessGuy2005 - Scriptor","description":"","rank":255,"memberCount":1,"permissions":{"viewWallPosts":true,"createWallPosts":true,"deleteWallPosts":true,"viewGroupShout":true,"createGroupShout":true,"changeRank":true,"acceptRequests":true,"exileMembers":true,"manageRelationships":true,"viewAuditLog":true,"spendGroupFunds":true,"advertiseGroup":true,"createAvatarItems":true,"manageAvatarItems":true,"manageGroupUniverses":true,"viewUniverseAnalytics":true,"createApiKeys":true,"manageApiKeys":true}}] * @exampleRawBody {"groupRoles":[{"path":"groups/5850082/roles/38353811","createTime":"2020-03-29T13:15:20.020Z","updateTime":"2020-09-20T08:04:35.850Z","id":"38353811","displayName":"NamelessGuy2005 - Scriptor","description":"","rank":255,"memberCount":1,"permissions":{"viewWallPosts":true,"createWallPosts":true,"deleteWallPosts":true,"viewGroupShout":true,"createGroupShout":true,"changeRank":true,"acceptRequests":true,"exileMembers":true,"manageRelationships":true,"viewAuditLog":true,"spendGroupFunds":true,"advertiseGroup":true,"createAvatarItems":true,"manageAvatarItems":true,"manageGroupUniverses":true,"viewUniverseAnalytics":true,"createApiKeys":true,"manageApiKeys":true}}],"nextPageToken":"38353811"} */ -export const groupRoles = addApiMethod(async ( +export const groupRoles = createApiMethod(async ( { groupId, limit, cursor } : { groupId: GroupId, limit?: number, cursor?: string } ): ApiMethod, PrettifiedGroupRolesData> => ({ @@ -152,7 +152,7 @@ export const groupRoles = addApiMethod(async ( * @exampleData {"path":"groups/5850082/shout","createTime":"2020-03-31T18:36:51.607Z","updateTime":"2023-09-17T20:35:48.213Z","content":"Hello World!","poster":"users/45348281"} * @exampleRawBody {"path":"groups/5850082/shout","createTime":"2020-03-31T18:36:51.607Z","updateTime":"2023-09-17T20:35:48.213Z","content":"Hello World!","poster":"users/45348281"} */ -export const groupShout = addApiMethod(async ( +export const groupShout = createApiMethod(async ( { groupId }: { groupId: GroupId } ): ApiMethod, PrettifiedGroupShoutData> => ({ path: `/v2/groups/${groupId}/shout`, @@ -179,7 +179,7 @@ export const groupShout = addApiMethod(async ( * @exampleData [{"path":"groups/5850082/join-requests/2655994471","createTime":"2024-05-12T16:32:46.841Z","user":"users/2655994471"}] * @exampleRawBody {"groupJoinRequests":[{"path":"groups/5850082/join-requests/2655994471","createTime":"2024-05-12T16:32:46.841Z","user":"users/2655994471"}],"nextPageToken":""} */ -export const groupJoinRequests = addApiMethod(async ( +export const groupJoinRequests = createApiMethod(async ( { groupId, limit, filter:{userId:userIdFilter} = {} as any, cursor } : { groupId: GroupId, limit?: number, filter?: { userId: Identifier }, cursor?: string } ): ApiMethod, PrettifiedGroupJoinRequestsData> => ({ @@ -207,7 +207,7 @@ export const groupJoinRequests = addApiMethod(async * @exampleData true * @exampleRawBody {} */ -export const acceptGroupJoinRequest = addApiMethod(async ( +export const acceptGroupJoinRequest = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", @@ -230,7 +230,7 @@ export const acceptGroupJoinRequest = addApiMethod(async ( * @exampleData true * @exampleRawBody {} */ -export const declineGroupJoinRequest = addApiMethod(async ( +export const declineGroupJoinRequest = createApiMethod(async ( { groupId, userId }: { groupId: Identifier, userId: Identifier } ): ApiMethod<{}, boolean> => ({ method: "POST", diff --git a/src/apis/cloud/index.ts b/src/apis/cloud/index.ts index b5f373d..a4bd546 100644 --- a/src/apis/cloud/index.ts +++ b/src/apis/cloud/index.ts @@ -4,8 +4,12 @@ export * as EngineApi from "./engine" export * as ExperiencesApi from "./experiences" export * as GroupsApi from "./groups" export * as InventoryApi from "./inventory" + export * as LegacyBadgesApi from "./legacyBadges" +export * as LegacyDevelopApi from "./legacyDevelop" export * as LegacyFollowingsApi from "./legacyFollowings" +export * as LegacyGroupsApi from "./legacyGroups" + export * as LuauExecutionApi from "./luauExecution" export * as MemoryStoresApi from "./memoryStores" export * as MessagingApi from "./messaging" diff --git a/src/apis/cloud/inventory/inventory.ts b/src/apis/cloud/inventory/inventory.ts index c5fa580..e105638 100644 --- a/src/apis/cloud/inventory/inventory.ts +++ b/src/apis/cloud/inventory/inventory.ts @@ -13,7 +13,7 @@ import type { UnionPrettify } from "typeforge" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Inventory", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "Inventory", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -43,7 +43,7 @@ const formatInventoryItemsForUserFilters = (filter: any) => { * @exampleRawBody { inventoryItems: [ { path: 'users/45348281/inventory-items/R0FNRV9QQVNTX0lEPTEyNTI3', gamePassDetails: { gamePassId: '12527' } } ], nextPageToken: 'djEveyJGaWVsZEluZGV4IjoyLCJWYWx1ZUluZGV4IjowLCJDdXJzb3IiOiIxMjUyNyIsIkZpbHRlckhhc2giOiJrV3Y2VFQ0ZW1FOGgzT1RQL1hjOXFkdGIwR0JiWjNySkRMU3FTSmV5TUVJPSJ9' } */ -export const inventoryItemsForUser = addApiMethod(async ( +export const inventoryItemsForUser = createApiMethod(async ( { userId, limit, filter, cursor }: { userId: Identifier, limit?: number, filter?: UnionPrettify, cursor?: string } ): ApiMethod => ({ path: `/v2/users/${userId}/inventory-items`, diff --git a/src/apis/cloud/legacyBadges/legacyBadges.ts b/src/apis/cloud/legacyBadges/legacyBadges.ts index aa855be..8b0a686 100644 --- a/src/apis/cloud/legacyBadges/legacyBadges.ts +++ b/src/apis/cloud/legacyBadges/legacyBadges.ts @@ -1,22 +1,11 @@ // [ Modules ] /////////////////////////////////////////////////////////////////// import { createApiGroup } from "../../apiGroup" -import { dataIsSuccess } from "../../../utils/utils" -////////////////////////////////////////////////////////////////////////////////// - - -// [ Types ] ///////////////////////////////////////////////////////////////////// -import type { Identifier } from "typeforge" - -import type { ApiMethod } from "../../apiGroup" +import { ClassicBadgesApi } from "../../classic" ////////////////////////////////////////////////////////////////////////////////// // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "LegacyBadges", baseUrl: "https://apis.roblox.com/legacy-badges" }) -////////////////////////////////////////////////////////////////////////////////// - - -// [ Private Functions ] ///////////////////////////////////////////////////////// +const { addExistingApiMethod } = createApiGroup({ name: "LegacyBadges", baseUrl: "https://apis.roblox.com/legacy-badges" }) ////////////////////////////////////////////////////////////////////////////////// @@ -34,14 +23,5 @@ const addApiMethod = createApiGroup({ name: "LegacyBadges", baseUrl: "https://ap * @exampleData true * @exampleRawBody {} */ -export const updateBadge = addApiMethod(async ( - { badgeId, name, description, enabled }: { badgeId: Identifier, name?: string, description?: string, enabled?: boolean } -): ApiMethod<{}, boolean> => ({ - method: "PATCH", - path: `/v1/badges/${badgeId}`, - name: `updateBadge`, - body: { name, description, enabled }, - - formatRawDataFn: rawData => dataIsSuccess(rawData) -})) +export const updateBadge = addExistingApiMethod(ClassicBadgesApi.updateBadge) ////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/apis/cloud/legacyDevelop/index.ts b/src/apis/cloud/legacyDevelop/index.ts new file mode 100644 index 0000000..6cb8c6b --- /dev/null +++ b/src/apis/cloud/legacyDevelop/index.ts @@ -0,0 +1 @@ +export * from "./legacyDevelop" \ No newline at end of file diff --git a/src/apis/cloud/legacyDevelop/legacyDevelop.ts b/src/apis/cloud/legacyDevelop/legacyDevelop.ts new file mode 100644 index 0000000..d3f972b --- /dev/null +++ b/src/apis/cloud/legacyDevelop/legacyDevelop.ts @@ -0,0 +1,99 @@ +// [ Modules ] /////////////////////////////////////////////////////////////////// +import { createApiGroup } from "../../apiGroup" +import { ClassicDevelopApi } from "../../classic" +////////////////////////////////////////////////////////////////////////////////// + + +// [ Variables ] ///////////////////////////////////////////////////////////////// +const { addExistingApiMethod } = createApiGroup({ name: "LegacyDevelop", baseUrl: "https://apis.roblox.com/legacy-develop" }) +////////////////////////////////////////////////////////////////////////////////// + + +// [ Team Create ] /////////////////////////////////////////////////////////////// +/** + * Updates team create settings for a universe. + * @endpoint PATCH /v1/universes/{universeId}/teamcreate + * + * @param universeId The ID of the universe to update team create settings for. + * @param isEnabled If team create should be enabled. + * + * @example const { data:success } = await LegacyDevelopApi.setTeamCreateSettingsForUniverse({ universeId: 6069031486, isEnabled: false }) + * @exampleData true + * @exampleRawBody {} + */ +export const setTeamCreateSettingsForUniverse = addExistingApiMethod(ClassicDevelopApi.setTeamCreateSettingsForUniverse) + + +/** + * Gets team create settings for a universe. + * @endpoint GET /v1/universes/{universeId}/teamcreate + * + * @param universeId The ID of the universe to get team create settings for. + * + * @example const { data:settings } = await LegacyDevelopApi.teamCreateSettingsForUniverse({ universeId: 6069031486 }) + * @exampleData {"isEnabled":true} + * @exampleRawBody {"isEnabled":true} + */ +export const teamCreateSettingsForUniverse = addExistingApiMethod(ClassicDevelopApi.teamCreateSettingsForUniverse) + + +/** + * Gets team create settings for many universes. + * @endpoint GET /v1/universes/multiget/teamcreate + * + * @param universeIds The ID of the universe to get team create settings for. + * + * @example const { data:settings } = await LegacyDevelopApi.teamCreateSettingsForUniverses({ universeIds: [ 6069031486 ] }) + * @exampleData {"6069031486":{"isEnabled":false}} + * @exampleRawBody {"data":[{"id":6069031486,"isEnabled":false}]} + */ +export const teamCreateSettingsForUniverses = addExistingApiMethod(ClassicDevelopApi.teamCreateSettingsForUniverses) + + +/** + * Removes a users team create access. + * @endpoint DELETE /v1/universes/{universeId}/teamcreate/memberships + * + * @param universeId The ID of the universe to remove the users team create access from. + * @param userId The ID of the user to remove team create access from. + * + * @example const { data:success } = await LegacyDevelopApi.teamCreateRemoveUsersAccessForUniverse({ universeId: 6069031486, userId: 45348281 }) + * @exampleData true + * @exampleRawBody {} + */ +export const teamCreateRemoveUsersAccessForUniverse = addExistingApiMethod(ClassicDevelopApi.teamCreateRemoveUsersAccessForUniverse) + + +/** + * List of users in the active Team Create session. + * @endpoint GET /v1/places/{placeId}/teamcreate/active_session/members + * + * @param placeId The ID of the place to get active team create members from. + * @param limit The number of results per request. + * @param cursor The paging cursor for the previous or next page. + * + * @example const { data:activeMembers } = await LegacyDevelopApi.teamCreateActiveMembers({ placeId: 17718644108 }) + * @exampleData [{"id":45348281,"name":"MightyPart","displayName":"Mighty"}] + * @exampleRawBody {"previousPageCursor":null,"nextPageCursor":null,"data":[{"id":45348281,"name":"MightyPart","displayName":"Mighty"}]} + */ +export const teamCreateActiveMembers = addExistingApiMethod(ClassicDevelopApi.teamCreateActiveMembers) +////////////////////////////////////////////////////////////////////////////////// + + +// [ Team Test V2 ] ////////////////////////////////////////////////////////////// +/** + * Close a game instance that is being used for team testing. + * @endpoint DELETE /v2/teamtest/{placeId} + * + * @param placeId The ID of the place to close team test session for. + * @param jobId The ID of the game instance to close. + * + * @example + * const { data:success } = await LegacyDevelopApi.closeTeamTestSession({ + placeId: 16349154726, jobId: "0e6f3d93-a4aa-44ab-b3b7-9169ddc1d9a1" + }) + * @exampleData true + * @exampleRawBody {} + */ +export const closeTeamTestSession = addExistingApiMethod(ClassicDevelopApi.closeTeamTestSession) +////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/apis/cloud/legacyFollowings/legacyFollowings.ts b/src/apis/cloud/legacyFollowings/legacyFollowings.ts index b3022b6..b00d82f 100644 --- a/src/apis/cloud/legacyFollowings/legacyFollowings.ts +++ b/src/apis/cloud/legacyFollowings/legacyFollowings.ts @@ -13,7 +13,7 @@ import type { PrettifiedUniverseFollowingStatusForUserData, RawUniverseFollowing // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "LegacyFollowings", baseUrl: "https://apis.roblox.com/legacy-followings" }) +const { createApiMethod } = createApiGroup({ name: "LegacyFollowings", baseUrl: "https://apis.roblox.com/legacy-followings" }) ////////////////////////////////////////////////////////////////////////////////// @@ -32,7 +32,7 @@ const addApiMethod = createApiGroup({ name: "LegacyFollowings", baseUrl: "https: * @exampleData [1040909955,1055503474,1127443799,1165192137,1200754375,1236793313,1272809249,1291219836,1325075446,1333987814,1455656959,1459495916,1475796875,1566033,1619449303,1638574655,1642810480,1652474931,1658520392,1684207825,1685831367,1756953036,1778285344,245662005,2471084,37146255,3837270861,38625144,4459945221,4571818074,478688139,495693931,498490399,518243913,5693752693,602133888,6102030522,6211067578,777854650,878103525,88070565,904999465,953412571,99361251] * @exampleRawBody [{"universeId":1040909955,"userId":45348281},{"universeId":1055503474,"userId":45348281},{"universeId":1127443799,"userId":45348281},{"universeId":1165192137,"userId":45348281},{"universeId":1200754375,"userId":45348281},{"universeId":1236793313,"userId":45348281},{"universeId":1272809249,"userId":45348281},{"universeId":1291219836,"userId":45348281},{"universeId":1325075446,"userId":45348281},{"universeId":1333987814,"userId":45348281},{"universeId":1455656959,"userId":45348281},{"universeId":1459495916,"userId":45348281},{"universeId":1475796875,"userId":45348281},{"universeId":1566033,"userId":45348281},{"universeId":1619449303,"userId":45348281},{"universeId":1638574655,"userId":45348281},{"universeId":1642810480,"userId":45348281},{"universeId":1652474931,"userId":45348281},{"universeId":1658520392,"userId":45348281},{"universeId":1684207825,"userId":45348281},{"universeId":1685831367,"userId":45348281},{"universeId":1756953036,"userId":45348281},{"universeId":1778285344,"userId":45348281},{"universeId":245662005,"userId":45348281},{"universeId":2471084,"userId":45348281},{"universeId":37146255,"userId":45348281},{"universeId":3837270861,"userId":45348281},{"universeId":38625144,"userId":45348281},{"universeId":4459945221,"userId":45348281},{"universeId":4571818074,"userId":45348281},{"universeId":478688139,"userId":45348281},{"universeId":495693931,"userId":45348281},{"universeId":498490399,"userId":45348281},{"universeId":518243913,"userId":45348281},{"universeId":5693752693,"userId":45348281},{"universeId":602133888,"userId":45348281},{"universeId":6102030522,"userId":45348281},{"universeId":6211067578,"userId":45348281},{"universeId":777854650,"userId":45348281},{"universeId":878103525,"userId":45348281},{"universeId":88070565,"userId":45348281},{"universeId":904999465,"userId":45348281},{"universeId":953412571,"userId":45348281},{"universeId":99361251,"userId":45348281}] */ -export const universeFollowingsForUser = addApiMethod(async ( +export const universeFollowingsForUser = createApiMethod(async ( { userId }: { userId: Identifier } ): ApiMethod, Identifier[]> => ({ method: "GET", @@ -54,7 +54,7 @@ export const universeFollowingsForUser = addApiMethod(async ( +export const universeFollowingStatusForUser = createApiMethod(async ( { universeId, userId }: { universeId: UniverseId, userId: UserId } ): ApiMethod, PrettifiedUniverseFollowingStatusForUserData> => ({ method: "GET", @@ -76,7 +76,7 @@ export const universeFollowingStatusForUser = addApiMethod(async ( +export const authedUserUnfollowUniverse = createApiMethod(async ( { universeId, userId }: { universeId: UniverseId, userId: UserId } ): ApiMethod<{ universeId: UniverseId, userId: UserId }> => ({ method: "DELETE", @@ -96,7 +96,7 @@ export const authedUserUnfollowUniverse = addApiMethod(async ( +export const authedUserFollowUniverse = createApiMethod(async ( { universeId, userId }: { universeId: UniverseId, userId: UserId } ): ApiMethod<{ universeId: UniverseId, userId: UserId }> => ({ method: "POST", diff --git a/src/apis/cloud/legacyGroups/index.ts b/src/apis/cloud/legacyGroups/index.ts new file mode 100644 index 0000000..a7a758f --- /dev/null +++ b/src/apis/cloud/legacyGroups/index.ts @@ -0,0 +1 @@ +export * from "./legacyGroups" \ No newline at end of file diff --git a/src/apis/cloud/legacyGroups/legacyGroups.ts b/src/apis/cloud/legacyGroups/legacyGroups.ts new file mode 100644 index 0000000..c0ec553 --- /dev/null +++ b/src/apis/cloud/legacyGroups/legacyGroups.ts @@ -0,0 +1,114 @@ +// [ Modules ] /////////////////////////////////////////////////////////////////// +import { createApiGroup } from "../../apiGroup" +import { ClassicGroupsApi } from "../../classic" +////////////////////////////////////////////////////////////////////////////////// + + +// [ Variables ] ///////////////////////////////////////////////////////////////// +const { addExistingApiMethod } = createApiGroup({ name: "LegacyGroups", baseUrl: "https://apis.roblox.com/legacy-groups" }) +////////////////////////////////////////////////////////////////////////////////// + + +// [ Groups ] ///////////////////////////////////////////////////////////////////// +/** + * Gets audit log entries for a group. + * @category Groups + * @endpoint GET /v1/groups/{groupId}/audit-log + * + * @param groupId The id of the group. + * @param actionType The action to filter the audit logs by. (no filter will be applied if actionType is undefined). + * @param userId Filter for specific user by their id. + * @param limit The number of results to be returned. + * @param sortOrder The order that the results are sorted in. + * @param cursor The paging cursor for the previous or next page. + * + * @example const { data:auditLog } = await LegacyGroupsApi.groupAuditLogs({ groupId: 5850082 }) + * @exampleData { previousPageCursor: null, nextPageCursor: null, data: [ { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 6333562, TargetGroupName: "Mine Ways Talk Show" }, created: "2020-05-18T12:06:34Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 5257567, TargetGroupName: "The X1 Team" }, created: "2020-05-13T13:52:57Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "Accept Ally Request", description: { TargetGroupId: 5894486, TargetGroupName: "Sky-Blox Studio" }, created: "2020-05-13T13:52:56Z" } ] } + * @exampleRawBody [ { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 6333562, targetGroupName: "Mine Ways Talk Show" }, created: "2020-05-18T12:06:34Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 5257567, targetGroupName: "The X1 Team" }, created: "2020-05-13T13:52:57Z" }, { actor: { user: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, role: { id: 38353811, name: "NamelessGuy2005 - Scriptor", rank: 255 } }, actionType: "AcceptAllyRequest", description: { targetGroupId: 5894486, targetGroupName: "Sky-Blox Studio" }, created: "2020-05-13T13:52:56Z" } ] + */ +export const groupAuditLogs = addExistingApiMethod(ClassicGroupsApi.groupAuditLogs) + + +/** + * Gets group policy info used for compliance. + * @category Groups + * @endpoint GET /v1/groups/policies + * @tags [ "Cookie" ] + * + * @param groupIds the ids of groups to get policy info for. + * + * @example const { data:policyInfo } = await LegacyGroupsApi.groupsPolicyInfo({ groupIds: [ 5850082 ] }) + * @exampleData { "5850082": { canViewGroup: true } } + * @exampleRawBody { groups: [ { canViewGroup: true, groupId: 5850082 } ] } + */ +export const groupsPolicyInfo = addExistingApiMethod(ClassicGroupsApi.groupsPolicyInfo) + + +/** + * Gets settings for a group. + * @category Groups + * @endpoint GET /v1/groups/{groupId}/settings + * @tags [ "Cookie" ] + * + * @param groupId The id of the group to get settings for. + * + * @example const { data:settings } = await LegacyGroupsApi.groupSettings({ groupId: 5850082 }) + * @exampleData { isApprovalRequired: true, isBuildersClubRequired: false, areEnemiesAllowed: true, areGroupFundsVisible: false, areGroupGamesVisible: true, isGroupNameChangeEnabled: true } + * @exampleRawBody { isApprovalRequired: true, isBuildersClubRequired: false, areEnemiesAllowed: true, areGroupFundsVisible: false, areGroupGamesVisible: true, isGroupNameChangeEnabled: true } + */ +export const groupSettings = addExistingApiMethod(ClassicGroupsApi.groupSettings) + + +/** + * Sets settings for a group. + * @category Groups + * @endpoint PATCH /v1/groups/{groupId}/settings + * @tags [ "Cookie" ] + * + * @param groupId The id of the group. + * @param newSettings The new settings for the group. + * + * @example const { data:success } = await LegacyGroupsApi.setGroupSettings({ groupId: 5850082, newSettings: { + isApprovalRequired: true, + isBuildersClubRequired: false, + areEnemiesAllowed: true, + areGroupFundsVisible: false, + areGroupGamesVisible: true, isGroupNameChangeEnabled: true + }}) + * @exampleData boolean + * @exampleRawBody {} + */ +export const setGroupSettings = addExistingApiMethod(ClassicGroupsApi.setGroupSettings) + + +/** + * Sets group shout (status). + * @category Groups + * @endpoint PATCH /v1/groups/{groupId}/status + * @tags [ "Cookie" ] + * + * @param groupId The id of the group to set the shout for. + * @param message The content of the new shout. + * + * @example const { data:newShout } = await LegacyGroupsApi.setGroupShout({ groupId: 5850082, newShout: "Hello World!" }) + * @exampleData { body: "Hello World!", poster: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, created: 2020-03-31T18:36:51.607Z, updated: 2023-09-15T16:21:00.272Z } + * @exampleRawBody { body: "Hello World!", poster: { hasVerifiedBadge: false, userId: 45348281, username: "MightyPart", displayName: "MightyPart" }, created: "2020-03-31T18:36:51.607Z", updated: "2023-09-15T16:21:00.272Z" } + */ +export const setGroupShout = addExistingApiMethod(ClassicGroupsApi.setGroupShout) + + +/** + * Sets group description. + * @category Groups + * @endpoint PATCH /v1/groups/{groupId}/description + * @tags [ "Cookie" ] + * + * @param groupId The id of the group to set the description for. + * @param newDescription The content of the new description. + * + * @example const { data:newDescription } = await LegacyGroupsApi.setGroupDescription({ groupId: 5850082, newDescription: "Hello World!" }) + * @exampleData "Hello World!" + * @exampleRawBody { newDescription: "Hello World!" } + */ +export const setGroupDescription = addExistingApiMethod(ClassicGroupsApi.setGroupDescription) +////////////////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/apis/cloud/luauExecution/luauExecution.ts b/src/apis/cloud/luauExecution/luauExecution.ts index f9f2b6c..8134e1a 100644 --- a/src/apis/cloud/luauExecution/luauExecution.ts +++ b/src/apis/cloud/luauExecution/luauExecution.ts @@ -14,7 +14,7 @@ import { cloneAndMutateObject } from "../../../utils/utils" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "LuauExecution", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "LuauExecution", baseUrl: "https://apis.roblox.com/cloud" }) const executedLuauPathRegex = /universes\/([0-9]+)\/places\/([0-9]+)\/versions\/([0-9]+)\/luau-execution-sessions\/([^/]+)\/tasks\/([^/]+)/ ////////////////////////////////////////////////////////////////////////////////// @@ -69,7 +69,7 @@ const addPathItemsToExecutedLuauResponse = < * @exampleData {"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d","user":"45348281","state":"PROCESSING","script":"local x, y = 3, 4; return x + y","universeId":"5795192361","placeId":"16866553538","version":26,"sessionId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d","taskId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d"} * @exampleRawBody {"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d","user":"45348281","state":"PROCESSING","script":"local x, y = 3, 4; return x + y"} */ -export const executeLuau = addApiMethod(async < +export const executeLuau = createApiMethod(async < UniverseId extends Identifier, PlaceId extends Identifier, Version extends number | undefined = undefined >( { universeId, placeId, version, script }: @@ -118,7 +118,7 @@ export const executeLuau = addApiMethod(async < * @exampleData {"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d","createTime":"2024-10-01T02:31:46.304Z","updateTime":"2024-10-01T02:31:49.959Z","user":"45348281","state":"COMPLETE","script":"","output":{"results":[7]},"universeId":"5795192361","placeId":"16866553538","version":26,"sessionId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d","taskId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d"} * @exampleRawBody {"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d","createTime":"2024-10-01T02:31:46.304Z","updateTime":"2024-10-01T02:31:49.959Z","user":"45348281","state":"COMPLETE","script":"","output":{"results":[7]}} */ -export const luauExecutionTask = addApiMethod(async ( +export const luauExecutionTask = createApiMethod(async ( { universeId, placeId, version, sessionId, taskId, view }: { universeId: Identifier, placeId: Identifier, version?: number, sessionId: string, taskId: string, view?: "BASIC" | "FULL" } ): ApiMethod, FormattedLuauExecutionTaskData> => ({ @@ -159,7 +159,7 @@ export const luauExecutionTask = addApiMethod(async ( * @exampleData [{"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/logs/1","messages":[],"universeId":"5795192361","placeId":"16866553538","version":26,"sessionId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d","taskId":"67823af7-1f99-4fc5-b3bb-da7ab3456b5d"}] * @exampleRawBody {"luauExecutionSessionTaskLogs":[{"path":"universes/5795192361/places/16866553538/versions/26/luau-execution-sessions/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/tasks/67823af7-1f99-4fc5-b3bb-da7ab3456b5d/logs/1","messages":[]}],"nextPageToken":""} */ -export const listLuauExecutionLogs = addApiMethod(async < +export const listLuauExecutionLogs = createApiMethod(async < UniverseId extends Identifier, PlaceId extends Identifier, SessionId extends string, TaskId extends string, Version extends number | undefined = undefined >( diff --git a/src/apis/cloud/memoryStores/memoryStores.ts b/src/apis/cloud/memoryStores/memoryStores.ts index c02f778..4663543 100644 --- a/src/apis/cloud/memoryStores/memoryStores.ts +++ b/src/apis/cloud/memoryStores/memoryStores.ts @@ -13,7 +13,7 @@ import type { CreateSortedMapItem_ConstructItemConfig, EnqueueItem_ConstructItem // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "MemoryStore", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "MemoryStore", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -31,7 +31,7 @@ const addApiMethod = createApiGroup({ name: "MemoryStore", baseUrl: "https://api * @exampleData {"path":"cloud/v2/universes/5243626809/memory-stores/sorted-maps/MySortedMap/items/Testing123","value":{"isReal":true},"etag":"12","expireTime":"2024-04-18T01:44:49.000Z","id":"Testing123","numericSortKey":1} * @exampleRawBody {"path":"cloud/v2/universes/5243626809/memory-stores/sorted-maps/MySortedMap/items/Testing123","value":{"isReal":true},"etag":"12","expireTime":"2024-04-18T01:44:49Z","id":"Testing123","numericSortKey":1} */ -export const sortedMapItem = addApiMethod(async ( +export const sortedMapItem = createApiMethod(async ( { universeId, sortedMap, itemId }: { universeId: Identifier, sortedMap: string, itemId: string } ): ApiMethod, PrettifiedSortedMapItemData> => ({ path: `/v2/universes/${universeId}/memory-store/sorted-maps/${sortedMap}/items/${itemId}`, @@ -56,7 +56,7 @@ export const sortedMapItem = addApiMethod(async ( * @exampleData [{"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items/Testing123","value":{"isReal":true},"etag":"24","expireTime":"2024-04-18T04:31:14.000Z","id":"Testing123","numericSortKey":1}] * @exampleRawBody {"items":[{"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items/Testing123","value":{"isReal":true},"etag":"24","expireTime":"2024-04-18T04:31:14Z","id":"Testing123","numericSortKey":1}],"nextPageToken":"S_USLzRFVMU73i67jNK349FgCtYxw4Wl18ziPHeFRZoACgBUZXN0aW5nMTIzCQAAv_AAAAAAAAA"} */ -export const listSortedMapItems = addApiMethod(async ( +export const listSortedMapItems = createApiMethod(async ( { universeId, sortedMap, maxPageSize, orderBy, filter, cursor }: { universeId: Identifier, sortedMap: string, maxPageSize?: number, orderBy?: "asc" | "desc", filter?: string, cursor?: string } ): ApiMethod => ({ @@ -89,7 +89,7 @@ export const listSortedMapItems = addApiMethod(async ( * @exampleData {"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items","value":{"isReal":true},"etag":"10","expireTime":"2024-04-18T00:30:14.000Z","id":"Testing123","numericSortKey":1} * @exampleRawBody {"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items","value":{"isReal":true},"etag":"10","expireTime":"2024-04-18T00:30:14Z","id":"Testing123","numericSortKey":1} */ -export const createSortedMapItem = addApiMethod(async ( +export const createSortedMapItem = createApiMethod(async ( { universeId, sortedMap, item }: { universeId: Identifier, sortedMap: string, item: CreateSortedMapItem_ConstructItemConfig } ): ApiMethod, PrettifiedSortedMapItemData> => ({ path: `/v2/universes/${universeId}/memory-store/sorted-maps/${sortedMap}/items`, @@ -120,7 +120,7 @@ export const createSortedMapItem = addApiMethod(async ( * @exampleData {"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items/","value":{"isReal":false},"etag":"20","expireTime":"2024-04-18T03:48:53.000Z","numericSortKey":null} * @exampleRawBody {"path":"cloud/v2/universes/5243626809/memory-store/sorted-maps/MySortedMap/items/","value":{"isReal":false},"etag":"20","expireTime":"2024-04-18T03:48:53Z","numericSortKey":null} */ -export const updateSortedMapItem = addApiMethod(async ( +export const updateSortedMapItem = createApiMethod(async ( { universeId, sortedMap, itemId, updatedItemData, allowMissing }: { universeId: Identifier, sortedMap: string, itemId: string, updatedItemData: UpdateSortedMapItem_ConstructItemConfig, allowMissing?: boolean } ): ApiMethod, PrettifiedUpdateSortedMapItem> => ({ @@ -149,7 +149,7 @@ export const updateSortedMapItem = addApiMethod(async ( * @exampleData "" * @exampleRawBody "" */ -export const deleteSortedMapItem = addApiMethod(async ( +export const deleteSortedMapItem = createApiMethod(async ( { universeId, sortedMap, itemId, etag }: { universeId: Identifier, sortedMap: string, itemId: string, etag?: string } ): ApiMethod<""> => ({ @@ -176,7 +176,7 @@ export const deleteSortedMapItem = addApiMethod(async ( * @exampleData {"path":"cloud/v2/universes/5243626809/memory-store/queues/MyQueue/items/7fffffffffffffff0000000000000003","data":{"name":"MyItem","value":"fooBar"},"priority":0,"expireTime":2024-06-04T08:10:33.000Z} * @exampleRawBody {"path":"cloud/v2/universes/5243626809/memory-store/queues/MyQueue/items/7fffffffffffffff0000000000000003","data":{"name":"MyItem","value":"fooBar"},"priority":0,"expireTime":"2024-06-04T08:10:33Z"} */ -export const enqueueItem = addApiMethod(async ( +export const enqueueItem = createApiMethod(async ( { universeId, queue, item }: { universeId: Identifier, queue: string, item: EnqueueItem_ConstructItemConfig } ): ApiMethod, PrettifiedEnqueueItemData> => ({ @@ -209,7 +209,7 @@ export const enqueueItem = addApiMethod(async ( * @exampleData {"items":[{"name":"Testing123","value":{"isReal":true}},{"name":"Testing1234","value":{"isReal":true}}],"id":"48e44da3c8754a4ab7ed728d07ac9526"} * @exampleRawBody {"data":[{"name":"Testing123","value":{"isReal":true}},{"name":"Testing1234","value":{"isReal":true}}],"id":"5cfc27af46da4cf08b41aa9a3d78a75e"} */ -export const readQueueItems = addApiMethod(async ( +export const readQueueItems = createApiMethod(async ( { universeId, queue, limit, allOrNothing, invisibilityTimeoutSeconds }: { universeId: Identifier, queue: string, limit?: number, allOrNothing?: boolean, invisibilityTimeoutSeconds?: number } ): ApiMethod, PrettifiedReadQueueItemsData> => ({ @@ -235,7 +235,7 @@ export const readQueueItems = addApiMethod(async ( * @exampleData "" * @exampleRawBody "" */ -export const dequeueItems = addApiMethod(async ( +export const dequeueItems = createApiMethod(async ( { universeId, queue, readId }: { universeId: Identifier, queue: string, readId: string } ): ApiMethod<""> => ({ @@ -255,7 +255,7 @@ export const dequeueItems = addApiMethod(async ( * @exampleData {"path":"cloud/v2/universes/5243626809/operations/AAUAAAAAAADRMx55T0AKRxSgFCrSusMzqOKQNyVaQz8eMi9t-dwQwQ","done":false,"id":"AAUAAAAAAADRMx55T0AKRxSgFCrSusMzqOKQNyVaQz8eMi9t-dwQwQ"} * @exampleRawBody {"path":"cloud/v2/universes/5243626809/operations/AAUAAAAAAADRMx55T0AKRxSgFCrSusMzqOKQNyVaQz8eMi9t-dwQwQ","done":null} */ -export const flushAllQueues = addApiMethod(async ( +export const flushAllQueues = createApiMethod(async ( { universeId }: { universeId: UniverseId } ): ApiMethod, PrettifiedFlushAllQueuesData> => ({ path: `/v2/universes/${universeId}/memory-store:flush`, diff --git a/src/apis/cloud/messaging/messaging.ts b/src/apis/cloud/messaging/messaging.ts index b00d2e9..26e1bb9 100644 --- a/src/apis/cloud/messaging/messaging.ts +++ b/src/apis/cloud/messaging/messaging.ts @@ -11,7 +11,7 @@ import type { ApiMethod } from "../../apiGroup" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Messaging", baseUrl: "https://apis.roblox.com/messaging-service" }) +const { createApiMethod } = createApiGroup({ name: "Messaging", baseUrl: "https://apis.roblox.com/messaging-service" }) ////////////////////////////////////////////////////////////////////////////////// @@ -44,7 +44,7 @@ const addApiMethod = createApiGroup({ name: "Messaging", baseUrl: "https://apis. * @exampleData true * @exampleRawBody "" */ -export const publishMessage = addApiMethod(async >( +export const publishMessage = createApiMethod(async >( { universeId, topic, message }: { universeId: Identifier, topic: string, message: Message } ): ApiMethod<"", true> => ({ path: `/v1/universes/${universeId}/topics/${topic}`, diff --git a/src/apis/cloud/oauth/oauth.ts b/src/apis/cloud/oauth/oauth.ts index 883c165..d8f8339 100644 --- a/src/apis/cloud/oauth/oauth.ts +++ b/src/apis/cloud/oauth/oauth.ts @@ -8,11 +8,12 @@ import type { Identifier } from "typeforge" import type { ApiMethod } from "../../apiGroup" import type { UserInfoData } from "./oauth.types" +import { ClassicGroupsApi } from "../../classic" ////////////////////////////////////////////////////////////////////////////////// // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "OAuth", baseUrl: "https://apis.roblox.com/oauth" }) +const { createApiMethod } = createApiGroup({ name: "OAuth", baseUrl: "https://apis.roblox.com/oauth" }) ////////////////////////////////////////////////////////////////////////////////// @@ -28,9 +29,9 @@ const addApiMethod = createApiGroup({ name: "OAuth", baseUrl: "https://apis.robl * @exampleData {"sub":"45348281","name":"Mighty","nickname":"Mighty","preferred_username":"MightyPart","created_at":1373701800,"profile":"https://www.roblox.com/users/45348281/profile","picture":"https://tr.rbxcdn.com/30DAY-AvatarHeadshot-11BD4BBC67E3F95A4F4BED256CFB4591-Png/150/150/AvatarHeadshot/Png/noFilter"} * @exampleRawBody {"sub":"45348281","name":"Mighty","nickname":"Mighty","preferred_username":"MightyPart","created_at":1373701800,"profile":"https://www.roblox.com/users/45348281/profile","picture":"https://tr.rbxcdn.com/30DAY-AvatarHeadshot-11BD4BBC67E3F95A4F4BED256CFB4591-Png/150/150/AvatarHeadshot/Png/noFilter"} */ -export const userInfo = addApiMethod(async ( +export const userInfo = createApiMethod(async ( ): ApiMethod => ({ method: "GET", path: `/v1/userinfo`, name: `userInfo`, -})) +})) \ No newline at end of file diff --git a/src/apis/cloud/orderedDataStores_V1/orderedDataStores_V1.ts b/src/apis/cloud/orderedDataStores_V1/orderedDataStores_V1.ts index ce950ac..74d7f38 100644 --- a/src/apis/cloud/orderedDataStores_V1/orderedDataStores_V1.ts +++ b/src/apis/cloud/orderedDataStores_V1/orderedDataStores_V1.ts @@ -13,7 +13,7 @@ import type { OrderedDatastoreEntry, PrettifiedListOrderedDatastoreEntriesData, // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "OrderedDatastores_V1", baseUrl: "https://apis.roblox.com/ordered-data-stores" }) +const { createApiMethod } = createApiGroup({ name: "OrderedDatastores_V1", baseUrl: "https://apis.roblox.com/ordered-data-stores" }) ////////////////////////////////////////////////////////////////////////////////// @@ -38,7 +38,7 @@ const addApiMethod = createApiGroup({ name: "OrderedDatastores_V1", baseUrl: "ht * @exampleData [ { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 54, id: "45348281" } ] * @exampleRawBody { entries: [ { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 54, id: "45348281" } ], nextPageToken: "" } */ -export const listOrderedDatastoreEntries = addApiMethod(async ( +export const listOrderedDatastoreEntries = createApiMethod(async ( { universeId, orderedDataStore, scope, maxPageSize, orderBy, filter, cursor }: { universeId: UniverseId, orderedDataStore: OrderedDataStore, scope: Scope, @@ -79,7 +79,7 @@ export const listOrderedDatastoreEntries = addApiMethod(async ( { universeId, orderedDataStore, scope, id, value }: @@ -111,7 +111,7 @@ export const createOrderedDatastoreEntry = addApiMethod(async < * @exampleData { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 54, id: "45348281" } * @exampleRawBody { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 54, id: "45348281" } */ -export const orderedDatastoreEntry = addApiMethod(async < +export const orderedDatastoreEntry = createApiMethod(async < UniverseId extends Identifier, OrderedDataStore extends string, Scope extends string, Id extends string >( { universeId, orderedDataStore, scope, id }: @@ -141,7 +141,7 @@ export const orderedDatastoreEntry = addApiMethod(async < * @exampleData true * @exampleRawBody {} */ -export const deleteOrderedDatastoreEntry = addApiMethod(async ( +export const deleteOrderedDatastoreEntry = createApiMethod(async ( { universeId, orderedDataStore, scope, id }: { universeId: Identifier, orderedDataStore: string, scope: string, id: string } ): ApiMethod<{}, boolean> => ({ @@ -174,7 +174,7 @@ export const deleteOrderedDatastoreEntry = addApiMethod(async ( * @exampleData { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 58, id: "45348281" } * @exampleRawBody { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 58, id: "45348281" } */ -export const updateOrderedDatastoreEntry = addApiMethod(async < +export const updateOrderedDatastoreEntry = createApiMethod(async < UniverseId extends Identifier, OrderedDataStore extends string, Scope extends string, Id extends string, Value extends Identifier >( { universeId, orderedDataStore, scope, id, newValue, createIfNoEntryExists }: @@ -209,7 +209,7 @@ export const updateOrderedDatastoreEntry = addApiMethod(async < * @exampleData { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 66, id: "45348281" } * @exampleRawBody { path: "universes/5097539509/orderedDataStores/PointsStore/scopes/global/entries/45348281", value: 66, id: "45348281" } */ - export const incrementOrderedDatastoreEntry = addApiMethod(async < + export const incrementOrderedDatastoreEntry = createApiMethod(async < UniverseId extends Identifier, OrderedDataStore extends string, Scope extends string, Id extends string >( { universeId, orderedDataStore, scope, id, incrementBy, createIfNoEntryExists }: diff --git a/src/apis/cloud/orderedDataStores_V2/orderedDataStores_V2.ts b/src/apis/cloud/orderedDataStores_V2/orderedDataStores_V2.ts index 117ed51..25e481c 100644 --- a/src/apis/cloud/orderedDataStores_V2/orderedDataStores_V2.ts +++ b/src/apis/cloud/orderedDataStores_V2/orderedDataStores_V2.ts @@ -14,7 +14,7 @@ import type { SortOrder } from "../../../utils/utils.types" // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "OrderedDatastores_V2", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "OrderedDatastores_V2", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -49,7 +49,7 @@ const formatEntryFilter = (lessThanOrEq?: number, moreThanOrEq?: number) => { * @exampleData [{"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":78,"id":"45348281"}] * @exampleRawBody {"orderedDataStoreEntries":[{"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":78,"id":"45348281"}]} */ -export const listOrderedDatastoreEntries = addApiMethod(async ( +export const listOrderedDatastoreEntries = createApiMethod(async ( { universeId, dataStoreId, scope, sortOrder, lessThanOrEq, moreThanOrEq, limit, cursor }: { universeId: UniverseId, dataStoreId: DataStoreId, scope: Scope, @@ -89,7 +89,7 @@ export const listOrderedDatastoreEntries = addApiMethod(async ( {universeId, dataStoreId, scope, entryId, entryValue }: @@ -121,7 +121,7 @@ export const createOrderedDataStoreEntry = addApiMethod(async < * @exampleData {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":78,"id":"45348281"} * @exampleRawBody {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":78,"id":"45348281"} */ -export const orderedDataStoreEntry = addApiMethod(async < +export const orderedDataStoreEntry = createApiMethod(async < UniverseId extends Identifier, DataStoreId extends string, Scope extends string, EntryId extends string >( {universeId, dataStoreId, scope, entryId }: { universeId: UniverseId, dataStoreId: DataStoreId, scope: Scope, entryId: EntryId } @@ -148,7 +148,7 @@ export const orderedDataStoreEntry = addApiMethod(async < * @exampleData true * @exampleRawBody {} */ -export const deleteOrderedDataStoreEntry = addApiMethod(async < +export const deleteOrderedDataStoreEntry = createApiMethod(async < UniverseId extends Identifier, DataStoreId extends string, Scope extends string, EntryId extends string >( {universeId, dataStoreId, scope, entryId }: { universeId: UniverseId, dataStoreId: DataStoreId, scope: Scope, entryId: EntryId } @@ -177,7 +177,7 @@ export const deleteOrderedDataStoreEntry = addApiMethod(async < * @exampleData {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":45,"id":"45348281"} * @exampleRawBody {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":45,"id":"45348281"} */ -export const updateOrderedDataStoreEntry = addApiMethod(async < +export const updateOrderedDataStoreEntry = createApiMethod(async < UniverseId extends Identifier, DataStoreId extends string, Scope extends string, EntryId extends string, EntryValue extends number >( {universeId, dataStoreId, scope, entryId, newEntryValue, allowIfMissing }: @@ -209,7 +209,7 @@ export const updateOrderedDataStoreEntry = addApiMethod(async < * @exampleData {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":42,"id":"45348281"} * @exampleRawBody {"path":"universes/5097539509/ordered-data-stores/PointsStore/scopes/global/entries/45348281","value":42,"id":"45348281"} */ - export const incrementOrderedDataStoreEntry = addApiMethod(async < + export const incrementOrderedDataStoreEntry = createApiMethod(async < UniverseId extends Identifier, DataStoreId extends string, Scope extends string, EntryId extends string >( {universeId, dataStoreId, scope, entryId, incrementBy }: diff --git a/src/apis/cloud/standardDataStores_V1/standardDataStores_V1.ts b/src/apis/cloud/standardDataStores_V1/standardDataStores_V1.ts index c5bc332..8a46e6a 100644 --- a/src/apis/cloud/standardDataStores_V1/standardDataStores_V1.ts +++ b/src/apis/cloud/standardDataStores_V1/standardDataStores_V1.ts @@ -14,7 +14,7 @@ import type { PrettifiedListStandardDatastoreData, PrettifiedListStandardDatasto // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "StandardDatastores_V1", baseUrl: "https://apis.roblox.com/datastores" }) +const { createApiMethod } = createApiGroup({ name: "StandardDatastores_V1", baseUrl: "https://apis.roblox.com/datastores" }) ////////////////////////////////////////////////////////////////////////////////// @@ -33,7 +33,7 @@ const addApiMethod = createApiGroup({ name: "StandardDatastores_V1", baseUrl: "h * @exampleData [ { name: "InventoryStore", createdTime: 2023-09-16T11:03:03.868Z } ] * @exampleRawBody { datastores: [ { name: "InventoryStore", createdTime: "2023-09-16T11:03:03.868331Z" } ], nextPageCursor: "" } */ -export const listStandardDatastores = addApiMethod(async ( +export const listStandardDatastores = createApiMethod(async ( { universeId, prefix, limit, cursor }: { universeId: Identifier, prefix?: Prefix, limit?: number, cursor?: string } ): ApiMethod, PrettifiedListStandardDatastoreData> => ({ method: "GET", @@ -68,7 +68,7 @@ export const listStandardDatastores = addApiMethod(async * @exampleData [ "user/45348281" ] * @exampleRawBody { keys: [ { key: "user/45348281" } ], nextPageCursor: "eyJ2ZXJzaW9uIjoxLCJjdXJzb3IiOiIxMyMifQ==" } */ -export const standardDatastoreKeys = addApiMethod(async ( +export const standardDatastoreKeys = createApiMethod(async ( { universeId, datastoreName, scope, allScopes, limit, prefix, cursor }: { universeId: Identifier, datastoreName: string, scope?: string, allScopes?: boolean, limit?: number, prefix?: Prefix, cursor?: string } ): ApiMethod, PrettifiedStandardDatastoreKeysData> => ({ @@ -104,7 +104,7 @@ export const standardDatastoreKeys = addApiMethod(async ( * @exampleData { entry: { Gold: 6, Iron: 57 }, checksumsMatch: true, metadata: { contentMD5: "hGwoaGwduF4bOhexREYGkA==", entryVersion: "08DBB6A47FDE6132.0000000016.08DBB782CEE11766.01", entryCreatedTime: 2023-09-16T11:03:03.922Z, entryVersionCreatedTime: 2023-09-17T13:34:24.754Z, entryAttributes: null, entryUserIds: [ 45348281 ] } } * @exampleRawBody { entry: { Gold: 6, Iron: 57 }, checksumsMatch: true, metadata: { contentMD5: "hGwoaGwduF4bOhexREYGkA==", entryVersion: "08DBB6A47FDE6132.0000000016.08DBB782CEE11766.01", entryCreatedTime: 2023-09-16T11:03:03.922Z, entryVersionCreatedTime: 2023-09-17T13:34:24.754Z, entryAttributes: null, entryUserIds: [ 45348281 ] } } */ -export const standardDatastoreEntry = addApiMethod(async | string | number = string | number>( +export const standardDatastoreEntry = createApiMethod(async | string | number = string | number>( { universeId, datastoreName, entryKey, scope }: { universeId: Identifier, datastoreName: string, entryKey: string, scope?: string } ): ApiMethod> => ({ @@ -160,7 +160,7 @@ export const standardDatastoreEntry = addApiMethod(async | string | number = string | number>( +export const setStandardDatastoreEntry = createApiMethod(async | string | number = string | number>( { universeId, datastoreName, entryKey, entryValue, scope, matchVersion, exclusiveCreate, entryAttributes, entryUserIds }: { universeId: Identifier, datastoreName: string, entryKey: string, entryValue: Schema, scope?: string, @@ -206,7 +206,7 @@ export const setStandardDatastoreEntry = addApiMethod(async => ({ @@ -241,7 +241,7 @@ export const deleteStandardDatastoreEntry = addApiMethod(async ( * @exampleData 2 * @exampleRawBody 2 */ -export const incrementStandardDatastoreEntry = addApiMethod(async ( +export const incrementStandardDatastoreEntry = createApiMethod(async ( { universeId, datastoreName, entryKey, scope, incrementBy, entryAttributes, entryUserIds }: { universeId: Identifier, datastoreName: string, entryKey: string, scope?: string, incrementBy: number, @@ -280,7 +280,7 @@ export const incrementStandardDatastoreEntry = addApiMethod(async ( * @exampleData { entry: { Gold: 6, Iron: 57 }, checksumsMatch: true, metadata: { contentMD5: "hGwoaGwduF4bOhexREYGkA==", entryVersion: "08DBB6A47FDE6132.0000000016.08DBB782CEE11766.01", entryCreatedTime: 2023-09-16T11:03:03.922Z, entryVersionCreatedTime: 2023-09-17T13:34:24.754Z, entryAttributes: null, entryUserIds: [ 45348281 ] } } * @exampleRawBody { entry: { Gold: 6, Iron: 57 }, checksumsMatch: true, metadata: { contentMD5: "hGwoaGwduF4bOhexREYGkA==", entryVersion: "08DBB6A47FDE6132.0000000016.08DBB782CEE11766.01", entryCreatedTime: 2023-09-16T11:03:03.922Z, entryVersionCreatedTime: 2023-09-17T13:34:24.754Z, entryAttributes: null, entryUserIds: [ 45348281 ] } } */ -export const standardDatastoreEntryOfVersion = addApiMethod(async | string | number = string | number>( +export const standardDatastoreEntryOfVersion = createApiMethod(async | string | number = string | number>( { universeId, datastoreName, entryKey, scope, versionId }: { universeId: Identifier, datastoreName: string, entryKey: string, scope?: string, versionId: string } ): ApiMethod, PrettifiedStandardDatastoreEntryData> => ({ @@ -336,7 +336,7 @@ export const standardDatastoreEntryOfVersion = addApiMethod(async | string | number = string | number>( +export const listStandardDatastoreEntryVersions = createApiMethod(async | string | number = string | number>( { universeId, datastoreName, entryKey, scope, startTime, endTime, sortOrder, limit, cursor }: { universeId: Identifier, datastoreName: string, entryKey: string, scope?: string, diff --git a/src/apis/cloud/standardDataStores_V2/standardDataStores_V2.ts b/src/apis/cloud/standardDataStores_V2/standardDataStores_V2.ts index 06d528e..1464193 100644 --- a/src/apis/cloud/standardDataStores_V2/standardDataStores_V2.ts +++ b/src/apis/cloud/standardDataStores_V2/standardDataStores_V2.ts @@ -13,7 +13,7 @@ import type { PrettifiedCreateStandardDataStoreSnapshotData, PrettifiedFullDatas // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "StandardDatastores_V2", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "StandardDatastores_V2", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -44,7 +44,7 @@ const formatRevisionCreateTimeClamp = (createdBefore?: ISODateTime | Date, creat * @exampleData [{"path":"universes/5097539509/data-stores/Bans","id":"Bans"}] * @exampleRawBody {"dataStores":[{"path":"universes/5097539509/data-stores/Bans","id":"Bans"}]} */ -export const listStandardDataStores = addApiMethod(async ( +export const listStandardDataStores = createApiMethod(async ( { universeId, prefix, limit, cursor }: { universeId: UniverseId, prefix?: Prefix, limit?: number, cursor?: string } ): ApiMethod, PrettifiedListStandardDatastoresData> => ({ method: "GET", @@ -66,7 +66,7 @@ export const listStandardDataStores = addApiMethod(async => ({ method: "POST", @@ -99,7 +99,7 @@ export const createStandardDataStoreSnapshot = addApiMethod(async ( * @exampleData [{"path":"universes/5097539509/data-stores/InventoryStore/entries/user/45348281","id":"user/45348281"}] * @exampleRawBody {"dataStoreEntries":[{"path":"universes/5097539509/data-stores/InventoryStore/entries/user/45348281","id":"user/45348281"}]} */ -export const listStandardDataStoreEntries = addApiMethod(async < +export const listStandardDataStoreEntries = createApiMethod(async < UniverseId extends Identifier, Prefix extends string, DataStore extends string, Scope extends string >( { universeId, dataStore, scope, prefix, limit, cursor }: @@ -144,7 +144,7 @@ export const listStandardDataStoreEntries = addApiMethod(async < * @exampleData {"path":"universes/5097539509/data-stores/InventoryStore/entries/users:45348281","createTime":"2024-07-22T19:06:55.829Z","revisionId":"08DCAA81744A406E.0000000001.08DCAA81744A406E.01","revisionCreateTime":"2024-07-22T19:06:55.829Z","state":"ACTIVE","etag":"08DCAA81744A406E.0000000001.08DCAA81744A406E.01","value":{"Iron":50},"id":"users:45348281","users":["users/45348281"],"attributes":{}} * @exampleRawBody {"path":"universes/5097539509/data-stores/InventoryStore/entries/users:45348281","createTime":"2024-07-22T19:06:55.829412600Z","revisionId":"08DCAA81744A406E.0000000001.08DCAA81744A406E.01","revisionCreateTime":"2024-07-22T19:06:55.829412600Z","state":"ACTIVE","etag":"08DCAA81744A406E.0000000001.08DCAA81744A406E.01","value":{"Iron":50},"id":"users:45348281","users":["users/45348281"],"attributes":{}} */ -export const createStandardDataStoreEntry = addApiMethod(async | any[] | null | boolean | string | number>( +export const createStandardDataStoreEntry = createApiMethod(async | any[] | null | boolean | string | number>( { universeId, dataStore, scope, entryId, value, users, attributes }: { universeId: Identifier, dataStore: string, scope?: string, entryId: string, @@ -187,7 +187,7 @@ export const createStandardDataStoreEntry = addApiMethod(async >( +export const standardDataStoreEntry = createApiMethod(async >( { universeId, dataStore, scope, entryId, revisionId }: { universeId: Identifier, dataStore: string, scope?: string, entryId: string, revisionId?: string } ): ApiMethod, PrettifiedFullDatastoreData> => ({ @@ -223,7 +223,7 @@ export const standardDataStoreEntry = addApiMethod(async => ({ @@ -260,7 +260,7 @@ export const deleteStandardDataStoreEntry = addApiMethod(async ( * @exampleData {"path":"universes/5097539509/data-stores/InventoryStore/entries/users:453482811","createTime":"2024-07-22T19:02:27.811Z","revisionId":"08DCAA80D489FD52.0000000003.08DCAA8627CF76E1.01","revisionCreateTime":"2024-07-22T19:02:27.811Z","state":"ACTIVE","etag":"08DCAA80D489FD52.0000000003.08DCAA8627CF76E1.01","value":{"Iron":50,"Gold":26},"id":"users:453482811","users":["users/45348281"],"attributes":{}} * @exampleRawBody {"path":"universes/5097539509/data-stores/InventoryStore/entries/users:453482811","createTime":"2024-07-22T19:02:27.811669Z","revisionId":"08DCAA80D489FD52.0000000003.08DCAA8627CF76E1.01","revisionCreateTime":"2024-07-22T19:40:35.001520100Z","state":"ACTIVE","etag":"08DCAA80D489FD52.0000000003.08DCAA8627CF76E1.01","value":{"Iron":50,"Gold":26},"id":"users:453482811","users":["users/45348281"],"attributes":{}} */ -export const updateStandardDataStoreEntry = addApiMethod(async >( +export const updateStandardDataStoreEntry = createApiMethod(async >( { universeId, dataStore, scope, entryId, value, users, attributes }: { universeId: Identifier, dataStore: string, scope?: string, entryId: string, @@ -303,7 +303,7 @@ export const updateStandardDataStoreEntry = addApiMethod(async ( { universeId, dataStore, scope, entryId, createdBefore, createdAfter, limit, cursor }: diff --git a/src/apis/cloud/subscriptions/subscriptions.ts b/src/apis/cloud/subscriptions/subscriptions.ts index 842cba7..982d317 100644 --- a/src/apis/cloud/subscriptions/subscriptions.ts +++ b/src/apis/cloud/subscriptions/subscriptions.ts @@ -13,7 +13,7 @@ import type { PrettifiedSubscriptionInfoData, RawSubscriptionInfoData } from "./ // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Inventory", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "Inventory", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -33,7 +33,7 @@ const addApiMethod = createApiGroup({ name: "Inventory", baseUrl: "https://apis. * @exampleData * @exampleRawBody */ -export const subscriptionInfo = addApiMethod(async < +export const subscriptionInfo = createApiMethod(async < UniverseId extends Identifier, SubscriptionProductId extends string, SubscriptionId extends Identifier >( { universeId, subscriptionProductId, subscriptionId }: diff --git a/src/apis/cloud/userRestrictions/userRestrictions.ts b/src/apis/cloud/userRestrictions/userRestrictions.ts index 13c23ba..2647605 100644 --- a/src/apis/cloud/userRestrictions/userRestrictions.ts +++ b/src/apis/cloud/userRestrictions/userRestrictions.ts @@ -13,7 +13,7 @@ import type { PrettifiedListRestrictionLogsData, RawListRestrictionLogsData, Upd // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "UserRestrictions", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "UserRestrictions", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -39,7 +39,7 @@ const addApiMethod = createApiGroup({ name: "UserRestrictions", baseUrl: "https: * @exampleData {"path":"universes/5795192361/places/18210254887/user-restrictions/6193495014","user":"users/6193495014","gameJoinRestriction":{"active":true,"startTime":"2024-06-25T22:56:58.873Z","duration":"31540000s","privateReason":"Being a meanie :/","displayReason":"Annoying other players.","excludeAltAccounts":false,"inherited":false}} * @exampleRawBody {"path":"universes/5795192361/places/18210254887/user-restrictions/6193495014","user":"users/6193495014","gameJoinRestriction":{"active":true,"startTime":"2024-06-25T22:56:58.873Z","duration":"31540000s","privateReason":"Being a meanie :/","displayReason":"Annoying other players.","excludeAltAccounts":false,"inherited":false}} */ -export const listRestrictions = addApiMethod(async < +export const listRestrictions = createApiMethod(async < UniverseId extends Identifier, UserId extends Identifier, PlaceId extends Identifier | undefined = undefined >( { universeId, placeId, userId }: @@ -65,7 +65,7 @@ export const listRestrictions = addApiMethod(async < * @exampleData * @exampleRawBody */ -export const restrictionForUser = addApiMethod(async ( +export const restrictionForUser = createApiMethod(async ( { universeId, placeId, userId }: { universeId: Identifier, placeId?: Identifier, userId: Identifier } ): ApiMethod> => ({ method: "GET", @@ -108,7 +108,7 @@ export const restrictionForUser = addApiMethod(async ( @@ -149,7 +149,7 @@ export const updateRestrictionsForUser = addApiMethod(async < * @exampleData [{"user":"users/6193495014","place":"18210254887","moderator":{"robloxUser":"45348281"},"createTime":"2024-06-25T22:56:58.873Z","active":true,"startTime":"2024-06-25T22:56:58.873Z","duration":"31540000s","privateReason":"Being a meanie :/","displayReason":"Annoying other players.","excludeAltAccounts":false}] * @exampleRawBody {"logs":[{"user":"users/6193495014","place":"18210254887","moderator":{"robloxUser":"45348281"},"createTime":"2024-06-25T22:56:58.873Z","active":true,"startTime":"2024-06-25T22:56:58.873Z","duration":"31540000s","privateReason":"Being a meanie :/","displayReason":"Annoying other players.","excludeAltAccounts":false}],"nextPageToken":"id_2zwAAAZBRnd35xBBXeienIm9K54uMH01-RpcT"} */ -export const listRestrictionLogs = addApiMethod(async < +export const listRestrictionLogs = createApiMethod(async < UniverseId extends Identifier, UserId extends Identifier = Identifier, PlaceId extends Identifier = Identifier >( { universeId, placeId, userId, limit, cursor }: diff --git a/src/apis/cloud/users/users.ts b/src/apis/cloud/users/users.ts index 5af783d..2976177 100644 --- a/src/apis/cloud/users/users.ts +++ b/src/apis/cloud/users/users.ts @@ -13,7 +13,7 @@ import type { NotificationData, PrettifiedUserInfoData, RawUserInfoData, SendNot // [ Variables ] ///////////////////////////////////////////////////////////////// -const addApiMethod = createApiGroup({ name: "Users", baseUrl: "https://apis.roblox.com/cloud" }) +const { createApiMethod } = createApiGroup({ name: "Users", baseUrl: "https://apis.roblox.com/cloud" }) ////////////////////////////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ const sendNotificationToUser_formatParameters = (params: Record) * @exampleData {"path":"users/45348281","createTime":"2013-07-13T07:50:00.083Z","id":"45348281","name":"MightyPart","displayName":"Mighty","about":"football nothing to is push sudden national","locale":"en_us","premium":true,"idVerified":true,"socialNetworkProfiles":{"visibility":"EVERYONE"}} * @exampleRawBody {"path":"users/45348281","createTime":"2013-07-13T07:50:00.083Z","id":"45348281","name":"MightyPart","displayName":"Mighty","about":"football nothing to is push sudden national","locale":"en_us","premium":true,"idVerified":true,"socialNetworkProfiles":{"facebook":"","twitter":"","youtube":"","twitch":"","guilded":"","visibility":"EVERYONE"}} */ -export const userInfo = addApiMethod(async ( +export const userInfo = createApiMethod(async ( { userId }: { userId: UserId } ): ApiMethod, PrettifiedUserInfoData> => ({ path: `/v2/users/${userId}`, @@ -68,7 +68,7 @@ export const userInfo = addApiMethod(async ( * @exampleData {"path":"users/45348281/operations/eyJOb25jZSI6ImM5ZGZmN2E3OTQ1ZTQxYTc4M2E3OGY4Nzk2ZTYwOTczIiwiVHlwZSI6IkdlbmVyYXRlVXNlclRodW1ibmFpbFJlcXVlc3QiLCJQYXRoIjoidXNlcnMvNDUzNDgyODEiLCJTaXplIjoiMCIsIkZvcm1hdCI6IjAiLCJTaGFwZSI6IjAifQ==","done":true,"response":{"@type":"apis.roblox.com/roblox.open_cloud.cloud.v2.GenerateUserThumbnailResponse","imageUri":"https://tr.rbxcdn.com/30DAY-AvatarHeadshot-8D297BB79DBA963A48A765F78DFC5D1B-Png/420/420/AvatarHeadshot/Png/isCircular"}} * @exampleRawBody {"path":"users/45348281/operations/eyJOb25jZSI6ImM5ZGZmN2E3OTQ1ZTQxYTc4M2E3OGY4Nzk2ZTYwOTczIiwiVHlwZSI6IkdlbmVyYXRlVXNlclRodW1ibmFpbFJlcXVlc3QiLCJQYXRoIjoidXNlcnMvNDUzNDgyODEiLCJTaXplIjoiMCIsIkZvcm1hdCI6IjAiLCJTaGFwZSI6IjAifQ==","done":true,"response":{"@type":"apis.roblox.com/roblox.open_cloud.cloud.v2.GenerateUserThumbnailResponse","imageUri":"https://tr.rbxcdn.com/30DAY-AvatarHeadshot-8D297BB79DBA963A48A765F78DFC5D1B-Png/420/420/AvatarHeadshot/Png/isCircular"}} */ -export const userThumbnail = addApiMethod(async ( +export const userThumbnail = createApiMethod(async ( { userId, size, format, shape }: { userId: UserId, size?: UserThumbnailSize, format?: "PNG" | "JPEG", shape?: "ROUND" | "SQUARE" } ): ApiMethod> => ({ path: `/v2/users/${userId}:generateThumbnail`, @@ -97,7 +97,7 @@ export const userThumbnail = addApiMethod(async ( * @exampleData {"path":"users/45348281/notifications/05268fb7-3a73-4d07-9972-65e7a6063892","id":"05268fb7-3a73-4d07-9972-65e7a6063892"} * @exampleRawBody {"path":"users/45348281/notifications/05268fb7-3a73-4d07-9972-65e7a6063892","id":"05268fb7-3a73-4d07-9972-65e7a6063892"} */ -export const sendNotificationToUser = addApiMethod(async ( +export const sendNotificationToUser = createApiMethod(async ( { userId, universeId, notificationData }: { userId: Identifier, universeId: Identifier, notificationData: SendNotificationToUser_NotificationData } ): ApiMethod> => ({