discord-protos 1.0.5 → 1.2.43

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.
Files changed (42) hide show
  1. package/.github/workflows/update.yml +40 -16
  2. package/.prettierrc.yml +1 -0
  3. package/README.md +5 -6
  4. package/discord_protos/__init__.py +20 -6
  5. package/discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures.proto +22 -0
  6. package/discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures_pb2.py +42 -0
  7. package/discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection.proto +10 -0
  8. package/discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection_pb2.py +40 -0
  9. package/discord_protos/{FrecencyUserSettings.proto → discord_users/v1/FrecencyUserSettings.proto} +26 -5
  10. package/discord_protos/discord_users/v1/FrecencyUserSettings_pb2.py +100 -0
  11. package/discord_protos/{PreloadedUserSettings.proto → discord_users/v1/PreloadedUserSettings.proto} +234 -26
  12. package/discord_protos/discord_users/v1/PreloadedUserSettings_pb2.py +208 -0
  13. package/discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties.proto +62 -0
  14. package/discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties_pb2.py +60 -0
  15. package/dist/discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures.d.ts +71 -0
  16. package/dist/discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures.js +131 -0
  17. package/dist/discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection.d.ts +41 -0
  18. package/dist/discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection.js +94 -0
  19. package/dist/{proto → discord_protos/discord_users/v1}/FrecencyUserSettings.d.ts +165 -57
  20. package/dist/{proto → discord_protos/discord_users/v1}/FrecencyUserSettings.js +414 -103
  21. package/dist/discord_protos/discord_users/v1/PreloadedUserSettings.d.ts +2035 -0
  22. package/dist/{proto → discord_protos/discord_users/v1}/PreloadedUserSettings.js +1921 -364
  23. package/dist/{proto → discord_protos}/google/protobuf/timestamp.d.ts +3 -6
  24. package/dist/{proto → discord_protos}/google/protobuf/timestamp.js +11 -11
  25. package/dist/{proto → discord_protos}/google/protobuf/wrappers.d.ts +9 -9
  26. package/dist/{proto → discord_protos}/google/protobuf/wrappers.js +28 -30
  27. package/dist/discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties.d.ts +261 -0
  28. package/dist/discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties.js +558 -0
  29. package/dist/index.d.ts +5 -2
  30. package/dist/index.js +34 -4
  31. package/dist/load.js +144 -8
  32. package/package.json +14 -13
  33. package/scripts/parse.js +269 -0
  34. package/scripts/preload.js +17 -0
  35. package/tsconfig.json +6 -4
  36. package/discord_protos/FrecencyUserSettings_pb2.py +0 -63
  37. package/discord_protos/PreloadedUserSettings_pb2.py +0 -119
  38. package/dist/parse.d.ts +0 -35
  39. package/dist/parse.js +0 -180
  40. package/dist/proto/PreloadedUserSettings.d.ts +0 -1223
  41. package/dist/test.d.ts +0 -1
  42. package/dist/test.js +0 -18
@@ -0,0 +1,558 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties = exports.PremiumMarketingComponentProperties_Variant1Storage = exports.PremiumMarketingComponentProperties_Subtitle = exports.PremiumMarketingComponentProperties_SubscriptionButton = exports.PremiumMarketingComponentProperties_FeatureCard = exports.PremiumMarketingComponentProperties = exports.PremiumMarketingComponentProperties_ButtonAction = void 0;
4
+ const runtime_1 = require("@protobuf-ts/runtime");
5
+ const runtime_2 = require("@protobuf-ts/runtime");
6
+ const runtime_3 = require("@protobuf-ts/runtime");
7
+ const runtime_4 = require("@protobuf-ts/runtime");
8
+ /**
9
+ * @generated from protobuf enum discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.ButtonAction
10
+ */
11
+ var PremiumMarketingComponentProperties_ButtonAction;
12
+ (function (PremiumMarketingComponentProperties_ButtonAction) {
13
+ /**
14
+ * @generated from protobuf enum value: BUTTON_ACTION_UNSPECIFIED = 0;
15
+ */
16
+ PremiumMarketingComponentProperties_ButtonAction[PremiumMarketingComponentProperties_ButtonAction["UNSPECIFIED"] = 0] = "UNSPECIFIED";
17
+ /**
18
+ * @generated from protobuf enum value: BUTTON_ACTION_OPEN_MARKETING_PAGE = 1;
19
+ */
20
+ PremiumMarketingComponentProperties_ButtonAction[PremiumMarketingComponentProperties_ButtonAction["OPEN_MARKETING_PAGE"] = 1] = "OPEN_MARKETING_PAGE";
21
+ /**
22
+ * @generated from protobuf enum value: BUTTON_ACTION_OPEN_TIER_2_PAYMENT_MODAL = 2;
23
+ */
24
+ PremiumMarketingComponentProperties_ButtonAction[PremiumMarketingComponentProperties_ButtonAction["OPEN_TIER_2_PAYMENT_MODAL"] = 2] = "OPEN_TIER_2_PAYMENT_MODAL";
25
+ /**
26
+ * @generated from protobuf enum value: BUTTON_ACTION_OPEN_TIER_1_PAYMENT_MODAL = 3;
27
+ */
28
+ PremiumMarketingComponentProperties_ButtonAction[PremiumMarketingComponentProperties_ButtonAction["OPEN_TIER_1_PAYMENT_MODAL"] = 3] = "OPEN_TIER_1_PAYMENT_MODAL";
29
+ /**
30
+ * @generated from protobuf enum value: BUTTON_ACTION_OPEN_TIER_2_PAYMENT_MODAL_CUSTOM_CONFIRMATION_FOOTER = 4;
31
+ */
32
+ PremiumMarketingComponentProperties_ButtonAction[PremiumMarketingComponentProperties_ButtonAction["OPEN_TIER_2_PAYMENT_MODAL_CUSTOM_CONFIRMATION_FOOTER"] = 4] = "OPEN_TIER_2_PAYMENT_MODAL_CUSTOM_CONFIRMATION_FOOTER";
33
+ })(PremiumMarketingComponentProperties_ButtonAction || (exports.PremiumMarketingComponentProperties_ButtonAction = PremiumMarketingComponentProperties_ButtonAction = {}));
34
+ // @generated message type with reflection information, may provide speed optimized methods
35
+ class PremiumMarketingComponentProperties$Type extends runtime_4.MessageType {
36
+ constructor() {
37
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties", [
38
+ { no: 3, name: "content_identifier", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
39
+ { no: 1, name: "placeholder", kind: "scalar", oneof: "properties", T: 9 /*ScalarType.STRING*/ },
40
+ { no: 2, name: "announcement_modal_variant_1", kind: "message", oneof: "properties", T: () => exports.PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties }
41
+ ]);
42
+ }
43
+ create(value) {
44
+ const message = globalThis.Object.create((this.messagePrototype));
45
+ message.contentIdentifier = "";
46
+ message.properties = { oneofKind: undefined };
47
+ if (value !== undefined)
48
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
49
+ return message;
50
+ }
51
+ internalBinaryRead(reader, length, options, target) {
52
+ let message = target ?? this.create(), end = reader.pos + length;
53
+ while (reader.pos < end) {
54
+ let [fieldNo, wireType] = reader.tag();
55
+ switch (fieldNo) {
56
+ case /* string content_identifier */ 3:
57
+ message.contentIdentifier = reader.string();
58
+ break;
59
+ case /* string placeholder */ 1:
60
+ message.properties = {
61
+ oneofKind: "placeholder",
62
+ placeholder: reader.string()
63
+ };
64
+ break;
65
+ case /* discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.AnnouncementModalVariant1Properties announcement_modal_variant_1 */ 2:
66
+ message.properties = {
67
+ oneofKind: "announcementModalVariant1",
68
+ announcementModalVariant1: exports.PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties.internalBinaryRead(reader, reader.uint32(), options, message.properties.announcementModalVariant1)
69
+ };
70
+ break;
71
+ default:
72
+ let u = options.readUnknownField;
73
+ if (u === "throw")
74
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
75
+ let d = reader.skip(wireType);
76
+ if (u !== false)
77
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
78
+ }
79
+ }
80
+ return message;
81
+ }
82
+ internalBinaryWrite(message, writer, options) {
83
+ /* string placeholder = 1; */
84
+ if (message.properties.oneofKind === "placeholder")
85
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.properties.placeholder);
86
+ /* discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.AnnouncementModalVariant1Properties announcement_modal_variant_1 = 2; */
87
+ if (message.properties.oneofKind === "announcementModalVariant1")
88
+ exports.PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties.internalBinaryWrite(message.properties.announcementModalVariant1, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join();
89
+ /* string content_identifier = 3; */
90
+ if (message.contentIdentifier !== "")
91
+ writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.contentIdentifier);
92
+ let u = options.writeUnknownFields;
93
+ if (u !== false)
94
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
95
+ return writer;
96
+ }
97
+ }
98
+ /**
99
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties
100
+ */
101
+ exports.PremiumMarketingComponentProperties = new PremiumMarketingComponentProperties$Type();
102
+ // @generated message type with reflection information, may provide speed optimized methods
103
+ class PremiumMarketingComponentProperties_FeatureCard$Type extends runtime_4.MessageType {
104
+ constructor() {
105
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.FeatureCard", [
106
+ { no: 1, name: "header", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
107
+ { no: 2, name: "pill", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
108
+ { no: 3, name: "body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
109
+ { no: 4, name: "image_link", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
110
+ { no: 5, name: "image_link_light_theme", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
111
+ ]);
112
+ }
113
+ create(value) {
114
+ const message = globalThis.Object.create((this.messagePrototype));
115
+ message.header = "";
116
+ message.pill = "";
117
+ message.body = "";
118
+ message.imageLink = "";
119
+ message.imageLinkLightTheme = "";
120
+ if (value !== undefined)
121
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
122
+ return message;
123
+ }
124
+ internalBinaryRead(reader, length, options, target) {
125
+ let message = target ?? this.create(), end = reader.pos + length;
126
+ while (reader.pos < end) {
127
+ let [fieldNo, wireType] = reader.tag();
128
+ switch (fieldNo) {
129
+ case /* string header */ 1:
130
+ message.header = reader.string();
131
+ break;
132
+ case /* string pill */ 2:
133
+ message.pill = reader.string();
134
+ break;
135
+ case /* string body */ 3:
136
+ message.body = reader.string();
137
+ break;
138
+ case /* string image_link */ 4:
139
+ message.imageLink = reader.string();
140
+ break;
141
+ case /* string image_link_light_theme */ 5:
142
+ message.imageLinkLightTheme = reader.string();
143
+ break;
144
+ default:
145
+ let u = options.readUnknownField;
146
+ if (u === "throw")
147
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
148
+ let d = reader.skip(wireType);
149
+ if (u !== false)
150
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
151
+ }
152
+ }
153
+ return message;
154
+ }
155
+ internalBinaryWrite(message, writer, options) {
156
+ /* string header = 1; */
157
+ if (message.header !== "")
158
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.header);
159
+ /* string pill = 2; */
160
+ if (message.pill !== "")
161
+ writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.pill);
162
+ /* string body = 3; */
163
+ if (message.body !== "")
164
+ writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.body);
165
+ /* string image_link = 4; */
166
+ if (message.imageLink !== "")
167
+ writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.imageLink);
168
+ /* string image_link_light_theme = 5; */
169
+ if (message.imageLinkLightTheme !== "")
170
+ writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.imageLinkLightTheme);
171
+ let u = options.writeUnknownFields;
172
+ if (u !== false)
173
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
174
+ return writer;
175
+ }
176
+ }
177
+ /**
178
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.FeatureCard
179
+ */
180
+ exports.PremiumMarketingComponentProperties_FeatureCard = new PremiumMarketingComponentProperties_FeatureCard$Type();
181
+ // @generated message type with reflection information, may provide speed optimized methods
182
+ class PremiumMarketingComponentProperties_SubscriptionButton$Type extends runtime_4.MessageType {
183
+ constructor() {
184
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.SubscriptionButton", [
185
+ { no: 1, name: "copy", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
186
+ { no: 2, name: "button_action", kind: "enum", T: () => ["discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.ButtonAction", PremiumMarketingComponentProperties_ButtonAction, "BUTTON_ACTION_"] }
187
+ ]);
188
+ }
189
+ create(value) {
190
+ const message = globalThis.Object.create((this.messagePrototype));
191
+ message.copy = "";
192
+ message.buttonAction = 0;
193
+ if (value !== undefined)
194
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
195
+ return message;
196
+ }
197
+ internalBinaryRead(reader, length, options, target) {
198
+ let message = target ?? this.create(), end = reader.pos + length;
199
+ while (reader.pos < end) {
200
+ let [fieldNo, wireType] = reader.tag();
201
+ switch (fieldNo) {
202
+ case /* string copy */ 1:
203
+ message.copy = reader.string();
204
+ break;
205
+ case /* discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.ButtonAction button_action */ 2:
206
+ message.buttonAction = reader.int32();
207
+ break;
208
+ default:
209
+ let u = options.readUnknownField;
210
+ if (u === "throw")
211
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
212
+ let d = reader.skip(wireType);
213
+ if (u !== false)
214
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
215
+ }
216
+ }
217
+ return message;
218
+ }
219
+ internalBinaryWrite(message, writer, options) {
220
+ /* string copy = 1; */
221
+ if (message.copy !== "")
222
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.copy);
223
+ /* discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.ButtonAction button_action = 2; */
224
+ if (message.buttonAction !== 0)
225
+ writer.tag(2, runtime_1.WireType.Varint).int32(message.buttonAction);
226
+ let u = options.writeUnknownFields;
227
+ if (u !== false)
228
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
229
+ return writer;
230
+ }
231
+ }
232
+ /**
233
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.SubscriptionButton
234
+ */
235
+ exports.PremiumMarketingComponentProperties_SubscriptionButton = new PremiumMarketingComponentProperties_SubscriptionButton$Type();
236
+ // @generated message type with reflection information, may provide speed optimized methods
237
+ class PremiumMarketingComponentProperties_Subtitle$Type extends runtime_4.MessageType {
238
+ constructor() {
239
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Subtitle", [
240
+ { no: 1, name: "link", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
241
+ { no: 2, name: "locale", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
242
+ { no: 3, name: "is_default", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
243
+ ]);
244
+ }
245
+ create(value) {
246
+ const message = globalThis.Object.create((this.messagePrototype));
247
+ message.link = "";
248
+ message.locale = "";
249
+ message.isDefault = false;
250
+ if (value !== undefined)
251
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
252
+ return message;
253
+ }
254
+ internalBinaryRead(reader, length, options, target) {
255
+ let message = target ?? this.create(), end = reader.pos + length;
256
+ while (reader.pos < end) {
257
+ let [fieldNo, wireType] = reader.tag();
258
+ switch (fieldNo) {
259
+ case /* string link */ 1:
260
+ message.link = reader.string();
261
+ break;
262
+ case /* string locale */ 2:
263
+ message.locale = reader.string();
264
+ break;
265
+ case /* bool is_default */ 3:
266
+ message.isDefault = reader.bool();
267
+ break;
268
+ default:
269
+ let u = options.readUnknownField;
270
+ if (u === "throw")
271
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
272
+ let d = reader.skip(wireType);
273
+ if (u !== false)
274
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
275
+ }
276
+ }
277
+ return message;
278
+ }
279
+ internalBinaryWrite(message, writer, options) {
280
+ /* string link = 1; */
281
+ if (message.link !== "")
282
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.link);
283
+ /* string locale = 2; */
284
+ if (message.locale !== "")
285
+ writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.locale);
286
+ /* bool is_default = 3; */
287
+ if (message.isDefault !== false)
288
+ writer.tag(3, runtime_1.WireType.Varint).bool(message.isDefault);
289
+ let u = options.writeUnknownFields;
290
+ if (u !== false)
291
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
292
+ return writer;
293
+ }
294
+ }
295
+ /**
296
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Subtitle
297
+ */
298
+ exports.PremiumMarketingComponentProperties_Subtitle = new PremiumMarketingComponentProperties_Subtitle$Type();
299
+ // @generated message type with reflection information, may provide speed optimized methods
300
+ class PremiumMarketingComponentProperties_Variant1Storage$Type extends runtime_4.MessageType {
301
+ constructor() {
302
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage", [
303
+ { no: 1, name: "hero_art_localized_video_links_dark_theme", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
304
+ { no: 2, name: "hero_art_localized_video_links_light_theme", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } },
305
+ { no: 3, name: "hero_art_video_subtitle_links", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }
306
+ ]);
307
+ }
308
+ create(value) {
309
+ const message = globalThis.Object.create((this.messagePrototype));
310
+ message.heroArtLocalizedVideoLinksDarkTheme = {};
311
+ message.heroArtLocalizedVideoLinksLightTheme = {};
312
+ message.heroArtVideoSubtitleLinks = {};
313
+ if (value !== undefined)
314
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
315
+ return message;
316
+ }
317
+ internalBinaryRead(reader, length, options, target) {
318
+ let message = target ?? this.create(), end = reader.pos + length;
319
+ while (reader.pos < end) {
320
+ let [fieldNo, wireType] = reader.tag();
321
+ switch (fieldNo) {
322
+ case /* map<string, string> hero_art_localized_video_links_dark_theme */ 1:
323
+ this.binaryReadMap1(message.heroArtLocalizedVideoLinksDarkTheme, reader, options);
324
+ break;
325
+ case /* map<string, string> hero_art_localized_video_links_light_theme */ 2:
326
+ this.binaryReadMap2(message.heroArtLocalizedVideoLinksLightTheme, reader, options);
327
+ break;
328
+ case /* map<string, string> hero_art_video_subtitle_links */ 3:
329
+ this.binaryReadMap3(message.heroArtVideoSubtitleLinks, reader, options);
330
+ break;
331
+ default:
332
+ let u = options.readUnknownField;
333
+ if (u === "throw")
334
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
335
+ let d = reader.skip(wireType);
336
+ if (u !== false)
337
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
338
+ }
339
+ }
340
+ return message;
341
+ }
342
+ binaryReadMap1(map, reader, options) {
343
+ let len = reader.uint32(), end = reader.pos + len, key, val;
344
+ while (reader.pos < end) {
345
+ let [fieldNo, wireType] = reader.tag();
346
+ switch (fieldNo) {
347
+ case 1:
348
+ key = reader.string();
349
+ break;
350
+ case 2:
351
+ val = reader.string();
352
+ break;
353
+ default: throw new globalThis.Error("unknown map entry field for discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage.hero_art_localized_video_links_dark_theme");
354
+ }
355
+ }
356
+ map[key ?? ""] = val ?? "";
357
+ }
358
+ binaryReadMap2(map, reader, options) {
359
+ let len = reader.uint32(), end = reader.pos + len, key, val;
360
+ while (reader.pos < end) {
361
+ let [fieldNo, wireType] = reader.tag();
362
+ switch (fieldNo) {
363
+ case 1:
364
+ key = reader.string();
365
+ break;
366
+ case 2:
367
+ val = reader.string();
368
+ break;
369
+ default: throw new globalThis.Error("unknown map entry field for discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage.hero_art_localized_video_links_light_theme");
370
+ }
371
+ }
372
+ map[key ?? ""] = val ?? "";
373
+ }
374
+ binaryReadMap3(map, reader, options) {
375
+ let len = reader.uint32(), end = reader.pos + len, key, val;
376
+ while (reader.pos < end) {
377
+ let [fieldNo, wireType] = reader.tag();
378
+ switch (fieldNo) {
379
+ case 1:
380
+ key = reader.string();
381
+ break;
382
+ case 2:
383
+ val = reader.string();
384
+ break;
385
+ default: throw new globalThis.Error("unknown map entry field for discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage.hero_art_video_subtitle_links");
386
+ }
387
+ }
388
+ map[key ?? ""] = val ?? "";
389
+ }
390
+ internalBinaryWrite(message, writer, options) {
391
+ /* map<string, string> hero_art_localized_video_links_dark_theme = 1; */
392
+ for (let k of globalThis.Object.keys(message.heroArtLocalizedVideoLinksDarkTheme))
393
+ writer.tag(1, runtime_1.WireType.LengthDelimited).fork().tag(1, runtime_1.WireType.LengthDelimited).string(k).tag(2, runtime_1.WireType.LengthDelimited).string(message.heroArtLocalizedVideoLinksDarkTheme[k]).join();
394
+ /* map<string, string> hero_art_localized_video_links_light_theme = 2; */
395
+ for (let k of globalThis.Object.keys(message.heroArtLocalizedVideoLinksLightTheme))
396
+ writer.tag(2, runtime_1.WireType.LengthDelimited).fork().tag(1, runtime_1.WireType.LengthDelimited).string(k).tag(2, runtime_1.WireType.LengthDelimited).string(message.heroArtLocalizedVideoLinksLightTheme[k]).join();
397
+ /* map<string, string> hero_art_video_subtitle_links = 3; */
398
+ for (let k of globalThis.Object.keys(message.heroArtVideoSubtitleLinks))
399
+ writer.tag(3, runtime_1.WireType.LengthDelimited).fork().tag(1, runtime_1.WireType.LengthDelimited).string(k).tag(2, runtime_1.WireType.LengthDelimited).string(message.heroArtVideoSubtitleLinks[k]).join();
400
+ let u = options.writeUnknownFields;
401
+ if (u !== false)
402
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
403
+ return writer;
404
+ }
405
+ }
406
+ /**
407
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage
408
+ */
409
+ exports.PremiumMarketingComponentProperties_Variant1Storage = new PremiumMarketingComponentProperties_Variant1Storage$Type();
410
+ // @generated message type with reflection information, may provide speed optimized methods
411
+ class PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties$Type extends runtime_4.MessageType {
412
+ constructor() {
413
+ super("discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.AnnouncementModalVariant1Properties", [
414
+ { no: 1, name: "header", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
415
+ { no: 2, name: "subheader", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
416
+ { no: 3, name: "video_link", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
417
+ { no: 4, name: "help_article_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
418
+ { no: 5, name: "feature_cards", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => exports.PremiumMarketingComponentProperties_FeatureCard },
419
+ { no: 6, name: "button", kind: "message", T: () => exports.PremiumMarketingComponentProperties_SubscriptionButton },
420
+ { no: 7, name: "dismiss_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
421
+ { no: 8, name: "hero_art_video_link_light_theme", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
422
+ { no: 9, name: "hero_art_image_link_dark_theme", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
423
+ { no: 10, name: "hero_art_image_link_light_theme", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
424
+ { no: 11, name: "modal_top_pill", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
425
+ { no: 12, name: "body", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
426
+ { no: 13, name: "hero_art_video_subtitles", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => exports.PremiumMarketingComponentProperties_Subtitle },
427
+ { no: 14, name: "storage", kind: "message", T: () => exports.PremiumMarketingComponentProperties_Variant1Storage }
428
+ ]);
429
+ }
430
+ create(value) {
431
+ const message = globalThis.Object.create((this.messagePrototype));
432
+ message.header = "";
433
+ message.subheader = "";
434
+ message.videoLink = "";
435
+ message.helpArticleId = "";
436
+ message.featureCards = [];
437
+ message.dismissKey = "";
438
+ message.heroArtVideoLinkLightTheme = "";
439
+ message.heroArtImageLinkDarkTheme = "";
440
+ message.heroArtImageLinkLightTheme = "";
441
+ message.modalTopPill = "";
442
+ message.body = "";
443
+ message.heroArtVideoSubtitles = [];
444
+ if (value !== undefined)
445
+ (0, runtime_3.reflectionMergePartial)(this, message, value);
446
+ return message;
447
+ }
448
+ internalBinaryRead(reader, length, options, target) {
449
+ let message = target ?? this.create(), end = reader.pos + length;
450
+ while (reader.pos < end) {
451
+ let [fieldNo, wireType] = reader.tag();
452
+ switch (fieldNo) {
453
+ case /* string header */ 1:
454
+ message.header = reader.string();
455
+ break;
456
+ case /* string subheader */ 2:
457
+ message.subheader = reader.string();
458
+ break;
459
+ case /* string video_link */ 3:
460
+ message.videoLink = reader.string();
461
+ break;
462
+ case /* string help_article_id */ 4:
463
+ message.helpArticleId = reader.string();
464
+ break;
465
+ case /* repeated discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.FeatureCard feature_cards */ 5:
466
+ message.featureCards.push(exports.PremiumMarketingComponentProperties_FeatureCard.internalBinaryRead(reader, reader.uint32(), options));
467
+ break;
468
+ case /* optional discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.SubscriptionButton button */ 6:
469
+ message.button = exports.PremiumMarketingComponentProperties_SubscriptionButton.internalBinaryRead(reader, reader.uint32(), options, message.button);
470
+ break;
471
+ case /* string dismiss_key */ 7:
472
+ message.dismissKey = reader.string();
473
+ break;
474
+ case /* string hero_art_video_link_light_theme */ 8:
475
+ message.heroArtVideoLinkLightTheme = reader.string();
476
+ break;
477
+ case /* string hero_art_image_link_dark_theme */ 9:
478
+ message.heroArtImageLinkDarkTheme = reader.string();
479
+ break;
480
+ case /* string hero_art_image_link_light_theme */ 10:
481
+ message.heroArtImageLinkLightTheme = reader.string();
482
+ break;
483
+ case /* string modal_top_pill */ 11:
484
+ message.modalTopPill = reader.string();
485
+ break;
486
+ case /* string body */ 12:
487
+ message.body = reader.string();
488
+ break;
489
+ case /* repeated discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Subtitle hero_art_video_subtitles */ 13:
490
+ message.heroArtVideoSubtitles.push(exports.PremiumMarketingComponentProperties_Subtitle.internalBinaryRead(reader, reader.uint32(), options));
491
+ break;
492
+ case /* optional discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage storage */ 14:
493
+ message.storage = exports.PremiumMarketingComponentProperties_Variant1Storage.internalBinaryRead(reader, reader.uint32(), options, message.storage);
494
+ break;
495
+ default:
496
+ let u = options.readUnknownField;
497
+ if (u === "throw")
498
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
499
+ let d = reader.skip(wireType);
500
+ if (u !== false)
501
+ (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
502
+ }
503
+ }
504
+ return message;
505
+ }
506
+ internalBinaryWrite(message, writer, options) {
507
+ /* string header = 1; */
508
+ if (message.header !== "")
509
+ writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.header);
510
+ /* string subheader = 2; */
511
+ if (message.subheader !== "")
512
+ writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.subheader);
513
+ /* string video_link = 3; */
514
+ if (message.videoLink !== "")
515
+ writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.videoLink);
516
+ /* string help_article_id = 4; */
517
+ if (message.helpArticleId !== "")
518
+ writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.helpArticleId);
519
+ /* repeated discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.FeatureCard feature_cards = 5; */
520
+ for (let i = 0; i < message.featureCards.length; i++)
521
+ exports.PremiumMarketingComponentProperties_FeatureCard.internalBinaryWrite(message.featureCards[i], writer.tag(5, runtime_1.WireType.LengthDelimited).fork(), options).join();
522
+ /* optional discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.SubscriptionButton button = 6; */
523
+ if (message.button)
524
+ exports.PremiumMarketingComponentProperties_SubscriptionButton.internalBinaryWrite(message.button, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join();
525
+ /* string dismiss_key = 7; */
526
+ if (message.dismissKey !== "")
527
+ writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.dismissKey);
528
+ /* string hero_art_video_link_light_theme = 8; */
529
+ if (message.heroArtVideoLinkLightTheme !== "")
530
+ writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.heroArtVideoLinkLightTheme);
531
+ /* string hero_art_image_link_dark_theme = 9; */
532
+ if (message.heroArtImageLinkDarkTheme !== "")
533
+ writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.heroArtImageLinkDarkTheme);
534
+ /* string hero_art_image_link_light_theme = 10; */
535
+ if (message.heroArtImageLinkLightTheme !== "")
536
+ writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.heroArtImageLinkLightTheme);
537
+ /* string modal_top_pill = 11; */
538
+ if (message.modalTopPill !== "")
539
+ writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.modalTopPill);
540
+ /* string body = 12; */
541
+ if (message.body !== "")
542
+ writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.body);
543
+ /* repeated discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Subtitle hero_art_video_subtitles = 13; */
544
+ for (let i = 0; i < message.heroArtVideoSubtitles.length; i++)
545
+ exports.PremiumMarketingComponentProperties_Subtitle.internalBinaryWrite(message.heroArtVideoSubtitles[i], writer.tag(13, runtime_1.WireType.LengthDelimited).fork(), options).join();
546
+ /* optional discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.Variant1Storage storage = 14; */
547
+ if (message.storage)
548
+ exports.PremiumMarketingComponentProperties_Variant1Storage.internalBinaryWrite(message.storage, writer.tag(14, runtime_1.WireType.LengthDelimited).fork(), options).join();
549
+ let u = options.writeUnknownFields;
550
+ if (u !== false)
551
+ (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
552
+ return writer;
553
+ }
554
+ }
555
+ /**
556
+ * @generated MessageType for protobuf message discord_protos.premium_marketing.v1.PremiumMarketingComponentProperties.AnnouncementModalVariant1Properties
557
+ */
558
+ exports.PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties = new PremiumMarketingComponentProperties_AnnouncementModalVariant1Properties$Type();
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
- export * from "./proto/PreloadedUserSettings";
2
- export * from "./proto/FrecencyUserSettings";
3
1
  declare module "@protobuf-ts/runtime" {
4
2
  interface MessageType<T> {
5
3
  toBase64(data: T): string;
6
4
  fromBase64(base64: string): T;
7
5
  }
8
6
  }
7
+ export * from "./discord_protos/discord_users/v1/PreloadedUserSettings";
8
+ export * from "./discord_protos/discord_users/v1/FrecencyUserSettings";
9
+ export * from "./discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection";
10
+ export * from "./discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures";
11
+ export * from "./discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties";
package/dist/index.js CHANGED
@@ -15,13 +15,43 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const runtime_1 = require("@protobuf-ts/runtime");
18
+ /**
19
+ * Supports both node and web environments, replacement of previous Buffer.from() being node-only.
20
+ * This is specific to this package's usage, and not a replacement of Buffer.from() altogether
21
+ */
22
+ const compatBuffer = {
23
+ from: function (input, encoding) {
24
+ if (typeof input === "string" && encoding === "base64") {
25
+ const encodedBytes = atob(input);
26
+ const bytes = new Uint8Array(encodedBytes.length);
27
+ for (let i = 0; i < encodedBytes.length; i++) {
28
+ bytes[i] = encodedBytes.charCodeAt(i);
29
+ }
30
+ return bytes;
31
+ }
32
+ else if (!encoding && input instanceof Uint8Array) {
33
+ return input;
34
+ }
35
+ throw new Error("Invalid input type.");
36
+ },
37
+ toBase64String: function (buffer) {
38
+ let encodedBytes = "";
39
+ for (let i = 0; i < buffer.length; i++) {
40
+ encodedBytes += String.fromCharCode(buffer[i]);
41
+ }
42
+ return btoa(encodedBytes);
43
+ },
44
+ };
18
45
  function toBase64(data) {
19
- return Buffer.from(this.toBinary(data)).toString("base64");
46
+ return compatBuffer.toBase64String(compatBuffer.from(this.toBinary(data)));
20
47
  }
21
48
  function fromBase64(base64) {
22
- return this.fromBinary(Buffer.from(base64, "base64"));
49
+ return this.fromBinary(compatBuffer.from(base64, "base64"));
23
50
  }
24
- __exportStar(require("./proto/PreloadedUserSettings"), exports);
25
- __exportStar(require("./proto/FrecencyUserSettings"), exports);
26
51
  runtime_1.MessageType.prototype.fromBase64 = fromBase64;
27
52
  runtime_1.MessageType.prototype.toBase64 = toBase64;
53
+ __exportStar(require("./discord_protos/discord_users/v1/PreloadedUserSettings"), exports);
54
+ __exportStar(require("./discord_protos/discord_users/v1/FrecencyUserSettings"), exports);
55
+ __exportStar(require("./discord_protos/discord_kkv_store_value_models/v1/ApplicationUserRoleConnection"), exports);
56
+ __exportStar(require("./discord_protos/discord_kkv_store_value_models/v1/AcknowledgedApplicationDisclosures"), exports);
57
+ __exportStar(require("./discord_protos/premium_marketing/v1/PremiumMarketingComponentProperties"), exports);