@getstackrun/sdk 0.1.0
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 +119 -0
- package/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +65 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +31 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/services/agents.d.ts +18 -0
- package/dist/services/agents.d.ts.map +1 -0
- package/dist/services/agents.js +28 -0
- package/dist/services/agents.js.map +1 -0
- package/dist/services/credentials.d.ts +9 -0
- package/dist/services/credentials.d.ts.map +1 -0
- package/dist/services/credentials.js +13 -0
- package/dist/services/credentials.js.map +1 -0
- package/dist/services/delivery-methods.d.ts +23 -0
- package/dist/services/delivery-methods.d.ts.map +1 -0
- package/dist/services/delivery-methods.js +25 -0
- package/dist/services/delivery-methods.js.map +1 -0
- package/dist/services/dropoffs.d.ts +15 -0
- package/dist/services/dropoffs.d.ts.map +1 -0
- package/dist/services/dropoffs.js +25 -0
- package/dist/services/dropoffs.js.map +1 -0
- package/dist/services/identity.d.ts +24 -0
- package/dist/services/identity.d.ts.map +1 -0
- package/dist/services/identity.js +42 -0
- package/dist/services/identity.js.map +1 -0
- package/dist/services/notifications.d.ts +27 -0
- package/dist/services/notifications.d.ts.map +1 -0
- package/dist/services/notifications.js +31 -0
- package/dist/services/notifications.js.map +1 -0
- package/dist/services/passports.d.ts +42 -0
- package/dist/services/passports.d.ts.map +1 -0
- package/dist/services/passports.js +59 -0
- package/dist/services/passports.js.map +1 -0
- package/dist/services/proxy.d.ts +9 -0
- package/dist/services/proxy.d.ts.map +1 -0
- package/dist/services/proxy.js +13 -0
- package/dist/services/proxy.js.map +1 -0
- package/dist/services/security-events.d.ts +22 -0
- package/dist/services/security-events.d.ts.map +1 -0
- package/dist/services/security-events.js +20 -0
- package/dist/services/security-events.js.map +1 -0
- package/dist/services/services.d.ts +24 -0
- package/dist/services/services.d.ts.map +1 -0
- package/dist/services/services.js +34 -0
- package/dist/services/services.js.map +1 -0
- package/dist/services/skills.d.ts +40 -0
- package/dist/services/skills.d.ts.map +1 -0
- package/dist/services/skills.js +83 -0
- package/dist/services/skills.js.map +1 -0
- package/dist/services/team.d.ts +18 -0
- package/dist/services/team.d.ts.map +1 -0
- package/dist/services/team.js +22 -0
- package/dist/services/team.js.map +1 -0
- package/dist/types.d.ts +361 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/verify-offline.d.ts +70 -0
- package/dist/verify-offline.d.ts.map +1 -0
- package/dist/verify-offline.js +61 -0
- package/dist/verify-offline.js.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 STACK (getstack.run)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# @getstackrun/sdk
|
|
2
|
+
|
|
3
|
+
Official JavaScript / TypeScript SDK for [STACK](https://getstack.run) — the runtime security layer for AI agents.
|
|
4
|
+
|
|
5
|
+
> This package is also the target for our `@getstack/sdk` scope claim (pending). Once settled, `@getstackrun/sdk` will be deprecated with a pointer to the new name.
|
|
6
|
+
|
|
7
|
+
STACK sits between your agent and everything it touches. Short-lived, scoped passports replace long-lived API keys. Every outbound call routes through a proxy that enforces scope and parameter constraints. A hash-chained audit log records every decision. A single call kills any passport globally in under 60 seconds.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @getstackrun/sdk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires Node.js 18 or newer. Works in Deno, Bun, and browsers via native `fetch`.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Stack } from '@getstackrun/sdk';
|
|
21
|
+
|
|
22
|
+
const stack = new Stack({ apiKey: process.env.STACK_API_KEY! });
|
|
23
|
+
|
|
24
|
+
// 1. Register an agent
|
|
25
|
+
const agent = await stack.agents.register({ name: 'support-bot' });
|
|
26
|
+
|
|
27
|
+
// 2. Issue a short-lived scoped passport
|
|
28
|
+
const passport = await stack.passports.issue({
|
|
29
|
+
agent_id: agent.id,
|
|
30
|
+
intent: {
|
|
31
|
+
summary: 'Answer one customer ticket',
|
|
32
|
+
services: ['slack', 'github'],
|
|
33
|
+
estimated_duration_seconds: 900,
|
|
34
|
+
},
|
|
35
|
+
ttl_seconds: 900,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// 3. Every outbound call routes through the proxy
|
|
39
|
+
await stack.proxy.request({
|
|
40
|
+
service: 'slack',
|
|
41
|
+
method: 'POST',
|
|
42
|
+
url: 'https://slack.com/api/chat.postMessage',
|
|
43
|
+
body: { channel: 'C0123', text: 'Ticket resolved' },
|
|
44
|
+
passport_token: passport.token,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// 4. Revoke when done (or let the passport expire)
|
|
48
|
+
await stack.passports.revoke(passport.jti, 'mission complete');
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Offline passport verification
|
|
52
|
+
|
|
53
|
+
Downstream services that only need cryptographic validity (no revocation awareness) can verify a passport using the public JWKS — no network round-trip to STACK per request.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { verifyPassportOffline } from '@getstackrun/sdk';
|
|
57
|
+
|
|
58
|
+
// Mode 1: fetch JWKS once per process
|
|
59
|
+
const claims = await verifyPassportOffline(token, {
|
|
60
|
+
jwksUrl: 'https://api.getstack.run/v1/.well-known/jwks.json',
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Mode 2: fully air-gapped with a pre-fetched public key
|
|
64
|
+
const claims2 = await verifyPassportOffline(token, {
|
|
65
|
+
publicJwk: { kty: 'OKP', crv: 'Ed25519', x: '...', kid: 'stack-passport-v1', alg: 'EdDSA', use: 'sig' },
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For revocation-aware verdicts, combine with a short cache against `POST /v1/passports/verify` or subscribe to the `stack:revoked` Redis pub/sub channel.
|
|
70
|
+
|
|
71
|
+
## What the SDK wraps
|
|
72
|
+
|
|
73
|
+
| Service | Typical use |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `stack.agents` | Register, list, update, delete agents |
|
|
76
|
+
| `stack.passports` | Issue, verify, delegate, refresh, revoke |
|
|
77
|
+
| `stack.services` | Connect OAuth / custom credentials, grant agent access |
|
|
78
|
+
| `stack.credentials` | Retrieve decrypted credentials (agent-side) |
|
|
79
|
+
| `stack.proxy` | Make outbound HTTP calls; scope + constraints enforced server-side |
|
|
80
|
+
| `stack.dropoffs` | Schema-validated, encrypted agent-to-agent data transfer |
|
|
81
|
+
| `stack.skills` | Publish + invoke marketplace skills |
|
|
82
|
+
| `stack.identity` | Verification sessions, claims, providers |
|
|
83
|
+
| `stack.team` | Team members, roles, scoped API keys |
|
|
84
|
+
| `stack.deliveryMethods` | Email, SMS, webhook destinations |
|
|
85
|
+
| `stack.notifications` | Rules mapping events to destinations |
|
|
86
|
+
| `stack.securityEvents` | List, resolve real-time detector signals |
|
|
87
|
+
|
|
88
|
+
A handful of endpoints (audit export, chain-head, verify-chain, billing) are not yet wrapped — call them via `fetch` using the same API key. See [docs/api](https://getstack.run/docs).
|
|
89
|
+
|
|
90
|
+
## Error handling
|
|
91
|
+
|
|
92
|
+
Every error is a `StackError` subclass with a stable machine code.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { Stack, StackError, PassportRevokedError, InsufficientCreditsError } from '@getstackrun/sdk';
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
await stack.passports.verify(token);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
if (err instanceof PassportRevokedError) {
|
|
101
|
+
// issue a fresh passport
|
|
102
|
+
} else if (err instanceof StackError) {
|
|
103
|
+
console.error(err.code, err.statusCode, err.message);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Full catalog: [docs/reference/errors](https://getstack.run/docs/reference/errors).
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
- Getting started: https://getstack.run/docs/getting-started
|
|
113
|
+
- Concepts: https://getstack.run/docs/concepts/passports
|
|
114
|
+
- API reference: https://getstack.run/docs/api/passports
|
|
115
|
+
- MCP tools (alternative to the SDK): https://getstack.run/docs/mcp-tools
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
|
|
119
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class HttpClient {
|
|
6
|
+
private readonly apiKey;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(options: ClientOptions);
|
|
9
|
+
get<T>(path: string, query?: Record<string, string | undefined>): Promise<T>;
|
|
10
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
11
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
12
|
+
delete<T>(path: string): Promise<T>;
|
|
13
|
+
private buildUrl;
|
|
14
|
+
private request;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,EAAE,aAAa;IAK5B,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAK5E,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjD,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAKlD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAKzC,OAAO,CAAC,QAAQ;YAUF,OAAO;CAgCtB"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { StackError } from './errors.js';
|
|
2
|
+
export class HttpClient {
|
|
3
|
+
apiKey;
|
|
4
|
+
baseUrl;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.apiKey = options.apiKey;
|
|
7
|
+
this.baseUrl = (options.baseUrl ?? 'https://api.getstack.run').replace(/\/$/, '');
|
|
8
|
+
}
|
|
9
|
+
async get(path, query) {
|
|
10
|
+
const url = this.buildUrl(path, query);
|
|
11
|
+
return this.request('GET', url);
|
|
12
|
+
}
|
|
13
|
+
async post(path, body) {
|
|
14
|
+
const url = this.buildUrl(path);
|
|
15
|
+
return this.request('POST', url, body);
|
|
16
|
+
}
|
|
17
|
+
async patch(path, body) {
|
|
18
|
+
const url = this.buildUrl(path);
|
|
19
|
+
return this.request('PATCH', url, body);
|
|
20
|
+
}
|
|
21
|
+
async delete(path) {
|
|
22
|
+
const url = this.buildUrl(path);
|
|
23
|
+
return this.request('DELETE', url);
|
|
24
|
+
}
|
|
25
|
+
buildUrl(path, query) {
|
|
26
|
+
const url = new URL(path, this.baseUrl);
|
|
27
|
+
if (query) {
|
|
28
|
+
for (const [key, value] of Object.entries(query)) {
|
|
29
|
+
if (value !== undefined)
|
|
30
|
+
url.searchParams.set(key, value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return url.toString();
|
|
34
|
+
}
|
|
35
|
+
async request(method, url, body) {
|
|
36
|
+
const headers = {
|
|
37
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
38
|
+
'Accept': 'application/json',
|
|
39
|
+
};
|
|
40
|
+
if (body !== undefined) {
|
|
41
|
+
headers['Content-Type'] = 'application/json';
|
|
42
|
+
}
|
|
43
|
+
const res = await fetch(url, {
|
|
44
|
+
method,
|
|
45
|
+
headers,
|
|
46
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
47
|
+
});
|
|
48
|
+
if (!res.ok) {
|
|
49
|
+
let errorBody = {};
|
|
50
|
+
try {
|
|
51
|
+
errorBody = await res.json();
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// ignore parse errors
|
|
55
|
+
}
|
|
56
|
+
const message = errorBody.error?.message ?? errorBody.message ?? res.statusText;
|
|
57
|
+
const code = errorBody.error?.code ?? `HTTP_${res.status}`;
|
|
58
|
+
throw new StackError(message, code, res.status, errorBody);
|
|
59
|
+
}
|
|
60
|
+
if (res.status === 204)
|
|
61
|
+
return undefined;
|
|
62
|
+
return res.json();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,OAAO,UAAU;IACJ,MAAM,CAAS;IACf,OAAO,CAAS;IAEjC,YAAY,OAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,0BAA0B,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,KAA0C;QACnE,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAI,KAAK,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,IAAI,CAAI,IAAY,EAAE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CAAC,GAAG,kBAAkB,CAAC;QAC/C,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,MAAM;YACN,OAAO;YACP,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;SAC5D,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,IAAI,SAAS,GAAsE,EAAE,CAAC;YACtF,IAAI,CAAC;gBACH,SAAS,GAAG,MAAM,GAAG,CAAC,IAAI,EAAsB,CAAC;YACnD,CAAC;YAAC,MAAM,CAAC;gBACP,sBAAsB;YACxB,CAAC;YAED,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC;YAChF,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,IAAI,QAAQ,GAAG,CAAC,MAAM,EAAE,CAAC;YAC3D,MAAM,IAAI,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;YAAE,OAAO,SAAc,CAAC;QAC9C,OAAO,GAAG,CAAC,IAAI,EAAgB,CAAC;IAClC,CAAC;CACF"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class StackError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly details?: unknown | undefined;
|
|
5
|
+
constructor(message: string, code: string, status: number, details?: unknown | undefined);
|
|
6
|
+
}
|
|
7
|
+
export declare class NotFoundError extends StackError {
|
|
8
|
+
constructor(resource: string, id: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class ForbiddenError extends StackError {
|
|
11
|
+
constructor(message?: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class ValidationError extends StackError {
|
|
14
|
+
constructor(message: string, details?: unknown);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAW,SAAQ,KAAK;aAGjB,IAAI,EAAE,MAAM;aACZ,MAAM,EAAE,MAAM;aACd,OAAO,CAAC,EAAE,OAAO;gBAHjC,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,OAAO,YAAA;CAKpC;AAED,qBAAa,aAAc,SAAQ,UAAU;gBAC/B,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;CAIzC;AAED,qBAAa,cAAe,SAAQ,UAAU;gBAChC,OAAO,SAAc;CAIlC;AAED,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAI/C"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class StackError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
status;
|
|
4
|
+
details;
|
|
5
|
+
constructor(message, code, status, details) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.status = status;
|
|
9
|
+
this.details = details;
|
|
10
|
+
this.name = 'StackError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class NotFoundError extends StackError {
|
|
14
|
+
constructor(resource, id) {
|
|
15
|
+
super(`${resource} ${id} not found`, 'NOT_FOUND', 404);
|
|
16
|
+
this.name = 'NotFoundError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class ForbiddenError extends StackError {
|
|
20
|
+
constructor(message = 'Forbidden') {
|
|
21
|
+
super(message, 'FORBIDDEN', 403);
|
|
22
|
+
this.name = 'ForbiddenError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class ValidationError extends StackError {
|
|
26
|
+
constructor(message, details) {
|
|
27
|
+
super(message, 'VALIDATION_ERROR', 400, details);
|
|
28
|
+
this.name = 'ValidationError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGjB;IACA;IACA;IAJlB,YACE,OAAe,EACC,IAAY,EACZ,MAAc,EACd,OAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAU;QAGjC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,OAAO,aAAc,SAAQ,UAAU;IAC3C,YAAY,QAAgB,EAAE,EAAU;QACtC,KAAK,CAAC,GAAG,QAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,OAAO,GAAG,WAAW;QAC/B,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,OAAe,EAAE,OAAiB;QAC5C,KAAK,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ClientOptions } from './client.js';
|
|
2
|
+
import { AgentService } from './services/agents.js';
|
|
3
|
+
import { PassportService } from './services/passports.js';
|
|
4
|
+
import { ServiceService } from './services/services.js';
|
|
5
|
+
import { CredentialService } from './services/credentials.js';
|
|
6
|
+
import { DropoffService } from './services/dropoffs.js';
|
|
7
|
+
import { SkillService } from './services/skills.js';
|
|
8
|
+
import { IdentityService } from './services/identity.js';
|
|
9
|
+
import { TeamService } from './services/team.js';
|
|
10
|
+
import { DeliveryMethodService } from './services/delivery-methods.js';
|
|
11
|
+
import { NotificationService } from './services/notifications.js';
|
|
12
|
+
import { SecurityEventService } from './services/security-events.js';
|
|
13
|
+
import { ProxyService } from './services/proxy.js';
|
|
14
|
+
export declare class Stack {
|
|
15
|
+
private readonly client;
|
|
16
|
+
readonly agents: AgentService;
|
|
17
|
+
readonly passports: PassportService;
|
|
18
|
+
readonly services: ServiceService;
|
|
19
|
+
readonly credentials: CredentialService;
|
|
20
|
+
readonly dropoffs: DropoffService;
|
|
21
|
+
readonly skills: SkillService;
|
|
22
|
+
readonly identity: IdentityService;
|
|
23
|
+
readonly team: TeamService;
|
|
24
|
+
readonly deliveryMethods: DeliveryMethodService;
|
|
25
|
+
readonly notifications: NotificationService;
|
|
26
|
+
readonly securityEvents: SecurityEventService;
|
|
27
|
+
readonly proxy: ProxyService;
|
|
28
|
+
constructor(options: ClientOptions);
|
|
29
|
+
}
|
|
30
|
+
export type { ClientOptions } from './client.js';
|
|
31
|
+
export * from './types.js';
|
|
32
|
+
export * from './errors.js';
|
|
33
|
+
export { verifyPassportOffline, type VerifiedPassportClaims, type VerifyOfflineOptions, } from './verify-offline.js';
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","s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C,cAAc,EAAE,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;gBAEjB,OAAO,EAAE,aAAa;CAenC;AAGD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAK5B,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HttpClient } from './client.js';
|
|
2
|
+
import { AgentService } from './services/agents.js';
|
|
3
|
+
import { PassportService } from './services/passports.js';
|
|
4
|
+
import { ServiceService } from './services/services.js';
|
|
5
|
+
import { CredentialService } from './services/credentials.js';
|
|
6
|
+
import { DropoffService } from './services/dropoffs.js';
|
|
7
|
+
import { SkillService } from './services/skills.js';
|
|
8
|
+
import { IdentityService } from './services/identity.js';
|
|
9
|
+
import { TeamService } from './services/team.js';
|
|
10
|
+
import { DeliveryMethodService } from './services/delivery-methods.js';
|
|
11
|
+
import { NotificationService } from './services/notifications.js';
|
|
12
|
+
import { SecurityEventService } from './services/security-events.js';
|
|
13
|
+
import { ProxyService } from './services/proxy.js';
|
|
14
|
+
export class Stack {
|
|
15
|
+
client;
|
|
16
|
+
agents;
|
|
17
|
+
passports;
|
|
18
|
+
services;
|
|
19
|
+
credentials;
|
|
20
|
+
dropoffs;
|
|
21
|
+
skills;
|
|
22
|
+
identity;
|
|
23
|
+
team;
|
|
24
|
+
deliveryMethods;
|
|
25
|
+
notifications;
|
|
26
|
+
securityEvents;
|
|
27
|
+
proxy;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.client = new HttpClient(options);
|
|
30
|
+
this.agents = new AgentService(this.client);
|
|
31
|
+
this.passports = new PassportService(this.client);
|
|
32
|
+
this.services = new ServiceService(this.client);
|
|
33
|
+
this.credentials = new CredentialService(this.client);
|
|
34
|
+
this.dropoffs = new DropoffService(this.client);
|
|
35
|
+
this.skills = new SkillService(this.client);
|
|
36
|
+
this.identity = new IdentityService(this.client);
|
|
37
|
+
this.team = new TeamService(this.client);
|
|
38
|
+
this.deliveryMethods = new DeliveryMethodService(this.client);
|
|
39
|
+
this.notifications = new NotificationService(this.client);
|
|
40
|
+
this.securityEvents = new SecurityEventService(this.client);
|
|
41
|
+
this.proxy = new ProxyService(this.client);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export * from './types.js';
|
|
45
|
+
export * from './errors.js';
|
|
46
|
+
// Offline passport verification — public-key crypto only, no network to
|
|
47
|
+
// the STACK API. Pair with a cache against /v1/passports/verify if you
|
|
48
|
+
// also need revocation-aware verdicts.
|
|
49
|
+
export { verifyPassportOffline, } from './verify-offline.js';
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BA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I,CAAC,cAAc,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;CACF;AAID,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAE5B,wEAAwE;AACxE,uEAAuE;AACvE,uCAAuC;AACvC,OAAO,EACL,qBAAqB,GAGtB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { Agent, RegisterAgentInput, UpdateAgentInput } from '../types.js';
|
|
3
|
+
export declare class AgentService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
register(input: RegisterAgentInput): Promise<Agent>;
|
|
7
|
+
list(): Promise<Agent[]>;
|
|
8
|
+
get(id: string): Promise<Agent>;
|
|
9
|
+
update(id: string, input: UpdateAgentInput): Promise<Agent>;
|
|
10
|
+
delete(id: string): Promise<{
|
|
11
|
+
deleted: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
unblock(id: string): Promise<{
|
|
14
|
+
unblocked: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
getPermissions(agentId: string): Promise<unknown>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/services/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/E,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC;IAInD,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAIxB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAI/B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI3D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIjD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAIpD,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGxD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class AgentService {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async register(input) {
|
|
7
|
+
return this.client.post('/v1/agents/register', input);
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
return this.client.get('/v1/agents');
|
|
11
|
+
}
|
|
12
|
+
async get(id) {
|
|
13
|
+
return this.client.get(`/v1/agents/${id}`);
|
|
14
|
+
}
|
|
15
|
+
async update(id, input) {
|
|
16
|
+
return this.client.patch(`/v1/agents/${id}`, input);
|
|
17
|
+
}
|
|
18
|
+
async delete(id) {
|
|
19
|
+
return this.client.delete(`/v1/agents/${id}`);
|
|
20
|
+
}
|
|
21
|
+
async unblock(id) {
|
|
22
|
+
return this.client.post(`/v1/agents/${id}/unblock`);
|
|
23
|
+
}
|
|
24
|
+
async getPermissions(agentId) {
|
|
25
|
+
return this.client.get(`/v1/agents/${agentId}/permissions`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/services/agents.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,YAAY;IACH;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,QAAQ,CAAC,KAAyB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,YAAY,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAQ,cAAc,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAuB;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAQ,cAAc,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAuB,cAAc,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAyB,cAAc,EAAE,UAAU,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,OAAO,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { CredentialResult } from '../types.js';
|
|
3
|
+
export declare class CredentialService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
get(provider: string): Promise<CredentialResult>;
|
|
7
|
+
getByConnection(connectionId: string): Promise<CredentialResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/services/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIhD,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAGvE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class CredentialService {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async get(provider) {
|
|
7
|
+
return this.client.get(`/v1/credentials/${provider}`);
|
|
8
|
+
}
|
|
9
|
+
async getByConnection(connectionId) {
|
|
10
|
+
return this.client.get(`/v1/credentials/by-connection/${connectionId}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/services/credentials.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;IACR;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmB,mBAAmB,QAAQ,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,YAAoB;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmB,iCAAiC,YAAY,EAAE,CAAC,CAAC;IAC5F,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { DeliveryMethod, AddDeliveryMethodInput } from '../types.js';
|
|
3
|
+
export declare class DeliveryMethodService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
add(input: AddDeliveryMethodInput): Promise<DeliveryMethod>;
|
|
7
|
+
list(): Promise<DeliveryMethod[]>;
|
|
8
|
+
delete(id: string): Promise<{
|
|
9
|
+
deleted: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
sendVerificationCode(id: string): Promise<{
|
|
12
|
+
sent: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
verify(id: string, code: string): Promise<{
|
|
15
|
+
verified: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
}>;
|
|
18
|
+
test(id: string): Promise<{
|
|
19
|
+
sent: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=delivery-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-methods.d.ts","sourceRoot":"","sources":["../../src/services/delivery-methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1E,qBAAa,qBAAqB;IACpB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,GAAG,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI3D,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAIjC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIjD,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;IAI5D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAIhF,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAGnE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class DeliveryMethodService {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async add(input) {
|
|
7
|
+
return this.client.post('/v1/notifications/destinations', input);
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
return this.client.get('/v1/notifications/destinations');
|
|
11
|
+
}
|
|
12
|
+
async delete(id) {
|
|
13
|
+
return this.client.delete(`/v1/notifications/destinations/${id}`);
|
|
14
|
+
}
|
|
15
|
+
async sendVerificationCode(id) {
|
|
16
|
+
return this.client.post(`/v1/notifications/destinations/${id}/send-code`);
|
|
17
|
+
}
|
|
18
|
+
async verify(id, code) {
|
|
19
|
+
return this.client.post(`/v1/notifications/destinations/${id}/verify`, { code });
|
|
20
|
+
}
|
|
21
|
+
async test(id) {
|
|
22
|
+
return this.client.post(`/v1/notifications/destinations/${id}/test`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=delivery-methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-methods.js","sourceRoot":"","sources":["../../src/services/delivery-methods.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,qBAAqB;IACZ;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,GAAG,CAAC,KAA6B;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAiB,gCAAgC,EAAE,KAAK,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmB,gCAAgC,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAuB,kCAAkC,EAAE,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,EAAU;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,YAAY,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAAY;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { Dropoff, CreateDropoffInput } from '../types.js';
|
|
3
|
+
export declare class DropoffService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
create(input: CreateDropoffInput): Promise<Dropoff>;
|
|
7
|
+
deposit(id: string, agentId: string, payload: Record<string, unknown>): Promise<unknown>;
|
|
8
|
+
collect(id: string, agentId: string): Promise<{
|
|
9
|
+
payload: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
get(id: string): Promise<Dropoff>;
|
|
12
|
+
list(): Promise<Dropoff[]>;
|
|
13
|
+
expire(id: string): Promise<unknown>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=dropoffs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropoffs.d.ts","sourceRoot":"","sources":["../../src/services/dropoffs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAInD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxF,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAInE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAI1B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class DropoffService {
|
|
2
|
+
client;
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
async create(input) {
|
|
7
|
+
return this.client.post('/v1/dropoffs', input);
|
|
8
|
+
}
|
|
9
|
+
async deposit(id, agentId, payload) {
|
|
10
|
+
return this.client.post(`/v1/dropoffs/${id}/deposit`, { agent_id: agentId, payload });
|
|
11
|
+
}
|
|
12
|
+
async collect(id, agentId) {
|
|
13
|
+
return this.client.post(`/v1/dropoffs/${id}/collect`, { agent_id: agentId });
|
|
14
|
+
}
|
|
15
|
+
async get(id) {
|
|
16
|
+
return this.client.get(`/v1/dropoffs/${id}`);
|
|
17
|
+
}
|
|
18
|
+
async list() {
|
|
19
|
+
return this.client.get('/v1/dropoffs');
|
|
20
|
+
}
|
|
21
|
+
async expire(id) {
|
|
22
|
+
return this.client.post(`/v1/dropoffs/${id}/expire`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=dropoffs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropoffs.js","sourceRoot":"","sources":["../../src/services/dropoffs.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,MAAM,CAAC,KAAyB;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,cAAc,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,OAAe,EAAE,OAAgC;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,OAAe;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAY,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HttpClient } from '../client.js';
|
|
2
|
+
import type { IdentityProvider, IdentityClaim, IdentitySettings, UpdateIdentitySettingsInput, InitiateVerificationInput, VerificationResult } from '../types.js';
|
|
3
|
+
export declare class IdentityService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: HttpClient);
|
|
6
|
+
getSettings(): Promise<IdentitySettings>;
|
|
7
|
+
updateSettings(input: UpdateIdentitySettingsInput): Promise<IdentitySettings>;
|
|
8
|
+
listProviders(): Promise<IdentityProvider[]>;
|
|
9
|
+
initiateVerification(input: InitiateVerificationInput): Promise<VerificationResult>;
|
|
10
|
+
completeVerification(providerKey: string, sessionRef: string): Promise<unknown>;
|
|
11
|
+
grantDelegation(delegatedScopes: string[]): Promise<IdentityClaim>;
|
|
12
|
+
listClaims(): Promise<IdentityClaim[]>;
|
|
13
|
+
revokeClaim(id: string): Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
getServiceRequirements(serviceId: string): Promise<unknown>;
|
|
17
|
+
setServiceRequirement(serviceId: string, input: {
|
|
18
|
+
layer: string;
|
|
19
|
+
assurance_level: string;
|
|
20
|
+
requires_pii?: boolean;
|
|
21
|
+
lawful_basis?: string;
|
|
22
|
+
}): Promise<unknown>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/services/identity.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