@quenty/marketplaceutils 6.0.1 → 6.0.2-canary.328.cc9ab2d.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,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
+ ## [6.0.2-canary.328.cc9ab2d.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@6.0.1...@quenty/marketplaceutils@6.0.2-canary.328.cc9ab2d.0) (2023-02-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add MarketplaceUtils.convertAssetTypeIdToAvatarAssetType(assetTypeId) and MarketplaceUtils.convertAssetTypeIdToAssetType(assetTypeId) ([7bc18ed](https://github.com/Quenty/NevermoreEngine/commit/7bc18ed2afc55b45c4ba98f87ac0f7132eb94a9c))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.0.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/marketplaceutils@6.0.0...@quenty/marketplaceutils@6.0.1) (2022-11-04)
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": "6.0.1",
3
+ "version": "6.0.2-canary.328.cc9ab2d.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": "^6.0.1",
30
- "@quenty/promise": "^6.0.1"
29
+ "@quenty/loader": "6.0.1",
30
+ "@quenty/promise": "6.0.1"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "8b9877c26a3fc753409a5114e56717837291279d"
35
+ "gitHead": "cc9ab2d1cab37ed4c3105922ffd871f81b3812fb"
36
36
  }
@@ -87,6 +87,42 @@ function MarketplaceUtils.promiseProductInfo(assetId, infoType)
87
87
  end)
88
88
  end
89
89
 
90
+ --[=[
91
+ Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible
92
+
93
+ @param assetTypeId number
94
+ @return AssetType | nl
95
+ ]=]
96
+ function MarketplaceUtils.convertAssetTypeIdToAssetType(assetTypeId)
97
+ assert(type(assetTypeId) == "number", "Bad assetTypeId")
98
+
99
+ for _, enumItem in pairs(Enum.AssetType:GetEnumItems()) do
100
+ if enumItem.Value == assetTypeId then
101
+ return enumItem
102
+ end
103
+ end
104
+
105
+ return nil
106
+ end
107
+
108
+ --[=[
109
+ Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible
110
+
111
+ @param assetTypeId number
112
+ @return AvatarAssetType | nil
113
+ ]=]
114
+ function MarketplaceUtils.convertAssetTypeIdToAvatarAssetType(assetTypeId)
115
+ assert(type(assetTypeId) == "number", "Bad assetTypeId")
116
+
117
+ for _, enumItem in pairs(Enum.AvatarAssetType:GetEnumItems()) do
118
+ if enumItem.Value == assetTypeId then
119
+ return enumItem
120
+ end
121
+ end
122
+
123
+ return nil
124
+ end
125
+
90
126
  --[=[
91
127
  Retrieves whether a player owns a gamepass.
92
128
  @param userId number