@quenty/marketplaceutils 11.11.1 → 11.11.2

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,17 @@
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
+ ## [11.11.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@11.11.1...@quenty/marketplaceutils@11.11.2) (2025-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [11.11.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@11.11.0...@quenty/marketplaceutils@11.11.1) (2025-03-21)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/marketplaceutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/marketplaceutils",
3
- "version": "11.11.1",
3
+ "version": "11.11.2",
4
4
  "description": "Provides utility methods for MarketplaceService",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,12 +26,12 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/loader": "^10.8.0",
30
- "@quenty/memoize": "^1.6.0",
31
- "@quenty/promise": "^10.10.1"
29
+ "@quenty/loader": "^10.8.1",
30
+ "@quenty/memoize": "^1.6.1",
31
+ "@quenty/promise": "^10.10.2"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
36
+ "gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
37
37
  }
@@ -6,18 +6,19 @@ local require = require(script.Parent.loader).load(script)
6
6
 
7
7
  local MemorizeUtils = require("MemorizeUtils")
8
8
  local MarketplaceUtils = require("MarketplaceUtils")
9
+ local _ServiceBag = require("ServiceBag")
9
10
 
10
11
  local MarketplaceServiceCache = {}
11
12
  MarketplaceServiceCache.ServiceName = "MarketplaceServiceCache"
12
13
 
13
- function MarketplaceServiceCache:Init(serviceBag)
14
+ function MarketplaceServiceCache:Init(serviceBag: _ServiceBag.ServiceBag)
14
15
  assert(not self._serviceBag, "Already initialized")
15
16
  self._serviceBag = assert(serviceBag, "No serviceBag")
16
17
 
17
18
  self:_ensureInit()
18
19
  end
19
20
 
20
- function MarketplaceServiceCache:PromiseProductInfo(productId, infoType)
21
+ function MarketplaceServiceCache:PromiseProductInfo(productId: number, infoType: Enum.InfoType)
21
22
  assert(type(productId) == "number", "Bad productId")
22
23
 
23
24
  self:_ensureInit()
@@ -1,3 +1,4 @@
1
+ --!strict
1
2
  --[=[
2
3
  Provides utility methods for MarketplaceService
3
4
  @class MarketplaceUtils
@@ -20,6 +21,12 @@ local MarketplaceUtils = {}
20
21
  .Id number -- (Use CreatorTargetId instead)
21
22
  @within MarketplaceUtils
22
23
  ]=]
24
+ export type CreatorProductInfo = {
25
+ CreatorType: string,
26
+ CreatorTargetId: number,
27
+ Name: string,
28
+ Id: number,
29
+ }
23
30
 
24
31
  --[=[
25
32
  Product info result for assets.
@@ -43,6 +50,25 @@ local MarketplaceUtils = {}
43
50
  .IsPublicDomain boolean -- Describes whether the asset can be taken for free
44
51
  @within MarketplaceUtils
45
52
  ]=]
53
+ export type AssetProductInfo = {
54
+ Creator: CreatorProductInfo,
55
+ AssetId: number,
56
+ AssetTypeId: number,
57
+ IsForSale: boolean,
58
+ IsLimited: boolean,
59
+ IsLimitedUnique: boolean,
60
+ IsNew: boolean,
61
+ Remaining: number,
62
+ Sales: number,
63
+ Name: string,
64
+ Description: string?,
65
+ PriceInRobux: number,
66
+ Created: string,
67
+ Updated: string,
68
+ ContentRatingTypeId: number,
69
+ MinimumMembershipLevel: number,
70
+ IsPublicDomain: boolean,
71
+ }
46
72
 
47
73
  --[=[
48
74
  Product info result for gamepasses.
@@ -60,6 +86,19 @@ local MarketplaceUtils = {}
60
86
  .IsPublicDomain boolean -- Describes whether the asset can be taken for free
61
87
  @within MarketplaceUtils
62
88
  ]=]
89
+ export type GamePassOrDeveloperProductInfo = {
90
+ Creator: CreatorProductInfo,
91
+ ProductId: number,
92
+ IconImageAssetId: number,
93
+ Name: string,
94
+ Description: string?,
95
+ PriceInRobux: number,
96
+ Created: string,
97
+ Updated: string,
98
+ ContentRatingTypeId: number,
99
+ MinimumMembershipLevel: number,
100
+ IsPublicDomain: boolean,
101
+ }
63
102
 
64
103
  --[=[
65
104
  Subscription Status
@@ -69,6 +108,10 @@ local MarketplaceUtils = {}
69
108
  .IsRenewing boolean -- True if the user is set to renew this subscription after the current subscription period ends.
70
109
  @within MarketplaceUtils
71
110
  ]=]
111
+ export type UserSubscriptonStatus = {
112
+ IsSubscribed: boolean,
113
+ IsRenewing: boolean,
114
+ }
72
115
 
73
116
  --[=[
74
117
  Wraps [MarketplaceService.GetProductInfo] and retrieves information about
@@ -76,7 +119,10 @@ local MarketplaceUtils = {}
76
119
  @param infoType InfoType | nil
77
120
  @return Promise<AssetProductInfo | GamePassOrDeveloperProductInfo>
78
121
  ]=]
79
- function MarketplaceUtils.promiseProductInfo(assetId, infoType)
122
+ function MarketplaceUtils.promiseProductInfo(
123
+ assetId: number,
124
+ infoType: Enum.InfoType
125
+ ): Promise.Promise<AssetProductInfo | GamePassOrDeveloperProductInfo>
80
126
  assert(type(assetId) == "number", "Bad assetId")
81
127
  assert(typeof(infoType) == "EnumItem" or infoType == nil, "Bad infoType")
82
128
 
@@ -103,7 +149,10 @@ end
103
149
  @param subscriptionId string
104
150
  @return UserSubscriptonStatus
105
151
  ]=]
106
- function MarketplaceUtils.promiseUserSubscriptionStatus(player, subscriptionId)
152
+ function MarketplaceUtils.promiseUserSubscriptionStatus(
153
+ player: Player,
154
+ subscriptionId: string
155
+ ): Promise.Promise<UserSubscriptonStatus>
107
156
  assert(typeof(player) == "Instance" and player:IsA("Player"), "Bad player")
108
157
  assert(type(subscriptionId) == "string", "Bad subscriptionId")
109
158
 
@@ -128,7 +177,7 @@ end
128
177
  @param gamePassId number
129
178
  @return Promise<boolean>
130
179
  ]=]
131
- function MarketplaceUtils.promiseUserOwnsGamePass(userId, gamePassId)
180
+ function MarketplaceUtils.promiseUserOwnsGamePass(userId: number, gamePassId: number): Promise.Promise<boolean>
132
181
  assert(typeof(userId) == "number", "Bad userId")
133
182
  assert(type(gamePassId) == "number", "Bad gamePassId")
134
183
 
@@ -153,7 +202,7 @@ end
153
202
  @param assetId number
154
203
  @return Promise<boolean>
155
204
  ]=]
156
- function MarketplaceUtils.promisePlayerOwnsAsset(player, assetId)
205
+ function MarketplaceUtils.promisePlayerOwnsAsset(player: Player, assetId: number): Promise.Promise<boolean>
157
206
  assert(typeof(player) == "Instance", "Bad player")
158
207
  assert(type(assetId) == "number", "Bad assetId")
159
208
 
@@ -178,7 +227,7 @@ end
178
227
  @param bundleId number
179
228
  @return Promise<boolean>
180
229
  ]=]
181
- function MarketplaceUtils.promisePlayerOwnsBundle(player, bundleId)
230
+ function MarketplaceUtils.promisePlayerOwnsBundle(player: Player, bundleId: number): Promise.Promise<boolean>
182
231
  assert(typeof(player) == "Instance", "Bad player")
183
232
  assert(type(bundleId) == "number", "Bad bundleId")
184
233