@quenty/marketplaceutils 3.3.0 → 3.4.0-canary.241.a4e8214.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.4.0-canary.241.a4e8214.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@3.3.1...@quenty/marketplaceutils@3.4.0-canary.241.a4e8214.0) (2022-01-03)
7
+
8
+ **Note:** Version bump only for package @quenty/marketplaceutils
9
+
10
+
11
+
12
+
13
+
14
+ ## [3.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@3.3.0...@quenty/marketplaceutils@3.3.1) (2021-12-30)
15
+
16
+ **Note:** Version bump only for package @quenty/marketplaceutils
17
+
18
+
19
+
20
+
21
+
6
22
  # [3.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@3.2.0...@quenty/marketplaceutils@3.3.0) (2021-12-18)
7
23
 
8
24
  **Note:** Version bump only for package @quenty/marketplaceutils
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  ## MarketplaceUtils
2
2
  <div align="center">
3
- <a href="http://quenty.github.io/api/">
4
- <img src="https://img.shields.io/badge/docs-website-green.svg" alt="Documentation" />
3
+ <a href="http://quenty.github.io/NevermoreEngine/">
4
+ <img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
5
5
  </a>
6
6
  <a href="https://discord.gg/mhtGUS8">
7
- <img src="https://img.shields.io/badge/discord-nevermore-blue.svg" alt="Discord" />
7
+ <img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
8
8
  </a>
9
9
  <a href="https://github.com/Quenty/NevermoreEngine/actions">
10
10
  <img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
@@ -13,17 +13,9 @@
13
13
 
14
14
  Provides utility methods for MarketplaceService
15
15
 
16
+ <div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/MarketplaceUtils">View docs →</a></div>
17
+
16
18
  ## Installation
17
19
  ```
18
20
  npm install @quenty/marketplaceutils --save
19
- ```
20
-
21
- ## Usage
22
- Usage is designed to be simple.
23
-
24
- ### `MarketplaceUtils.promiseProductInfo(assetId, infoType)`
25
-
26
- ### `MarketplaceUtils.promiseUserOwnsGamePass(userId, gamePassId)`
27
-
28
- ### `MarketplaceUtils.promisePlayerOwnsAsset(player, assetId)`
29
-
21
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/marketplaceutils",
3
- "version": "3.3.0",
3
+ "version": "3.4.0-canary.241.a4e8214.0",
4
4
  "description": "Provides utility methods for MarketplaceService",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,11 +26,11 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/loader": "^3.1.1",
30
- "@quenty/promise": "^3.3.0"
29
+ "@quenty/loader": "3.2.0-canary.241.a4e8214.0",
30
+ "@quenty/promise": "3.4.0-canary.241.a4e8214.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "6eb398e9fb81191f0815885f807ab0cb3bb9bad1"
35
+ "gitHead": "a4e821471f35998d63f38a4f4a578e07b4e79035"
36
36
  }
@@ -1,5 +1,7 @@
1
- --- Provides utility methods for MarketplaceService
2
- -- @module MarketplaceUtils
1
+ --[=[
2
+ Provides utility methods for MarketplaceService
3
+ @class MarketplaceUtils
4
+ ]=]
3
5
 
4
6
  local require = require(script.Parent.loader).load(script)
5
7
 
@@ -9,6 +11,62 @@ local Promise = require("Promise")
9
11
 
10
12
  local MarketplaceUtils = {}
11
13
 
14
+ --[=[
15
+ Product info about the creator. See [MarketplaceService.GetProductInfo].
16
+ @interface CreatorProductInfo
17
+ .CreatorType string -- Either User or Group
18
+ .CreatorTargetId number -- The ID of the creator user or group
19
+ .Name string -- The name/username of the creator
20
+ .Id number -- (Use CreatorTargetId instead)
21
+ @within MarketplaceUtils
22
+ ]=]
23
+
24
+ --[=[
25
+ Product info result for assets.
26
+ @interface AssetProductInfo
27
+ .Creator CreatorProductInfo -- A table of information describing the creator of the asset
28
+ .AssetId number -- If InfoType was Asset, this is the ID of the given asset.
29
+ .AssetTypeId number -- The type of asset (e.g. place, model, shirt)*
30
+ .IsForSale boolean -- Describes whether the asset is purchasable
31
+ .IsLimited boolean -- Describes whether the asset is a "limited item" that is no longer (if ever) sold
32
+ .IsLimitedUnique boolean -- Describes whether the asset is a "limited unique" ("Limited U") item
33
+ .IsNew boolean -- Describes whether the asset is marked as "new" in the catalog
34
+ .Remaining number -- The remaining number of items a limited unique item may be sold
35
+ .Sales number -- The number of items the asset has been sold
36
+ .Name string -- The name shown on the asset's page
37
+ .Description string -- The description as shown on the asset's page; can be nil if blank
38
+ .PriceInRobux number -- The cost of purchasing the asset using Robux
39
+ .Created string -- Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z
40
+ .Updated string -- Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z
41
+ .ContentRatingTypeId number -- Indicates whether the item is marked as 13+ in catalog
42
+ .MinimumMembershipLevel number -- The minimum subscription level necessary to purchase the item
43
+ .IsPublicDomain boolean -- Describes whether the asset can be taken for free
44
+ @within MarketplaceUtils
45
+ ]=]
46
+
47
+ --[=[
48
+ Product info result for gamepasses.
49
+ @interface GamepassOrDeveloperProductInfo
50
+ .Creator CreatorProductInfo -- A table of information describing the creator of the asset
51
+ .ProductId number -- If the InfoType was Product, this is the product ID
52
+ .IconImageAssetId number -- This is the asset ID of the product/pass icon, or 0 if there isn't one
53
+ .Name string -- The name shown on the asset's page
54
+ .Description string -- The description as shown on the asset's page; can be nil if blank
55
+ .PriceInRobux number -- The cost of purchasing the asset using Robux
56
+ .Created string -- Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z
57
+ .Updated string -- Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z
58
+ .ContentRatingTypeId number -- Indicates whether the item is marked as 13+ in catalog
59
+ .MinimumMembershipLevel number -- The minimum subscription level necessary to purchase the item
60
+ .IsPublicDomain boolean -- Describes whether the asset can be taken for free
61
+ @within MarketplaceUtils
62
+ ]=]
63
+
64
+ --[=[
65
+ Wraps [MarketplaceService.GetProductInfo] and retrieves information about
66
+ @param assetId number
67
+ @param infoType InfoType
68
+ @return Promise<AssetProductInfo | GamepassOrDeveloperProductInfo>
69
+ ]=]
12
70
  function MarketplaceUtils.promiseProductInfo(assetId, infoType)
13
71
  assert(type(assetId) == "number", "Bad assetId")
14
72
  assert(typeof(infoType) == "EnumItem", "Bad infoType")
@@ -29,6 +87,12 @@ function MarketplaceUtils.promiseProductInfo(assetId, infoType)
29
87
  end)
30
88
  end
31
89
 
90
+ --[=[
91
+ Retrieves whether a player owns a gamepass.
92
+ @param userId number
93
+ @param gamePassId number
94
+ @return Promise<boolean>
95
+ ]=]
32
96
  function MarketplaceUtils.promiseUserOwnsGamePass(userId, gamePassId)
33
97
  assert(typeof(userId) == "number", "Bad userId")
34
98
  assert(type(gamePassId) == "number", "Bad gamePassId")
@@ -48,7 +112,12 @@ function MarketplaceUtils.promiseUserOwnsGamePass(userId, gamePassId)
48
112
  end)
49
113
  end
50
114
 
51
- -- Such as a hat or some other item!
115
+ --[=[
116
+ Retrieves whether a player owns an asset, such as a hat or some other item.
117
+ @param player Player
118
+ @param assetId number
119
+ @return Promise<boolean>
120
+ ]=]
52
121
  function MarketplaceUtils.promisePlayerOwnsAsset(player, assetId)
53
122
  assert(typeof(player) == "Instance", "Bad player")
54
123
  assert(type(assetId) == "number", "Bad assetId")
@@ -68,5 +137,4 @@ function MarketplaceUtils.promisePlayerOwnsAsset(player, assetId)
68
137
  end)
69
138
  end
70
139
 
71
-
72
- return MarketplaceUtils
140
+ return MarketplaceUtils