@osrsclans/api 0.0.0 → 1.15.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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +166 -0
  3. package/dist/answered.d.ts +17 -0
  4. package/dist/answered.js +52 -0
  5. package/dist/api-error.d.ts +13 -0
  6. package/dist/api-error.js +18 -0
  7. package/dist/chains.d.ts +37 -0
  8. package/dist/chains.js +30 -0
  9. package/dist/client.d.ts +24 -0
  10. package/dist/client.js +25 -0
  11. package/dist/data-request-error.d.ts +9 -0
  12. package/dist/data-request-error.js +12 -0
  13. package/dist/data-requests.d.ts +6 -0
  14. package/dist/data-requests.js +16 -0
  15. package/dist/destinations.d.ts +23 -0
  16. package/dist/destinations.js +74 -0
  17. package/dist/errors.generated.d.ts +775 -0
  18. package/dist/errors.generated.js +1034 -0
  19. package/dist/index.generated.d.ts +7 -0
  20. package/dist/index.generated.js +4 -0
  21. package/dist/models.generated.d.ts +351 -0
  22. package/dist/models.generated.js +1 -0
  23. package/dist/operation-types.d.ts +23 -0
  24. package/dist/operation-types.js +1 -0
  25. package/dist/operations.generated.d.ts +5693 -0
  26. package/dist/operations.generated.js +362 -0
  27. package/dist/outcomes.generated.d.ts +21 -0
  28. package/dist/outcomes.generated.js +26 -0
  29. package/dist/public.d.ts +7 -0
  30. package/dist/public.js +7 -0
  31. package/dist/schema.generated.d.ts +32193 -0
  32. package/dist/schema.generated.js +1136 -0
  33. package/dist/streams.d.ts +29 -0
  34. package/dist/streams.js +95 -0
  35. package/dist/unexpected-status.d.ts +5 -0
  36. package/dist/unexpected-status.js +9 -0
  37. package/dist/walk.d.ts +13 -0
  38. package/dist/walk.js +24 -0
  39. package/dist/walkers.generated.d.ts +702 -0
  40. package/dist/walkers.generated.js +106 -0
  41. package/package.json +52 -6
@@ -0,0 +1,362 @@
1
+ import { answered, finished, formData } from "./answered.js";
2
+ /** One function per route: it returns the answer, and throws the refusal's `ApiError` class. */
3
+ export function namedOperations(client) {
4
+ return {
5
+ /** Search items by name, slot and value */
6
+ browseItems: (query = {}) => answered(client.GET("/api/v1/osrs/items/browse", { params: { query } })),
7
+ /** Claim a clan's in-game clan through ClanSocket */
8
+ claimClansocketClan: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/clansocket/claim", { params: { path: { "slug": slug } }, body })),
9
+ /** Publish an update */
10
+ createClanPost: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/posts", { params: { path: { "slug": slug } }, body })),
11
+ /** Create a data request to one member's plugin */
12
+ createClansocketDataRequest: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/clansocket/data-requests", { params: { path: { "slug": slug } }, body })),
13
+ /** Create a ClanSocket destination for this clan */
14
+ createClansocketDestination: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/clansocket/destinations", { params: { path: { "slug": slug } }, body })),
15
+ /** Create a Dink config for this clan */
16
+ createDinkConfig: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/dink/configs", { params: { path: { "slug": slug } }, body })),
17
+ /** Create a Dink consumer for this clan */
18
+ createDinkConsumer: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/dink/consumers", { params: { path: { "slug": slug } }, body })),
19
+ /** Create a Raffle Utils run */
20
+ createRaffleRun: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/raffle-runs", { params: { path: { "slug": slug } }, body })),
21
+ /** Create a webhook for this clan's board */
22
+ createWebhook: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/webhooks", { params: { path: { "slug": slug } }, body })),
23
+ /** Remove one file this clan has sent */
24
+ deleteArtwork: (slug, artworkId) => finished(client.DELETE("/api/v1/clans/{slug}/artwork/{artwork_id}", { params: { path: { "slug": slug, "artwork_id": artworkId } } })),
25
+ /** Remove an update */
26
+ deleteClanPost: (slug, postId) => finished(client.DELETE("/api/v1/clans/{slug}/posts/{post_id}", { params: { path: { "slug": slug, "post_id": postId } } })),
27
+ /** Remove a ClanSocket destination */
28
+ deleteClansocketDestination: (slug, destinationId) => answered(client.POST("/api/v1/clans/{slug}/clansocket/destinations/{destination_id}/removal", { params: { path: { "slug": slug, "destination_id": destinationId } } })),
29
+ /** Remove a clan's ClanSocket link */
30
+ deleteClansocketLink: (slug) => finished(client.DELETE("/api/v1/clans/{slug}/clansocket", { params: { path: { "slug": slug } } })),
31
+ /** Remove a Dink config */
32
+ deleteDinkConfig: (slug, configId) => answered(client.POST("/api/v1/clans/{slug}/dink/configs/{config_id}/removal", { params: { path: { "slug": slug, "config_id": configId } } })),
33
+ /** Remove a Dink consumer */
34
+ deleteDinkConsumer: (slug, consumerId) => answered(client.POST("/api/v1/clans/{slug}/dink/consumers/{consumer_id}/removal", { params: { path: { "slug": slug, "consumer_id": consumerId } } })),
35
+ /** Remove a clan's Discord server link */
36
+ deleteDiscordServer: (slug) => finished(client.DELETE("/api/v1/clans/{slug}/discord-server", { params: { path: { "slug": slug } } })),
37
+ /** Remove a reply to a review of your clan */
38
+ deleteReviewReply: (slug, reviewId) => finished(client.DELETE("/api/v1/clans/{slug}/reviews/{review_id}/reply", { params: { path: { "slug": slug, "review_id": reviewId } } })),
39
+ /** Remove one of this clan's webhooks */
40
+ deleteWebhook: (slug, webhookId) => answered(client.POST("/api/v1/clans/{slug}/webhooks/{webhook_id}/removal", { params: { path: { "slug": slug, "webhook_id": webhookId } } })),
41
+ /** Sign out */
42
+ endSession: () => finished(client.POST("/api/v1/auth/logout")),
43
+ /** Complete a sign-in */
44
+ finishSignIn: (provider, query) => finished(client.GET("/api/v1/auth/{provider}/callback", { params: { path: { "provider": provider }, query } })),
45
+ /** Fetch an animated model */
46
+ getAnimationModel: (kind, subjectId, sequenceId, query = {}) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}/animations/{sequence_id}.glb", { params: { path: { "kind": kind, "subject_id": subjectId, "sequence_id": sequenceId }, query }, parseAs: "blob" })),
47
+ /** Fetch the stills of an animation */
48
+ getAnimationStills: (kind, subjectId, sequenceId, query = {}) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}/animations/{sequence_id}.webp", { params: { path: { "kind": kind, "subject_id": subjectId, "sequence_id": sequenceId }, query }, parseAs: "blob" })),
49
+ /** Fetch one account's image */
50
+ getAvatar: (accountId, query = {}) => answered(client.GET("/api/v1/avatars/{account_id}", { params: { path: { "account_id": accountId }, query }, parseAs: "blob" })),
51
+ /** Fetch one board */
52
+ getBoard: (slug) => answered(client.GET("/api/v1/forums/boards/{slug}", { params: { path: { "slug": slug } } })),
53
+ /** Fetch a general board's header */
54
+ getBoardBanner: (slug) => answered(client.GET("/api/v1/forums/boards/{slug}/banner.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
55
+ /** Fetch this board's share card */
56
+ getBoardCard: (slug) => answered(client.GET("/api/v1/forums/boards/{slug}/card.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
57
+ /** Fetch a general board's strip */
58
+ getBoardStrip: (slug) => answered(client.GET("/api/v1/forums/boards/{slug}/strip.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
59
+ /** Fetch the game build in use */
60
+ getCacheBuild: () => answered(client.GET("/api/v1/osrs/meta/build")),
61
+ /** Fetch how many of each thing the build holds */
62
+ getCacheCounts: () => answered(client.GET("/api/v1/osrs/meta/counts")),
63
+ /** Fetch everything about the cache build in use */
64
+ getCacheMeta: () => answered(client.GET("/api/v1/osrs/meta")),
65
+ /** Fetch whether the site is on the newest game build */
66
+ getCacheStatus: () => answered(client.GET("/api/v1/osrs/meta/status")),
67
+ /** Fetch one clan */
68
+ getClan: (slug) => answered(client.GET("/api/v1/clans/{slug}", { params: { path: { "slug": slug } } })),
69
+ /** Fetch this clan's badge */
70
+ getClanBadge: (slug, badgeFormat, query) => answered(client.GET("/api/v1/clans/{slug}/badge.{badge_format}", { params: { path: { "slug": slug, "badge_format": badgeFormat }, query }, parseAs: "blob" })),
71
+ /** Fetch this clan's share card */
72
+ getClanCard: (slug) => answered(client.GET("/api/v1/clans/{slug}/card.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
73
+ /** Fetch a clan's Discord invite */
74
+ getClanDiscordInvite: (slug) => answered(client.GET("/api/v1/clans/{slug}/discord", { params: { path: { "slug": slug } } })),
75
+ /** Fetch this clan's embeddable card */
76
+ getClanEmbedCard: (slug, cardFormat, query) => answered(client.GET("/api/v1/clans/{slug}/embed-card.{card_format}", { params: { path: { "slug": slug, "card_format": cardFormat }, query }, parseAs: "blob" })),
77
+ /** Fetch a clan's Fluxer invite */
78
+ getClanFluxerInvite: (slug) => answered(client.GET("/api/v1/clans/{slug}/fluxer", { params: { path: { "slug": slug } } })),
79
+ /** Fetch where a clan moved to */
80
+ getClanRedirect: (slug) => answered(client.GET("/api/v1/clans/{slug}/moved", { params: { path: { "slug": slug } } })),
81
+ /** Fetch one review of a clan */
82
+ getClanReview: (slug, reviewId) => answered(client.GET("/api/v1/clans/{slug}/reviews/{review_id}", { params: { path: { "slug": slug, "review_id": reviewId } } })),
83
+ /** Fetch the traffic of one clan's page */
84
+ getClanTraffic: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/traffic", { params: { path: { "slug": slug }, query } })),
85
+ /** Fetch the traffic of one clan's page, hour by hour */
86
+ getClanTrafficHours: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/traffic/hours", { params: { path: { "slug": slug }, query } })),
87
+ /** Fetch where a data request stands */
88
+ getClansocketDataRequest: (slug, requestId, query = {}) => answered(client.GET("/api/v1/clans/{slug}/clansocket/data-requests/{request_id}", { params: { path: { "slug": slug, "request_id": requestId }, query } })),
89
+ /** Fetch a clan's ClanSocket link */
90
+ getClansocketLink: (slug) => answered(client.GET("/api/v1/clans/{slug}/clansocket", { params: { path: { "slug": slug } } })),
91
+ /** Fetch a clan's ClanSocket preset */
92
+ getClansocketPreset: (slug) => answered(client.GET("/api/v1/clans/{slug}/clansocket/preset", { params: { path: { "slug": slug } } })),
93
+ /** Fetch one community's page */
94
+ getCommunity: (slug) => answered(client.GET("/api/v1/communities/{slug}", { params: { path: { "slug": slug } } })),
95
+ /** Fetch this community's share card */
96
+ getCommunityCard: (slug) => answered(client.GET("/api/v1/communities/{slug}/card.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
97
+ /** Fetch a community's Discord invite */
98
+ getCommunityDiscordInvite: (slug) => answered(client.GET("/api/v1/communities/{slug}/discord", { params: { path: { "slug": slug } } })),
99
+ /** Fetch a community's Fluxer invite */
100
+ getCommunityFluxerInvite: (slug) => answered(client.GET("/api/v1/communities/{slug}/fluxer", { params: { path: { "slug": slug } } })),
101
+ /** Fetch every Dink setting a config can set */
102
+ getDinkCatalog: () => answered(client.GET("/api/v1/dink/catalog")),
103
+ /** Fetch the Dink config a member's Dink imports */
104
+ getDinkConfigFile: (slug, name) => answered(client.GET("/api/v1/dink/{slug}/configs/{name}.json", { params: { path: { "slug": slug, "name": name } } })),
105
+ /** Fetch how much Dink traffic this clan sent through osrsclans */
106
+ getDinkUsage: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/dink/usage", { params: { path: { "slug": slug }, query } })),
107
+ /** Fetch this clan's Dink traffic, hour by hour and by kind */
108
+ getDinkUsageHours: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/dink/usage/hours", { params: { path: { "slug": slug }, query } })),
109
+ /** Install the site's bot on a server */
110
+ getDiscordInstallLink: (slug) => finished(client.GET("/api/v1/clans/{slug}/discord-server/install", { params: { path: { "slug": slug } } })),
111
+ /** Fetch a clan's Discord role rules */
112
+ getDiscordRoleRules: (slug) => answered(client.GET("/api/v1/clans/{slug}/discord-server/rules", { params: { path: { "slug": slug } } })),
113
+ /** Fetch the Discord server a clan links */
114
+ getDiscordServer: (slug) => answered(client.GET("/api/v1/clans/{slug}/discord-server", { params: { path: { "slug": slug } } })),
115
+ /** Fetch the forums' week */
116
+ getForumWeek: () => answered(client.GET("/api/v1/forums/week")),
117
+ /** Fetch the forums header */
118
+ getForumsBanner: () => answered(client.GET("/api/v1/forums/banner.webp", { parseAs: "blob" })),
119
+ /** Fetch one OSRS news post and its article */
120
+ getGameNewsPost: (slug) => answered(client.GET("/api/v1/game-news/{slug}", { params: { path: { "slug": slug } } })),
121
+ /** Check that the service runs */
122
+ getHealth: () => answered(client.GET("/health")),
123
+ /** Fetch what an image address accepts */
124
+ getImageOptions: () => answered(client.GET("/api/v1/osrs/meta/images")),
125
+ /** Download many images as one .zip file */
126
+ getImagesZip: (query = {}) => answered(client.GET("/api/v1/osrs/images.zip", { params: { query }, parseAs: "blob" })),
127
+ /** Fetch one item */
128
+ getItem: (itemId, query = {}) => answered(client.GET("/api/v1/osrs/items/{item_id}", { params: { path: { "item_id": itemId }, query } })),
129
+ /** Fetch an image of an item */
130
+ getItemImage: (itemId, imageFormat, query = {}) => answered(client.GET("/api/v1/osrs/items/{item_id}.{image_format}", { params: { path: { "item_id": itemId, "image_format": imageFormat }, query }, parseAs: "blob" })),
131
+ /** Fetch the item browse as a CSV table */
132
+ getItemsCsv: (query = {}) => answered(client.GET("/api/v1/osrs/items/browse.csv", { params: { query }, parseAs: "text" })),
133
+ /** Fetch one of your clan's pages */
134
+ getLayout: (slug, layout) => answered(client.GET("/api/v1/clans/{slug}/layouts/{layout}", { params: { path: { "slug": slug, "layout": layout } } })),
135
+ /** Fetch Loot Rates as a CSV table */
136
+ getLootRatesCsv: (query = {}) => answered(client.GET("/api/v1/loot-rates/table.csv", { params: { query }, parseAs: "text" })),
137
+ /** Fetch a model at rest */
138
+ getModel: (kind, subjectId, query = {}) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}.glb", { params: { path: { "kind": kind, "subject_id": subjectId }, query }, parseAs: "blob" })),
139
+ /** Fetch a model's image at rest */
140
+ getModelImage: (kind, subjectId, query = {}) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}/still.webp", { params: { path: { "kind": kind, "subject_id": subjectId }, query }, parseAs: "blob" })),
141
+ /** Fetch a model at rest as .obj */
142
+ getModelObj: (kind, subjectId, query = {}) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}.zip", { params: { path: { "kind": kind, "subject_id": subjectId }, query }, parseAs: "blob" })),
143
+ /** Fetch one NPC */
144
+ getNpc: (npcId) => answered(client.GET("/api/v1/osrs/npcs/{npc_id}", { params: { path: { "npc_id": npcId } } })),
145
+ /** Fetch an NPC's image at rest */
146
+ getNpcImage: (npcId, query = {}) => answered(client.GET("/api/v1/osrs/npcs/{npc_id}.webp", { params: { path: { "npc_id": npcId }, query }, parseAs: "blob" })),
147
+ /** Fetch the oEmbed answer for a page of this site */
148
+ getOembed: (query) => answered(client.GET("/api/v1/oembed", { params: { query } })),
149
+ /** Fetch one animation a player plays, and its place */
150
+ getOutfitAnimation: (animationId) => answered(client.GET("/api/v1/osrs/outfits/animations/{animation_id}", { params: { path: { "animation_id": animationId } } })),
151
+ /** Fetch the kits and the body colours of a player */
152
+ getOutfitKits: () => answered(client.GET("/api/v1/osrs/outfits/kits")),
153
+ /** Fetch a player in an outfit */
154
+ getOutfitModel: (bodyType, query = {}) => answered(client.GET("/api/v1/osrs/outfits/{body_type}.glb", { params: { path: { "body_type": bodyType }, query }, parseAs: "blob" })),
155
+ /** Fetch a player in an outfit as .obj */
156
+ getOutfitObj: (bodyType, query = {}) => answered(client.GET("/api/v1/osrs/outfits/{body_type}.zip", { params: { path: { "body_type": bodyType }, query }, parseAs: "blob" })),
157
+ /** Fetch which of some items a body type draws */
158
+ getOutfitWornItems: (bodyType, query) => answered(client.GET("/api/v1/osrs/outfits/{body_type}/worn", { params: { path: { "body_type": bodyType }, query } })),
159
+ /** Fetch a page's share card */
160
+ getPageCard: (key) => answered(client.GET("/api/v1/cards/pages/{key}/card.webp", { params: { path: { "key": key } }, parseAs: "blob" })),
161
+ /** Fetch the plaque under the header */
162
+ getPlaque: () => answered(client.GET("/api/v1/plaques/current")),
163
+ /** Fetch a Raffle Utils run */
164
+ getRaffleRun: (slug, runId) => answered(client.GET("/api/v1/clans/{slug}/raffle-runs/{run_id}", { params: { path: { "slug": slug, "run_id": runId } } })),
165
+ /** Check that the service is ready */
166
+ getReadiness: () => answered(client.GET("/health/ready")),
167
+ /** Fetch this review's share card */
168
+ getReviewCard: (slug, reviewId) => answered(client.GET("/api/v1/clans/{slug}/reviews/{review_id}/card.webp", { params: { path: { "slug": slug, "review_id": reviewId } }, parseAs: "blob" })),
169
+ /** Fetch a clan's roster */
170
+ getRoster: (slug) => answered(client.GET("/api/v1/clans/{slug}/roster", { params: { path: { "slug": slug } } })),
171
+ /** Fetch one Raffle Utils Scene's room */
172
+ getScene: (name) => answered(client.GET("/api/v1/osrs/scenes/{name}", { params: { path: { "name": name } } })),
173
+ /** Fetch a section's strip */
174
+ getSectionStrip: (slug) => answered(client.GET("/api/v1/forums/sections/{slug}/strip.webp", { params: { path: { "slug": slug } }, parseAs: "blob" })),
175
+ /** Fetch who is signed in */
176
+ getSession: () => answered(client.GET("/api/v1/session")),
177
+ /** Fetch the index of every sitemap of the site */
178
+ getSitemapIndex: () => answered(client.GET("/api/v1/sitemap.xml", { parseAs: "blob" })),
179
+ /** Fetch every page of the site worth crawling, but the game's subjects */
180
+ getSitemapPages: () => answered(client.GET("/api/v1/sitemap-pages.xml", { parseAs: "blob" })),
181
+ /** Fetch one part of the pages of one kind of game subject */
182
+ getSitemapSubjects: (kind, query = {}) => answered(client.GET("/api/v1/sitemap-{kind}.xml", { params: { path: { "kind": kind }, query }, parseAs: "blob" })),
183
+ /** Fetch the clan in the spotlight */
184
+ getSpotlight: () => answered(client.GET("/api/v1/spotlight")),
185
+ /** Fetch one sprite */
186
+ getSprite: (spriteId) => answered(client.GET("/api/v1/osrs/sprites/{sprite_id}", { params: { path: { "sprite_id": spriteId } } })),
187
+ /** Fetch a sprite group's share card */
188
+ getSpriteGroupCard: (query) => answered(client.GET("/api/v1/cards/sprite-groups/card.webp", { params: { query }, parseAs: "blob" })),
189
+ /** Fetch an image of a sprite */
190
+ getSpriteImage: (spriteId, imageFormat, query = {}) => answered(client.GET("/api/v1/osrs/sprites/{sprite_id}.{image_format}", { params: { path: { "sprite_id": spriteId, "image_format": imageFormat }, query }, parseAs: "blob" })),
191
+ /** Fetch one subject's page */
192
+ getSubject: (kind, subjectId) => answered(client.GET("/api/v1/osrs/subjects/{kind}/{subject_id}", { params: { path: { "kind": kind, "subject_id": subjectId } } })),
193
+ /** Fetch a tag page's share card */
194
+ getTagCard: (query) => answered(client.GET("/api/v1/cards/tags/card.webp", { params: { query }, parseAs: "blob" })),
195
+ /** Fetch one thread */
196
+ getThread: (threadId, query = {}) => answered(client.GET("/api/v1/forums/threads/{thread_id}", { params: { path: { "thread_id": threadId }, query } })),
197
+ /** Fetch this thread's share card */
198
+ getThreadCard: (threadId) => answered(client.GET("/api/v1/forums/threads/{thread_id}/card.webp", { params: { path: { "thread_id": threadId } }, parseAs: "blob" })),
199
+ /** Fetch the version and the build of the service */
200
+ getVersion: () => answered(client.GET("/version")),
201
+ /** Fetch the listed clan of a Wise Old Man group */
202
+ getWomGroupClan: (groupId) => answered(client.GET("/api/v1/wom-groups/{group_id}/clan", { params: { path: { "group_id": groupId } } })),
203
+ /** Grant somebody permissions in this clan */
204
+ grantRole: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/people", { params: { path: { "slug": slug } }, body })),
205
+ /** Fetch the artwork this clan has sent */
206
+ listArtwork: (slug) => answered(client.GET("/api/v1/clans/{slug}/artwork", { params: { path: { "slug": slug } } })),
207
+ /** Fetch the boards */
208
+ listBoards: (query = {}) => answered(client.GET("/api/v1/forums/boards", { params: { query } })),
209
+ /** Fetch a clan's feed */
210
+ listClanPosts: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/posts", { params: { path: { "slug": slug }, query } })),
211
+ /** Fetch a clan's reviews */
212
+ listClanReviews: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/reviews", { params: { path: { "slug": slug }, query } })),
213
+ /** Fetch the clan directory */
214
+ listClans: (query = {}) => answered(client.GET("/api/v1/clans", { params: { query } })),
215
+ /** Fetch this clan's ClanSocket destinations */
216
+ listClansocketDestinations: (slug) => answered(client.GET("/api/v1/clans/{slug}/clansocket/destinations", { params: { path: { "slug": slug } } })),
217
+ /** Fetch the ClanSocket events a destination can take */
218
+ listClansocketEvents: () => answered(client.GET("/api/v1/clansocket/events")),
219
+ /** Fetch the communities this site shows */
220
+ listCommunities: (query = {}) => answered(client.GET("/api/v1/communities", { params: { query } })),
221
+ /** Fetch one community's updates */
222
+ listCommunityPosts: (slug, query = {}) => answered(client.GET("/api/v1/communities/{slug}/posts", { params: { path: { "slug": slug }, query } })),
223
+ /** Fetch this clan's Dink configs */
224
+ listDinkConfigs: (slug) => answered(client.GET("/api/v1/clans/{slug}/dink/configs", { params: { path: { "slug": slug } } })),
225
+ /** Fetch this clan's Dink consumers */
226
+ listDinkConsumers: (slug) => answered(client.GET("/api/v1/clans/{slug}/dink/consumers", { params: { path: { "slug": slug } } })),
227
+ /** Fetch the facts a Discord message can show, per Dink type */
228
+ listDinkMessageFacts: () => answered(client.GET("/api/v1/dink/message-facts")),
229
+ /** Fetch the placeholders a destination's messages can use, per Dink type */
230
+ listDinkMessageWords: () => answered(client.GET("/api/v1/dink/message-words")),
231
+ /** Fetch the fields a custom rule can test, per Dink type */
232
+ listDinkRuleFields: () => answered(client.GET("/api/v1/dink/rule-fields")),
233
+ /** Fetch the sections of the forums */
234
+ listForumSections: (query = {}) => answered(client.GET("/api/v1/forums/sections", { params: { query } })),
235
+ /** Fetch one month of OSRS news */
236
+ listGameNews: (query = {}) => answered(client.GET("/api/v1/game-news", { params: { query } })),
237
+ /** Fetch the categories of OSRS news */
238
+ listGameNewsCategories: () => answered(client.GET("/api/v1/game-news/categories")),
239
+ /** Fetch the months holding OSRS news */
240
+ listGameNewsMonths: (query = {}) => answered(client.GET("/api/v1/game-news/months", { params: { query } })),
241
+ /** Fetch a run of months of OSRS news */
242
+ listGameNewsRange: (query) => answered(client.GET("/api/v1/game-news/months/posts", { params: { query } })),
243
+ /** Fetch the name of every item */
244
+ listItemNames: () => answered(client.GET("/api/v1/osrs/items/names")),
245
+ /** Fetch how many items each equipment slot holds */
246
+ listItemSlots: () => answered(client.GET("/api/v1/osrs/items/slots")),
247
+ /** Fetch the stack forms of every item */
248
+ listItemStackForms: () => answered(client.GET("/api/v1/osrs/items/stack-forms")),
249
+ /** Fetch a window of items */
250
+ listItems: (query = {}) => answered(client.GET("/api/v1/osrs/items", { params: { query } })),
251
+ /** Fetch the newest updates one by one */
252
+ listLatestUpdates: (query = {}) => answered(client.GET("/api/v1/updates/latest", { params: { query } })),
253
+ /** Fetch how many Loot Rates each category holds */
254
+ listLootRateCategories: (query = {}) => answered(client.GET("/api/v1/loot-rates/categories", { params: { query } })),
255
+ /** Fetch how many Loot Rates sources each category holds */
256
+ listLootRateSourceCategories: (query = {}) => answered(client.GET("/api/v1/loot-rates/sources/categories", { params: { query } })),
257
+ /** Fetch a window of Loot Rates sources */
258
+ listLootRateSources: (query = {}) => answered(client.GET("/api/v1/loot-rates/sources", { params: { query } })),
259
+ /** Fetch a window of Loot Rates */
260
+ listLootRates: (query = {}) => answered(client.GET("/api/v1/loot-rates", { params: { query } })),
261
+ /** Fetch every model file of a subject */
262
+ listModelFiles: (kind, subjectId) => answered(client.GET("/api/v1/osrs/{kind}/{subject_id}/models", { params: { path: { "kind": kind, "subject_id": subjectId } } })),
263
+ /** Fetch a window of subjects with a model */
264
+ listModels: (query) => answered(client.GET("/api/v1/osrs/models", { params: { query } })),
265
+ /** Fetch the name of every NPC */
266
+ listNpcNames: () => answered(client.GET("/api/v1/osrs/npcs/names")),
267
+ /** Fetch a window of NPCs */
268
+ listNpcs: (query = {}) => answered(client.GET("/api/v1/osrs/npcs", { params: { query } })),
269
+ /** Fetch a window of the animations a player plays */
270
+ listOutfitAnimations: (query = {}) => answered(client.GET("/api/v1/osrs/outfits/animations", { params: { query } })),
271
+ /** Fetch the months holding clan reviews */
272
+ listReviewUpdateMonths: () => answered(client.GET("/api/v1/updates/reviews/months")),
273
+ /** Fetch a month of clan reviews */
274
+ listReviewUpdates: (query = {}) => answered(client.GET("/api/v1/updates/reviews", { params: { query } })),
275
+ /** Fetch who runs this clan */
276
+ listRoles: (slug) => answered(client.GET("/api/v1/clans/{slug}/people", { params: { path: { "slug": slug } } })),
277
+ /** Fetch every sprite category */
278
+ listSpriteCategories: () => answered(client.GET("/api/v1/osrs/sprites/categories")),
279
+ /** Fetch a window of sprites */
280
+ listSprites: (query = {}) => answered(client.GET("/api/v1/osrs/sprites", { params: { query } })),
281
+ /** Fetch every tag a clan may carry */
282
+ listTags: () => answered(client.GET("/api/v1/tags")),
283
+ /** Fetch threads */
284
+ listThreads: (query = {}) => answered(client.GET("/api/v1/forums/threads", { params: { query } })),
285
+ /** Fetch the months holding updates */
286
+ listUpdateMonths: () => answered(client.GET("/api/v1/updates/months")),
287
+ /** Fetch one page of a month of updates */
288
+ listUpdates: (query = {}) => answered(client.GET("/api/v1/updates", { params: { query } })),
289
+ /** Fetch this clan's webhooks */
290
+ listWebhooks: (slug) => answered(client.GET("/api/v1/clans/{slug}/webhooks", { params: { path: { "slug": slug } } })),
291
+ /** Search items by exact name */
292
+ lookupItems: (query) => answered(client.GET("/api/v1/osrs/items/lookup", { params: { query } })),
293
+ /** Search NPCs by exact name */
294
+ lookupNpcs: (query) => answered(client.GET("/api/v1/osrs/npcs/lookup", { params: { query } })),
295
+ /** Search sprites by exact name */
296
+ lookupSprites: (query) => answered(client.GET("/api/v1/osrs/sprites/lookup", { params: { query } })),
297
+ /** Play a Raffle Utils run's next round */
298
+ playRaffleRound: (slug, runId) => answered(client.POST("/api/v1/clans/{slug}/raffle-runs/{run_id}/rounds", { params: { path: { "slug": slug, "run_id": runId } } })),
299
+ /** Preview one sample ClanSocket Discord message */
300
+ previewClansocketMessage: (event, { body }) => answered(client.POST("/api/v1/clansocket/samples/{event}", { params: { path: { "event": event } }, body })),
301
+ /** Preview one sample Dink message, as a destination receives it */
302
+ previewDinkMessage: (kind, { body }) => answered(client.POST("/api/v1/dink/samples/{kind}", { params: { path: { "kind": kind } }, body })),
303
+ /** Preview role rules against the roster */
304
+ previewDiscordRoleRules: (slug, { body }) => answered(client.POST("/api/v1/clans/{slug}/discord-server/rules/reach", { params: { path: { "slug": slug } }, body })),
305
+ /** Count the pages this site's web server drew */
306
+ recordServedViews: ({ body, header }) => finished(client.POST("/api/v1/views/served", { params: { header }, body })),
307
+ /** Count one use of a tool */
308
+ recordToolUse: ({ body }) => finished(client.POST("/api/v1/usage", { body })),
309
+ /** Count a page or a press */
310
+ recordView: ({ body }) => finished(client.POST("/api/v1/views", { body })),
311
+ /** Restore one of your clan's pages to the default */
312
+ resetLayout: (slug, layout) => answered(client.POST("/api/v1/clans/{slug}/layouts/{layout}/revert", { params: { path: { "slug": slug, "layout": layout } } })),
313
+ /** Remove somebody's permissions in this clan */
314
+ revokeRole: (slug, accountId) => answered(client.DELETE("/api/v1/clans/{slug}/people/{account_id}", { params: { path: { "slug": slug, "account_id": accountId } } })),
315
+ /** Rotate the secret of a ClanSocket destination */
316
+ rotateClansocketDestinationSecret: (slug, destinationId) => answered(client.POST("/api/v1/clans/{slug}/clansocket/destinations/{destination_id}/rotation", { params: { path: { "slug": slug, "destination_id": destinationId } } })),
317
+ /** Rotate the hook of a Dink config */
318
+ rotateDinkConfigHook: (slug, configId) => answered(client.POST("/api/v1/clans/{slug}/dink/configs/{config_id}/rotation", { params: { path: { "slug": slug, "config_id": configId } } })),
319
+ /** Search DropTracker's groups by name */
320
+ searchDroptrackerGroups: (slug, query = {}) => answered(client.GET("/api/v1/clans/{slug}/droptracker-groups", { params: { path: { "slug": slug }, query } })),
321
+ /** Search the people who have written here */
322
+ searchForumPeople: (query) => answered(client.GET("/api/v1/forums/people", { params: { query } })),
323
+ /** Search items by a part of a name */
324
+ searchItems: (query) => answered(client.GET("/api/v1/osrs/items/search", { params: { query } })),
325
+ /** Search NPCs by a part of a name */
326
+ searchNpcs: (query) => answered(client.GET("/api/v1/osrs/npcs/search", { params: { query } })),
327
+ /** Search sprites by a part of a name */
328
+ searchSprites: (query) => answered(client.GET("/api/v1/osrs/sprites/search", { params: { query } })),
329
+ /** Receive one notification from a member's Dink */
330
+ sendDinkNotification: (token, { body }) => finished(client.POST("/api/v1/dink/hooks/{token}", { params: { path: { "token": token } }, body, bodySerializer: formData })),
331
+ /** Start a sign-in */
332
+ startSignIn: (provider, query = {}) => finished(client.GET("/api/v1/auth/{provider}/start", { params: { path: { "provider": provider }, query } })),
333
+ /** Stream a Raffle Utils run */
334
+ streamRaffleRun: (slug, runId) => answered(client.GET("/api/v1/clans/{slug}/raffle-runs/{run_id}/events", { params: { path: { "slug": slug, "run_id": runId } }, parseAs: "text" })),
335
+ /** Edit a clan you run */
336
+ updateClan: (slug, { body }) => answered(client.PATCH("/api/v1/clans/{slug}", { params: { path: { "slug": slug } }, body })),
337
+ /** Edit an update */
338
+ updateClanPost: (slug, postId, { body }) => answered(client.PATCH("/api/v1/clans/{slug}/posts/{post_id}", { params: { path: { "slug": slug, "post_id": postId } }, body })),
339
+ /** Edit one of this clan's ClanSocket destinations */
340
+ updateClansocketDestination: (slug, destinationId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/clansocket/destinations/{destination_id}", { params: { path: { "slug": slug, "destination_id": destinationId } }, body })),
341
+ /** Edit a clan's ClanSocket preset */
342
+ updateClansocketPreset: (slug, { body }) => answered(client.PUT("/api/v1/clans/{slug}/clansocket/preset", { params: { path: { "slug": slug } }, body })),
343
+ /** Edit one of this clan's Dink configs */
344
+ updateDinkConfig: (slug, configId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/dink/configs/{config_id}", { params: { path: { "slug": slug, "config_id": configId } }, body })),
345
+ /** Edit one of this clan's Dink consumers */
346
+ updateDinkConsumer: (slug, consumerId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/dink/consumers/{consumer_id}", { params: { path: { "slug": slug, "consumer_id": consumerId } }, body })),
347
+ /** Edit a clan's Discord role rules */
348
+ updateDiscordRoleRules: (slug, { body }) => answered(client.PUT("/api/v1/clans/{slug}/discord-server/rules", { params: { path: { "slug": slug } }, body })),
349
+ /** Edit how a clan's role sync lands a change */
350
+ updateDiscordRoleSyncMode: (slug, { body }) => answered(client.PUT("/api/v1/clans/{slug}/discord-server/rules/mode", { params: { path: { "slug": slug } }, body })),
351
+ /** Edit a Raffle Utils run before it starts */
352
+ updateRaffleRun: (slug, runId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/raffle-runs/{run_id}", { params: { path: { "slug": slug, "run_id": runId } }, body })),
353
+ /** Reply to a review of your clan */
354
+ updateReviewReply: (slug, reviewId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/reviews/{review_id}/reply", { params: { path: { "slug": slug, "review_id": reviewId } }, body })),
355
+ /** Edit which of your clan's pages is served */
356
+ updateServedLayout: (slug, { body }) => answered(client.PUT("/api/v1/clans/{slug}/layout", { params: { path: { "slug": slug } }, body })),
357
+ /** Edit what one of this clan's webhooks carries */
358
+ updateWebhookEvents: (slug, webhookId, { body }) => answered(client.PUT("/api/v1/clans/{slug}/webhooks/{webhook_id}/events", { params: { path: { "slug": slug, "webhook_id": webhookId } }, body })),
359
+ /** Upload artwork for this clan */
360
+ uploadArtwork: (slug, role, { body }) => answered(client.POST("/api/v1/clans/{slug}/artwork/{role}", { params: { path: { "slug": slug, "role": role } }, body, bodySerializer: formData })),
361
+ };
362
+ }
@@ -0,0 +1,21 @@
1
+ import { DataRequestError } from "./data-request-error.js";
2
+ import { DataRequestStatus } from "./schema.generated.js";
3
+ /** The data request ended with the outcome `not_connected`. */
4
+ export declare class DataRequestNotConnected extends DataRequestError {
5
+ }
6
+ /** The data request ended with the outcome `declined`. */
7
+ export declare class DataRequestDeclined extends DataRequestError {
8
+ }
9
+ /** The data request ended with the outcome `plugin_outdated`. */
10
+ export declare class DataRequestPluginOutdated extends DataRequestError {
11
+ }
12
+ /** The data request ended with the outcome `busy`. */
13
+ export declare class DataRequestBusy extends DataRequestError {
14
+ }
15
+ /** The data request ended with the outcome `failed`. */
16
+ export declare class DataRequestFailed extends DataRequestError {
17
+ }
18
+ type Outcome = Exclude<DataRequestStatus, DataRequestStatus.Pending | DataRequestStatus.Data>;
19
+ /** The error class of each outcome other than the member's data. */
20
+ export declare const OUTCOME_ERRORS: Record<Outcome, typeof DataRequestError>;
21
+ export {};
@@ -0,0 +1,26 @@
1
+ // Generated by generate.ts from the client contract. Do not edit.
2
+ import { DataRequestError } from "./data-request-error.js";
3
+ import { DataRequestStatus } from "./schema.generated.js";
4
+ /** The data request ended with the outcome `not_connected`. */
5
+ export class DataRequestNotConnected extends DataRequestError {
6
+ }
7
+ /** The data request ended with the outcome `declined`. */
8
+ export class DataRequestDeclined extends DataRequestError {
9
+ }
10
+ /** The data request ended with the outcome `plugin_outdated`. */
11
+ export class DataRequestPluginOutdated extends DataRequestError {
12
+ }
13
+ /** The data request ended with the outcome `busy`. */
14
+ export class DataRequestBusy extends DataRequestError {
15
+ }
16
+ /** The data request ended with the outcome `failed`. */
17
+ export class DataRequestFailed extends DataRequestError {
18
+ }
19
+ /** The error class of each outcome other than the member's data. */
20
+ export const OUTCOME_ERRORS = {
21
+ [DataRequestStatus.NotConnected]: DataRequestNotConnected,
22
+ [DataRequestStatus.Declined]: DataRequestDeclined,
23
+ [DataRequestStatus.PluginOutdated]: DataRequestPluginOutdated,
24
+ [DataRequestStatus.Busy]: DataRequestBusy,
25
+ [DataRequestStatus.Failed]: DataRequestFailed,
26
+ };
@@ -0,0 +1,7 @@
1
+ export { ApiError } from "./api-error.js";
2
+ export { type ClanProfile, LOOKUP_NAMES_MOST, type NamedChains } from "./chains.js";
3
+ export { type ClientOptions, DEFAULT_BASE_URL, type OsrsClansClient, createClient } from "./client.js";
4
+ export { DataRequestError } from "./data-request-error.js";
5
+ export { type BatchCheck, DELIVERY_HEADER, SIGNATURE_HEADER, SignatureMismatch, TIMESTAMP_HEADER, batchSignature, readDestinationBatch, } from "./destinations.js";
6
+ export { StreamClosed, type StreamOptions, type WebSocketFactory } from "./streams.js";
7
+ export { UnexpectedStatus } from "./unexpected-status.js";
package/dist/public.js ADDED
@@ -0,0 +1,7 @@
1
+ export { ApiError } from "./api-error.js";
2
+ export { LOOKUP_NAMES_MOST } from "./chains.js";
3
+ export { DEFAULT_BASE_URL, createClient } from "./client.js";
4
+ export { DataRequestError } from "./data-request-error.js";
5
+ export { DELIVERY_HEADER, SIGNATURE_HEADER, SignatureMismatch, TIMESTAMP_HEADER, batchSignature, readDestinationBatch, } from "./destinations.js";
6
+ export { StreamClosed } from "./streams.js";
7
+ export { UnexpectedStatus } from "./unexpected-status.js";