@reclaimprotocol/client 0.1.0-dev.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/lib/client.d.ts +30 -0
- package/lib/client.js +107 -0
- package/lib/consts.d.ts +3 -0
- package/lib/consts.js +4 -0
- package/lib/errors.d.ts +5 -0
- package/lib/errors.js +22 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +4 -0
- package/lib/keypair.d.ts +21 -0
- package/lib/keypair.js +51 -0
- package/lib/routes.gen.d.ts +279 -0
- package/lib/routes.gen.js +75 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +1 -0
- package/lib/types/openapi.d.ts +74 -0
- package/lib/types/openapi.gen.d.ts +3989 -0
- package/lib/types/openapi.gen.js +5 -0
- package/lib/types/openapi.js +1 -0
- package/package.json +56 -0
- package/src/client.ts +146 -0
- package/src/consts.ts +6 -0
- package/src/errors.ts +30 -0
- package/src/index.ts +10 -0
- package/src/keypair.ts +63 -0
- package/src/routes.gen.ts +78 -0
- package/src/types/index.ts +2 -0
- package/src/types/openapi.gen.ts +3990 -0
- package/src/types/openapi.ts +80 -0
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IOperationArgs, IOperationId, IOperationResponse } from './types/openapi.ts';
|
|
2
|
+
export type ReclaimClientOptions = {
|
|
3
|
+
/** Backend base URL. Defaults to {@link DEFAULT_BASE_URL}. */
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
/** Bearer token for authenticated operations. */
|
|
6
|
+
token?: string;
|
|
7
|
+
/** Custom fetch implementation. Defaults to global `fetch`. */
|
|
8
|
+
fetch?: typeof fetch;
|
|
9
|
+
/** Extra headers merged into every request. */
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Core HTTP client. Shared by the SDK entrypoint, MCP server, and CLI —
|
|
14
|
+
* extend behaviour here rather than duplicating it across surfaces.
|
|
15
|
+
*
|
|
16
|
+
* Per @reclaimprotocol/app conventions, validation lives in the openapi
|
|
17
|
+
* spec; this client forwards requests and maps RFC 9457 problem responses
|
|
18
|
+
* to {@link ProblemError}.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ReclaimClient {
|
|
21
|
+
#private;
|
|
22
|
+
readonly baseUrl: string;
|
|
23
|
+
constructor(opts?: ReclaimClientOptions);
|
|
24
|
+
setToken(token: string | undefined): void;
|
|
25
|
+
getToken(): string | undefined;
|
|
26
|
+
call<T extends IOperationId>(operationId: T, ...argsRest: {} extends IOperationArgs<T> ? [args?: IOperationArgs<T>] : [args: IOperationArgs<T>]): Promise<{
|
|
27
|
+
data: IOperationResponse<T>;
|
|
28
|
+
response: Response;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { notFound } from '@hapi/boom';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import { DEFAULT_BASE_URL, USER_AGENT } from "./consts.js";
|
|
4
|
+
import { throwProblemError } from "./errors.js";
|
|
5
|
+
// `ROUTES` is generated from `packages/app/openapi.yaml` and is the
|
|
6
|
+
// single source of method/path mapping for every operation. New
|
|
7
|
+
// endpoints added to the spec are picked up by re-running
|
|
8
|
+
// `npm run openapi:typegen --workspace=packages/client`.
|
|
9
|
+
import { ROUTES } from "./routes.gen.js";
|
|
10
|
+
/**
|
|
11
|
+
* Core HTTP client. Shared by the SDK entrypoint, MCP server, and CLI —
|
|
12
|
+
* extend behaviour here rather than duplicating it across surfaces.
|
|
13
|
+
*
|
|
14
|
+
* Per @reclaimprotocol/app conventions, validation lives in the openapi
|
|
15
|
+
* spec; this client forwards requests and maps RFC 9457 problem responses
|
|
16
|
+
* to {@link ProblemError}.
|
|
17
|
+
*/
|
|
18
|
+
export class ReclaimClient {
|
|
19
|
+
baseUrl;
|
|
20
|
+
#token;
|
|
21
|
+
#fetch;
|
|
22
|
+
#headers;
|
|
23
|
+
constructor(opts = {}) {
|
|
24
|
+
this.baseUrl = (opts.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, '');
|
|
25
|
+
this.#token = opts.token;
|
|
26
|
+
this.#fetch = opts.fetch || fetch;
|
|
27
|
+
this.#headers = {
|
|
28
|
+
'User-Agent': USER_AGENT,
|
|
29
|
+
Accept: 'application/json',
|
|
30
|
+
...opts.headers,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
setToken(token) {
|
|
34
|
+
this.#token = token;
|
|
35
|
+
}
|
|
36
|
+
getToken() {
|
|
37
|
+
return this.#token;
|
|
38
|
+
}
|
|
39
|
+
async call(operationId, ...argsRest) {
|
|
40
|
+
const args = argsRest[0] ?? {};
|
|
41
|
+
const op = ROUTES[operationId];
|
|
42
|
+
assert(op, notFound(`Unknown operation: ${String(operationId)}`));
|
|
43
|
+
let url = `${this.baseUrl}${op.path}`;
|
|
44
|
+
if (args.params) {
|
|
45
|
+
for (const [key, value] of Object.entries(args.params)) {
|
|
46
|
+
url = url.replace(`{${key}}`, String(value));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (args.query && Object.keys(args.query).length > 0) {
|
|
50
|
+
const search = new URLSearchParams();
|
|
51
|
+
for (const [key, value] of Object.entries(args.query)) {
|
|
52
|
+
if (value === undefined || value === null) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
for (const v of value) {
|
|
57
|
+
search.append(key, String(v));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
search.append(key, String(value));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
url += `?${search.toString()}`;
|
|
65
|
+
}
|
|
66
|
+
const headers = {
|
|
67
|
+
...this.#headers,
|
|
68
|
+
Accept: 'application/json',
|
|
69
|
+
};
|
|
70
|
+
if (this.#token) {
|
|
71
|
+
headers['Authorization'] = `Bearer ${this.#token}`;
|
|
72
|
+
}
|
|
73
|
+
// Per-request header parameters (e.g. `If-Match` for optimistic
|
|
74
|
+
// concurrency). Applied last so spec-declared headers win over the
|
|
75
|
+
// client-wide defaults, but never override Authorization.
|
|
76
|
+
if (args.headers) {
|
|
77
|
+
for (const [key, value] of Object.entries(args.headers)) {
|
|
78
|
+
if (value === undefined || value === null) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
headers[key] = String(value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const init = {
|
|
85
|
+
method: op.method.toUpperCase(),
|
|
86
|
+
headers,
|
|
87
|
+
};
|
|
88
|
+
// Write methods always carry a JSON body (defaulting to `{}`) plus a
|
|
89
|
+
// Content-Type. Some endpoints — e.g. the auth-only attach session —
|
|
90
|
+
// take an empty body, and omitting Content-Type makes the server
|
|
91
|
+
// reject the request with `415 unsupported media type`.
|
|
92
|
+
const method = op.method.toLowerCase();
|
|
93
|
+
if (method !== 'get' && method !== 'head') {
|
|
94
|
+
init.body = JSON.stringify(args.body ?? {});
|
|
95
|
+
headers['Content-Type'] = 'application/json';
|
|
96
|
+
}
|
|
97
|
+
const res = await this.#fetch(url, init);
|
|
98
|
+
if (!res.ok) {
|
|
99
|
+
await throwProblemError(res);
|
|
100
|
+
}
|
|
101
|
+
if (res.status === 204 || res.headers.get('content-length') === '0') {
|
|
102
|
+
return { data: undefined, response: res };
|
|
103
|
+
}
|
|
104
|
+
const data = await res.json();
|
|
105
|
+
return { data, response: res };
|
|
106
|
+
}
|
|
107
|
+
}
|
package/lib/consts.d.ts
ADDED
package/lib/consts.js
ADDED
package/lib/errors.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import type { ProblemDetails } from './types/openapi.ts';
|
|
3
|
+
export type { ProblemDetails } from './types/openapi.ts';
|
|
4
|
+
export type ProblemError = Boom<ProblemDetails>;
|
|
5
|
+
export declare function throwProblemError(res: Response): Promise<void>;
|
package/lib/errors.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Boom } from '@hapi/boom';
|
|
2
|
+
import { PROBLEM_CONTENT_TYPE } from "./consts.js";
|
|
3
|
+
// Reads an `application/problem+json` response and throws a Boom-style
|
|
4
|
+
// error. Falls back to status-only mapping when the body isn't a problem doc.
|
|
5
|
+
export async function throwProblemError(res) {
|
|
6
|
+
const contentType = res.headers.get('Content-Type') || '';
|
|
7
|
+
let problem;
|
|
8
|
+
if (contentType.includes(PROBLEM_CONTENT_TYPE)) {
|
|
9
|
+
problem = (await res.json());
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
problem = {
|
|
13
|
+
type: 'about:blank',
|
|
14
|
+
status: res.status,
|
|
15
|
+
title: res.statusText,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
throw new Boom(problem.title, {
|
|
19
|
+
statusCode: res.status,
|
|
20
|
+
data: problem,
|
|
21
|
+
});
|
|
22
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './client.ts';
|
|
2
|
+
export type * from './client.ts';
|
|
3
|
+
export { ProblemError, type ProblemDetails } from './errors.ts';
|
|
4
|
+
export { DEFAULT_BASE_URL, PROBLEM_CONTENT_TYPE, USER_AGENT } from './consts.ts';
|
|
5
|
+
export { deriveFromPrivateKey, type EthKeypair, generateKeypair, } from './keypair.ts';
|
|
6
|
+
export * from './types/index.ts';
|
package/lib/index.js
ADDED
package/lib/keypair.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type EthKeypair = {
|
|
2
|
+
address: string;
|
|
3
|
+
privateKey: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Generate a fresh secp256k1 key-pair and derive its lowercase
|
|
7
|
+
* Ethereum address (keccak-256 of the uncompressed pubkey minus the
|
|
8
|
+
* `0x04` prefix, last 20 bytes).
|
|
9
|
+
*
|
|
10
|
+
* Lives in the client SDK so every consumer — the MCP `issue_credentials`
|
|
11
|
+
* tool, scripts, future SDK callers — mints credentials the same way.
|
|
12
|
+
* The private key is returned to the caller and MUST stay local; only
|
|
13
|
+
* the derived address is ever sent to the server. The public key is an
|
|
14
|
+
* intermediate value used to compute the address and is not retained.
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateKeypair(): EthKeypair;
|
|
17
|
+
/**
|
|
18
|
+
* Recover the address from a hex-encoded private key. Used when
|
|
19
|
+
* importing a key the user already holds.
|
|
20
|
+
*/
|
|
21
|
+
export declare function deriveFromPrivateKey(privateKey: string): EthKeypair;
|
package/lib/keypair.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { keccak_256 } from '@noble/hashes/sha3.js';
|
|
2
|
+
import * as secp from '@noble/secp256k1';
|
|
3
|
+
/**
|
|
4
|
+
* Generate a fresh secp256k1 key-pair and derive its lowercase
|
|
5
|
+
* Ethereum address (keccak-256 of the uncompressed pubkey minus the
|
|
6
|
+
* `0x04` prefix, last 20 bytes).
|
|
7
|
+
*
|
|
8
|
+
* Lives in the client SDK so every consumer — the MCP `issue_credentials`
|
|
9
|
+
* tool, scripts, future SDK callers — mints credentials the same way.
|
|
10
|
+
* The private key is returned to the caller and MUST stay local; only
|
|
11
|
+
* the derived address is ever sent to the server. The public key is an
|
|
12
|
+
* intermediate value used to compute the address and is not retained.
|
|
13
|
+
*/
|
|
14
|
+
export function generateKeypair() {
|
|
15
|
+
const priv = secp.utils.randomSecretKey();
|
|
16
|
+
const pub = secp.getPublicKey(priv, false);
|
|
17
|
+
return {
|
|
18
|
+
address: '0x' + bytesToHex(keccak_256(pub.slice(1))).slice(-40),
|
|
19
|
+
privateKey: '0x' + bytesToHex(priv),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Recover the address from a hex-encoded private key. Used when
|
|
24
|
+
* importing a key the user already holds.
|
|
25
|
+
*/
|
|
26
|
+
export function deriveFromPrivateKey(privateKey) {
|
|
27
|
+
const hex = privateKey.replace(/^0x/, '');
|
|
28
|
+
const priv = hexToBytes(hex);
|
|
29
|
+
const pub = secp.getPublicKey(priv, false);
|
|
30
|
+
return {
|
|
31
|
+
address: '0x' + bytesToHex(keccak_256(pub.slice(1))).slice(-40),
|
|
32
|
+
privateKey: '0x' + hex,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function bytesToHex(bytes) {
|
|
36
|
+
let out = '';
|
|
37
|
+
for (const b of bytes) {
|
|
38
|
+
out += b.toString(16).padStart(2, '0');
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
function hexToBytes(hex) {
|
|
43
|
+
if (hex.length % 2 !== 0) {
|
|
44
|
+
throw new Error('private key hex must have even length');
|
|
45
|
+
}
|
|
46
|
+
const out = new Uint8Array(hex.length / 2);
|
|
47
|
+
for (let i = 0; i < out.length; i++) {
|
|
48
|
+
out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
export declare const ROUTES: {
|
|
2
|
+
readonly AddOrgMember: {
|
|
3
|
+
readonly method: "post";
|
|
4
|
+
readonly path: "/orgs/{orgId}/members";
|
|
5
|
+
};
|
|
6
|
+
readonly AdminHome: {
|
|
7
|
+
readonly method: "get";
|
|
8
|
+
readonly path: "/admin";
|
|
9
|
+
};
|
|
10
|
+
readonly AdminOrgs: {
|
|
11
|
+
readonly method: "get";
|
|
12
|
+
readonly path: "/admin/orgs";
|
|
13
|
+
};
|
|
14
|
+
readonly AdminProviders: {
|
|
15
|
+
readonly method: "get";
|
|
16
|
+
readonly path: "/admin/providers";
|
|
17
|
+
};
|
|
18
|
+
readonly AdminReviews: {
|
|
19
|
+
readonly method: "get";
|
|
20
|
+
readonly path: "/admin/reviews";
|
|
21
|
+
};
|
|
22
|
+
readonly AdminThemes: {
|
|
23
|
+
readonly method: "get";
|
|
24
|
+
readonly path: "/admin/themes";
|
|
25
|
+
};
|
|
26
|
+
readonly AdminUsers: {
|
|
27
|
+
readonly method: "get";
|
|
28
|
+
readonly path: "/admin/users";
|
|
29
|
+
};
|
|
30
|
+
readonly AttachPage: {
|
|
31
|
+
readonly method: "get";
|
|
32
|
+
readonly path: "/attach/{code}";
|
|
33
|
+
};
|
|
34
|
+
readonly CancelPublicListingRequest: {
|
|
35
|
+
readonly method: "post";
|
|
36
|
+
readonly path: "/providers/{providerId}/versions/{version}/cancel-review";
|
|
37
|
+
};
|
|
38
|
+
readonly ComponentsDemo: {
|
|
39
|
+
readonly method: "get";
|
|
40
|
+
readonly path: "/components_demo";
|
|
41
|
+
};
|
|
42
|
+
readonly ConfirmAttachSession: {
|
|
43
|
+
readonly method: "post";
|
|
44
|
+
readonly path: "/credentials/attach/sessions/{code}/confirm";
|
|
45
|
+
};
|
|
46
|
+
readonly CreateAttachSession: {
|
|
47
|
+
readonly method: "post";
|
|
48
|
+
readonly path: "/credentials/attach/sessions";
|
|
49
|
+
};
|
|
50
|
+
readonly CreateOrg: {
|
|
51
|
+
readonly method: "post";
|
|
52
|
+
readonly path: "/orgs";
|
|
53
|
+
};
|
|
54
|
+
readonly CreateProvider: {
|
|
55
|
+
readonly method: "post";
|
|
56
|
+
readonly path: "/providers";
|
|
57
|
+
};
|
|
58
|
+
readonly CreateProviderVersion: {
|
|
59
|
+
readonly method: "post";
|
|
60
|
+
readonly path: "/providers/{providerId}/versions";
|
|
61
|
+
};
|
|
62
|
+
readonly CreateTheme: {
|
|
63
|
+
readonly method: "post";
|
|
64
|
+
readonly path: "/orgs/{orgId}/themes";
|
|
65
|
+
};
|
|
66
|
+
readonly CredentialAuthChallenge: {
|
|
67
|
+
readonly method: "post";
|
|
68
|
+
readonly path: "/credentials/auth/challenge";
|
|
69
|
+
};
|
|
70
|
+
readonly CredentialAuthVerify: {
|
|
71
|
+
readonly method: "post";
|
|
72
|
+
readonly path: "/credentials/auth/verify";
|
|
73
|
+
};
|
|
74
|
+
readonly DecideProviderVersionReview: {
|
|
75
|
+
readonly method: "post";
|
|
76
|
+
readonly path: "/providers/{providerId}/versions/{version}/review-decision";
|
|
77
|
+
};
|
|
78
|
+
readonly DeleteOrg: {
|
|
79
|
+
readonly method: "delete";
|
|
80
|
+
readonly path: "/orgs/{orgId}";
|
|
81
|
+
};
|
|
82
|
+
readonly DeleteOrgBilling: {
|
|
83
|
+
readonly method: "delete";
|
|
84
|
+
readonly path: "/orgs/{orgId}/billing";
|
|
85
|
+
};
|
|
86
|
+
readonly DeleteOrgIcon: {
|
|
87
|
+
readonly method: "delete";
|
|
88
|
+
readonly path: "/orgs/{orgId}/icon";
|
|
89
|
+
};
|
|
90
|
+
readonly DeleteProvider: {
|
|
91
|
+
readonly method: "delete";
|
|
92
|
+
readonly path: "/providers/{providerId}";
|
|
93
|
+
};
|
|
94
|
+
readonly DeleteProviderVersion: {
|
|
95
|
+
readonly method: "delete";
|
|
96
|
+
readonly path: "/providers/{providerId}/versions/{version}";
|
|
97
|
+
};
|
|
98
|
+
readonly DeleteTheme: {
|
|
99
|
+
readonly method: "delete";
|
|
100
|
+
readonly path: "/orgs/{orgId}/themes/{themeId}";
|
|
101
|
+
};
|
|
102
|
+
readonly Docs: {
|
|
103
|
+
readonly method: "get";
|
|
104
|
+
readonly path: "/docs";
|
|
105
|
+
};
|
|
106
|
+
readonly ExplorePreviewImage: {
|
|
107
|
+
readonly method: "get";
|
|
108
|
+
readonly path: "/og/explore.png";
|
|
109
|
+
};
|
|
110
|
+
readonly GetAttachSession: {
|
|
111
|
+
readonly method: "get";
|
|
112
|
+
readonly path: "/credentials/attach/sessions/{code}";
|
|
113
|
+
};
|
|
114
|
+
readonly GetCredential: {
|
|
115
|
+
readonly method: "get";
|
|
116
|
+
readonly path: "/credentials/{credentialId}";
|
|
117
|
+
};
|
|
118
|
+
readonly GetCredentialByAddress: {
|
|
119
|
+
readonly method: "get";
|
|
120
|
+
readonly path: "/credentials/by-address/{address}";
|
|
121
|
+
};
|
|
122
|
+
readonly GetImage: {
|
|
123
|
+
readonly method: "get";
|
|
124
|
+
readonly path: "/images/{imageId}";
|
|
125
|
+
};
|
|
126
|
+
readonly GetMe: {
|
|
127
|
+
readonly method: "get";
|
|
128
|
+
readonly path: "/me";
|
|
129
|
+
};
|
|
130
|
+
readonly GetOrg: {
|
|
131
|
+
readonly method: "get";
|
|
132
|
+
readonly path: "/orgs/{orgId}";
|
|
133
|
+
};
|
|
134
|
+
readonly GetOrgBilling: {
|
|
135
|
+
readonly method: "get";
|
|
136
|
+
readonly path: "/orgs/{orgId}/billing";
|
|
137
|
+
};
|
|
138
|
+
readonly GetProvider: {
|
|
139
|
+
readonly method: "get";
|
|
140
|
+
readonly path: "/providers/{providerId}";
|
|
141
|
+
};
|
|
142
|
+
readonly GetProviderBySlug: {
|
|
143
|
+
readonly method: "get";
|
|
144
|
+
readonly path: "/providers/{providerId}/{slug}";
|
|
145
|
+
};
|
|
146
|
+
readonly GetProviderVersion: {
|
|
147
|
+
readonly method: "get";
|
|
148
|
+
readonly path: "/providers/{providerId}/versions/{version}";
|
|
149
|
+
};
|
|
150
|
+
readonly GetTheme: {
|
|
151
|
+
readonly method: "get";
|
|
152
|
+
readonly path: "/orgs/{orgId}/themes/{themeId}";
|
|
153
|
+
};
|
|
154
|
+
readonly GetUser: {
|
|
155
|
+
readonly method: "get";
|
|
156
|
+
readonly path: "/users/{userId}";
|
|
157
|
+
};
|
|
158
|
+
readonly Index: {
|
|
159
|
+
readonly method: "get";
|
|
160
|
+
readonly path: "/";
|
|
161
|
+
};
|
|
162
|
+
readonly LinkCredential: {
|
|
163
|
+
readonly method: "post";
|
|
164
|
+
readonly path: "/credentials";
|
|
165
|
+
};
|
|
166
|
+
readonly ListOrgCredentials: {
|
|
167
|
+
readonly method: "get";
|
|
168
|
+
readonly path: "/orgs/{orgId}/credentials";
|
|
169
|
+
};
|
|
170
|
+
readonly ListOrgs: {
|
|
171
|
+
readonly method: "get";
|
|
172
|
+
readonly path: "/orgs";
|
|
173
|
+
};
|
|
174
|
+
readonly ListProviderVersions: {
|
|
175
|
+
readonly method: "get";
|
|
176
|
+
readonly path: "/providers/{providerId}/versions";
|
|
177
|
+
};
|
|
178
|
+
readonly ListThemes: {
|
|
179
|
+
readonly method: "get";
|
|
180
|
+
readonly path: "/orgs/{orgId}/themes";
|
|
181
|
+
};
|
|
182
|
+
readonly Login: {
|
|
183
|
+
readonly method: "post";
|
|
184
|
+
readonly path: "/auth/login";
|
|
185
|
+
};
|
|
186
|
+
readonly LoginPage: {
|
|
187
|
+
readonly method: "get";
|
|
188
|
+
readonly path: "/login";
|
|
189
|
+
};
|
|
190
|
+
readonly Logout: {
|
|
191
|
+
readonly method: "post";
|
|
192
|
+
readonly path: "/logout";
|
|
193
|
+
};
|
|
194
|
+
readonly MakePrivate: {
|
|
195
|
+
readonly method: "post";
|
|
196
|
+
readonly path: "/providers/{providerId}/make-private";
|
|
197
|
+
};
|
|
198
|
+
readonly OpenApiSpec: {
|
|
199
|
+
readonly method: "get";
|
|
200
|
+
readonly path: "/openapi.yaml";
|
|
201
|
+
};
|
|
202
|
+
readonly ProviderPreviewImage: {
|
|
203
|
+
readonly method: "get";
|
|
204
|
+
readonly path: "/providers/{providerId}/preview.png";
|
|
205
|
+
};
|
|
206
|
+
readonly Providers: {
|
|
207
|
+
readonly method: "get";
|
|
208
|
+
readonly path: "/providers";
|
|
209
|
+
};
|
|
210
|
+
readonly PublishProviderVersion: {
|
|
211
|
+
readonly method: "post";
|
|
212
|
+
readonly path: "/providers/{providerId}/versions/{version}/publish";
|
|
213
|
+
};
|
|
214
|
+
readonly RemoveOrgMember: {
|
|
215
|
+
readonly method: "delete";
|
|
216
|
+
readonly path: "/orgs/{orgId}/members/{memberId}";
|
|
217
|
+
};
|
|
218
|
+
readonly RequestPublicListing: {
|
|
219
|
+
readonly method: "post";
|
|
220
|
+
readonly path: "/providers/{providerId}/request-public";
|
|
221
|
+
};
|
|
222
|
+
readonly RevokeCredential: {
|
|
223
|
+
readonly method: "delete";
|
|
224
|
+
readonly path: "/credentials/{credentialId}";
|
|
225
|
+
};
|
|
226
|
+
readonly Robots: {
|
|
227
|
+
readonly method: "get";
|
|
228
|
+
readonly path: "/robots.txt";
|
|
229
|
+
};
|
|
230
|
+
readonly SetupProviderCreate: {
|
|
231
|
+
readonly method: "post";
|
|
232
|
+
readonly path: "/providers/setup";
|
|
233
|
+
};
|
|
234
|
+
readonly Sitemap: {
|
|
235
|
+
readonly method: "get";
|
|
236
|
+
readonly path: "/sitemap.xml";
|
|
237
|
+
};
|
|
238
|
+
readonly SubmitProviderVersionForReview: {
|
|
239
|
+
readonly method: "post";
|
|
240
|
+
readonly path: "/providers/{providerId}/versions/{version}/review";
|
|
241
|
+
};
|
|
242
|
+
readonly TransferProvider: {
|
|
243
|
+
readonly method: "post";
|
|
244
|
+
readonly path: "/providers/{providerId}/transfer";
|
|
245
|
+
};
|
|
246
|
+
readonly UpdateMe: {
|
|
247
|
+
readonly method: "patch";
|
|
248
|
+
readonly path: "/me";
|
|
249
|
+
};
|
|
250
|
+
readonly UpdateOrg: {
|
|
251
|
+
readonly method: "patch";
|
|
252
|
+
readonly path: "/orgs/{orgId}";
|
|
253
|
+
};
|
|
254
|
+
readonly UpdateOrgBilling: {
|
|
255
|
+
readonly method: "put";
|
|
256
|
+
readonly path: "/orgs/{orgId}/billing";
|
|
257
|
+
};
|
|
258
|
+
readonly UpdateOrgIcon: {
|
|
259
|
+
readonly method: "put";
|
|
260
|
+
readonly path: "/orgs/{orgId}/icon";
|
|
261
|
+
};
|
|
262
|
+
readonly UpdateOrgMember: {
|
|
263
|
+
readonly method: "patch";
|
|
264
|
+
readonly path: "/orgs/{orgId}/members/{memberId}";
|
|
265
|
+
};
|
|
266
|
+
readonly UpdateProvider: {
|
|
267
|
+
readonly method: "patch";
|
|
268
|
+
readonly path: "/providers/{providerId}";
|
|
269
|
+
};
|
|
270
|
+
readonly UpdateProviderVersion: {
|
|
271
|
+
readonly method: "patch";
|
|
272
|
+
readonly path: "/providers/{providerId}/versions/{version}";
|
|
273
|
+
};
|
|
274
|
+
readonly UpdateTheme: {
|
|
275
|
+
readonly method: "patch";
|
|
276
|
+
readonly path: "/orgs/{orgId}/themes/{themeId}";
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
export type RouteId = keyof typeof ROUTES;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// AUTO-GENERATED by packages/app/scripts/mcp-tools-gen.ts
|
|
2
|
+
// from packages/app/openapi.yaml.
|
|
3
|
+
// Run `npm run openapi:typegen --workspace=packages/client`
|
|
4
|
+
// to regenerate. Do not edit by hand.
|
|
5
|
+
export const ROUTES = {
|
|
6
|
+
"AddOrgMember": { "method": "post", "path": "/orgs/{orgId}/members" },
|
|
7
|
+
"AdminHome": { "method": "get", "path": "/admin" },
|
|
8
|
+
"AdminOrgs": { "method": "get", "path": "/admin/orgs" },
|
|
9
|
+
"AdminProviders": { "method": "get", "path": "/admin/providers" },
|
|
10
|
+
"AdminReviews": { "method": "get", "path": "/admin/reviews" },
|
|
11
|
+
"AdminThemes": { "method": "get", "path": "/admin/themes" },
|
|
12
|
+
"AdminUsers": { "method": "get", "path": "/admin/users" },
|
|
13
|
+
"AttachPage": { "method": "get", "path": "/attach/{code}" },
|
|
14
|
+
"CancelPublicListingRequest": { "method": "post", "path": "/providers/{providerId}/versions/{version}/cancel-review" },
|
|
15
|
+
"ComponentsDemo": { "method": "get", "path": "/components_demo" },
|
|
16
|
+
"ConfirmAttachSession": { "method": "post", "path": "/credentials/attach/sessions/{code}/confirm" },
|
|
17
|
+
"CreateAttachSession": { "method": "post", "path": "/credentials/attach/sessions" },
|
|
18
|
+
"CreateOrg": { "method": "post", "path": "/orgs" },
|
|
19
|
+
"CreateProvider": { "method": "post", "path": "/providers" },
|
|
20
|
+
"CreateProviderVersion": { "method": "post", "path": "/providers/{providerId}/versions" },
|
|
21
|
+
"CreateTheme": { "method": "post", "path": "/orgs/{orgId}/themes" },
|
|
22
|
+
"CredentialAuthChallenge": { "method": "post", "path": "/credentials/auth/challenge" },
|
|
23
|
+
"CredentialAuthVerify": { "method": "post", "path": "/credentials/auth/verify" },
|
|
24
|
+
"DecideProviderVersionReview": { "method": "post", "path": "/providers/{providerId}/versions/{version}/review-decision" },
|
|
25
|
+
"DeleteOrg": { "method": "delete", "path": "/orgs/{orgId}" },
|
|
26
|
+
"DeleteOrgBilling": { "method": "delete", "path": "/orgs/{orgId}/billing" },
|
|
27
|
+
"DeleteOrgIcon": { "method": "delete", "path": "/orgs/{orgId}/icon" },
|
|
28
|
+
"DeleteProvider": { "method": "delete", "path": "/providers/{providerId}" },
|
|
29
|
+
"DeleteProviderVersion": { "method": "delete", "path": "/providers/{providerId}/versions/{version}" },
|
|
30
|
+
"DeleteTheme": { "method": "delete", "path": "/orgs/{orgId}/themes/{themeId}" },
|
|
31
|
+
"Docs": { "method": "get", "path": "/docs" },
|
|
32
|
+
"ExplorePreviewImage": { "method": "get", "path": "/og/explore.png" },
|
|
33
|
+
"GetAttachSession": { "method": "get", "path": "/credentials/attach/sessions/{code}" },
|
|
34
|
+
"GetCredential": { "method": "get", "path": "/credentials/{credentialId}" },
|
|
35
|
+
"GetCredentialByAddress": { "method": "get", "path": "/credentials/by-address/{address}" },
|
|
36
|
+
"GetImage": { "method": "get", "path": "/images/{imageId}" },
|
|
37
|
+
"GetMe": { "method": "get", "path": "/me" },
|
|
38
|
+
"GetOrg": { "method": "get", "path": "/orgs/{orgId}" },
|
|
39
|
+
"GetOrgBilling": { "method": "get", "path": "/orgs/{orgId}/billing" },
|
|
40
|
+
"GetProvider": { "method": "get", "path": "/providers/{providerId}" },
|
|
41
|
+
"GetProviderBySlug": { "method": "get", "path": "/providers/{providerId}/{slug}" },
|
|
42
|
+
"GetProviderVersion": { "method": "get", "path": "/providers/{providerId}/versions/{version}" },
|
|
43
|
+
"GetTheme": { "method": "get", "path": "/orgs/{orgId}/themes/{themeId}" },
|
|
44
|
+
"GetUser": { "method": "get", "path": "/users/{userId}" },
|
|
45
|
+
"Index": { "method": "get", "path": "/" },
|
|
46
|
+
"LinkCredential": { "method": "post", "path": "/credentials" },
|
|
47
|
+
"ListOrgCredentials": { "method": "get", "path": "/orgs/{orgId}/credentials" },
|
|
48
|
+
"ListOrgs": { "method": "get", "path": "/orgs" },
|
|
49
|
+
"ListProviderVersions": { "method": "get", "path": "/providers/{providerId}/versions" },
|
|
50
|
+
"ListThemes": { "method": "get", "path": "/orgs/{orgId}/themes" },
|
|
51
|
+
"Login": { "method": "post", "path": "/auth/login" },
|
|
52
|
+
"LoginPage": { "method": "get", "path": "/login" },
|
|
53
|
+
"Logout": { "method": "post", "path": "/logout" },
|
|
54
|
+
"MakePrivate": { "method": "post", "path": "/providers/{providerId}/make-private" },
|
|
55
|
+
"OpenApiSpec": { "method": "get", "path": "/openapi.yaml" },
|
|
56
|
+
"ProviderPreviewImage": { "method": "get", "path": "/providers/{providerId}/preview.png" },
|
|
57
|
+
"Providers": { "method": "get", "path": "/providers" },
|
|
58
|
+
"PublishProviderVersion": { "method": "post", "path": "/providers/{providerId}/versions/{version}/publish" },
|
|
59
|
+
"RemoveOrgMember": { "method": "delete", "path": "/orgs/{orgId}/members/{memberId}" },
|
|
60
|
+
"RequestPublicListing": { "method": "post", "path": "/providers/{providerId}/request-public" },
|
|
61
|
+
"RevokeCredential": { "method": "delete", "path": "/credentials/{credentialId}" },
|
|
62
|
+
"Robots": { "method": "get", "path": "/robots.txt" },
|
|
63
|
+
"SetupProviderCreate": { "method": "post", "path": "/providers/setup" },
|
|
64
|
+
"Sitemap": { "method": "get", "path": "/sitemap.xml" },
|
|
65
|
+
"SubmitProviderVersionForReview": { "method": "post", "path": "/providers/{providerId}/versions/{version}/review" },
|
|
66
|
+
"TransferProvider": { "method": "post", "path": "/providers/{providerId}/transfer" },
|
|
67
|
+
"UpdateMe": { "method": "patch", "path": "/me" },
|
|
68
|
+
"UpdateOrg": { "method": "patch", "path": "/orgs/{orgId}" },
|
|
69
|
+
"UpdateOrgBilling": { "method": "put", "path": "/orgs/{orgId}/billing" },
|
|
70
|
+
"UpdateOrgIcon": { "method": "put", "path": "/orgs/{orgId}/icon" },
|
|
71
|
+
"UpdateOrgMember": { "method": "patch", "path": "/orgs/{orgId}/members/{memberId}" },
|
|
72
|
+
"UpdateProvider": { "method": "patch", "path": "/providers/{providerId}" },
|
|
73
|
+
"UpdateProviderVersion": { "method": "patch", "path": "/providers/{providerId}/versions/{version}" },
|
|
74
|
+
"UpdateTheme": { "method": "patch", "path": "/orgs/{orgId}/themes/{themeId}" },
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./openapi.js";
|