@certen.io/sdk 0.5.0 → 0.7.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/CHANGELOG.md +599 -0
- package/README.md +133 -119
- package/dist/client.d.ts +96 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +258 -20
- package/dist/client.js.map +1 -1
- package/dist/doctor.d.ts +53 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +451 -0
- package/dist/doctor.js.map +1 -0
- package/dist/error-codes.d.ts +14 -0
- package/dist/error-codes.d.ts.map +1 -0
- package/dist/error-codes.js +55 -0
- package/dist/error-codes.js.map +1 -0
- package/dist/errors.d.ts +13 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +18 -1
- package/dist/errors.js.map +1 -1
- package/dist/funding.d.ts +43 -0
- package/dist/funding.d.ts.map +1 -0
- package/dist/funding.js +116 -0
- package/dist/funding.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/oauth.d.ts +56 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +68 -0
- package/dist/oauth.js.map +1 -0
- package/dist/registration.d.ts +33 -0
- package/dist/registration.d.ts.map +1 -0
- package/dist/registration.js +49 -0
- package/dist/registration.js.map +1 -0
- package/dist/resources/admin.d.ts +52 -1
- package/dist/resources/admin.d.ts.map +1 -1
- package/dist/resources/admin.js +55 -0
- package/dist/resources/admin.js.map +1 -1
- package/dist/resources/billing.d.ts +198 -19
- package/dist/resources/billing.d.ts.map +1 -1
- package/dist/resources/billing.js +297 -7
- package/dist/resources/billing.js.map +1 -1
- package/dist/resources/chains.d.ts +38 -0
- package/dist/resources/chains.d.ts.map +1 -0
- package/dist/resources/chains.js +46 -0
- package/dist/resources/chains.js.map +1 -0
- package/dist/resources/device.d.ts +43 -0
- package/dist/resources/device.d.ts.map +1 -0
- package/dist/resources/device.js +49 -0
- package/dist/resources/device.js.map +1 -0
- package/dist/resources/execute.d.ts +10 -0
- package/dist/resources/execute.d.ts.map +1 -1
- package/dist/resources/execute.js +28 -6
- package/dist/resources/execute.js.map +1 -1
- package/dist/resources/health.d.ts +34 -0
- package/dist/resources/health.d.ts.map +1 -0
- package/dist/resources/health.js +43 -0
- package/dist/resources/health.js.map +1 -0
- package/dist/resources/identity.d.ts +83 -2
- package/dist/resources/identity.d.ts.map +1 -1
- package/dist/resources/identity.js +154 -2
- package/dist/resources/identity.js.map +1 -1
- package/dist/resources/oauth-clients.d.ts +71 -0
- package/dist/resources/oauth-clients.d.ts.map +1 -0
- package/dist/resources/oauth-clients.js +75 -0
- package/dist/resources/oauth-clients.js.map +1 -0
- package/dist/resources/pending.d.ts +13 -1
- package/dist/resources/pending.d.ts.map +1 -1
- package/dist/resources/pending.js +15 -0
- package/dist/resources/pending.js.map +1 -1
- package/dist/resources/proof.d.ts +82 -0
- package/dist/resources/proof.d.ts.map +1 -0
- package/dist/resources/proof.js +112 -0
- package/dist/resources/proof.js.map +1 -0
- package/dist/resources/registration-tokens.d.ts +51 -0
- package/dist/resources/registration-tokens.d.ts.map +1 -0
- package/dist/resources/registration-tokens.js +54 -0
- package/dist/resources/registration-tokens.js.map +1 -0
- package/dist/resources/sign.d.ts.map +1 -1
- package/dist/resources/sign.js +12 -7
- package/dist/resources/sign.js.map +1 -1
- package/dist/resources/transaction.d.ts +20 -0
- package/dist/resources/transaction.d.ts.map +1 -1
- package/dist/resources/transaction.js +28 -0
- package/dist/resources/transaction.js.map +1 -1
- package/dist/resources/transparency.d.ts +68 -0
- package/dist/resources/transparency.d.ts.map +1 -0
- package/dist/resources/transparency.js +83 -0
- package/dist/resources/transparency.js.map +1 -0
- package/dist/resources/webhooks.d.ts +97 -0
- package/dist/resources/webhooks.d.ts.map +1 -0
- package/dist/resources/webhooks.js +112 -0
- package/dist/resources/webhooks.js.map +1 -0
- package/dist/self-signup.d.ts +66 -0
- package/dist/self-signup.d.ts.map +1 -0
- package/dist/self-signup.js +76 -0
- package/dist/self-signup.js.map +1 -0
- package/dist/shared-proof.d.ts +34 -0
- package/dist/shared-proof.d.ts.map +1 -0
- package/dist/shared-proof.js +78 -0
- package/dist/shared-proof.js.map +1 -0
- package/dist/sign-target.d.ts +34 -0
- package/dist/sign-target.d.ts.map +1 -0
- package/dist/sign-target.js +41 -0
- package/dist/sign-target.js.map +1 -0
- package/dist/types.d.ts +831 -22
- package/dist/types.d.ts.map +1 -1
- package/dist/verify-receipt.d.ts +32 -0
- package/dist/verify-receipt.d.ts.map +1 -0
- package/dist/verify-receipt.js +176 -0
- package/dist/verify-receipt.js.map +1 -0
- package/package.json +4 -3
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { omitUndefined } from '../internal.js';
|
|
2
|
+
import { CertenError } from '../errors.js';
|
|
3
|
+
/** Statuses provisioning is still in flight in. Anything else is treated as terminal. */
|
|
4
|
+
const IN_FLIGHT = ['provisioning', 'pending', 'creating'];
|
|
5
|
+
const sleep = (ms) => new Promise((r) => { setTimeout(r, ms); });
|
|
6
|
+
/**
|
|
7
|
+
* Accept what the gateway actually handed the caller.
|
|
8
|
+
*
|
|
9
|
+
* `mnemonic_retrieval.url` is a path, not an id and a token — so a method taking `(id, token)` only
|
|
10
|
+
* would make every caller split a string, and splitting it wrongly costs them the seed. Both forms
|
|
11
|
+
* are accepted, and an absolute URL works too in case the gateway ever returns one.
|
|
12
|
+
*/
|
|
13
|
+
export function parseMnemonicTarget(idOrUrl, token) {
|
|
14
|
+
if (token)
|
|
15
|
+
return { id: idOrUrl, token };
|
|
16
|
+
const path = idOrUrl.includes('://') ? new URL(idOrUrl).pathname : idOrUrl;
|
|
17
|
+
const m = /\/v1\/identity\/([^/]+)\/mnemonic\/([^/?#]+)/.exec(path);
|
|
18
|
+
if (!m) {
|
|
19
|
+
throw new CertenError(`certen: "${idOrUrl}" is not a mnemonic retrieval URL. Pass the create response's `
|
|
20
|
+
+ 'mnemonic_retrieval.url, or the identity id and token as two arguments.', 0, 'INVALID_MNEMONIC_TARGET');
|
|
21
|
+
}
|
|
22
|
+
return { id: decodeURIComponent(m[1]), token: decodeURIComponent(m[2]) };
|
|
23
|
+
}
|
|
2
24
|
export class IdentityResource {
|
|
3
25
|
http;
|
|
4
26
|
constructor(http) {
|
|
@@ -35,10 +57,108 @@ export class IdentityResource {
|
|
|
35
57
|
* as a query string, where it was silently ignored — so the signature promised a capability the API does
|
|
36
58
|
* not have.
|
|
37
59
|
*/
|
|
38
|
-
async get(id) {
|
|
39
|
-
const { data } = await this.http.get(`/v1/identity/${id}
|
|
60
|
+
async get(id, opts = {}) {
|
|
61
|
+
const { data } = await this.http.get(`/v1/identity/${id}`, {
|
|
62
|
+
// Only sent when asked for: omitting the param keeps the gateway's default, while sending
|
|
63
|
+
// `include=` is the explicit "none" that a poll loop wants. The two are different requests
|
|
64
|
+
// and conflating them would silently strip enrichments from every ordinary read.
|
|
65
|
+
...(opts.include ? { params: { include: opts.include.join(',') } } : {}),
|
|
66
|
+
});
|
|
40
67
|
return data;
|
|
41
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Create an identity and wait until it is genuinely usable.
|
|
71
|
+
*
|
|
72
|
+
* `create()` returns `202` and provisioning continues, so the response it gives back says nothing
|
|
73
|
+
* about whether the identity works. Every integration then writes the same poll loop, and the
|
|
74
|
+
* ones that do not write it hand around an identity that fails at the last step of every flow.
|
|
75
|
+
*
|
|
76
|
+
* "Usable" is `status` terminal AND `can_sign === true`, and those fail for different reasons:
|
|
77
|
+
*
|
|
78
|
+
* - `can_sign === false` — provisioning finished, but the on-chain key page is not held by your
|
|
79
|
+
* key. The identity exists, consumes org quota, and can never sign.
|
|
80
|
+
* - `can_sign === null` — the key page could not be READ. That is UNKNOWN, not a soft yes, and an
|
|
81
|
+
* Accumulate outage is exactly when the distinction matters most. This keeps polling, and says
|
|
82
|
+
* plainly that it could not determine the answer if the budget runs out.
|
|
83
|
+
*
|
|
84
|
+
* A timeout is neither success nor failure — provisioning may still complete — so it throws
|
|
85
|
+
* rather than returning something a caller could mistake for a ready identity.
|
|
86
|
+
*
|
|
87
|
+
* **Not the right call for `signing_mode: "provider"`.** The one-shot mnemonic URL expires in
|
|
88
|
+
* about ten minutes and this method is allowed to wait five, so waiting first burns most of the
|
|
89
|
+
* window on the one flow where losing the token loses the seed. Use `create()`, call
|
|
90
|
+
* `retrieveMnemonic()` immediately, then poll `get()`. If you do use this, the URL is carried
|
|
91
|
+
* through on `mnemonic_retrieval` rather than dropped — but it may already have expired.
|
|
92
|
+
*/
|
|
93
|
+
async createAndWait(params, { timeoutMs = 300_000, intervalMs, onPoll } = {}) {
|
|
94
|
+
const created = await this.create(params);
|
|
95
|
+
const id = created.id;
|
|
96
|
+
if (!id) {
|
|
97
|
+
throw new CertenError('certen: the gateway accepted the identity but returned no id', 0, 'NO_IDENTITY_ID');
|
|
98
|
+
}
|
|
99
|
+
// The gateway now publishes how to wait, so this stops guessing. It used to poll every 3s
|
|
100
|
+
// starting IMMEDIATELY, against an operation that is a chain of anchored Accumulate
|
|
101
|
+
// transactions and cannot finish in under a minute — roughly twenty requests spent before
|
|
102
|
+
// anything could possibly have changed. An explicit `intervalMs` still wins, and a gateway that
|
|
103
|
+
// sends no `polling` block falls back to the old numbers rather than to nothing.
|
|
104
|
+
const polling = created.polling;
|
|
105
|
+
const pollInterval = intervalMs ?? (polling ? polling.interval_seconds * 1_000 : 3_000);
|
|
106
|
+
const firstPollDelay = intervalMs === undefined && polling
|
|
107
|
+
? polling.first_poll_after_seconds * 1_000
|
|
108
|
+
: 0;
|
|
109
|
+
const deadline = Date.now() + timeoutMs;
|
|
110
|
+
let last;
|
|
111
|
+
// Bounded by the deadline, so a large published delay can never overshoot the caller's budget.
|
|
112
|
+
if (firstPollDelay > 0)
|
|
113
|
+
await sleep(Math.min(firstPollDelay, Math.max(0, deadline - Date.now())));
|
|
114
|
+
while (Date.now() < deadline) {
|
|
115
|
+
// The response IS the identity (plus its joined sub-resources) since the gateway flattened
|
|
116
|
+
// these endpoints; it no longer arrives under an `identity` key.
|
|
117
|
+
// No enrichments while polling. This loop reads `status` and `can_sign`, both computed
|
|
118
|
+
// before any enrichment runs — so fetching governance, balances and pending on every
|
|
119
|
+
// iteration bought nothing. At the default 3s interval a 90s provisioning wait is ~30
|
|
120
|
+
// polls, each of which was making a governance network call, a balance network call PER
|
|
121
|
+
// LINKED CHAIN, and a pending lookup, then discarding all of it.
|
|
122
|
+
const identity = await this.get(id, { include: [] });
|
|
123
|
+
last = identity;
|
|
124
|
+
onPoll?.(identity);
|
|
125
|
+
if (!IN_FLIGHT.includes(identity.status)) {
|
|
126
|
+
if (identity.can_sign === true) {
|
|
127
|
+
// One enriched read at the end, so what comes back is exactly what it always was.
|
|
128
|
+
// Returning the lean poll result would silently drop `balances`, `governance` and
|
|
129
|
+
// `pending` for anyone reading them off this — a saving not worth a surprise.
|
|
130
|
+
const ready = await this.get(id).catch(() => identity);
|
|
131
|
+
// `mnemonic_retrieval` only ever appears on the create response, and this method used to
|
|
132
|
+
// throw that response away — so provider mode through `createAndWait` lost the seed with
|
|
133
|
+
// no way to notice. Carried through instead.
|
|
134
|
+
//
|
|
135
|
+
// It may already be too late: the token lives ~10 minutes and this call is allowed to
|
|
136
|
+
// wait five. A caller who needs the mnemonic should use `create()` and collect it first,
|
|
137
|
+
// then wait. This is a safety net, not the recommended path.
|
|
138
|
+
return created.mnemonic_retrieval
|
|
139
|
+
? { ...ready, mnemonic_retrieval: created.mnemonic_retrieval }
|
|
140
|
+
: ready;
|
|
141
|
+
}
|
|
142
|
+
if (identity.can_sign === false) {
|
|
143
|
+
throw new CertenError(`certen: identity ${id} finished provisioning as "${identity.status}" but cannot sign — `
|
|
144
|
+
+ 'its key page is not held by your key'
|
|
145
|
+
+ (identity.error_message ? `: ${identity.error_message}` : ''), 0, 'IDENTITY_CANNOT_SIGN');
|
|
146
|
+
}
|
|
147
|
+
if (identity.status === 'error') {
|
|
148
|
+
throw new CertenError(`certen: identity ${id} failed to provision`
|
|
149
|
+
+ (identity.error_message ? `: ${identity.error_message}` : ''), 0, 'IDENTITY_PROVISIONING_FAILED');
|
|
150
|
+
}
|
|
151
|
+
// Terminal status with can_sign null: the key page was unreadable. Keep asking — this is
|
|
152
|
+
// usually transient — and fall through to the unknown-answer error if it never resolves.
|
|
153
|
+
}
|
|
154
|
+
await sleep(pollInterval);
|
|
155
|
+
}
|
|
156
|
+
if (last && !IN_FLIGHT.includes(last.status) && last.can_sign == null) {
|
|
157
|
+
throw new CertenError(`certen: identity ${id} is "${last.status}" but whether it can sign could not be determined `
|
|
158
|
+
+ '— the on-chain key page was unreadable for the whole wait', 0, 'IDENTITY_CAN_SIGN_UNKNOWN');
|
|
159
|
+
}
|
|
160
|
+
throw new CertenError(`certen: identity ${id} is still "${last?.status ?? 'unknown'}" after ${timeoutMs}ms — it may yet finish`, 0, 'IDENTITY_WAIT_TIMEOUT');
|
|
161
|
+
}
|
|
42
162
|
/** Link or unlink chains, set a webhook, or supply a `publicKey` to repair an identity created without one. */
|
|
43
163
|
async update(id, params) {
|
|
44
164
|
const { data } = await this.http.patch(`/v1/identity/${id}`, omitUndefined({
|
|
@@ -55,5 +175,37 @@ export class IdentityResource {
|
|
|
55
175
|
const { data } = await this.http.delete(`/v1/identity/${id}`);
|
|
56
176
|
return data;
|
|
57
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Collect the mnemonic generated for a `signing_mode: "provider"` identity. **Once.**
|
|
180
|
+
*
|
|
181
|
+
* This had no client surface at all, which made it the most dangerous gap in the SDK. Creating a
|
|
182
|
+
* provider-mode identity never returns the mnemonic inline — it returns a `mnemonic_retrieval.url`
|
|
183
|
+
* — and the token behind that URL is consumed atomically on first read. So a caller who did not
|
|
184
|
+
* hand-roll the HTTP request lost the seed permanently, on the one flow where the key material
|
|
185
|
+
* exists and CERTEN is holding it for them.
|
|
186
|
+
*
|
|
187
|
+
* **Two clocks are running.** The token expires (10 minutes by default, published as
|
|
188
|
+
* `mnemonic_retrieval.expires_in`) and it dies on first read. Call this immediately after
|
|
189
|
+
* `create()` and persist the result before doing anything else — including before waiting for
|
|
190
|
+
* provisioning to finish, which takes longer than the token lives.
|
|
191
|
+
*
|
|
192
|
+
* Pass either the URL the create response gave you, or the id and token separately:
|
|
193
|
+
*
|
|
194
|
+
* ```ts
|
|
195
|
+
* const created = await certen.identity.create({ name: 'ops', signingMode: 'provider' });
|
|
196
|
+
* if (created.mnemonic_retrieval) {
|
|
197
|
+
* const { mnemonic } = await certen.identity.retrieveMnemonic(created.mnemonic_retrieval.url);
|
|
198
|
+
* await saveToVault(mnemonic); // there is no second chance
|
|
199
|
+
* }
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* Requires `identity:write`. A second call fails with 404 — indistinguishable, by design, from a
|
|
203
|
+
* token that never existed.
|
|
204
|
+
*/
|
|
205
|
+
async retrieveMnemonic(idOrUrl, token) {
|
|
206
|
+
const { id, token: tok } = parseMnemonicTarget(idOrUrl, token);
|
|
207
|
+
const { data } = await this.http.get(`/v1/identity/${encodeURIComponent(id)}/mnemonic/${encodeURIComponent(tok)}`);
|
|
208
|
+
return data;
|
|
209
|
+
}
|
|
58
210
|
}
|
|
59
211
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/resources/identity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,MAAM,OAAO,gBAAgB;IACP;IAApB,YAAoB,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAE3C;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,MAA4B;QACvC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,MAAM,CAAC,cAAc;YAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC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Y;YAClC,WAAW,EAAE,MAAM,CAAC,UAAU;YAC9B,UAAU,EAAE,MAAM,CAAC,SAAS;SAC7B,CAAC,CAAC,CAAC;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;IAED;kGAC8F;IAC9F,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAAe,EACf,KAAc;QAEd,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC/D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAClC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,aAAa,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAC7E,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CASF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import type { OAuthClient, OAuthClientCredentials } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The OAuth2 clients your organization owns.
|
|
5
|
+
*
|
|
6
|
+
* `fetchOAuthToken` and `revokeOAuthToken` let a service obtain and give back tokens — but the
|
|
7
|
+
* client those tokens come from could only be created by a human opening the portal. So an
|
|
8
|
+
* integration could authenticate itself and could not provision itself, and every automated
|
|
9
|
+
* deployment stopped to wait on someone clicking through a browser.
|
|
10
|
+
*
|
|
11
|
+
* These sat at `/v1/admin/oauth-clients` behind `admin:write`, which was the same misfiling
|
|
12
|
+
* webhooks had: the rows are org-scoped and the create route explicitly refuses to cross orgs
|
|
13
|
+
* without admin scope, so this was always a customer capability wearing an operator's path. Moved
|
|
14
|
+
* to `/v1/oauth-clients` with `oauth:read` and `oauth:write`.
|
|
15
|
+
*
|
|
16
|
+
* **A secret appears exactly twice in its life** — once from `create()`, once from
|
|
17
|
+
* `rotateSecret()` — and never again from any read. Store it before doing anything else.
|
|
18
|
+
*/
|
|
19
|
+
export declare class OAuthClientsResource {
|
|
20
|
+
private http;
|
|
21
|
+
constructor(http: AxiosInstance);
|
|
22
|
+
/** Clients this organization owns. Never includes secrets. Requires `oauth:read`. */
|
|
23
|
+
list(): Promise<{
|
|
24
|
+
clients: OAuthClient[];
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a client and receive its credentials once.
|
|
28
|
+
*
|
|
29
|
+
* `scopes` is what tokens issued to this client may do — grant it the narrowest set that works,
|
|
30
|
+
* because a token is only as constrained as the client that minted it. Omitting it creates a
|
|
31
|
+
* client whose tokens can do nothing, which is rarely what anyone wants.
|
|
32
|
+
*
|
|
33
|
+
* `orgId` is for operators placing a client in another organization and requires `admin:write`;
|
|
34
|
+
* leave it unset and the client lands in your own org.
|
|
35
|
+
*
|
|
36
|
+
* NOT retry-safe — a repeat creates a second client. Requires `oauth:write`.
|
|
37
|
+
*/
|
|
38
|
+
create(params: {
|
|
39
|
+
scopes: string[];
|
|
40
|
+
orgId?: string;
|
|
41
|
+
}): Promise<OAuthClientCredentials>;
|
|
42
|
+
/**
|
|
43
|
+
* Deactivate a client and revoke every token it ever issued.
|
|
44
|
+
*
|
|
45
|
+
* Immediate and cascading: anything currently authenticating as this client stops working on the
|
|
46
|
+
* next request, including tokens that had hours left. That is the correct behaviour for a leaked
|
|
47
|
+
* client secret and a severe one for a live integration — reach for `rotateSecret` with a grace
|
|
48
|
+
* window when the goal is to change the credential rather than to stop the client.
|
|
49
|
+
*
|
|
50
|
+
* Idempotent: deactivation is a state, so a retry is safe. Requires `oauth:write`.
|
|
51
|
+
*/
|
|
52
|
+
remove(id: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Issue a new client secret, optionally keeping the old one alive while you deploy.
|
|
55
|
+
*
|
|
56
|
+
* `graceSeconds` is the whole point of this method over delete-and-recreate: the previous secret
|
|
57
|
+
* keeps working for that long, so a fleet can pick up the new one at its own pace instead of
|
|
58
|
+
* failing all at once. Defaults to 300 seconds, and the gateway caps it at seven days. Pass `0`
|
|
59
|
+
* for an immediate cutover — correct when the old secret has leaked, and a small outage otherwise.
|
|
60
|
+
*
|
|
61
|
+
* NOT retry-safe. Each call invalidates the secret the previous one issued, so calling twice
|
|
62
|
+
* strands whatever was mid-deployment with the first new secret. Requires `oauth:write`.
|
|
63
|
+
*/
|
|
64
|
+
rotateSecret(id: string, params?: {
|
|
65
|
+
graceSeconds?: number;
|
|
66
|
+
}): Promise<OAuthClientCredentials & {
|
|
67
|
+
grace_seconds?: number;
|
|
68
|
+
previous_secret_expires_at?: string | null;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=oauth-clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-clients.d.ts","sourceRoot":"","sources":["../../src/resources/oauth-clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,oBAAoB;IACnB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEvC,qFAAqF;IAC/E,IAAI,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,WAAW,EAAE,CAAA;KAAE,CAAC;IAKjD;;;;;;;;;;;OAWG;IACG,MAAM,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAQnC;;;;;;;;;OASG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvC;;;;;;;;;;OAUG;IACG,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAC7E,sBAAsB,GAAG;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,0BAA0B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAChG;CAOF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OAuth2 clients your organization owns.
|
|
3
|
+
*
|
|
4
|
+
* `fetchOAuthToken` and `revokeOAuthToken` let a service obtain and give back tokens — but the
|
|
5
|
+
* client those tokens come from could only be created by a human opening the portal. So an
|
|
6
|
+
* integration could authenticate itself and could not provision itself, and every automated
|
|
7
|
+
* deployment stopped to wait on someone clicking through a browser.
|
|
8
|
+
*
|
|
9
|
+
* These sat at `/v1/admin/oauth-clients` behind `admin:write`, which was the same misfiling
|
|
10
|
+
* webhooks had: the rows are org-scoped and the create route explicitly refuses to cross orgs
|
|
11
|
+
* without admin scope, so this was always a customer capability wearing an operator's path. Moved
|
|
12
|
+
* to `/v1/oauth-clients` with `oauth:read` and `oauth:write`.
|
|
13
|
+
*
|
|
14
|
+
* **A secret appears exactly twice in its life** — once from `create()`, once from
|
|
15
|
+
* `rotateSecret()` — and never again from any read. Store it before doing anything else.
|
|
16
|
+
*/
|
|
17
|
+
export class OAuthClientsResource {
|
|
18
|
+
http;
|
|
19
|
+
constructor(http) {
|
|
20
|
+
this.http = http;
|
|
21
|
+
}
|
|
22
|
+
/** Clients this organization owns. Never includes secrets. Requires `oauth:read`. */
|
|
23
|
+
async list() {
|
|
24
|
+
const { data } = await this.http.get('/v1/oauth-clients');
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a client and receive its credentials once.
|
|
29
|
+
*
|
|
30
|
+
* `scopes` is what tokens issued to this client may do — grant it the narrowest set that works,
|
|
31
|
+
* because a token is only as constrained as the client that minted it. Omitting it creates a
|
|
32
|
+
* client whose tokens can do nothing, which is rarely what anyone wants.
|
|
33
|
+
*
|
|
34
|
+
* `orgId` is for operators placing a client in another organization and requires `admin:write`;
|
|
35
|
+
* leave it unset and the client lands in your own org.
|
|
36
|
+
*
|
|
37
|
+
* NOT retry-safe — a repeat creates a second client. Requires `oauth:write`.
|
|
38
|
+
*/
|
|
39
|
+
async create(params) {
|
|
40
|
+
const { data } = await this.http.post('/v1/oauth-clients', {
|
|
41
|
+
scopes: params.scopes,
|
|
42
|
+
...(params.orgId ? { org_id: params.orgId } : {}),
|
|
43
|
+
});
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Deactivate a client and revoke every token it ever issued.
|
|
48
|
+
*
|
|
49
|
+
* Immediate and cascading: anything currently authenticating as this client stops working on the
|
|
50
|
+
* next request, including tokens that had hours left. That is the correct behaviour for a leaked
|
|
51
|
+
* client secret and a severe one for a live integration — reach for `rotateSecret` with a grace
|
|
52
|
+
* window when the goal is to change the credential rather than to stop the client.
|
|
53
|
+
*
|
|
54
|
+
* Idempotent: deactivation is a state, so a retry is safe. Requires `oauth:write`.
|
|
55
|
+
*/
|
|
56
|
+
async remove(id) {
|
|
57
|
+
await this.http.delete(`/v1/oauth-clients/${encodeURIComponent(id)}`);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Issue a new client secret, optionally keeping the old one alive while you deploy.
|
|
61
|
+
*
|
|
62
|
+
* `graceSeconds` is the whole point of this method over delete-and-recreate: the previous secret
|
|
63
|
+
* keeps working for that long, so a fleet can pick up the new one at its own pace instead of
|
|
64
|
+
* failing all at once. Defaults to 300 seconds, and the gateway caps it at seven days. Pass `0`
|
|
65
|
+
* for an immediate cutover — correct when the old secret has leaked, and a small outage otherwise.
|
|
66
|
+
*
|
|
67
|
+
* NOT retry-safe. Each call invalidates the secret the previous one issued, so calling twice
|
|
68
|
+
* strands whatever was mid-deployment with the first new secret. Requires `oauth:write`.
|
|
69
|
+
*/
|
|
70
|
+
async rotateSecret(id, params = {}) {
|
|
71
|
+
const { data } = await this.http.post(`/v1/oauth-clients/${encodeURIComponent(id)}/rotate-secret`, params.graceSeconds === undefined ? {} : { grace_seconds: params.graceSeconds });
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=oauth-clients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-clients.js","sourceRoot":"","sources":["../../src/resources/oauth-clients.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,oBAAoB;IACX;IAApB,YAAoB,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAE3C,qFAAqF;IACrF,KAAK,CAAC,IAAI;QACR,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAM,CAAC,MAGZ;QACC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YACzD,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAY,CAAC,EAAU,EAAE,SAAoC,EAAE;QAGnE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CACnC,qBAAqB,kBAAkB,CAAC,EAAE,CAAC,gBAAgB,EAC3D,MAAM,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,YAAY,EAAE,CAChF,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import type { PendingActionsResponse, ListPendingParams } from '../types.js';
|
|
2
|
+
import type { PendingActionsResponse, ListPendingParams, PendingAction } from '../types.js';
|
|
3
3
|
export declare class PendingResource {
|
|
4
4
|
private http;
|
|
5
5
|
constructor(http: AxiosInstance);
|
|
6
6
|
list(params?: ListPendingParams): Promise<PendingActionsResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* Every pending action, fetched a page at a time.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* for await (const action of certen.pending.listAll({ identity })) { … }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Filters are passed through, so this narrows the same way `list()` does. `stats` is not carried:
|
|
15
|
+
* it describes a page's context, and an iterator that spans pages has no single one to report —
|
|
16
|
+
* call `list()` when you want the counts.
|
|
17
|
+
*/
|
|
18
|
+
listAll(params?: Omit<ListPendingParams, 'limit' | 'offset'>, pageSize?: number): AsyncIterableIterator<PendingAction>;
|
|
7
19
|
}
|
|
8
20
|
//# sourceMappingURL=pending.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../src/resources/pending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../src/resources/pending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5F,qBAAa,eAAe;IACd,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEjC,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAavE;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,QAAQ,CAAC,EAAE,QAAQ,SAAM,GAAG,qBAAqB,CAAC,aAAa,CAAC;CAMpH"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paginate } from '../client.js';
|
|
1
2
|
export class PendingResource {
|
|
2
3
|
http;
|
|
3
4
|
constructor(http) {
|
|
@@ -15,5 +16,19 @@ export class PendingResource {
|
|
|
15
16
|
});
|
|
16
17
|
return data;
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Every pending action, fetched a page at a time.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* for await (const action of certen.pending.listAll({ identity })) { … }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Filters are passed through, so this narrows the same way `list()` does. `stats` is not carried:
|
|
27
|
+
* it describes a page's context, and an iterator that spans pages has no single one to report —
|
|
28
|
+
* call `list()` when you want the counts.
|
|
29
|
+
*/
|
|
30
|
+
listAll(params, pageSize = 100) {
|
|
31
|
+
return paginate(async (limit, offset) => ({ items: (await this.list({ ...params, limit, offset })).actions ?? [] }), pageSize);
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
//# sourceMappingURL=pending.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../src/resources/pending.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../src/resources/pending.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,OAAO,eAAe;IACN;IAApB,YAAoB,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAE3C,KAAK,CAAC,IAAI,CAAC,MAA0B;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE;YAClD,MAAM,EAAE;gBACN,QAAQ,EAAE,MAAM,EAAE,QAAQ;gBAC1B,MAAM,EAAE,MAAM,EAAE,MAAM;gBACtB,QAAQ,EAAE,MAAM,EAAE,QAAQ;gBAC1B,KAAK,EAAE,MAAM,EAAE,KAAK;gBACpB,MAAM,EAAE,MAAM,EAAE,MAAM;aACvB;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAoD,EAAE,QAAQ,GAAG,GAAG;QAC1E,OAAO,QAAQ,CACb,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,EACnG,QAAQ,CACT,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import type { ProofArtifact, ProofCustody, ChainReceipt, ProofShare, ProofSharesResponse, SharedProof } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reading and sharing proofs.
|
|
5
|
+
*
|
|
6
|
+
* A transaction hash is a claim; a proof is evidence. These are the reads a counterparty performs
|
|
7
|
+
* instead of trusting you — and the reads you perform to hand them something to check.
|
|
8
|
+
*
|
|
9
|
+
* **Two independent sources sit behind these methods, and they fail independently.**
|
|
10
|
+
*
|
|
11
|
+
* `proof/{id}`, `/bundle` and `/custody` are served by the proof-service. `proof/tx/{hash}/receipt`
|
|
12
|
+
* is read live from Accumulate. When the proof-service is unavailable the first three return 5xx
|
|
13
|
+
* — with a plain-text body, not JSON — while the receipt keeps working, because it never touched
|
|
14
|
+
* the proof-service at all. Code that treats "the proof endpoint failed" as "there is no proof"
|
|
15
|
+
* gets this exactly backwards, and the receipt is usually still there to be had.
|
|
16
|
+
*
|
|
17
|
+
* The receipt is also the only route that works for governance and key-page authorizations, which
|
|
18
|
+
* the proof-service does not index and which therefore carry no `proof_id`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ProofResource {
|
|
21
|
+
private http;
|
|
22
|
+
constructor(http: AxiosInstance);
|
|
23
|
+
/** The proof artifact for a proof id. Shape is defined by the proof-service, not by this SDK. */
|
|
24
|
+
get(proofId: string): Promise<ProofArtifact>;
|
|
25
|
+
/** The proof artifact for a transaction hash, where the proof-service indexed one. */
|
|
26
|
+
byTxHash(txHash: string): Promise<ProofArtifact>;
|
|
27
|
+
/**
|
|
28
|
+
* The Accumulate merkle inclusion receipt for a transaction, read from the network.
|
|
29
|
+
*
|
|
30
|
+
* This is the read that works everywhere: any delivered transaction has one, including the
|
|
31
|
+
* governance and key-page authorizations the proof-service does not index. When a `proof_id`
|
|
32
|
+
* lookup comes back empty for something you know executed, this is what you want.
|
|
33
|
+
*/
|
|
34
|
+
receipt(txHash: string): Promise<ChainReceipt>;
|
|
35
|
+
/**
|
|
36
|
+
* The full bundle.
|
|
37
|
+
*
|
|
38
|
+
* Returned as a Buffer because the gateway streams `application/octet-stream` when the
|
|
39
|
+
* downstream produces binary and JSON otherwise. Deciding between them here would mean
|
|
40
|
+
* guessing; the caller writes it to a file, and `contentType` says which it got.
|
|
41
|
+
*/
|
|
42
|
+
bundle(proofId: string): Promise<{
|
|
43
|
+
data: Buffer;
|
|
44
|
+
contentType: string;
|
|
45
|
+
}>;
|
|
46
|
+
/** The custody chain for a proof. */
|
|
47
|
+
custody(proofId: string): Promise<ProofCustody>;
|
|
48
|
+
/**
|
|
49
|
+
* Mint a shareable link, so a counterparty can fetch the bundle without an API key of yours.
|
|
50
|
+
*
|
|
51
|
+
* The token is returned once. `expiresIn` is seconds.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Read a proof someone shared with you.
|
|
55
|
+
*
|
|
56
|
+
* Convenience for a caller who already has a client. The endpoint takes NO API key — the person
|
|
57
|
+
* a share link is for has no CERTEN relationship — so a counterparty should import the standalone
|
|
58
|
+
* `fetchSharedProof(url)` instead and construct nothing.
|
|
59
|
+
*
|
|
60
|
+
* Accepts the share URL as handed over, or the bare token.
|
|
61
|
+
*/
|
|
62
|
+
shared(tokenOrUrl: string): Promise<SharedProof>;
|
|
63
|
+
/**
|
|
64
|
+
* @param params.expiresInHours How long the link stays valid. Defaults to 168h (7 days),
|
|
65
|
+
* capped at 2160h (90 days). `expiresIn` is accepted as a deprecated alias.
|
|
66
|
+
* @param params.maxViews Redemption ceiling. Omit for unlimited until expiry.
|
|
67
|
+
*/
|
|
68
|
+
share(proofId: string, params?: {
|
|
69
|
+
label?: string;
|
|
70
|
+
expiresInHours?: number;
|
|
71
|
+
maxViews?: number;
|
|
72
|
+
expiresIn?: number;
|
|
73
|
+
}): Promise<ProofShare>;
|
|
74
|
+
/** Every share link this organization has created, including revoked and expired ones. */
|
|
75
|
+
shares(): Promise<ProofSharesResponse>;
|
|
76
|
+
/** Revoke a share link. The token stops resolving; the proof itself is untouched. */
|
|
77
|
+
revokeShare(shareId: string): Promise<{
|
|
78
|
+
revoked?: boolean;
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
}>;
|
|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C,UAAU,CAAC;IAYtB,0FAA0F;IACpF,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAK5C,qFAAqF;IAC/E,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAI3F"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { parseShareTarget } from '../shared-proof.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reading and sharing proofs.
|
|
4
|
+
*
|
|
5
|
+
* A transaction hash is a claim; a proof is evidence. These are the reads a counterparty performs
|
|
6
|
+
* instead of trusting you — and the reads you perform to hand them something to check.
|
|
7
|
+
*
|
|
8
|
+
* **Two independent sources sit behind these methods, and they fail independently.**
|
|
9
|
+
*
|
|
10
|
+
* `proof/{id}`, `/bundle` and `/custody` are served by the proof-service. `proof/tx/{hash}/receipt`
|
|
11
|
+
* is read live from Accumulate. When the proof-service is unavailable the first three return 5xx
|
|
12
|
+
* — with a plain-text body, not JSON — while the receipt keeps working, because it never touched
|
|
13
|
+
* the proof-service at all. Code that treats "the proof endpoint failed" as "there is no proof"
|
|
14
|
+
* gets this exactly backwards, and the receipt is usually still there to be had.
|
|
15
|
+
*
|
|
16
|
+
* The receipt is also the only route that works for governance and key-page authorizations, which
|
|
17
|
+
* the proof-service does not index and which therefore carry no `proof_id`.
|
|
18
|
+
*/
|
|
19
|
+
export class ProofResource {
|
|
20
|
+
http;
|
|
21
|
+
constructor(http) {
|
|
22
|
+
this.http = http;
|
|
23
|
+
}
|
|
24
|
+
/** The proof artifact for a proof id. Shape is defined by the proof-service, not by this SDK. */
|
|
25
|
+
async get(proofId) {
|
|
26
|
+
const { data } = await this.http.get(`/v1/proof/${proofId}`);
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
/** The proof artifact for a transaction hash, where the proof-service indexed one. */
|
|
30
|
+
async byTxHash(txHash) {
|
|
31
|
+
const { data } = await this.http.get(`/v1/proof/tx/${txHash}`);
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The Accumulate merkle inclusion receipt for a transaction, read from the network.
|
|
36
|
+
*
|
|
37
|
+
* This is the read that works everywhere: any delivered transaction has one, including the
|
|
38
|
+
* governance and key-page authorizations the proof-service does not index. When a `proof_id`
|
|
39
|
+
* lookup comes back empty for something you know executed, this is what you want.
|
|
40
|
+
*/
|
|
41
|
+
async receipt(txHash) {
|
|
42
|
+
const { data } = await this.http.get(`/v1/proof/tx/${txHash}/receipt`);
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The full bundle.
|
|
47
|
+
*
|
|
48
|
+
* Returned as a Buffer because the gateway streams `application/octet-stream` when the
|
|
49
|
+
* downstream produces binary and JSON otherwise. Deciding between them here would mean
|
|
50
|
+
* guessing; the caller writes it to a file, and `contentType` says which it got.
|
|
51
|
+
*/
|
|
52
|
+
async bundle(proofId) {
|
|
53
|
+
const response = await this.http.get(`/v1/proof/${proofId}/bundle`, {
|
|
54
|
+
responseType: 'arraybuffer',
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
data: Buffer.from(response.data),
|
|
58
|
+
contentType: String(response.headers['content-type'] ?? 'application/octet-stream'),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The custody chain for a proof. */
|
|
62
|
+
async custody(proofId) {
|
|
63
|
+
const { data } = await this.http.get(`/v1/proof/${proofId}/custody`);
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Mint a shareable link, so a counterparty can fetch the bundle without an API key of yours.
|
|
68
|
+
*
|
|
69
|
+
* The token is returned once. `expiresIn` is seconds.
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Read a proof someone shared with you.
|
|
73
|
+
*
|
|
74
|
+
* Convenience for a caller who already has a client. The endpoint takes NO API key — the person
|
|
75
|
+
* a share link is for has no CERTEN relationship — so a counterparty should import the standalone
|
|
76
|
+
* `fetchSharedProof(url)` instead and construct nothing.
|
|
77
|
+
*
|
|
78
|
+
* Accepts the share URL as handed over, or the bare token.
|
|
79
|
+
*/
|
|
80
|
+
async shared(tokenOrUrl) {
|
|
81
|
+
const { token } = parseShareTarget(tokenOrUrl, 'http://placeholder');
|
|
82
|
+
const { data } = await this.http.get(`/v1/proof/shared/${encodeURIComponent(token)}`);
|
|
83
|
+
return data;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @param params.expiresInHours How long the link stays valid. Defaults to 168h (7 days),
|
|
87
|
+
* capped at 2160h (90 days). `expiresIn` is accepted as a deprecated alias.
|
|
88
|
+
* @param params.maxViews Redemption ceiling. Omit for unlimited until expiry.
|
|
89
|
+
*/
|
|
90
|
+
async share(proofId, params = {}) {
|
|
91
|
+
// The wire field is `expires_in_hours`. This sent `expires_in`, which the gateway does not
|
|
92
|
+
// read, so every requested TTL was silently discarded and every link got the 168h default —
|
|
93
|
+
// a share meant to expire in an hour outlived its purpose by a week.
|
|
94
|
+
const { data } = await this.http.post(`/v1/proof/${proofId}/share`, {
|
|
95
|
+
label: params.label,
|
|
96
|
+
expires_in_hours: params.expiresInHours ?? params.expiresIn,
|
|
97
|
+
max_views: params.maxViews,
|
|
98
|
+
});
|
|
99
|
+
return data;
|
|
100
|
+
}
|
|
101
|
+
/** Every share link this organization has created, including revoked and expired ones. */
|
|
102
|
+
async shares() {
|
|
103
|
+
const { data } = await this.http.get('/v1/proof/shares');
|
|
104
|
+
return data;
|
|
105
|
+
}
|
|
106
|
+
/** Revoke a share link. The token stops resolving; the proof itself is untouched. */
|
|
107
|
+
async revokeShare(shareId) {
|
|
108
|
+
const { data } = await this.http.delete(`/v1/proof/shares/${shareId}`);
|
|
109
|
+
return data;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=proof.js.map
|
|
@@ -0,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