@agledger/sdk 1.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.
Files changed (49) hide show
  1. package/LICENSE +34 -0
  2. package/README.md +209 -0
  3. package/dist/client.d.ts +46 -0
  4. package/dist/client.js +68 -0
  5. package/dist/errors.d.ts +64 -0
  6. package/dist/errors.js +114 -0
  7. package/dist/http.d.ts +47 -0
  8. package/dist/http.js +272 -0
  9. package/dist/index.d.ts +19 -0
  10. package/dist/index.js +12 -0
  11. package/dist/resources/a2a.d.ts +22 -0
  12. package/dist/resources/a2a.js +33 -0
  13. package/dist/resources/admin.d.ts +39 -0
  14. package/dist/resources/admin.js +57 -0
  15. package/dist/resources/capabilities.d.ts +23 -0
  16. package/dist/resources/capabilities.js +21 -0
  17. package/dist/resources/compliance.d.ts +34 -0
  18. package/dist/resources/compliance.js +54 -0
  19. package/dist/resources/dashboard.d.ts +14 -0
  20. package/dist/resources/dashboard.js +20 -0
  21. package/dist/resources/disputes.d.ts +16 -0
  22. package/dist/resources/disputes.js +26 -0
  23. package/dist/resources/events.d.ts +21 -0
  24. package/dist/resources/events.js +22 -0
  25. package/dist/resources/health.d.ts +15 -0
  26. package/dist/resources/health.js +21 -0
  27. package/dist/resources/mandates.d.ts +48 -0
  28. package/dist/resources/mandates.js +89 -0
  29. package/dist/resources/notarize.d.ts +20 -0
  30. package/dist/resources/notarize.js +44 -0
  31. package/dist/resources/proxy.d.ts +74 -0
  32. package/dist/resources/proxy.js +149 -0
  33. package/dist/resources/receipts.d.ts +28 -0
  34. package/dist/resources/receipts.js +27 -0
  35. package/dist/resources/registration.d.ts +30 -0
  36. package/dist/resources/registration.js +39 -0
  37. package/dist/resources/reputation.d.ts +16 -0
  38. package/dist/resources/reputation.js +17 -0
  39. package/dist/resources/schemas.d.ts +20 -0
  40. package/dist/resources/schemas.js +24 -0
  41. package/dist/resources/verification.d.ts +13 -0
  42. package/dist/resources/verification.js +17 -0
  43. package/dist/resources/webhooks.d.ts +25 -0
  44. package/dist/resources/webhooks.js +37 -0
  45. package/dist/types.d.ts +1134 -0
  46. package/dist/types.js +6 -0
  47. package/dist/webhooks/verify.d.ts +37 -0
  48. package/dist/webhooks/verify.js +86 -0
  49. package/package.json +74 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * AGLedger™ SDK — Registration & Auth Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class RegistrationResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ /** Get the authenticated account profile. */
11
+ async getMe(options) {
12
+ return this.http.get('/v1/auth/me', undefined, options);
13
+ }
14
+ /** Register a new account (enterprise or agent). */
15
+ async register(params, options) {
16
+ return this.http.post('/v1/auth/register', params, options);
17
+ }
18
+ /** Register an enterprise account. */
19
+ async registerEnterprise(params, options) {
20
+ return this.http.post('/v1/auth/enterprise', params, options);
21
+ }
22
+ /** Register an agent account. */
23
+ async registerAgent(params, options) {
24
+ return this.http.post('/v1/auth/agent', params, options);
25
+ }
26
+ /** Verify an agent via A2A AgentCard URL. */
27
+ async verifyAgentCard(agentCardUrl, options) {
28
+ return this.http.post('/v1/auth/verify-agent-card', { agentCardUrl }, options);
29
+ }
30
+ /** Rotate the current API key. Old key is immediately revoked. */
31
+ async rotateApiKey(options) {
32
+ return this.http.post('/v1/auth/keys/rotate', undefined, options);
33
+ }
34
+ /** Verify email address with token. */
35
+ async verifyEmail(token, options) {
36
+ return this.http.post('/v1/auth/verify-email', { token }, options);
37
+ }
38
+ }
39
+ //# sourceMappingURL=registration.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * AGLedger™ SDK — Reputation Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { ReputationScore, ReputationHistoryEntry, Page, ListParams, RequestOptions } from '../types.js';
7
+ export declare class ReputationResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ getAgent(agentId: string, options?: RequestOptions): Promise<ReputationScore>;
11
+ getHistory(agentId: string, params?: ListParams & {
12
+ from?: string;
13
+ to?: string;
14
+ }, options?: RequestOptions): Promise<Page<ReputationHistoryEntry>>;
15
+ }
16
+ //# sourceMappingURL=reputation.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * AGLedger™ SDK — Reputation Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class ReputationResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async getAgent(agentId, options) {
11
+ return this.http.get(`/v1/agents/${agentId}/reputation`, undefined, options);
12
+ }
13
+ async getHistory(agentId, params, options) {
14
+ return this.http.getPage(`/v1/agents/${agentId}/reputation/history`, params, options);
15
+ }
16
+ }
17
+ //# sourceMappingURL=reputation.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * AGLedger™ SDK — Schemas Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { ContractType, ContractSchema, SchemaValidationResult, Page, RequestOptions } from '../types.js';
7
+ export declare class SchemasResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ list(options?: RequestOptions): Promise<Page<ContractType>>;
11
+ get(contractType: ContractType, options?: RequestOptions): Promise<ContractSchema>;
12
+ getRules(contractType: ContractType, options?: RequestOptions): Promise<{
13
+ contractType: ContractType;
14
+ syncRuleIds: string[];
15
+ asyncRuleIds: string[];
16
+ }>;
17
+ /** Dry-run receipt validation against a contract type's schema. */
18
+ validateReceipt(contractType: ContractType, evidence: Record<string, unknown>, options?: RequestOptions): Promise<SchemaValidationResult>;
19
+ }
20
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * AGLedger™ SDK — Schemas Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class SchemasResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async list(options) {
11
+ return this.http.getPage('/v1/schemas', undefined, options);
12
+ }
13
+ async get(contractType, options) {
14
+ return this.http.get(`/v1/schemas/${contractType}`, undefined, options);
15
+ }
16
+ async getRules(contractType, options) {
17
+ return this.http.get(`/v1/schemas/${contractType}/rules`, undefined, options);
18
+ }
19
+ /** Dry-run receipt validation against a contract type's schema. */
20
+ async validateReceipt(contractType, evidence, options) {
21
+ return this.http.post(`/v1/schemas/${contractType}/validate`, { evidence }, options);
22
+ }
23
+ }
24
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AGLedger™ SDK — Verification Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { VerificationResult, VerificationStatus, RequestOptions } from '../types.js';
7
+ export declare class VerificationResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ verify(mandateId: string, receiptIds?: string[], options?: RequestOptions): Promise<VerificationResult>;
11
+ getStatus(mandateId: string, options?: RequestOptions): Promise<VerificationStatus>;
12
+ }
13
+ //# sourceMappingURL=verification.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * AGLedger™ SDK — Verification Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class VerificationResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async verify(mandateId, receiptIds, options) {
11
+ return this.http.post(`/v1/mandates/${mandateId}/verify`, receiptIds?.length ? { receiptIds } : undefined, options);
12
+ }
13
+ async getStatus(mandateId, options) {
14
+ return this.http.get(`/v1/mandates/${mandateId}/verification-status`, undefined, options);
15
+ }
16
+ }
17
+ //# sourceMappingURL=verification.js.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * AGLedger™ SDK — Webhooks Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ import type { HttpClient } from '../http.js';
6
+ import type { Webhook, CreateWebhookParams, UpdateWebhookParams, WebhookDelivery, WebhookTestResult, Page, ListParams, RequestOptions } from '../types.js';
7
+ export declare class WebhooksResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ create(params: CreateWebhookParams, options?: RequestOptions): Promise<Webhook>;
11
+ get(webhookId: string, options?: RequestOptions): Promise<Webhook>;
12
+ list(options?: RequestOptions): Promise<Page<Webhook>>;
13
+ update(webhookId: string, params: UpdateWebhookParams, options?: RequestOptions): Promise<Webhook>;
14
+ delete(webhookId: string, options?: RequestOptions): Promise<void>;
15
+ /** Rotate webhook secret. Returns new secret. */
16
+ rotate(webhookId: string, options?: RequestOptions): Promise<{
17
+ secret: string;
18
+ }>;
19
+ /** Send a test ping to the webhook URL. */
20
+ ping(webhookId: string, options?: RequestOptions): Promise<WebhookTestResult>;
21
+ listDeliveries(webhookId: string, params?: ListParams & {
22
+ status?: string;
23
+ }, options?: RequestOptions): Promise<Page<WebhookDelivery>>;
24
+ }
25
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * AGLedger™ SDK — Webhooks Resource
3
+ * Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
4
+ */
5
+ export class WebhooksResource {
6
+ http;
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ async create(params, options) {
11
+ return this.http.post('/v1/webhooks', params, options);
12
+ }
13
+ async get(webhookId, options) {
14
+ return this.http.get(`/v1/webhooks/${webhookId}`, undefined, options);
15
+ }
16
+ async list(options) {
17
+ return this.http.getPage('/v1/webhooks', undefined, options);
18
+ }
19
+ async update(webhookId, params, options) {
20
+ return this.http.patch(`/v1/webhooks/${webhookId}`, params, options);
21
+ }
22
+ async delete(webhookId, options) {
23
+ return this.http.delete(`/v1/webhooks/${webhookId}`, options);
24
+ }
25
+ /** Rotate webhook secret. Returns new secret. */
26
+ async rotate(webhookId, options) {
27
+ return this.http.post(`/v1/webhooks/${webhookId}/rotate`, undefined, options);
28
+ }
29
+ /** Send a test ping to the webhook URL. */
30
+ async ping(webhookId, options) {
31
+ return this.http.post(`/v1/webhooks/${webhookId}/ping`, undefined, options);
32
+ }
33
+ async listDeliveries(webhookId, params, options) {
34
+ return this.http.getPage(`/v1/webhooks/${webhookId}/deliveries`, params, options);
35
+ }
36
+ }
37
+ //# sourceMappingURL=webhooks.js.map