oceanic.js 1.10.3-dev.5c8c9d5 → 1.10.3-dev.8b65faf

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 (205) hide show
  1. package/dist/lib/Client.d.ts +99 -0
  2. package/dist/lib/Client.js +263 -0
  3. package/dist/lib/Constants.d.ts +1219 -0
  4. package/dist/lib/Constants.js +1518 -0
  5. package/dist/lib/gateway/Shard.d.ts +83 -0
  6. package/dist/lib/gateway/Shard.js +1621 -0
  7. package/dist/lib/gateway/ShardManager.d.ts +29 -0
  8. package/dist/lib/gateway/ShardManager.js +300 -0
  9. package/dist/lib/index.d.ts +84 -0
  10. package/dist/lib/index.js +168 -0
  11. package/dist/lib/rest/Bucket.d.ts +33 -0
  12. package/dist/lib/rest/Bucket.js +78 -0
  13. package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
  14. package/dist/lib/rest/DiscordHTTPError.js +65 -0
  15. package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
  16. package/dist/lib/rest/DiscordRESTError.js +89 -0
  17. package/dist/lib/rest/OAuthHelper.d.ts +62 -0
  18. package/dist/lib/rest/OAuthHelper.js +183 -0
  19. package/dist/lib/rest/RESTManager.d.ts +42 -0
  20. package/dist/lib/rest/RESTManager.js +82 -0
  21. package/dist/lib/rest/RequestHandler.d.ts +28 -0
  22. package/dist/lib/rest/RequestHandler.js +313 -0
  23. package/dist/lib/rest/SequentialBucket.d.ts +25 -0
  24. package/dist/lib/rest/SequentialBucket.js +76 -0
  25. package/dist/lib/routes/Applications.d.ts +171 -0
  26. package/dist/lib/routes/Applications.js +447 -0
  27. package/dist/lib/routes/Channels.d.ts +408 -0
  28. package/dist/lib/routes/Channels.js +1161 -0
  29. package/dist/lib/routes/Guilds.d.ts +606 -0
  30. package/dist/lib/routes/Guilds.js +1669 -0
  31. package/dist/lib/routes/Interactions.d.ts +74 -0
  32. package/dist/lib/routes/Interactions.js +141 -0
  33. package/dist/lib/routes/Miscellaneous.d.ts +31 -0
  34. package/dist/lib/routes/Miscellaneous.js +69 -0
  35. package/dist/lib/routes/OAuth.d.ts +108 -0
  36. package/dist/lib/routes/OAuth.js +312 -0
  37. package/dist/lib/routes/Users.d.ts +32 -0
  38. package/dist/lib/routes/Users.js +59 -0
  39. package/dist/lib/routes/Webhooks.d.ts +128 -0
  40. package/dist/lib/routes/Webhooks.js +265 -0
  41. package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
  42. package/dist/lib/structures/AnnouncementChannel.js +47 -0
  43. package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
  44. package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
  45. package/dist/lib/structures/Application.d.ts +102 -0
  46. package/dist/lib/structures/Application.js +189 -0
  47. package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
  48. package/dist/lib/structures/ApplicationCommand.js +141 -0
  49. package/dist/lib/structures/Attachment.d.ts +34 -0
  50. package/dist/lib/structures/Attachment.js +64 -0
  51. package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
  52. package/dist/lib/structures/AuditLogEntry.js +53 -0
  53. package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
  54. package/dist/lib/structures/AutoModerationRule.js +139 -0
  55. package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
  56. package/dist/lib/structures/AutocompleteInteraction.js +115 -0
  57. package/dist/lib/structures/Base.d.ts +20 -0
  58. package/dist/lib/structures/Base.js +58 -0
  59. package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
  60. package/dist/lib/structures/BaseEntitlement.js +44 -0
  61. package/dist/lib/structures/CategoryChannel.d.ts +41 -0
  62. package/dist/lib/structures/CategoryChannel.js +105 -0
  63. package/dist/lib/structures/Channel.d.ts +20 -0
  64. package/dist/lib/structures/Channel.js +91 -0
  65. package/dist/lib/structures/ClientApplication.d.ts +153 -0
  66. package/dist/lib/structures/ClientApplication.js +220 -0
  67. package/dist/lib/structures/CommandInteraction.d.ts +127 -0
  68. package/dist/lib/structures/CommandInteraction.js +297 -0
  69. package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
  70. package/dist/lib/structures/ComponentInteraction.js +311 -0
  71. package/dist/lib/structures/Entitlement.d.ts +12 -0
  72. package/dist/lib/structures/Entitlement.js +26 -0
  73. package/dist/lib/structures/ExtendedUser.d.ts +26 -0
  74. package/dist/lib/structures/ExtendedUser.js +57 -0
  75. package/dist/lib/structures/ForumChannel.d.ts +11 -0
  76. package/dist/lib/structures/ForumChannel.js +19 -0
  77. package/dist/lib/structures/GroupChannel.d.ts +62 -0
  78. package/dist/lib/structures/GroupChannel.js +133 -0
  79. package/dist/lib/structures/Guild.d.ts +654 -0
  80. package/dist/lib/structures/Guild.js +1319 -0
  81. package/dist/lib/structures/GuildChannel.d.ts +34 -0
  82. package/dist/lib/structures/GuildChannel.js +75 -0
  83. package/dist/lib/structures/GuildPreview.d.ts +50 -0
  84. package/dist/lib/structures/GuildPreview.js +119 -0
  85. package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
  86. package/dist/lib/structures/GuildScheduledEvent.js +154 -0
  87. package/dist/lib/structures/GuildTemplate.d.ts +55 -0
  88. package/dist/lib/structures/GuildTemplate.js +126 -0
  89. package/dist/lib/structures/Integration.d.ts +54 -0
  90. package/dist/lib/structures/Integration.js +156 -0
  91. package/dist/lib/structures/Interaction.d.ts +40 -0
  92. package/dist/lib/structures/Interaction.js +90 -0
  93. package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
  94. package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
  95. package/dist/lib/structures/Invite.d.ts +64 -0
  96. package/dist/lib/structures/Invite.js +193 -0
  97. package/dist/lib/structures/InviteGuild.d.ts +52 -0
  98. package/dist/lib/structures/InviteGuild.js +88 -0
  99. package/dist/lib/structures/MediaChannel.d.ts +11 -0
  100. package/dist/lib/structures/MediaChannel.js +19 -0
  101. package/dist/lib/structures/Member.d.ts +122 -0
  102. package/dist/lib/structures/Member.js +255 -0
  103. package/dist/lib/structures/Message.d.ts +196 -0
  104. package/dist/lib/structures/Message.js +508 -0
  105. package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
  106. package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
  107. package/dist/lib/structures/OAuthApplication.d.ts +79 -0
  108. package/dist/lib/structures/OAuthApplication.js +210 -0
  109. package/dist/lib/structures/OAuthGuild.d.ts +35 -0
  110. package/dist/lib/structures/OAuthGuild.js +61 -0
  111. package/dist/lib/structures/PartialApplication.d.ts +30 -0
  112. package/dist/lib/structures/PartialApplication.js +67 -0
  113. package/dist/lib/structures/Permission.d.ts +21 -0
  114. package/dist/lib/structures/Permission.js +68 -0
  115. package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
  116. package/dist/lib/structures/PermissionOverwrite.js +49 -0
  117. package/dist/lib/structures/PingInteraction.d.ts +16 -0
  118. package/dist/lib/structures/PingInteraction.js +26 -0
  119. package/dist/lib/structures/Poll.d.ts +28 -0
  120. package/dist/lib/structures/Poll.js +78 -0
  121. package/dist/lib/structures/PrivateChannel.d.ts +90 -0
  122. package/dist/lib/structures/PrivateChannel.js +131 -0
  123. package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
  124. package/dist/lib/structures/PrivateThreadChannel.js +27 -0
  125. package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
  126. package/dist/lib/structures/PublicThreadChannel.js +37 -0
  127. package/dist/lib/structures/Role.d.ts +52 -0
  128. package/dist/lib/structures/Role.js +137 -0
  129. package/dist/lib/structures/SKU.d.ts +32 -0
  130. package/dist/lib/structures/SKU.js +53 -0
  131. package/dist/lib/structures/StageChannel.d.ts +33 -0
  132. package/dist/lib/structures/StageChannel.js +44 -0
  133. package/dist/lib/structures/StageInstance.d.ts +36 -0
  134. package/dist/lib/structures/StageInstance.js +94 -0
  135. package/dist/lib/structures/Team.d.ts +22 -0
  136. package/dist/lib/structures/Team.js +67 -0
  137. package/dist/lib/structures/TestEntitlement.d.ts +10 -0
  138. package/dist/lib/structures/TestEntitlement.js +21 -0
  139. package/dist/lib/structures/TextChannel.d.ts +34 -0
  140. package/dist/lib/structures/TextChannel.js +46 -0
  141. package/dist/lib/structures/TextableChannel.d.ts +158 -0
  142. package/dist/lib/structures/TextableChannel.js +276 -0
  143. package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
  144. package/dist/lib/structures/TextableVoiceChannel.js +81 -0
  145. package/dist/lib/structures/ThreadChannel.d.ts +159 -0
  146. package/dist/lib/structures/ThreadChannel.js +295 -0
  147. package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
  148. package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
  149. package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
  150. package/dist/lib/structures/ThreadableChannel.js +58 -0
  151. package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
  152. package/dist/lib/structures/UnavailableGuild.js +21 -0
  153. package/dist/lib/structures/User.d.ts +82 -0
  154. package/dist/lib/structures/User.js +168 -0
  155. package/dist/lib/structures/VoiceChannel.d.ts +20 -0
  156. package/dist/lib/structures/VoiceChannel.js +35 -0
  157. package/dist/lib/structures/VoiceState.d.ts +51 -0
  158. package/dist/lib/structures/VoiceState.js +140 -0
  159. package/dist/lib/structures/Webhook.d.ts +129 -0
  160. package/dist/lib/structures/Webhook.js +206 -0
  161. package/dist/lib/types/applications.d.ts +466 -0
  162. package/dist/lib/types/audit-log.d.ts +122 -0
  163. package/dist/lib/types/auto-moderation.d.ts +99 -0
  164. package/dist/lib/types/channels.d.ts +1260 -0
  165. package/dist/lib/types/client.d.ts +228 -0
  166. package/dist/lib/types/events.d.ts +265 -0
  167. package/dist/lib/types/gateway-raw.d.ts +584 -0
  168. package/dist/lib/types/gateway.d.ts +351 -0
  169. package/dist/lib/types/guild-template.d.ts +33 -0
  170. package/dist/lib/types/guilds.d.ts +855 -0
  171. package/dist/lib/types/index.d.ts +18 -0
  172. package/dist/lib/types/interactions.d.ts +377 -0
  173. package/dist/lib/types/json.d.ts +753 -0
  174. package/dist/lib/types/misc.d.ts +28 -0
  175. package/dist/lib/types/oauth.d.ts +201 -0
  176. package/dist/lib/types/request-handler.d.ts +52 -0
  177. package/dist/lib/types/scheduled-events.d.ts +88 -0
  178. package/dist/lib/types/shared.d.ts +9 -0
  179. package/dist/lib/types/users.d.ts +45 -0
  180. package/dist/lib/types/voice.d.ts +45 -0
  181. package/dist/lib/types/webhooks.d.ts +74 -0
  182. package/dist/lib/util/Collection.d.ts +47 -0
  183. package/dist/lib/util/Collection.js +78 -0
  184. package/dist/lib/util/Errors.d.ts +29 -0
  185. package/dist/lib/util/Errors.js +56 -0
  186. package/dist/lib/util/Routes.d.ts +127 -0
  187. package/dist/lib/util/Routes.js +248 -0
  188. package/dist/lib/util/SimpleCollection.d.ts +12 -0
  189. package/dist/lib/util/SimpleCollection.js +81 -0
  190. package/dist/lib/util/TypedCollection.d.ts +24 -0
  191. package/dist/lib/util/TypedCollection.js +76 -0
  192. package/dist/lib/util/TypedEmitter.d.ts +19 -0
  193. package/dist/lib/util/TypedEmitter.js +19 -0
  194. package/dist/lib/util/Util.d.ts +58 -0
  195. package/dist/lib/util/Util.js +535 -0
  196. package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
  197. package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
  198. package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
  199. package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
  200. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
  201. package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
  202. package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
  203. package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
  204. package/dist/package.json +1 -1
  205. package/package.json +1 -1
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Team_1 = tslib_1.__importDefault(require("./Team"));
5
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
6
+ const Routes = tslib_1.__importStar(require("../util/Routes"));
7
+ const Errors_1 = require("../util/Errors");
8
+ /** Represents an oauth application. */
9
+ class OAuthApplication extends Base_1.default {
10
+ _cachedGuild;
11
+ /** When false, only the application's owners can invite the bot to guilds. */
12
+ botPublic;
13
+ /** When true, the applications bot will only join upon the completion of the full oauth2 code grant flow. */
14
+ botRequireCodeGrant;
15
+ /** This application's rich presence invite cover image hash, if any. */
16
+ coverImage;
17
+ /** This application's default custom authorization link, if any. */
18
+ customInstallURL;
19
+ /** The description of the application. */
20
+ description;
21
+ /** This application's [public flags](https://discord.com/developers/docs/resources/application#application-object-application-flags). */
22
+ flags;
23
+ /** If this application is a game sold on Discord, the ID of the guild to which it has been linked. */
24
+ guildID;
25
+ /** The icon hash of the application. */
26
+ icon;
27
+ /** Settings for this application's in-app authorization link, if enabled. */
28
+ installParams;
29
+ /** The install types available for this application. */
30
+ integrationTypes;
31
+ /** The configs for the install types available for this application. */
32
+ integrationTypesConfig;
33
+ /** The name of the application. */
34
+ name;
35
+ /** The owner of this application. */
36
+ owner;
37
+ /** The ID of the owner of this application. */
38
+ ownerID;
39
+ /** If this application is a game sold on Discord, the id of the Game's SKU. */
40
+ primarySKUID;
41
+ /** A URL to this application's privacy policy. */
42
+ privacyPolicyURL;
43
+ /** This application's role connections verification url. */
44
+ roleConnectionsVerificationURL;
45
+ /** A list of rpc origin urls, if rpc is enabled. */
46
+ rpcOrigins;
47
+ /** If this application is a game sold on Discord, the slug that links to its store page. */
48
+ slug;
49
+ /** The tags for this application. */
50
+ tags;
51
+ /** The team that owns this application, if any. */
52
+ team;
53
+ /** A URL to this application's terms of service. */
54
+ termsOfServiceURL;
55
+ /** The type of this application. */
56
+ type;
57
+ /** The bot's hex encoded public key. */
58
+ verifyKey;
59
+ constructor(data, client) {
60
+ super(data.id, client);
61
+ this.botPublic = !!data.bot_public;
62
+ this.botRequireCodeGrant = !!data.bot_require_code_grant;
63
+ this.coverImage = null;
64
+ this.description = data.description;
65
+ this.flags = data.flags;
66
+ this.guildID = data.guild_id ?? null;
67
+ this.icon = null;
68
+ this.integrationTypes = [];
69
+ this.integrationTypesConfig = {};
70
+ this.name = data.name;
71
+ this.owner = client.users.update(data.owner);
72
+ this.ownerID = data.owner.id;
73
+ this.rpcOrigins = [];
74
+ this.team = null;
75
+ this.type = data.type;
76
+ this.verifyKey = data.verify_key;
77
+ this.update(data);
78
+ }
79
+ update(data) {
80
+ super.update(data);
81
+ if (data.bot_public !== undefined) {
82
+ this.botPublic = data.bot_public;
83
+ }
84
+ if (data.bot_require_code_grant !== undefined) {
85
+ this.botRequireCodeGrant = data.bot_require_code_grant;
86
+ }
87
+ if (data.cover_image !== undefined) {
88
+ this.coverImage = data.cover_image;
89
+ }
90
+ if (data.custom_install_url !== undefined) {
91
+ this.customInstallURL = data.custom_install_url;
92
+ }
93
+ if (data.description !== undefined) {
94
+ this.description = data.description;
95
+ }
96
+ if (data.flags !== undefined) {
97
+ this.flags = data.flags;
98
+ }
99
+ this.guildID = data.guild_id === undefined ? null : data.guild_id;
100
+ if (data.icon !== undefined) {
101
+ this.icon = data.icon;
102
+ }
103
+ if (data.install_params !== undefined) {
104
+ this.installParams = data.install_params;
105
+ }
106
+ if (data.integration_types !== undefined) {
107
+ this.integrationTypes = data.integration_types;
108
+ }
109
+ if (data.integration_types_config !== undefined) {
110
+ this.integrationTypesConfig = Object.fromEntries(Object.entries(data.integration_types_config).map(([key, value]) => [key, { oauth2InstallParams: value.oauth2_install_params }]));
111
+ }
112
+ if (data.name !== undefined) {
113
+ this.name = data.name;
114
+ }
115
+ if (data.owner !== undefined) {
116
+ this.owner = this.client.users.update(data.owner);
117
+ this.ownerID = data.owner.id;
118
+ }
119
+ if (data.primary_sku_id !== undefined) {
120
+ this.primarySKUID = data.primary_sku_id;
121
+ }
122
+ if (data.privacy_policy_url !== undefined) {
123
+ this.privacyPolicyURL = data.privacy_policy_url;
124
+ }
125
+ if (data.rpc_origins !== undefined) {
126
+ this.rpcOrigins = data.rpc_origins;
127
+ }
128
+ if (data.slug !== undefined) {
129
+ this.slug = data.slug;
130
+ }
131
+ if (data.tags !== undefined) {
132
+ this.tags = data.tags;
133
+ }
134
+ if (data.team !== undefined) {
135
+ this.team = data.team ? new Team_1.default(data.team, this.client) : null;
136
+ }
137
+ if (data.terms_of_service_url !== undefined) {
138
+ this.termsOfServiceURL = data.terms_of_service_url;
139
+ }
140
+ if (data.type !== undefined) {
141
+ this.type = data.type;
142
+ }
143
+ if (data.verify_key !== undefined) {
144
+ this.verifyKey = data.verify_key;
145
+ }
146
+ }
147
+ /** If this application is a game sold on Discord, the guild to which it has been linked. This will throw an error if the guild is not cached. */
148
+ get guild() {
149
+ if (this.guildID !== null && this._cachedGuild !== null) {
150
+ this._cachedGuild ??= this.client.guilds.get(this.guildID);
151
+ if (!this._cachedGuild) {
152
+ if (this.client.options.restMode) {
153
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present when rest mode is enabled.`);
154
+ }
155
+ if (!this.client.shards.connected) {
156
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present without a gateway connection.`);
157
+ }
158
+ throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present.`);
159
+ }
160
+ return this._cachedGuild;
161
+ }
162
+ return this._cachedGuild === null ? this._cachedGuild : (this._cachedGuild = null);
163
+ }
164
+ /**
165
+ * The url of this application's cover image.
166
+ * @param format The format the url should be.
167
+ * @param size The dimensions of the image.
168
+ */
169
+ coverImageURL(format, size) {
170
+ return this.coverImage === null ? null : this.client.util.formatImage(Routes.APPLICATION_COVER(this.id, this.coverImage), format, size);
171
+ }
172
+ /**
173
+ * The url of this application's icon.
174
+ * @param format The format the url should be.
175
+ * @param size The dimensions of the image.
176
+ */
177
+ iconURL(format, size) {
178
+ return this.icon === null ? null : this.client.util.formatImage(Routes.APPLICATION_ICON(this.id, this.icon), format, size);
179
+ }
180
+ toJSON() {
181
+ return {
182
+ ...super.toJSON(),
183
+ botPublic: this.botPublic,
184
+ botRequireCodeGrant: this.botRequireCodeGrant,
185
+ coverImage: this.coverImage,
186
+ customInstallURL: this.customInstallURL,
187
+ description: this.description,
188
+ flags: this.flags,
189
+ guildID: this.guildID,
190
+ icon: this.icon,
191
+ installParams: this.installParams,
192
+ integrationTypes: this.integrationTypes,
193
+ integrationTypesConfig: this.integrationTypesConfig,
194
+ name: this.name,
195
+ owner: this.owner.toJSON(),
196
+ ownerID: this.ownerID,
197
+ primarySKUID: this.primarySKUID,
198
+ privacyPolicyURL: this.privacyPolicyURL,
199
+ rpcOrigins: this.rpcOrigins,
200
+ slug: this.slug,
201
+ tags: this.tags,
202
+ team: this.team?.toJSON() ?? null,
203
+ termsOfServiceURL: this.termsOfServiceURL,
204
+ type: this.type,
205
+ verifyKey: this.verifyKey
206
+ };
207
+ }
208
+ }
209
+ exports.default = OAuthApplication;
210
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhBcHBsaWNhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL09BdXRoQXBwbGljYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsMERBQTBCO0FBRTFCLDBEQUEwQjtBQUsxQiwrREFBeUM7QUFFekMsMkNBQStDO0FBRS9DLHVDQUF1QztBQUN2QyxNQUFxQixnQkFBaUIsU0FBUSxjQUFJO0lBQ3RDLFlBQVksQ0FBZ0I7SUFDcEMsOEVBQThFO0lBQzlFLFNBQVMsQ0FBVTtJQUNuQiw2R0FBNkc7SUFDN0csbUJBQW1CLENBQVU7SUFDN0Isd0VBQXdFO0lBQ3hFLFVBQVUsQ0FBZ0I7SUFDMUIsb0VBQW9FO0lBQ3BFLGdCQUFnQ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xJQUFJO1lBQ2pDLFNBQVMsRUFBZSxJQUFJLENBQUMsU0FBUztTQUV6QyxDQUFDO0lBQ04sQ0FBQztDQUNKO0FBak5ELG1DQWlOQyJ9
@@ -0,0 +1,35 @@
1
+ /** @module OAuthGuild */
2
+ import Base from "./Base";
3
+ import Permission from "./Permission";
4
+ import type Guild from "./Guild";
5
+ import type { GuildFeature, ImageFormat } from "../Constants";
6
+ import type { JSONOAuthGuild, RawOAuthGuild } from "../types";
7
+ import type Client from "../Client";
8
+ /** Represents a guild retrieved via oauth. */
9
+ export default class OAuthGuild extends Base {
10
+ private _cachedCompleteGuild?;
11
+ /** The approximate number of members in this guild (if retrieved with counts). */
12
+ approximateMemberCount?: number;
13
+ /** The approximate number of non-offline members in this guild (if retrieved with counts). */
14
+ approximatePresenceCount?: number;
15
+ /** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
16
+ features: Array<GuildFeature>;
17
+ /** The icon hash of this guild. */
18
+ icon: string | null;
19
+ /** The name of this guild. */
20
+ name: string;
21
+ /** If the user is the owner of this guild. */
22
+ owner: boolean;
23
+ /** The permissions of the user in this guild. */
24
+ permissions: Permission;
25
+ constructor(data: RawOAuthGuild, client: Client);
26
+ /** The complete guild this OAuthGuild represents, if cached. */
27
+ get completeGuild(): Guild | undefined;
28
+ /**
29
+ * The url of this guild's icon.
30
+ * @param format The format the url should be.
31
+ * @param size The dimensions of the image.
32
+ */
33
+ iconURL(format?: ImageFormat, size?: number): string | null;
34
+ toJSON(): JSONOAuthGuild;
35
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module OAuthGuild */
5
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
6
+ const Permission_1 = tslib_1.__importDefault(require("./Permission"));
7
+ const Routes = tslib_1.__importStar(require("../util/Routes"));
8
+ /** Represents a guild retrieved via oauth. */
9
+ class OAuthGuild extends Base_1.default {
10
+ _cachedCompleteGuild;
11
+ /** The approximate number of members in this guild (if retrieved with counts). */
12
+ approximateMemberCount;
13
+ /** The approximate number of non-offline members in this guild (if retrieved with counts). */
14
+ approximatePresenceCount;
15
+ /** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
16
+ features;
17
+ /** The icon hash of this guild. */
18
+ icon;
19
+ /** The name of this guild. */
20
+ name;
21
+ /** If the user is the owner of this guild. */
22
+ owner;
23
+ /** The permissions of the user in this guild. */
24
+ permissions;
25
+ constructor(data, client) {
26
+ super(data.id, client);
27
+ this.approximateMemberCount = data.approximate_member_count;
28
+ this.approximatePresenceCount = data.approximate_presence_count;
29
+ this.features = data.features;
30
+ this.name = data.name;
31
+ this.icon = data.icon;
32
+ this.owner = data.owner;
33
+ this.permissions = new Permission_1.default(data.permissions);
34
+ }
35
+ /** The complete guild this OAuthGuild represents, if cached. */
36
+ get completeGuild() {
37
+ return this._cachedCompleteGuild ??= this.client.guilds.get(this.id);
38
+ }
39
+ /**
40
+ * The url of this guild's icon.
41
+ * @param format The format the url should be.
42
+ * @param size The dimensions of the image.
43
+ */
44
+ iconURL(format, size) {
45
+ return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
46
+ }
47
+ toJSON() {
48
+ return {
49
+ ...super.toJSON(),
50
+ approximateMemberCount: this.approximateMemberCount,
51
+ approximatePresenceCount: this.approximatePresenceCount,
52
+ features: this.features,
53
+ icon: this.icon,
54
+ name: this.name,
55
+ owner: this.owner,
56
+ permissions: this.permissions.toJSON()
57
+ };
58
+ }
59
+ }
60
+ exports.default = OAuthGuild;
61
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhHdWlsZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL09BdXRoR3VpbGQudHMiXSwibmFtZXMiOltdLCJt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QUksYUFBYTtRQUNiLE9BQU8sSUFBSSxDQUFDLG9CQUFvQixLQUFLLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDekUsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxPQUFPLENBQUMsTUFBb0IsRUFBRSxJQUFhO1FBQ3ZDLE9BQU8sSUFBSSxDQUFDLElBQUksS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUUsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQ3pILENBQUM7SUFFUSxNQUFNO1FBQ1gsT0FBTztZQUNILEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRTtZQUNqQixzQkFBc0IsRUFBSSxJQUFJLENBQUMsc0JBQXNCO1lBQ3JELHdCQUF3QixFQUFFLElBQUksQ0FBQyx3QkFBd0I7WUFDdkQsUUFBUSxFQUFrQixJQUFJLENBQUMsUUFBUTtZQUN2QyxJQUFJLEVBQXNCLElBQUksQ0FBQyxJQUFJO1lBQ25DLElBQUksRUFBc0IsSUFBSSxDQUFDLElBQUk7WUFDbkMsS0FBSyxFQUFxQixJQUFJLENBQUMsS0FBSztZQUNwQyxXQUFXLEVBQWUsSUFBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLEVBQUU7U0FDdEQsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQXJERCw2QkFxREMifQ==
@@ -0,0 +1,30 @@
1
+ /** @module PartialApplication */
2
+ import Base from "./Base";
3
+ import type Client from "../Client";
4
+ import type { ImageFormat } from "../Constants";
5
+ import type { RawPartialApplication } from "../types/applications";
6
+ import type { JSONPartialApplication } from "../types/json";
7
+ /** Represents a partial application. */
8
+ export default class PartialApplication extends Base {
9
+ /** When false, only the application's owners can invite the bot to guilds. */
10
+ botPublic?: boolean;
11
+ /** When true, the applications bot will only join upon the completion of the full oauth2 code grant flow. */
12
+ botRequireCodeGrant?: boolean;
13
+ /** The description of the application. */
14
+ description: string;
15
+ /** The icon hash of the application. */
16
+ icon: string | null;
17
+ /** The name of the application. */
18
+ name: string;
19
+ /** The bot's hex encoded public key. */
20
+ verifyKey?: string;
21
+ constructor(data: RawPartialApplication, client: Client);
22
+ protected update(data: RawPartialApplication): void;
23
+ /**
24
+ * The url of this application's icon.
25
+ * @param format The format the url should be.
26
+ * @param size The dimensions of the image.
27
+ */
28
+ iconURL(format?: ImageFormat, size?: number): string | null;
29
+ toJSON(): JSONPartialApplication;
30
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module PartialApplication */
5
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
6
+ const Routes = tslib_1.__importStar(require("../util/Routes"));
7
+ /** Represents a partial application. */
8
+ class PartialApplication extends Base_1.default {
9
+ /** When false, only the application's owners can invite the bot to guilds. */
10
+ botPublic;
11
+ /** When true, the applications bot will only join upon the completion of the full oauth2 code grant flow. */
12
+ botRequireCodeGrant;
13
+ /** The description of the application. */
14
+ description;
15
+ /** The icon hash of the application. */
16
+ icon;
17
+ /** The name of the application. */
18
+ name;
19
+ /** The bot's hex encoded public key. */
20
+ verifyKey;
21
+ constructor(data, client) {
22
+ super(data.id, client);
23
+ this.description = data.description;
24
+ this.icon = null;
25
+ this.name = data.name;
26
+ this.verifyKey = data.verify_key;
27
+ this.update(data);
28
+ }
29
+ update(data) {
30
+ if (data.bot_public !== undefined) {
31
+ this.botPublic = data.bot_public;
32
+ }
33
+ if (data.bot_require_code_grant !== undefined) {
34
+ this.botRequireCodeGrant = data.bot_require_code_grant;
35
+ }
36
+ if (data.description !== undefined) {
37
+ this.description = data.description;
38
+ }
39
+ if (data.icon !== undefined) {
40
+ this.icon = data.icon;
41
+ }
42
+ if (data.name !== undefined) {
43
+ this.name = data.name;
44
+ }
45
+ }
46
+ /**
47
+ * The url of this application's icon.
48
+ * @param format The format the url should be.
49
+ * @param size The dimensions of the image.
50
+ */
51
+ iconURL(format, size) {
52
+ return this.icon === null ? null : this.client.util.formatImage(Routes.APPLICATION_COVER(this.id, this.icon), format, size);
53
+ }
54
+ toJSON() {
55
+ return {
56
+ ...super.toJSON(),
57
+ botPublic: this.botPublic,
58
+ botRequireCodeGrant: this.botRequireCodeGrant,
59
+ description: this.description,
60
+ icon: this.icon,
61
+ name: this.name,
62
+ verifyKey: this.verifyKey
63
+ };
64
+ }
65
+ }
66
+ exports.default = PartialApplication;
67
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGFydGlhbEFwcGxpY2F0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvUGFydGlhbEFwcGxpY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUNqQywwREFBMEI7QUFHMUIsK0RBQXlDO0FBSXpDLHdDQUF3QztBQUN4QyxNQUFxQixrQkFBbUIsU0FBUSxjQUFJO0lBQ2hELDhFQUE4RTtJQUM5RSxTQUFTLENBQVc7SUFDcEIsNkdBQTZHO0lBQzdHLG1CQUFtQixDQUFXO0lBQzlCLDBDQUEwQztJQUMxQyxXQUFXLENBQVM7SUFDcEIsd0NBQXdDO0lBQ3hDLElBQUksQ0FBZ0I7SUFDcEIsbUNBQW1DO0lBQ25DLElBQUksQ0FBUztJQUNiLHdDQUF3QztJQUN4QyxTQUFTLENBQVU7SUFDbkIsWUFBWSxJQUEyQixFQUFFLE1BQWM7UUFDbkQsS0FBSyxDQUF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LENBQUM7SUFDTCxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNILE9BQU8sQ0FBQyxNQUFvQixFQUFFLElBQWE7UUFDdkMsT0FBTyxJQUFJLENBQUMsSUFBSSxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLGlCQUFpQixDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFLE1BQU0sRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNoSSxDQUFDO0lBRVEsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsU0FBUyxFQUFZLElBQUksQ0FBQyxTQUFTO1lBQ25DLG1CQUFtQixFQUFFLElBQUksQ0FBQyxtQkFBbUI7WUFDN0MsV0FBVyxFQUFVLElBQUksQ0FBQyxXQUFXO1lBQ3JDLElBQUksRUFBaUIsSUFBSSxDQUFDLElBQUk7WUFDOUIsSUFBSSxFQUFpQixJQUFJLENBQUMsSUFBSTtZQUM5QixTQUFTLEVBQVksSUFBSSxDQUFDLFNBQVM7U0FDdEMsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQTVERCxxQ0E0REMifQ==
@@ -0,0 +1,21 @@
1
+ /** @module Permission */
2
+ import { Permissions, type PermissionName as PermissionNames } from "../Constants";
3
+ import type { JSONPermission } from "../types/json";
4
+ /** Represents a permission. */
5
+ export default class Permission {
6
+ private _json;
7
+ /** The allowed permissions for this permission instance. */
8
+ allow: bigint;
9
+ /** The denied permissions for this permission instance. */
10
+ deny: bigint;
11
+ constructor(allow: bigint | string, deny?: bigint | string);
12
+ /** A key-value map of permission to if it's been allowed or denied (not present if neither) */
13
+ get json(): Partial<Record<keyof typeof Permissions, boolean>>;
14
+ /**
15
+ * Check if this permissions instance has the given permissions allowed
16
+ * @param permissions The permissions to check for.
17
+ */
18
+ has(...permissions: Array<PermissionNames | bigint>): boolean;
19
+ toJSON(): JSONPermission;
20
+ toString(): string;
21
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** @module Permission */
4
+ const Constants_1 = require("../Constants");
5
+ /** Represents a permission. */
6
+ class Permission {
7
+ _json;
8
+ /** The allowed permissions for this permission instance. */
9
+ allow;
10
+ /** The denied permissions for this permission instance. */
11
+ deny;
12
+ constructor(allow, deny = 0n) {
13
+ this.allow = BigInt(allow);
14
+ this.deny = BigInt(deny);
15
+ Object.defineProperty(this, "#json", {
16
+ value: undefined,
17
+ enumerable: false,
18
+ writable: true,
19
+ configurable: false
20
+ });
21
+ }
22
+ /** A key-value map of permission to if it's been allowed or denied (not present if neither) */
23
+ get json() {
24
+ if (this._json) {
25
+ return this._json;
26
+ }
27
+ else {
28
+ const json = {};
29
+ for (const perm of Object.keys(Constants_1.Permissions)) {
30
+ if (this.allow & Constants_1.Permissions[perm]) {
31
+ json[perm] = true;
32
+ }
33
+ else if (this.deny & Constants_1.Permissions[perm]) {
34
+ json[perm] = false;
35
+ }
36
+ }
37
+ return (this._json = json);
38
+ }
39
+ }
40
+ /**
41
+ * Check if this permissions instance has the given permissions allowed
42
+ * @param permissions The permissions to check for.
43
+ */
44
+ has(...permissions) {
45
+ for (const perm of permissions) {
46
+ if (typeof perm === "bigint") {
47
+ if ((this.allow & perm) !== perm) {
48
+ return false;
49
+ }
50
+ }
51
+ else if (!(this.allow & Constants_1.Permissions[perm])) {
52
+ return false;
53
+ }
54
+ }
55
+ return true;
56
+ }
57
+ toJSON() {
58
+ return {
59
+ allow: this.allow.toString(),
60
+ deny: this.deny.toString()
61
+ };
62
+ }
63
+ toString() {
64
+ return `[${this.constructor.name} +${this.allow} -${this.deny}]`;
65
+ }
66
+ }
67
+ exports.default = Permission;
68
+ //# sourceMappingURL=data:application/json;base64,eyJ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0FBQztJQUVELFFBQVE7UUFDSixPQUFPLElBQUksSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLEtBQUssSUFBSSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUMsSUFBSSxHQUFHLENBQUM7SUFDckUsQ0FBQztDQUNKO0FBL0RELDZCQStEQyJ9
@@ -0,0 +1,26 @@
1
+ /** @module PermissionOverwrite */
2
+ import Base from "./Base";
3
+ import Permission from "./Permission";
4
+ import type { OverwriteTypes, PermissionName as PermissionNames, Permissions } from "../Constants";
5
+ import type Client from "../Client";
6
+ import type { RawOverwrite } from "../types/channels";
7
+ import type { JSONPermissionOverwrite } from "../types/json";
8
+ /** Represents a permission overwrite. */
9
+ export default class PermissionOverwrite extends Base {
10
+ /** The permissions of this overwrite. */
11
+ permission: Permission;
12
+ /** The type of this overwrite. `0` for role, `1` for user. */
13
+ type: OverwriteTypes;
14
+ constructor(data: RawOverwrite, client: Client);
15
+ protected update(data: Partial<RawOverwrite>): void;
16
+ get allow(): bigint;
17
+ get deny(): bigint;
18
+ /** A key-value map of permission to if it's been allowed or denied (not present if neither) */
19
+ get json(): Partial<Record<keyof typeof Permissions, boolean>>;
20
+ /**
21
+ *Check if this permissions instance has the given permissions allowed
22
+ * @param permissions The permissions to check for.
23
+ */
24
+ has(...permissions: Array<PermissionNames | bigint>): boolean;
25
+ toJSON(): JSONPermissionOverwrite;
26
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module PermissionOverwrite */
5
+ const Base_1 = tslib_1.__importDefault(require("./Base"));
6
+ const Permission_1 = tslib_1.__importDefault(require("./Permission"));
7
+ /** Represents a permission overwrite. */
8
+ class PermissionOverwrite extends Base_1.default {
9
+ /** The permissions of this overwrite. */
10
+ permission;
11
+ /** The type of this overwrite. `0` for role, `1` for user. */
12
+ type;
13
+ constructor(data, client) {
14
+ super(data.id, client);
15
+ this.permission = new Permission_1.default(data.allow, data.deny);
16
+ this.type = data.type;
17
+ }
18
+ update(data) {
19
+ if (data.allow !== undefined || data.deny !== undefined) {
20
+ this.permission = new Permission_1.default(data.allow ?? 0n, data.deny ?? 0n);
21
+ }
22
+ }
23
+ get allow() {
24
+ return this.permission.allow;
25
+ }
26
+ get deny() {
27
+ return this.permission.deny;
28
+ }
29
+ /** A key-value map of permission to if it's been allowed or denied (not present if neither) */
30
+ get json() {
31
+ return this.permission.json;
32
+ }
33
+ /**
34
+ *Check if this permissions instance has the given permissions allowed
35
+ * @param permissions The permissions to check for.
36
+ */
37
+ has(...permissions) {
38
+ return this.permission.has(...permissions);
39
+ }
40
+ toJSON() {
41
+ return {
42
+ ...super.toJSON(),
43
+ permission: this.permission.toJSON(),
44
+ type: this.type
45
+ };
46
+ }
47
+ }
48
+ exports.default = PermissionOverwrite;
49
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGVybWlzc2lvbk92ZXJ3cml0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL1Blcm1pc3Npb25PdmVyd3JpdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0NBQWtDO0FBQ2xDLDBEQUEwQjtBQUMxQixzRUFBc0M7QUFNdEMseUNBQXlDO0FBQ3pDLE1BQXFCLG1CQUFvQixTQUFRLGNBQUk7SUFDakQseUNBQXlDO0lBQ3pDLFVBQVUsQ0FBYTtJQUN2Qiw4REFBOEQ7SUFDOUQsSUFBSSxDQUFpQjtJQUNyQixZQUFZLElBQWtCLEVBQUUsTUFBYztRQUMxQyxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxNQUFNLENBQUMsQ0FBQztRQUN2QixJQUFJLENBQUMsVUFBVSxHQUFHLElBQUksb0JBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUF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Qsc0NBNENDIn0=
@@ -0,0 +1,16 @@
1
+ /** @module PingInteraction */
2
+ import Interaction from "./Interaction";
3
+ import { type InteractionTypes } from "../Constants";
4
+ import type { RawPingInteraction } from "../types/interactions";
5
+ import type Client from "../Client";
6
+ import type { JSONPingInteraction } from "../types/json";
7
+ /** Represents a PING interaction. This will not be received over a gateway connection. */
8
+ export default class PingInteraction extends Interaction {
9
+ type: InteractionTypes.PING;
10
+ constructor(data: RawPingInteraction, client: Client);
11
+ /**
12
+ * Responds to the interaction with a `PONG`.
13
+ */
14
+ pong(): Promise<void>;
15
+ toJSON(): JSONPingInteraction;
16
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /** @module PingInteraction */
5
+ const Interaction_1 = tslib_1.__importDefault(require("./Interaction"));
6
+ const Constants_1 = require("../Constants");
7
+ /** Represents a PING interaction. This will not be received over a gateway connection. */
8
+ class PingInteraction extends Interaction_1.default {
9
+ constructor(data, client) {
10
+ super(data, client);
11
+ }
12
+ /**
13
+ * Responds to the interaction with a `PONG`.
14
+ */
15
+ async pong() {
16
+ return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.PONG });
17
+ }
18
+ toJSON() {
19
+ return {
20
+ ...super.toJSON(),
21
+ type: this.type
22
+ };
23
+ }
24
+ }
25
+ exports.default = PingInteraction;
26
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGluZ0ludGVyYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvUGluZ0ludGVyYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDhCQUE4QjtBQUM5Qix3RUFBd0M7QUFDeEMsNENBQStFO0FBSy9FLDBGQUEwRjtBQUMxRixNQUFxQixlQUFnQixTQUFRLHFCQUFXO0lBRXBELFlBQVksSUFBd0IsRUFBRSxNQUFjO1FBQ2hELEtBQUssQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDeEIsQ0FBQztJQUVEOztPQUVHO0lBQ0gsS0FBSyxDQUFDLElBQUk7UUFDTixPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLElBQUksQ0FBQyxLQUFLLEVBQUUsRUFBRSxJQUFJLEVBQUUsb0NBQXdCLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUNqSSxDQUFDO0lBRVEsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJO1NBQ2xCLENBQUM7SUFDTixDQUFDO0NBQ0o7QUFuQkQsa0NBbUJDIn0=