@pymthouse/builder-sdk 0.3.0 → 0.4.1-rc.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 +54 -28
- package/dist/{client-BHfjDvIe.d.ts → client-CauCfGa7.d.ts} +1 -1
- package/dist/{client-CvhJEhjV.d.cts → client-D1Xz-xlx.d.cts} +1 -1
- package/dist/config.cjs +0 -21
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +1 -5
- package/dist/config.d.ts +1 -5
- package/dist/config.js +1 -20
- package/dist/config.js.map +1 -1
- package/dist/device-initiate.cjs.map +1 -1
- package/dist/device-initiate.js.map +1 -1
- package/dist/device.cjs.map +1 -1
- package/dist/device.d.cts +1 -1
- package/dist/device.d.ts +1 -1
- package/dist/device.js.map +1 -1
- package/dist/env.cjs +13 -4
- package/dist/env.cjs.map +1 -1
- package/dist/env.d.cts +2 -2
- package/dist/env.d.ts +2 -2
- package/dist/env.js +13 -4
- package/dist/env.js.map +1 -1
- package/dist/index-BTDKEorK.d.ts +64 -0
- package/dist/index-BixH4VIG.d.cts +64 -0
- package/dist/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/{ingest-DoKJTWU9.d.ts → proxy-JrT6raU_.d.cts} +5 -42
- package/dist/{ingest-B3Yi8Tb1.d.cts → proxy-U32DFNuj.d.ts} +5 -42
- package/dist/signer/server.cjs +799 -895
- package/dist/signer/server.cjs.map +1 -1
- package/dist/signer/server.d.cts +9 -13
- package/dist/signer/server.d.ts +9 -13
- package/dist/signer/server.js +799 -893
- package/dist/signer/server.js.map +1 -1
- package/dist/signer/webhook/adapters/api-key.cjs +78 -0
- package/dist/signer/webhook/adapters/api-key.cjs.map +1 -0
- package/dist/signer/webhook/adapters/api-key.d.cts +18 -0
- package/dist/signer/webhook/adapters/api-key.d.ts +18 -0
- package/dist/signer/webhook/adapters/api-key.js +76 -0
- package/dist/signer/webhook/adapters/api-key.js.map +1 -0
- package/dist/signer/webhook/adapters/composite.cjs +60 -0
- package/dist/signer/webhook/adapters/composite.cjs.map +1 -0
- package/dist/signer/webhook/adapters/composite.d.cts +5 -0
- package/dist/signer/webhook/adapters/composite.d.ts +5 -0
- package/dist/signer/webhook/adapters/composite.js +58 -0
- package/dist/signer/webhook/adapters/composite.js.map +1 -0
- package/dist/signer/webhook/adapters/oauth1.cjs +18 -0
- package/dist/signer/webhook/adapters/oauth1.cjs.map +1 -0
- package/dist/signer/webhook/adapters/oauth1.d.cts +19 -0
- package/dist/signer/webhook/adapters/oauth1.d.ts +19 -0
- package/dist/signer/webhook/adapters/oauth1.js +16 -0
- package/dist/signer/webhook/adapters/oauth1.js.map +1 -0
- package/dist/signer/webhook/adapters/oidc.cjs +522 -0
- package/dist/signer/webhook/adapters/oidc.cjs.map +1 -0
- package/dist/signer/webhook/adapters/oidc.d.cts +4 -0
- package/dist/signer/webhook/adapters/oidc.d.ts +4 -0
- package/dist/signer/webhook/adapters/oidc.js +515 -0
- package/dist/signer/webhook/adapters/oidc.js.map +1 -0
- package/dist/signer/webhook/adapters/trusted-headers.cjs +103 -0
- package/dist/signer/webhook/adapters/trusted-headers.cjs.map +1 -0
- package/dist/signer/webhook/adapters/trusted-headers.d.cts +18 -0
- package/dist/signer/webhook/adapters/trusted-headers.d.ts +18 -0
- package/dist/signer/webhook/adapters/trusted-headers.js +99 -0
- package/dist/signer/webhook/adapters/trusted-headers.js.map +1 -0
- package/dist/signer/webhook.cjs +747 -0
- package/dist/signer/webhook.cjs.map +1 -0
- package/dist/signer/webhook.d.cts +26 -0
- package/dist/signer/webhook.d.ts +26 -0
- package/dist/signer/webhook.js +721 -0
- package/dist/signer/webhook.js.map +1 -0
- package/dist/tokens.d.cts +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/{types-_R1AwEZp.d.cts → types-BORaHW_x.d.cts} +5 -5
- package/dist/{types-_R1AwEZp.d.ts → types-BORaHW_x.d.ts} +5 -5
- package/dist/verifier-B-WFDMz6.d.cts +48 -0
- package/dist/verifier-B-WFDMz6.d.ts +48 -0
- package/dist/verify.cjs.map +1 -1
- package/dist/verify.d.cts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js.map +1 -1
- package/package.json +30 -30
- package/dist/gateway/client/index.cjs +0 -492
- package/dist/gateway/client/index.cjs.map +0 -1
- package/dist/gateway/client/index.d.cts +0 -63
- package/dist/gateway/client/index.d.ts +0 -63
- package/dist/gateway/client/index.js +0 -489
- package/dist/gateway/client/index.js.map +0 -1
- package/dist/gateway/index.cjs +0 -16
- package/dist/gateway/index.cjs.map +0 -1
- package/dist/gateway/index.d.cts +0 -52
- package/dist/gateway/index.d.ts +0 -52
- package/dist/gateway/index.js +0 -10
- package/dist/gateway/index.js.map +0 -1
- package/dist/gateway/server/index.cjs +0 -1248
- package/dist/gateway/server/index.cjs.map +0 -1
- package/dist/gateway/server/index.d.cts +0 -31
- package/dist/gateway/server/index.d.ts +0 -31
- package/dist/gateway/server/index.js +0 -1233
- package/dist/gateway/server/index.js.map +0 -1
- package/gateway/proto/lp_rpc.proto +0 -542
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { F as FetchLike
|
|
1
|
+
import { F as FetchLike } from './types-BORaHW_x.cjs';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* - `pymthouse_hosted`: after sign, POST usage to Builder API (`/usage/signed-tickets`).
|
|
5
|
-
* - `platform_ingest` / `byo_openmeter`: platform calls ingest explicitly (no auto POST).
|
|
6
|
-
*/
|
|
7
|
-
type SignerMeteringMode = "pymthouse_hosted" | "platform_ingest" | "byo_openmeter";
|
|
8
|
-
declare function resolvesToHostedMetering(mode: SignerMeteringMode | undefined): boolean;
|
|
9
|
-
declare function resolvesToPlatformMetering(mode: SignerMeteringMode | undefined): boolean;
|
|
10
3
|
type SignerDmzGate = "http" | "cli";
|
|
11
|
-
interface SignerMeteringConfig {
|
|
12
|
-
mode: SignerMeteringMode;
|
|
13
|
-
openMeterBaseUrl?: string;
|
|
14
|
-
openMeterApiKey?: string;
|
|
15
|
-
meterSlug?: string;
|
|
16
|
-
featureKey?: string;
|
|
17
|
-
}
|
|
18
4
|
interface DirectSignerProxyConfig {
|
|
19
5
|
pymthouseIssuerUrl: string;
|
|
20
6
|
/** Public Builder app client id (`app_…`); used for cache keys and JWT `client_id`. */
|
|
@@ -31,9 +17,9 @@ interface DirectSignerProxyConfig {
|
|
|
31
17
|
proxyPathPrefix?: string;
|
|
32
18
|
/** Remote path used when the proxied suffix is empty. Defaults to `/generate-live-payment`. */
|
|
33
19
|
defaultRemotePath?: string;
|
|
34
|
-
metering?: SignerMeteringConfig;
|
|
35
20
|
authenticate: (request: Request) => Promise<unknown>;
|
|
36
21
|
resolveExternalUserId: (session: unknown) => Promise<string>;
|
|
22
|
+
resolvePublicClientId?: (session: unknown) => Promise<string>;
|
|
37
23
|
beforeSign?: (context: DirectSignerBeforeSignContext) => Promise<DirectSignerBeforeSignResult | void>;
|
|
38
24
|
}
|
|
39
25
|
interface CachedSignerToken {
|
|
@@ -67,7 +53,6 @@ interface MintUserSignerTokenResponse {
|
|
|
67
53
|
lifetimeGrantedUsdMicros: string;
|
|
68
54
|
}
|
|
69
55
|
interface SignerTokenManagerOptions {
|
|
70
|
-
publicClientId: string;
|
|
71
56
|
mint: (externalUserId: string) => Promise<CachedSignerToken>;
|
|
72
57
|
/** Fraction of TTL after which a proactive refresh runs. Defaults to `0.8`. */
|
|
73
58
|
ttlRefreshRatio?: number;
|
|
@@ -89,6 +74,8 @@ interface ForwardToSignerOptions {
|
|
|
89
74
|
subject: string;
|
|
90
75
|
getDmzToken: (subject: string, gate: SignerDmzGate) => Promise<string>;
|
|
91
76
|
forwardJwt?: boolean;
|
|
77
|
+
/** When set, used as Authorization instead of minting a DMZ JWT. */
|
|
78
|
+
authorization?: string;
|
|
92
79
|
/** Merged after Authorization; used for go-livepeer trusted_headers identity. */
|
|
93
80
|
extraHeaders?: Record<string, string>;
|
|
94
81
|
timeoutMs?: number;
|
|
@@ -244,28 +231,4 @@ declare function probeSignerHttpReachability(options: ProbeSignerHttpReachabilit
|
|
|
244
231
|
ethAddress?: string;
|
|
245
232
|
}>;
|
|
246
233
|
|
|
247
|
-
type
|
|
248
|
-
issuerUrl: string;
|
|
249
|
-
publicClientId: string;
|
|
250
|
-
m2mClientId: string;
|
|
251
|
-
m2mClientSecret: string;
|
|
252
|
-
ticket: SignedTicketIngestInput;
|
|
253
|
-
fetch?: FetchLike;
|
|
254
|
-
};
|
|
255
|
-
type IngestSignedTicketsBatchOptions = Omit<IngestSignedTicketOptions, "ticket"> & {
|
|
256
|
-
tickets: SignedTicketIngestInput[];
|
|
257
|
-
};
|
|
258
|
-
declare function signerSnapshotToIngestPayload(input: {
|
|
259
|
-
snapshot: SignerUsageSnapshot;
|
|
260
|
-
externalUserId: string;
|
|
261
|
-
gatewayRequestId?: string;
|
|
262
|
-
}): SignedTicketIngestInput;
|
|
263
|
-
declare function ingestSignedTicket(options: IngestSignedTicketOptions): Promise<SignedTicketIngestResult>;
|
|
264
|
-
declare function ingestSignedTicketsBatch(options: IngestSignedTicketsBatchOptions): Promise<{
|
|
265
|
-
results: Array<SignedTicketIngestResult & {
|
|
266
|
-
requestId?: string;
|
|
267
|
-
ok?: boolean;
|
|
268
|
-
}>;
|
|
269
|
-
}>;
|
|
270
|
-
|
|
271
|
-
export { type ApiKeyExchangeHandlerConfig as A, parseSignerUsageSnapshot as B, type CachedSignerToken as C, type DeviceExchangeHandlerConfig as D, type ExchangeDeviceTokenForSignerOptions as E, type ForwardDirectSignerRequestOptions as F, pickConflictingNumberAliases as G, pickConflictingStringAliases as H, probeSignerHttpReachability as I, readSignerUpstreamBody as J, resolveSignerBaseUrl as K, resolvesToHostedMetering as L, type MintUserSignerTokenOptions as M, resolvesToPlatformMetering as N, stripSignerUsageFromResponse as O, type ProbeSignerHttpReachabilityOptions as P, type SignerTokenManagerOptions as S, ingestSignedTicketsBatch as a, type SignerJwtIdentity as b, type DeviceExchangeHandlerConfigRemote as c, type DeviceExchangeResponse as d, type MintSignerTokenFromDeviceTokenOptions as e, type DeviceExchangeMintResult as f, type DeviceExchangeRequestBody as g, type ExchangeApiKeyForSignerOptions as h, ingestSignedTicket as i, type ApiKeyExchangeMintResult as j, type ApiKeyExchangeRequestBody as k, type DirectSignerProxyConfig as l, type DeviceExchangeMintContext as m, type DirectSignerBeforeSignContext as n, type DirectSignerBeforeSignResult as o, type ForwardToSignerOptions as p, type ForwardToSignerResult as q, type MintUserSignerTokenResponse as r, signerSnapshotToIngestPayload as s, type SignerDmzGate as t, type SignerMeteringConfig as u, type SignerMeteringMode as v, type SignerUsageSnapshot as w, forwardToSigner as x, getCachedDmzBearerToken as y, normalizeSignerBaseUrl as z };
|
|
234
|
+
export { type ApiKeyExchangeHandlerConfig as A, resolveSignerBaseUrl as B, type CachedSignerToken as C, type DeviceExchangeHandlerConfig as D, type ExchangeDeviceTokenForSignerOptions as E, type ForwardDirectSignerRequestOptions as F, stripSignerUsageFromResponse as G, type MintUserSignerTokenOptions as M, type ProbeSignerHttpReachabilityOptions as P, type SignerUsageSnapshot as S, type SignerTokenManagerOptions as a, type SignerJwtIdentity as b, type DeviceExchangeHandlerConfigRemote as c, type DeviceExchangeResponse as d, type MintSignerTokenFromDeviceTokenOptions as e, type DeviceExchangeMintResult as f, type DeviceExchangeRequestBody as g, type ExchangeApiKeyForSignerOptions as h, type ApiKeyExchangeMintResult as i, type ApiKeyExchangeRequestBody as j, type DirectSignerProxyConfig as k, type DeviceExchangeMintContext as l, type DirectSignerBeforeSignContext as m, type DirectSignerBeforeSignResult as n, type ForwardToSignerOptions as o, type ForwardToSignerResult as p, type MintUserSignerTokenResponse as q, type SignerDmzGate as r, forwardToSigner as s, getCachedDmzBearerToken as t, normalizeSignerBaseUrl as u, parseSignerUsageSnapshot as v, pickConflictingNumberAliases as w, pickConflictingStringAliases as x, probeSignerHttpReachability as y, readSignerUpstreamBody as z };
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { F as FetchLike
|
|
1
|
+
import { F as FetchLike } from './types-BORaHW_x.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* - `pymthouse_hosted`: after sign, POST usage to Builder API (`/usage/signed-tickets`).
|
|
5
|
-
* - `platform_ingest` / `byo_openmeter`: platform calls ingest explicitly (no auto POST).
|
|
6
|
-
*/
|
|
7
|
-
type SignerMeteringMode = "pymthouse_hosted" | "platform_ingest" | "byo_openmeter";
|
|
8
|
-
declare function resolvesToHostedMetering(mode: SignerMeteringMode | undefined): boolean;
|
|
9
|
-
declare function resolvesToPlatformMetering(mode: SignerMeteringMode | undefined): boolean;
|
|
10
3
|
type SignerDmzGate = "http" | "cli";
|
|
11
|
-
interface SignerMeteringConfig {
|
|
12
|
-
mode: SignerMeteringMode;
|
|
13
|
-
openMeterBaseUrl?: string;
|
|
14
|
-
openMeterApiKey?: string;
|
|
15
|
-
meterSlug?: string;
|
|
16
|
-
featureKey?: string;
|
|
17
|
-
}
|
|
18
4
|
interface DirectSignerProxyConfig {
|
|
19
5
|
pymthouseIssuerUrl: string;
|
|
20
6
|
/** Public Builder app client id (`app_…`); used for cache keys and JWT `client_id`. */
|
|
@@ -31,9 +17,9 @@ interface DirectSignerProxyConfig {
|
|
|
31
17
|
proxyPathPrefix?: string;
|
|
32
18
|
/** Remote path used when the proxied suffix is empty. Defaults to `/generate-live-payment`. */
|
|
33
19
|
defaultRemotePath?: string;
|
|
34
|
-
metering?: SignerMeteringConfig;
|
|
35
20
|
authenticate: (request: Request) => Promise<unknown>;
|
|
36
21
|
resolveExternalUserId: (session: unknown) => Promise<string>;
|
|
22
|
+
resolvePublicClientId?: (session: unknown) => Promise<string>;
|
|
37
23
|
beforeSign?: (context: DirectSignerBeforeSignContext) => Promise<DirectSignerBeforeSignResult | void>;
|
|
38
24
|
}
|
|
39
25
|
interface CachedSignerToken {
|
|
@@ -67,7 +53,6 @@ interface MintUserSignerTokenResponse {
|
|
|
67
53
|
lifetimeGrantedUsdMicros: string;
|
|
68
54
|
}
|
|
69
55
|
interface SignerTokenManagerOptions {
|
|
70
|
-
publicClientId: string;
|
|
71
56
|
mint: (externalUserId: string) => Promise<CachedSignerToken>;
|
|
72
57
|
/** Fraction of TTL after which a proactive refresh runs. Defaults to `0.8`. */
|
|
73
58
|
ttlRefreshRatio?: number;
|
|
@@ -89,6 +74,8 @@ interface ForwardToSignerOptions {
|
|
|
89
74
|
subject: string;
|
|
90
75
|
getDmzToken: (subject: string, gate: SignerDmzGate) => Promise<string>;
|
|
91
76
|
forwardJwt?: boolean;
|
|
77
|
+
/** When set, used as Authorization instead of minting a DMZ JWT. */
|
|
78
|
+
authorization?: string;
|
|
92
79
|
/** Merged after Authorization; used for go-livepeer trusted_headers identity. */
|
|
93
80
|
extraHeaders?: Record<string, string>;
|
|
94
81
|
timeoutMs?: number;
|
|
@@ -244,28 +231,4 @@ declare function probeSignerHttpReachability(options: ProbeSignerHttpReachabilit
|
|
|
244
231
|
ethAddress?: string;
|
|
245
232
|
}>;
|
|
246
233
|
|
|
247
|
-
type
|
|
248
|
-
issuerUrl: string;
|
|
249
|
-
publicClientId: string;
|
|
250
|
-
m2mClientId: string;
|
|
251
|
-
m2mClientSecret: string;
|
|
252
|
-
ticket: SignedTicketIngestInput;
|
|
253
|
-
fetch?: FetchLike;
|
|
254
|
-
};
|
|
255
|
-
type IngestSignedTicketsBatchOptions = Omit<IngestSignedTicketOptions, "ticket"> & {
|
|
256
|
-
tickets: SignedTicketIngestInput[];
|
|
257
|
-
};
|
|
258
|
-
declare function signerSnapshotToIngestPayload(input: {
|
|
259
|
-
snapshot: SignerUsageSnapshot;
|
|
260
|
-
externalUserId: string;
|
|
261
|
-
gatewayRequestId?: string;
|
|
262
|
-
}): SignedTicketIngestInput;
|
|
263
|
-
declare function ingestSignedTicket(options: IngestSignedTicketOptions): Promise<SignedTicketIngestResult>;
|
|
264
|
-
declare function ingestSignedTicketsBatch(options: IngestSignedTicketsBatchOptions): Promise<{
|
|
265
|
-
results: Array<SignedTicketIngestResult & {
|
|
266
|
-
requestId?: string;
|
|
267
|
-
ok?: boolean;
|
|
268
|
-
}>;
|
|
269
|
-
}>;
|
|
270
|
-
|
|
271
|
-
export { type ApiKeyExchangeHandlerConfig as A, parseSignerUsageSnapshot as B, type CachedSignerToken as C, type DeviceExchangeHandlerConfig as D, type ExchangeDeviceTokenForSignerOptions as E, type ForwardDirectSignerRequestOptions as F, pickConflictingNumberAliases as G, pickConflictingStringAliases as H, probeSignerHttpReachability as I, readSignerUpstreamBody as J, resolveSignerBaseUrl as K, resolvesToHostedMetering as L, type MintUserSignerTokenOptions as M, resolvesToPlatformMetering as N, stripSignerUsageFromResponse as O, type ProbeSignerHttpReachabilityOptions as P, type SignerTokenManagerOptions as S, ingestSignedTicketsBatch as a, type SignerJwtIdentity as b, type DeviceExchangeHandlerConfigRemote as c, type DeviceExchangeResponse as d, type MintSignerTokenFromDeviceTokenOptions as e, type DeviceExchangeMintResult as f, type DeviceExchangeRequestBody as g, type ExchangeApiKeyForSignerOptions as h, ingestSignedTicket as i, type ApiKeyExchangeMintResult as j, type ApiKeyExchangeRequestBody as k, type DirectSignerProxyConfig as l, type DeviceExchangeMintContext as m, type DirectSignerBeforeSignContext as n, type DirectSignerBeforeSignResult as o, type ForwardToSignerOptions as p, type ForwardToSignerResult as q, type MintUserSignerTokenResponse as r, signerSnapshotToIngestPayload as s, type SignerDmzGate as t, type SignerMeteringConfig as u, type SignerMeteringMode as v, type SignerUsageSnapshot as w, forwardToSigner as x, getCachedDmzBearerToken as y, normalizeSignerBaseUrl as z };
|
|
234
|
+
export { type ApiKeyExchangeHandlerConfig as A, resolveSignerBaseUrl as B, type CachedSignerToken as C, type DeviceExchangeHandlerConfig as D, type ExchangeDeviceTokenForSignerOptions as E, type ForwardDirectSignerRequestOptions as F, stripSignerUsageFromResponse as G, type MintUserSignerTokenOptions as M, type ProbeSignerHttpReachabilityOptions as P, type SignerUsageSnapshot as S, type SignerTokenManagerOptions as a, type SignerJwtIdentity as b, type DeviceExchangeHandlerConfigRemote as c, type DeviceExchangeResponse as d, type MintSignerTokenFromDeviceTokenOptions as e, type DeviceExchangeMintResult as f, type DeviceExchangeRequestBody as g, type ExchangeApiKeyForSignerOptions as h, type ApiKeyExchangeMintResult as i, type ApiKeyExchangeRequestBody as j, type DirectSignerProxyConfig as k, type DeviceExchangeMintContext as l, type DirectSignerBeforeSignContext as m, type DirectSignerBeforeSignResult as n, type ForwardToSignerOptions as o, type ForwardToSignerResult as p, type MintUserSignerTokenResponse as q, type SignerDmzGate as r, forwardToSigner as s, getCachedDmzBearerToken as t, normalizeSignerBaseUrl as u, parseSignerUsageSnapshot as v, pickConflictingNumberAliases as w, pickConflictingStringAliases as x, probeSignerHttpReachability as y, readSignerUpstreamBody as z };
|