@ianlucas/cs2-lib-inspect 2.0.0 → 2.1.0-beta.1
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.
|
@@ -84,6 +84,10 @@ export interface CEconItemPreviewDataBlock {
|
|
|
84
84
|
* @generated from protobuf field: optional uint32 petindex = 19;
|
|
85
85
|
*/
|
|
86
86
|
petindex?: number;
|
|
87
|
+
/**
|
|
88
|
+
* @generated from protobuf field: repeated CEconItemPreviewDataBlock.Sticker keychains = 20;
|
|
89
|
+
*/
|
|
90
|
+
keychains: CEconItemPreviewDataBlock_Sticker[];
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* @generated from protobuf message CEconItemPreviewDataBlock.Sticker
|
|
@@ -24,12 +24,14 @@ class CEconItemPreviewDataBlock$Type extends MessageType {
|
|
|
24
24
|
{ no: 16, name: "dropreason", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
|
|
25
25
|
{ no: 17, name: "musicindex", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
|
|
26
26
|
{ no: 18, name: "entindex", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ },
|
|
27
|
-
{ no: 19, name: "petindex", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }
|
|
27
|
+
{ no: 19, name: "petindex", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ },
|
|
28
|
+
{ no: 20, name: "keychains", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => CEconItemPreviewDataBlock_Sticker }
|
|
28
29
|
]);
|
|
29
30
|
}
|
|
30
31
|
create(value) {
|
|
31
32
|
const message = globalThis.Object.create((this.messagePrototype));
|
|
32
33
|
message.stickers = [];
|
|
34
|
+
message.keychains = [];
|
|
33
35
|
if (value !== undefined)
|
|
34
36
|
reflectionMergePartial(this, message, value);
|
|
35
37
|
return message;
|
|
@@ -96,6 +98,9 @@ class CEconItemPreviewDataBlock$Type extends MessageType {
|
|
|
96
98
|
case /* optional uint32 petindex */ 19:
|
|
97
99
|
message.petindex = reader.uint32();
|
|
98
100
|
break;
|
|
101
|
+
case /* repeated CEconItemPreviewDataBlock.Sticker keychains */ 20:
|
|
102
|
+
message.keychains.push(CEconItemPreviewDataBlock_Sticker.internalBinaryRead(reader, reader.uint32(), options));
|
|
103
|
+
break;
|
|
99
104
|
default:
|
|
100
105
|
let u = options.readUnknownField;
|
|
101
106
|
if (u === "throw")
|
|
@@ -165,6 +170,9 @@ class CEconItemPreviewDataBlock$Type extends MessageType {
|
|
|
165
170
|
/* optional uint32 petindex = 19; */
|
|
166
171
|
if (message.petindex !== undefined)
|
|
167
172
|
writer.tag(19, WireType.Varint).uint32(message.petindex);
|
|
173
|
+
/* repeated CEconItemPreviewDataBlock.Sticker keychains = 20; */
|
|
174
|
+
for (let i = 0; i < message.keychains.length; i++)
|
|
175
|
+
CEconItemPreviewDataBlock_Sticker.internalBinaryWrite(message.keychains[i], writer.tag(20, WireType.LengthDelimited).fork(), options).join();
|
|
168
176
|
let u = options.writeUnknownFields;
|
|
169
177
|
if (u !== false)
|
|
170
178
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { CS2InventoryItem, CS2ItemType, CS2RarityColor, CS2_MIN_SEED, CS2_MIN_STICKER_WEAR } from "@ianlucas/cs2-lib";
|
|
6
6
|
import { Buffer } from "buffer";
|
|
7
7
|
import CRC32 from "crc-32";
|
|
8
|
-
import { CEconItemPreviewDataBlock } from "./
|
|
8
|
+
import { CEconItemPreviewDataBlock } from "./Protobufs/cstrike15_gcmessages.js";
|
|
9
9
|
export const CS2PreviewRarity = {
|
|
10
10
|
[CS2RarityColor.Common]: 1,
|
|
11
11
|
[CS2RarityColor.Uncommon]: 2,
|
|
@@ -46,6 +46,7 @@ function getEconomyItemPreviewData(item) {
|
|
|
46
46
|
const hasPaintIndex = !hasStickers && !item.isMusicKit();
|
|
47
47
|
return {
|
|
48
48
|
defindex: def,
|
|
49
|
+
keychains: [],
|
|
49
50
|
musicindex: item.isMusicKit() ? index : undefined,
|
|
50
51
|
paintindex: hasPaintIndex ? index : undefined,
|
|
51
52
|
paintseed: item.hasSeed() ? CS2_MIN_SEED : undefined,
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ianlucas/cs2-lib-inspect",
|
|
3
|
-
"
|
|
4
|
-
"description": "A utility for creating inspect links for CS2 items",
|
|
3
|
+
"description": "An extension for cs2-lib to create Counter-Strike 2 inspect links",
|
|
5
4
|
"license": "MIT",
|
|
6
5
|
"repository": "ianlucas/cs2-lib-inspect",
|
|
7
6
|
"type": "module",
|
|
8
7
|
"main": "dist/index.js",
|
|
9
8
|
"scripts": {
|
|
9
|
+
"docs": "typedoc --out docs src/index.ts",
|
|
10
10
|
"format": "prettier . --write",
|
|
11
|
+
"generate:protobufs": "npx protoc --ts_out ./src/Protobufs --proto_path src/Protobufs src/Protobufs/cstrike15_gcmessages.proto",
|
|
11
12
|
"prepack": "([ -d dist ] && rm -rf dist); tsc",
|
|
12
|
-
"
|
|
13
|
-
"test": "jest"
|
|
13
|
+
"upgrade": "npx npm-check-updates@latest --target minor -u"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@protobuf-ts/runtime": "^2.9.4",
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
"@ianlucas/cs2-lib": "^5.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@protobuf-ts/plugin": "^2.9.
|
|
25
|
-
"prettier": "^3.
|
|
26
|
-
"
|
|
27
|
-
|
|
24
|
+
"@protobuf-ts/plugin": "^2.9.4",
|
|
25
|
+
"prettier": "^3.3.3",
|
|
26
|
+
"typedoc": "^0.26.6",
|
|
27
|
+
"typescript": "^5.5.4"
|
|
28
|
+
},
|
|
29
|
+
"version": "2.1.0-beta.1"
|
|
28
30
|
}
|