@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.
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/dist/answered.d.ts +17 -0
- package/dist/answered.js +52 -0
- package/dist/api-error.d.ts +13 -0
- package/dist/api-error.js +18 -0
- package/dist/chains.d.ts +37 -0
- package/dist/chains.js +30 -0
- package/dist/client.d.ts +24 -0
- package/dist/client.js +25 -0
- package/dist/data-request-error.d.ts +9 -0
- package/dist/data-request-error.js +12 -0
- package/dist/data-requests.d.ts +6 -0
- package/dist/data-requests.js +16 -0
- package/dist/destinations.d.ts +23 -0
- package/dist/destinations.js +74 -0
- package/dist/errors.generated.d.ts +775 -0
- package/dist/errors.generated.js +1034 -0
- package/dist/index.generated.d.ts +7 -0
- package/dist/index.generated.js +4 -0
- package/dist/models.generated.d.ts +351 -0
- package/dist/models.generated.js +1 -0
- package/dist/operation-types.d.ts +23 -0
- package/dist/operation-types.js +1 -0
- package/dist/operations.generated.d.ts +5693 -0
- package/dist/operations.generated.js +362 -0
- package/dist/outcomes.generated.d.ts +21 -0
- package/dist/outcomes.generated.js +26 -0
- package/dist/public.d.ts +7 -0
- package/dist/public.js +7 -0
- package/dist/schema.generated.d.ts +32193 -0
- package/dist/schema.generated.js +1136 -0
- package/dist/streams.d.ts +29 -0
- package/dist/streams.js +95 -0
- package/dist/unexpected-status.d.ts +5 -0
- package/dist/unexpected-status.js +9 -0
- package/dist/walk.d.ts +13 -0
- package/dist/walk.js +24 -0
- package/dist/walkers.generated.d.ts +702 -0
- package/dist/walkers.generated.js +106 -0
- package/package.json +52 -6
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { walk } from "./walk.js";
|
|
2
|
+
/** One walker per paged route, named `iter` and the route's name less a leading `list`. */
|
|
3
|
+
export function namedWalkers(operations) {
|
|
4
|
+
return {
|
|
5
|
+
/** Every row of `listBoards`, page by page from the first. `limit` is the size of each page. */
|
|
6
|
+
iterBoards: (query = {}) => walk(async (offset, _carried) => {
|
|
7
|
+
const page = await operations.listBoards({ ...query, offset });
|
|
8
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
9
|
+
}),
|
|
10
|
+
/** Every row of `browseItems`, page by page from the first. `limit` is the size of each page. */
|
|
11
|
+
iterBrowseItems: (query = {}) => walk(async (offset, _carried) => {
|
|
12
|
+
const page = await operations.browseItems({ ...query, offset });
|
|
13
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
14
|
+
}),
|
|
15
|
+
/** Every row of `listClanPosts`, page by page from the first. `limit` is the size of each page. */
|
|
16
|
+
iterClanPosts: (slug, query = {}) => walk(async (offset, _carried) => {
|
|
17
|
+
const page = await operations.listClanPosts(slug, { ...query, offset });
|
|
18
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
19
|
+
}),
|
|
20
|
+
/** Every row of `listClanReviews`, page by page from the first. `limit` is the size of each page. */
|
|
21
|
+
iterClanReviews: (slug, query = {}) => walk(async (offset, _carried) => {
|
|
22
|
+
const page = await operations.listClanReviews(slug, { ...query, offset });
|
|
23
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
24
|
+
}),
|
|
25
|
+
/** Every row of `listClans`, page by page from the first. `limit` is the size of each page. */
|
|
26
|
+
iterClans: (query = {}) => walk(async (offset, carried) => {
|
|
27
|
+
const page = await operations.listClans({ ...query, ...carried, offset });
|
|
28
|
+
return { carried: { seed: page.seed }, rows: page.clans, total: page.total };
|
|
29
|
+
}),
|
|
30
|
+
/** Every row of `listCommunities`, page by page from the first. `limit` is the size of each page. */
|
|
31
|
+
iterCommunities: (query = {}) => walk(async (offset, _carried) => {
|
|
32
|
+
const page = await operations.listCommunities({ ...query, offset });
|
|
33
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
34
|
+
}),
|
|
35
|
+
/** Every row of `listCommunityPosts`, page by page from the first. `limit` is the size of each page. */
|
|
36
|
+
iterCommunityPosts: (slug, query = {}) => walk(async (offset, _carried) => {
|
|
37
|
+
const page = await operations.listCommunityPosts(slug, { ...query, offset });
|
|
38
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
39
|
+
}),
|
|
40
|
+
/** Every row of `listForumSections`, page by page from the first. `limit` is the size of each page. */
|
|
41
|
+
iterForumSections: (query = {}) => walk(async (offset, _carried) => {
|
|
42
|
+
const page = await operations.listForumSections({ ...query, offset });
|
|
43
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
44
|
+
}),
|
|
45
|
+
/** Every row of `listItems`, page by page from the first. `limit` is the size of each page. */
|
|
46
|
+
iterItems: (query = {}) => walk(async (offset, _carried) => {
|
|
47
|
+
const page = await operations.listItems({ ...query, offset });
|
|
48
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
49
|
+
}),
|
|
50
|
+
/** Every row of `listLootRates`, page by page from the first. `limit` is the size of each page. */
|
|
51
|
+
iterLootRates: (query = {}) => walk(async (offset, _carried) => {
|
|
52
|
+
const page = await operations.listLootRates({ ...query, offset });
|
|
53
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
54
|
+
}),
|
|
55
|
+
/** Every row of `listLootRateSources`, page by page from the first. `limit` is the size of each page. */
|
|
56
|
+
iterLootRateSources: (query = {}) => walk(async (offset, _carried) => {
|
|
57
|
+
const page = await operations.listLootRateSources({ ...query, offset });
|
|
58
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
59
|
+
}),
|
|
60
|
+
/** Every row of `listModels`, page by page from the first. `limit` is the size of each page. */
|
|
61
|
+
iterModels: (query) => walk(async (offset, _carried) => {
|
|
62
|
+
const page = await operations.listModels({ ...query, offset });
|
|
63
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
64
|
+
}),
|
|
65
|
+
/** Every row of `listNpcs`, page by page from the first. `limit` is the size of each page. */
|
|
66
|
+
iterNpcs: (query = {}) => walk(async (offset, _carried) => {
|
|
67
|
+
const page = await operations.listNpcs({ ...query, offset });
|
|
68
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
69
|
+
}),
|
|
70
|
+
/** Every row of `listOutfitAnimations`, page by page from the first. `limit` is the size of each page. */
|
|
71
|
+
iterOutfitAnimations: (query = {}) => walk(async (offset, _carried) => {
|
|
72
|
+
const page = await operations.listOutfitAnimations({ ...query, offset });
|
|
73
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
74
|
+
}),
|
|
75
|
+
/** Every row of `searchForumPeople`, page by page from the first. `limit` is the size of each page. */
|
|
76
|
+
iterSearchForumPeople: (query) => walk(async (offset, _carried) => {
|
|
77
|
+
const page = await operations.searchForumPeople({ ...query, offset });
|
|
78
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
79
|
+
}),
|
|
80
|
+
/** Every row of `searchItems`, page by page from the first. `limit` is the size of each page. */
|
|
81
|
+
iterSearchItems: (query) => walk(async (offset, _carried) => {
|
|
82
|
+
const page = await operations.searchItems({ ...query, offset });
|
|
83
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
84
|
+
}),
|
|
85
|
+
/** Every row of `searchNpcs`, page by page from the first. `limit` is the size of each page. */
|
|
86
|
+
iterSearchNpcs: (query) => walk(async (offset, _carried) => {
|
|
87
|
+
const page = await operations.searchNpcs({ ...query, offset });
|
|
88
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
89
|
+
}),
|
|
90
|
+
/** Every row of `searchSprites`, page by page from the first. `limit` is the size of each page. */
|
|
91
|
+
iterSearchSprites: (query) => walk(async (offset, _carried) => {
|
|
92
|
+
const page = await operations.searchSprites({ ...query, offset });
|
|
93
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
94
|
+
}),
|
|
95
|
+
/** Every row of `listSprites`, page by page from the first. `limit` is the size of each page. */
|
|
96
|
+
iterSprites: (query = {}) => walk(async (offset, _carried) => {
|
|
97
|
+
const page = await operations.listSprites({ ...query, offset });
|
|
98
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
99
|
+
}),
|
|
100
|
+
/** Every row of `listThreads`, page by page from the first. `limit` is the size of each page. */
|
|
101
|
+
iterThreads: (query = {}) => walk(async (offset, _carried) => {
|
|
102
|
+
const page = await operations.listThreads({ ...query, offset });
|
|
103
|
+
return { carried: {}, rows: page.items, total: page.total };
|
|
104
|
+
}),
|
|
105
|
+
};
|
|
106
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@osrsclans/api",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@osrsclans/api",
|
|
3
|
+
"version": "1.15.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A typed client for the OSRS Clans public API and Clan Owner API: the clan directory, the forums, the game cache data and images, Loot Rates and the clan token routes.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"osrs",
|
|
8
|
+
"old school runescape",
|
|
9
|
+
"runescape",
|
|
10
|
+
"clans",
|
|
11
|
+
"api",
|
|
12
|
+
"openapi",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://osrsclans.cc/docs",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://gitlab.com/Osrsclans/osrsclans.git",
|
|
20
|
+
"directory": "osrsclans-api-js"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.generated.d.ts",
|
|
28
|
+
"import": "./dist/index.generated.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"generate": "bun run generate.ts",
|
|
38
|
+
"check": "bun run generate.ts --check",
|
|
39
|
+
"build": "tsc --project tsconfig.build.json",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"test": "bun test",
|
|
42
|
+
"prepublishOnly": "bun run check && bun test && bun run build"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"openapi-fetch": "^0.17.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/bun": "1.4.2",
|
|
49
|
+
"openapi-typescript": "^7.13.0",
|
|
50
|
+
"typescript": "5.9.3"
|
|
51
|
+
}
|
|
52
|
+
}
|