notaryos 1.0.0 → 2.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/README.md +3 -3
- package/dist/index.d.mts +24 -32
- package/dist/index.d.ts +24 -32
- package/dist/index.js +27 -58
- package/dist/index.mjs +27 -58
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -112,15 +112,15 @@ try {
|
|
|
112
112
|
|
|
113
113
|
## Get an API Key
|
|
114
114
|
|
|
115
|
-
1. Sign up at [
|
|
115
|
+
1. Sign up at [agenttownsquare.com/notary](https://agenttownsquare.com/notary)
|
|
116
116
|
2. Generate an API key from the dashboard
|
|
117
117
|
3. Keys start with `notary_live_` (production) or `notary_test_` (sandbox)
|
|
118
118
|
|
|
119
119
|
## Links
|
|
120
120
|
|
|
121
|
-
- [NotaryOS Documentation](https://
|
|
121
|
+
- [NotaryOS Documentation](https://agenttownsquare.com/notary)
|
|
122
122
|
- [API Reference](https://api.agenttownsquare.com/v1/notary/status)
|
|
123
|
-
- [Public Verification](https://
|
|
123
|
+
- [Public Verification](https://api.agenttownsquare.com/v1/notary/r/{hash})
|
|
124
124
|
|
|
125
125
|
## License
|
|
126
126
|
|
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
|
-
declare const SDK_VERSION = "1.0
|
|
20
|
+
declare const SDK_VERSION = "2.1.0";
|
|
21
21
|
/** Client configuration options. */
|
|
22
22
|
interface NotaryConfig {
|
|
23
23
|
/** Your Notary API key (notary_live_xxx or notary_test_xxx). */
|
|
@@ -73,13 +73,6 @@ interface PublicKeyInfo {
|
|
|
73
73
|
public_key_pem: string;
|
|
74
74
|
verification_note: string;
|
|
75
75
|
}
|
|
76
|
-
/** Result of a receipt lookup by hash. */
|
|
77
|
-
interface LookupResult {
|
|
78
|
-
found: boolean;
|
|
79
|
-
receipt: Receipt | null;
|
|
80
|
-
verification: VerificationResult | null;
|
|
81
|
-
meta: Record<string, unknown> | null;
|
|
82
|
-
}
|
|
83
76
|
/** Authenticated agent information. */
|
|
84
77
|
interface AgentInfo {
|
|
85
78
|
agent_id: string;
|
|
@@ -95,6 +88,17 @@ interface IssueOptions {
|
|
|
95
88
|
/** Additional metadata. */
|
|
96
89
|
metadata?: Record<string, unknown>;
|
|
97
90
|
}
|
|
91
|
+
/** Object-form argument for issue()/seal(). */
|
|
92
|
+
interface IssueRequest {
|
|
93
|
+
/** Type of action (e.g., "data_processing", "api_call"). */
|
|
94
|
+
actionType: string;
|
|
95
|
+
/** Action payload to be receipted. */
|
|
96
|
+
payload: Record<string, unknown>;
|
|
97
|
+
/** Hash of previous receipt for chaining. */
|
|
98
|
+
previousReceiptHash?: string;
|
|
99
|
+
/** Additional metadata. */
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
98
102
|
/** Base error for all NotaryOS SDK errors. */
|
|
99
103
|
declare class NotaryError extends Error {
|
|
100
104
|
code: string;
|
|
@@ -146,19 +150,22 @@ declare class NotaryClient {
|
|
|
146
150
|
/**
|
|
147
151
|
* Issue a signed receipt for an action.
|
|
148
152
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @returns A signed Receipt
|
|
153
|
+
* Supports two calling conventions:
|
|
154
|
+
* - `issue('action_type', { key: 'value' })` — positional args
|
|
155
|
+
* - `issue({ actionType: 'action_type', payload: { key: 'value' } })` — object form
|
|
153
156
|
*
|
|
154
157
|
* @example
|
|
155
158
|
* ```typescript
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
+
* // Positional (recommended)
|
|
160
|
+
* const receipt = await notary.issue('transfer', { amount: 100 });
|
|
161
|
+
*
|
|
162
|
+
* // Object form
|
|
163
|
+
* const receipt = await notary.issue({ actionType: 'transfer', payload: { amount: 100 } });
|
|
159
164
|
* ```
|
|
160
165
|
*/
|
|
161
|
-
issue(
|
|
166
|
+
issue(actionTypeOrRequest: string | IssueRequest, payload?: Record<string, unknown>, options?: IssueOptions): Promise<Receipt>;
|
|
167
|
+
/** Alias: seal() → issue() for the 3-line integration pattern. */
|
|
168
|
+
seal: (actionTypeOrRequest: string | IssueRequest, payload?: Record<string, unknown>, options?: IssueOptions) => Promise<Receipt>;
|
|
162
169
|
/**
|
|
163
170
|
* Verify a receipt's signature and integrity.
|
|
164
171
|
*
|
|
@@ -190,21 +197,6 @@ declare class NotaryClient {
|
|
|
190
197
|
publicKey(): Promise<PublicKeyInfo>;
|
|
191
198
|
/** Get authenticated agent info. */
|
|
192
199
|
me(): Promise<AgentInfo>;
|
|
193
|
-
/**
|
|
194
|
-
* Look up a receipt by hash (public endpoint, no API key required for lookup).
|
|
195
|
-
*
|
|
196
|
-
* @param receiptHash - Full or partial receipt hash (min 16 chars)
|
|
197
|
-
* @returns Lookup result with receipt, verification, and meta
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```typescript
|
|
201
|
-
* const result = await notary.lookup('abc123def456...');
|
|
202
|
-
* if (result.found && result.verification?.valid) {
|
|
203
|
-
* console.log('Receipt is valid!');
|
|
204
|
-
* }
|
|
205
|
-
* ```
|
|
206
|
-
*/
|
|
207
|
-
lookup(receiptHash: string): Promise<LookupResult>;
|
|
208
200
|
}
|
|
209
201
|
/**
|
|
210
202
|
* Quick receipt verification without API key.
|
|
@@ -234,4 +226,4 @@ declare function verifyReceipt(receipt: Record<string, unknown>, baseUrl?: strin
|
|
|
234
226
|
*/
|
|
235
227
|
declare function computeHash(payload: Record<string, unknown> | string): Promise<string>;
|
|
236
228
|
|
|
237
|
-
export { type AgentInfo, AuthenticationError, type IssueOptions, type
|
|
229
|
+
export { type AgentInfo, AuthenticationError, type IssueOptions, type IssueRequest, NotaryClient, type NotaryConfig, NotaryError, type PublicKeyInfo, RateLimitError, type Receipt, SDK_VERSION, type ServiceStatus, ValidationError, type VerificationResult, computeHash, verifyReceipt };
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
|
-
declare const SDK_VERSION = "1.0
|
|
20
|
+
declare const SDK_VERSION = "2.1.0";
|
|
21
21
|
/** Client configuration options. */
|
|
22
22
|
interface NotaryConfig {
|
|
23
23
|
/** Your Notary API key (notary_live_xxx or notary_test_xxx). */
|
|
@@ -73,13 +73,6 @@ interface PublicKeyInfo {
|
|
|
73
73
|
public_key_pem: string;
|
|
74
74
|
verification_note: string;
|
|
75
75
|
}
|
|
76
|
-
/** Result of a receipt lookup by hash. */
|
|
77
|
-
interface LookupResult {
|
|
78
|
-
found: boolean;
|
|
79
|
-
receipt: Receipt | null;
|
|
80
|
-
verification: VerificationResult | null;
|
|
81
|
-
meta: Record<string, unknown> | null;
|
|
82
|
-
}
|
|
83
76
|
/** Authenticated agent information. */
|
|
84
77
|
interface AgentInfo {
|
|
85
78
|
agent_id: string;
|
|
@@ -95,6 +88,17 @@ interface IssueOptions {
|
|
|
95
88
|
/** Additional metadata. */
|
|
96
89
|
metadata?: Record<string, unknown>;
|
|
97
90
|
}
|
|
91
|
+
/** Object-form argument for issue()/seal(). */
|
|
92
|
+
interface IssueRequest {
|
|
93
|
+
/** Type of action (e.g., "data_processing", "api_call"). */
|
|
94
|
+
actionType: string;
|
|
95
|
+
/** Action payload to be receipted. */
|
|
96
|
+
payload: Record<string, unknown>;
|
|
97
|
+
/** Hash of previous receipt for chaining. */
|
|
98
|
+
previousReceiptHash?: string;
|
|
99
|
+
/** Additional metadata. */
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
98
102
|
/** Base error for all NotaryOS SDK errors. */
|
|
99
103
|
declare class NotaryError extends Error {
|
|
100
104
|
code: string;
|
|
@@ -146,19 +150,22 @@ declare class NotaryClient {
|
|
|
146
150
|
/**
|
|
147
151
|
* Issue a signed receipt for an action.
|
|
148
152
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @returns A signed Receipt
|
|
153
|
+
* Supports two calling conventions:
|
|
154
|
+
* - `issue('action_type', { key: 'value' })` — positional args
|
|
155
|
+
* - `issue({ actionType: 'action_type', payload: { key: 'value' } })` — object form
|
|
153
156
|
*
|
|
154
157
|
* @example
|
|
155
158
|
* ```typescript
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
+
* // Positional (recommended)
|
|
160
|
+
* const receipt = await notary.issue('transfer', { amount: 100 });
|
|
161
|
+
*
|
|
162
|
+
* // Object form
|
|
163
|
+
* const receipt = await notary.issue({ actionType: 'transfer', payload: { amount: 100 } });
|
|
159
164
|
* ```
|
|
160
165
|
*/
|
|
161
|
-
issue(
|
|
166
|
+
issue(actionTypeOrRequest: string | IssueRequest, payload?: Record<string, unknown>, options?: IssueOptions): Promise<Receipt>;
|
|
167
|
+
/** Alias: seal() → issue() for the 3-line integration pattern. */
|
|
168
|
+
seal: (actionTypeOrRequest: string | IssueRequest, payload?: Record<string, unknown>, options?: IssueOptions) => Promise<Receipt>;
|
|
162
169
|
/**
|
|
163
170
|
* Verify a receipt's signature and integrity.
|
|
164
171
|
*
|
|
@@ -190,21 +197,6 @@ declare class NotaryClient {
|
|
|
190
197
|
publicKey(): Promise<PublicKeyInfo>;
|
|
191
198
|
/** Get authenticated agent info. */
|
|
192
199
|
me(): Promise<AgentInfo>;
|
|
193
|
-
/**
|
|
194
|
-
* Look up a receipt by hash (public endpoint, no API key required for lookup).
|
|
195
|
-
*
|
|
196
|
-
* @param receiptHash - Full or partial receipt hash (min 16 chars)
|
|
197
|
-
* @returns Lookup result with receipt, verification, and meta
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```typescript
|
|
201
|
-
* const result = await notary.lookup('abc123def456...');
|
|
202
|
-
* if (result.found && result.verification?.valid) {
|
|
203
|
-
* console.log('Receipt is valid!');
|
|
204
|
-
* }
|
|
205
|
-
* ```
|
|
206
|
-
*/
|
|
207
|
-
lookup(receiptHash: string): Promise<LookupResult>;
|
|
208
200
|
}
|
|
209
201
|
/**
|
|
210
202
|
* Quick receipt verification without API key.
|
|
@@ -234,4 +226,4 @@ declare function verifyReceipt(receipt: Record<string, unknown>, baseUrl?: strin
|
|
|
234
226
|
*/
|
|
235
227
|
declare function computeHash(payload: Record<string, unknown> | string): Promise<string>;
|
|
236
228
|
|
|
237
|
-
export { type AgentInfo, AuthenticationError, type IssueOptions, type
|
|
229
|
+
export { type AgentInfo, AuthenticationError, type IssueOptions, type IssueRequest, NotaryClient, type NotaryConfig, NotaryError, type PublicKeyInfo, RateLimitError, type Receipt, SDK_VERSION, type ServiceStatus, ValidationError, type VerificationResult, computeHash, verifyReceipt };
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ __export(index_exports, {
|
|
|
30
30
|
verifyReceipt: () => verifyReceipt
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(index_exports);
|
|
33
|
-
var SDK_VERSION = "1.0
|
|
33
|
+
var SDK_VERSION = "2.1.0";
|
|
34
34
|
var NotaryError = class extends Error {
|
|
35
35
|
constructor(message, code = "", status = 0, details = {}) {
|
|
36
36
|
super(message);
|
|
@@ -61,6 +61,8 @@ var ValidationError = class extends NotaryError {
|
|
|
61
61
|
};
|
|
62
62
|
var _NotaryClient = class _NotaryClient {
|
|
63
63
|
constructor(config) {
|
|
64
|
+
/** Alias: seal() → issue() for the 3-line integration pattern. */
|
|
65
|
+
this.seal = this.issue.bind(this);
|
|
64
66
|
const { apiKey, baseUrl, timeout, maxRetries } = config;
|
|
65
67
|
if (!apiKey || !(apiKey.startsWith("notary_live_") || apiKey.startsWith("notary_test_"))) {
|
|
66
68
|
throw new AuthenticationError(
|
|
@@ -145,22 +147,37 @@ var _NotaryClient = class _NotaryClient {
|
|
|
145
147
|
/**
|
|
146
148
|
* Issue a signed receipt for an action.
|
|
147
149
|
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* @returns A signed Receipt
|
|
150
|
+
* Supports two calling conventions:
|
|
151
|
+
* - `issue('action_type', { key: 'value' })` — positional args
|
|
152
|
+
* - `issue({ actionType: 'action_type', payload: { key: 'value' } })` — object form
|
|
152
153
|
*
|
|
153
154
|
* @example
|
|
154
155
|
* ```typescript
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
156
|
+
* // Positional (recommended)
|
|
157
|
+
* const receipt = await notary.issue('transfer', { amount: 100 });
|
|
158
|
+
*
|
|
159
|
+
* // Object form
|
|
160
|
+
* const receipt = await notary.issue({ actionType: 'transfer', payload: { amount: 100 } });
|
|
158
161
|
* ```
|
|
159
162
|
*/
|
|
160
|
-
async issue(
|
|
163
|
+
async issue(actionTypeOrRequest, payload, options = {}) {
|
|
164
|
+
let actionType;
|
|
165
|
+
let actionPayload;
|
|
166
|
+
if (typeof actionTypeOrRequest === "object" && actionTypeOrRequest !== null) {
|
|
167
|
+
actionType = actionTypeOrRequest.actionType;
|
|
168
|
+
actionPayload = actionTypeOrRequest.payload || {};
|
|
169
|
+
options = {
|
|
170
|
+
previousReceiptHash: actionTypeOrRequest.previousReceiptHash,
|
|
171
|
+
metadata: actionTypeOrRequest.metadata,
|
|
172
|
+
...options
|
|
173
|
+
};
|
|
174
|
+
} else {
|
|
175
|
+
actionType = actionTypeOrRequest;
|
|
176
|
+
actionPayload = payload || {};
|
|
177
|
+
}
|
|
161
178
|
const body = {
|
|
162
179
|
action_type: actionType,
|
|
163
|
-
payload
|
|
180
|
+
payload: actionPayload
|
|
164
181
|
};
|
|
165
182
|
if (options.previousReceiptHash) {
|
|
166
183
|
body.previous_receipt_hash = options.previousReceiptHash;
|
|
@@ -217,54 +234,6 @@ var _NotaryClient = class _NotaryClient {
|
|
|
217
234
|
async me() {
|
|
218
235
|
return this.request("GET", "/agents/me");
|
|
219
236
|
}
|
|
220
|
-
/**
|
|
221
|
-
* Look up a receipt by hash (public endpoint, no API key required for lookup).
|
|
222
|
-
*
|
|
223
|
-
* @param receiptHash - Full or partial receipt hash (min 16 chars)
|
|
224
|
-
* @returns Lookup result with receipt, verification, and meta
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
* ```typescript
|
|
228
|
-
* const result = await notary.lookup('abc123def456...');
|
|
229
|
-
* if (result.found && result.verification?.valid) {
|
|
230
|
-
* console.log('Receipt is valid!');
|
|
231
|
-
* }
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
async lookup(receiptHash) {
|
|
235
|
-
const url = `${this.baseUrl}/v1/notary/r/${receiptHash}`;
|
|
236
|
-
const controller = new AbortController();
|
|
237
|
-
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
238
|
-
try {
|
|
239
|
-
const response = await fetch(url, {
|
|
240
|
-
method: "GET",
|
|
241
|
-
headers: {
|
|
242
|
-
"Content-Type": "application/json",
|
|
243
|
-
"User-Agent": `notary-typescript-sdk/${SDK_VERSION}`
|
|
244
|
-
},
|
|
245
|
-
signal: controller.signal
|
|
246
|
-
});
|
|
247
|
-
clearTimeout(timeoutId);
|
|
248
|
-
if (response.status === 404) {
|
|
249
|
-
return { found: false, receipt: null, verification: null, meta: null };
|
|
250
|
-
}
|
|
251
|
-
if (!response.ok) {
|
|
252
|
-
throw new NotaryError(
|
|
253
|
-
response.statusText,
|
|
254
|
-
"ERR_LOOKUP",
|
|
255
|
-
response.status
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
return await response.json();
|
|
259
|
-
} catch (err) {
|
|
260
|
-
clearTimeout(timeoutId);
|
|
261
|
-
if (err instanceof NotaryError) throw err;
|
|
262
|
-
throw new NotaryError(
|
|
263
|
-
`Connection failed: ${err.message}`,
|
|
264
|
-
"ERR_CONNECTION"
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
237
|
};
|
|
269
238
|
_NotaryClient.DEFAULT_BASE_URL = "https://api.agenttownsquare.com";
|
|
270
239
|
_NotaryClient.DEFAULT_TIMEOUT = 3e4;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var SDK_VERSION = "1.0
|
|
2
|
+
var SDK_VERSION = "2.1.0";
|
|
3
3
|
var NotaryError = class extends Error {
|
|
4
4
|
constructor(message, code = "", status = 0, details = {}) {
|
|
5
5
|
super(message);
|
|
@@ -30,6 +30,8 @@ var ValidationError = class extends NotaryError {
|
|
|
30
30
|
};
|
|
31
31
|
var _NotaryClient = class _NotaryClient {
|
|
32
32
|
constructor(config) {
|
|
33
|
+
/** Alias: seal() → issue() for the 3-line integration pattern. */
|
|
34
|
+
this.seal = this.issue.bind(this);
|
|
33
35
|
const { apiKey, baseUrl, timeout, maxRetries } = config;
|
|
34
36
|
if (!apiKey || !(apiKey.startsWith("notary_live_") || apiKey.startsWith("notary_test_"))) {
|
|
35
37
|
throw new AuthenticationError(
|
|
@@ -114,22 +116,37 @@ var _NotaryClient = class _NotaryClient {
|
|
|
114
116
|
/**
|
|
115
117
|
* Issue a signed receipt for an action.
|
|
116
118
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* @returns A signed Receipt
|
|
119
|
+
* Supports two calling conventions:
|
|
120
|
+
* - `issue('action_type', { key: 'value' })` — positional args
|
|
121
|
+
* - `issue({ actionType: 'action_type', payload: { key: 'value' } })` — object form
|
|
121
122
|
*
|
|
122
123
|
* @example
|
|
123
124
|
* ```typescript
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
125
|
+
* // Positional (recommended)
|
|
126
|
+
* const receipt = await notary.issue('transfer', { amount: 100 });
|
|
127
|
+
*
|
|
128
|
+
* // Object form
|
|
129
|
+
* const receipt = await notary.issue({ actionType: 'transfer', payload: { amount: 100 } });
|
|
127
130
|
* ```
|
|
128
131
|
*/
|
|
129
|
-
async issue(
|
|
132
|
+
async issue(actionTypeOrRequest, payload, options = {}) {
|
|
133
|
+
let actionType;
|
|
134
|
+
let actionPayload;
|
|
135
|
+
if (typeof actionTypeOrRequest === "object" && actionTypeOrRequest !== null) {
|
|
136
|
+
actionType = actionTypeOrRequest.actionType;
|
|
137
|
+
actionPayload = actionTypeOrRequest.payload || {};
|
|
138
|
+
options = {
|
|
139
|
+
previousReceiptHash: actionTypeOrRequest.previousReceiptHash,
|
|
140
|
+
metadata: actionTypeOrRequest.metadata,
|
|
141
|
+
...options
|
|
142
|
+
};
|
|
143
|
+
} else {
|
|
144
|
+
actionType = actionTypeOrRequest;
|
|
145
|
+
actionPayload = payload || {};
|
|
146
|
+
}
|
|
130
147
|
const body = {
|
|
131
148
|
action_type: actionType,
|
|
132
|
-
payload
|
|
149
|
+
payload: actionPayload
|
|
133
150
|
};
|
|
134
151
|
if (options.previousReceiptHash) {
|
|
135
152
|
body.previous_receipt_hash = options.previousReceiptHash;
|
|
@@ -186,54 +203,6 @@ var _NotaryClient = class _NotaryClient {
|
|
|
186
203
|
async me() {
|
|
187
204
|
return this.request("GET", "/agents/me");
|
|
188
205
|
}
|
|
189
|
-
/**
|
|
190
|
-
* Look up a receipt by hash (public endpoint, no API key required for lookup).
|
|
191
|
-
*
|
|
192
|
-
* @param receiptHash - Full or partial receipt hash (min 16 chars)
|
|
193
|
-
* @returns Lookup result with receipt, verification, and meta
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* ```typescript
|
|
197
|
-
* const result = await notary.lookup('abc123def456...');
|
|
198
|
-
* if (result.found && result.verification?.valid) {
|
|
199
|
-
* console.log('Receipt is valid!');
|
|
200
|
-
* }
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
async lookup(receiptHash) {
|
|
204
|
-
const url = `${this.baseUrl}/v1/notary/r/${receiptHash}`;
|
|
205
|
-
const controller = new AbortController();
|
|
206
|
-
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
207
|
-
try {
|
|
208
|
-
const response = await fetch(url, {
|
|
209
|
-
method: "GET",
|
|
210
|
-
headers: {
|
|
211
|
-
"Content-Type": "application/json",
|
|
212
|
-
"User-Agent": `notary-typescript-sdk/${SDK_VERSION}`
|
|
213
|
-
},
|
|
214
|
-
signal: controller.signal
|
|
215
|
-
});
|
|
216
|
-
clearTimeout(timeoutId);
|
|
217
|
-
if (response.status === 404) {
|
|
218
|
-
return { found: false, receipt: null, verification: null, meta: null };
|
|
219
|
-
}
|
|
220
|
-
if (!response.ok) {
|
|
221
|
-
throw new NotaryError(
|
|
222
|
-
response.statusText,
|
|
223
|
-
"ERR_LOOKUP",
|
|
224
|
-
response.status
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
return await response.json();
|
|
228
|
-
} catch (err) {
|
|
229
|
-
clearTimeout(timeoutId);
|
|
230
|
-
if (err instanceof NotaryError) throw err;
|
|
231
|
-
throw new NotaryError(
|
|
232
|
-
`Connection failed: ${err.message}`,
|
|
233
|
-
"ERR_CONNECTION"
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
206
|
};
|
|
238
207
|
_NotaryClient.DEFAULT_BASE_URL = "https://api.agenttownsquare.com";
|
|
239
208
|
_NotaryClient.DEFAULT_TIMEOUT = 3e4;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notaryos",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "NotaryOS SDK - Cryptographic receipts for AI agent actions. Issue, verify, and audit agent behavior with Ed25519 signatures.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
10
|
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js"
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "https://github.com/
|
|
47
|
+
"url": "https://github.com/agenttownsquare/notaryos-sdk-typescript"
|
|
48
48
|
},
|
|
49
|
-
"homepage": "https://
|
|
49
|
+
"homepage": "https://agenttownsquare.com/notary",
|
|
50
50
|
"bugs": {
|
|
51
|
-
"url": "https://github.com/
|
|
51
|
+
"url": "https://github.com/agenttownsquare/notaryos-sdk-typescript/issues"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=18.0.0"
|