@pymthouse/builder-sdk 0.4.1-rc.3 → 0.4.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/README.md +10 -10
- package/dist/env.cjs +4 -13
- package/dist/env.cjs.map +1 -1
- package/dist/env.js +4 -13
- package/dist/env.js.map +1 -1
- package/dist/index.cjs +4 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -13
- package/dist/index.js.map +1 -1
- package/dist/signer/server.cjs +2 -8
- package/dist/signer/server.cjs.map +1 -1
- package/dist/signer/server.js +2 -8
- package/dist/signer/server.js.map +1 -1
- package/dist/signer/webhook.cjs +0 -104
- package/dist/signer/webhook.cjs.map +1 -1
- package/dist/signer/webhook.d.cts +3 -14
- package/dist/signer/webhook.d.ts +3 -14
- package/dist/signer/webhook.js +1 -103
- package/dist/signer/webhook.js.map +1 -1
- package/package.json +2 -8
- package/dist/signer/webhook/adapters/oauth1.cjs +0 -18
- package/dist/signer/webhook/adapters/oauth1.cjs.map +0 -1
- package/dist/signer/webhook/adapters/oauth1.d.cts +0 -19
- package/dist/signer/webhook/adapters/oauth1.d.ts +0 -19
- package/dist/signer/webhook/adapters/oauth1.js +0 -16
- package/dist/signer/webhook/adapters/oauth1.js.map +0 -1
package/dist/env.js
CHANGED
|
@@ -211,14 +211,8 @@ var init_fetch_json = __esm({
|
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
// src/signer/handler-errors.ts
|
|
214
|
-
function isPmtHouseError(error) {
|
|
215
|
-
if (error instanceof PmtHouseError) {
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
return error instanceof Error && typeof error.status === "number" && typeof error.code === "string";
|
|
219
|
-
}
|
|
220
214
|
function signerHandlerErrorResponse(error) {
|
|
221
|
-
if (
|
|
215
|
+
if (error instanceof PmtHouseError) {
|
|
222
216
|
return new Response(
|
|
223
217
|
JSON.stringify({
|
|
224
218
|
error: error.code,
|
|
@@ -271,9 +265,6 @@ var init_json_fields = __esm({
|
|
|
271
265
|
});
|
|
272
266
|
|
|
273
267
|
// src/signer/mint-token.ts
|
|
274
|
-
function signerJwtAudience(issuerUrl) {
|
|
275
|
-
return stripTrailingSlashes(issuerUrl);
|
|
276
|
-
}
|
|
277
268
|
function parseMintUserSignerTokenResponse(body, ttlRefreshRatio = DEFAULT_TTL_REFRESH_RATIO) {
|
|
278
269
|
const accessToken = readStringField(body, "access_token", TOKEN_RESPONSE_ERROR, "Token response");
|
|
279
270
|
const expiresIn = readExpiresIn(body, TOKEN_RESPONSE_ERROR);
|
|
@@ -300,11 +291,11 @@ function parseMintUserSignerTokenResponse(body, ttlRefreshRatio = DEFAULT_TTL_RE
|
|
|
300
291
|
lifetimeGrantedUsdMicros
|
|
301
292
|
};
|
|
302
293
|
}
|
|
303
|
-
var DEFAULT_TTL_REFRESH_RATIO, TOKEN_RESPONSE_ERROR;
|
|
294
|
+
var LIVEPEER_REMOTE_SIGNER_AUDIENCE, DEFAULT_TTL_REFRESH_RATIO, TOKEN_RESPONSE_ERROR;
|
|
304
295
|
var init_mint_token = __esm({
|
|
305
296
|
"src/signer/mint-token.ts"() {
|
|
306
|
-
init_string_utils();
|
|
307
297
|
init_json_fields();
|
|
298
|
+
LIVEPEER_REMOTE_SIGNER_AUDIENCE = "livepeer-remote-signer";
|
|
308
299
|
DEFAULT_TTL_REFRESH_RATIO = 0.8;
|
|
309
300
|
TOKEN_RESPONSE_ERROR = "invalid_token_response";
|
|
310
301
|
}
|
|
@@ -371,7 +362,7 @@ async function mintSignerTokenFromDeviceToken(options) {
|
|
|
371
362
|
code: "oidc_discovery_invalid"
|
|
372
363
|
});
|
|
373
364
|
}
|
|
374
|
-
const audience = options.audience?.trim() ||
|
|
365
|
+
const audience = options.audience?.trim() || LIVEPEER_REMOTE_SIGNER_AUDIENCE;
|
|
375
366
|
const params = new URLSearchParams({
|
|
376
367
|
grant_type: TOKEN_EXCHANGE_GRANT,
|
|
377
368
|
subject_token: options.deviceToken,
|