@pymthouse/builder-sdk 0.4.1 → 0.4.2-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/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@ export { NETWORK_USD_PER_MICRO, applyRetailRateToNetworkMicros, defaultRetailRat
2
2
  import { S as SignedTicketIngestInput, F as FetchLike, f as SignedTicketIngestResult, r as UsageByUserRow, s as UsageForExternalUser, e as UsageApiResponse, n as MeScopeUsagePayload, t as UsageByPipelineModelRow, u as UsageByPipelineModelFiatRow, O as OidcDiscoveryDocument, v as AppManifestResponse } from './types-BORaHW_x.cjs';
3
3
  export { w as AllowancePolicy, x as AppManifestCapability, A as AppUserRecord, q as ApproveDeviceLoginInput, B as BillingProduct, y as BillingSyncState, z as BillingSyncStatus, E as CapabilityPriceRule, C as ClientCredentialsTokenResponse, D as DeviceApprovalInput, o as GetAppManifestResult, G as GetDiscoveryOptions, l as GrantSource, L as ListBillingProductsResult, p as MintSignerSessionForExternalUserInput, M as MintUserAccessTokenInput, b as MintUserAccessTokenResponse, c as MintUserSignerSessionTokenInput, a as ParsedDeviceApprovalRedirect, h as PlanSyncResult, P as PmtHouseClientOptions, H as SignerRoutingConfig, g as SignerRoutingResponse, T as TokenExchangeResponse, U as UpsertAppUserInput, i as UsageBalanceResponse, I as UsageDailyPipelineRow, d as UsageQueryInput, J as UsageTotals, k as UserAllowanceGrantInput, j as UserAllowancesResponse, K as UserCreditGrantInput, N as UserCreditsResponse, m as UserSubscriptionResponse } from './types-BORaHW_x.cjs';
4
4
  import { S as SignerUsageSnapshot } from './proxy-0wa8QZIU.cjs';
5
- export { P as PmtHouseClient, b as buildDeviceCodeResource, n as normalizeUserCode } from './client-D1Xz-xlx.cjs';
5
+ export { P as PmtHouseClient, b as buildDeviceCodeResource, n as normalizeUserCode } from './client-C0HgAugK.cjs';
6
6
  export { PYMTHOUSE_NOT_CONFIGURED_MESSAGE, getBuilderApiV1BaseFromIssuerUrl, getPymthouseIssuerOrigin, getPymthouseIssuerUrlFromEnv, getPymthousePublicClientIdFromEnv, isPymthouseConfigured, readPymthouseEnv } from './config.cjs';
7
7
  import { AuthorizationServer } from 'oauth4webapi';
8
8
  export { PYMTHOUSE_SIGNER_SESSION_TTL_MS, SIGNER_SESSION_EXPIRES_IN_SEC, SIGNER_SESSION_TTL_MS, SIGN_JOB_SCOPE, SignerSessionToken, computePymthouseExpiry, computeSignerSessionExpiry, decodeJwtExp, isLikelyOidcJwt, isOpaqueSignerSessionToken, parseSignerSessionExchange } from './tokens.cjs';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export { NETWORK_USD_PER_MICRO, applyRetailRateToNetworkMicros, defaultRetailRat
2
2
  import { S as SignedTicketIngestInput, F as FetchLike, f as SignedTicketIngestResult, r as UsageByUserRow, s as UsageForExternalUser, e as UsageApiResponse, n as MeScopeUsagePayload, t as UsageByPipelineModelRow, u as UsageByPipelineModelFiatRow, O as OidcDiscoveryDocument, v as AppManifestResponse } from './types-BORaHW_x.js';
3
3
  export { w as AllowancePolicy, x as AppManifestCapability, A as AppUserRecord, q as ApproveDeviceLoginInput, B as BillingProduct, y as BillingSyncState, z as BillingSyncStatus, E as CapabilityPriceRule, C as ClientCredentialsTokenResponse, D as DeviceApprovalInput, o as GetAppManifestResult, G as GetDiscoveryOptions, l as GrantSource, L as ListBillingProductsResult, p as MintSignerSessionForExternalUserInput, M as MintUserAccessTokenInput, b as MintUserAccessTokenResponse, c as MintUserSignerSessionTokenInput, a as ParsedDeviceApprovalRedirect, h as PlanSyncResult, P as PmtHouseClientOptions, H as SignerRoutingConfig, g as SignerRoutingResponse, T as TokenExchangeResponse, U as UpsertAppUserInput, i as UsageBalanceResponse, I as UsageDailyPipelineRow, d as UsageQueryInput, J as UsageTotals, k as UserAllowanceGrantInput, j as UserAllowancesResponse, K as UserCreditGrantInput, N as UserCreditsResponse, m as UserSubscriptionResponse } from './types-BORaHW_x.js';
4
4
  import { S as SignerUsageSnapshot } from './proxy-KrA1vEmh.js';
5
- export { P as PmtHouseClient, b as buildDeviceCodeResource, n as normalizeUserCode } from './client-CauCfGa7.js';
5
+ export { P as PmtHouseClient, b as buildDeviceCodeResource, n as normalizeUserCode } from './client-zCskUJag.js';
6
6
  export { PYMTHOUSE_NOT_CONFIGURED_MESSAGE, getBuilderApiV1BaseFromIssuerUrl, getPymthouseIssuerOrigin, getPymthouseIssuerUrlFromEnv, getPymthousePublicClientIdFromEnv, isPymthouseConfigured, readPymthouseEnv } from './config.js';
7
7
  import { AuthorizationServer } from 'oauth4webapi';
8
8
  export { PYMTHOUSE_SIGNER_SESSION_TTL_MS, SIGNER_SESSION_EXPIRES_IN_SEC, SIGNER_SESSION_TTL_MS, SIGN_JOB_SCOPE, SignerSessionToken, computePymthouseExpiry, computeSignerSessionExpiry, decodeJwtExp, isLikelyOidcJwt, isOpaqueSignerSessionToken, parseSignerSessionExchange } from './tokens.js';
package/dist/index.js CHANGED
@@ -322,11 +322,10 @@ function parseMintUserSignerTokenResponse(body, ttlRefreshRatio = DEFAULT_TTL_RE
322
322
  lifetimeGrantedUsdMicros
323
323
  };
324
324
  }
325
- var LIVEPEER_REMOTE_SIGNER_AUDIENCE, DEFAULT_TTL_REFRESH_RATIO, TOKEN_RESPONSE_ERROR;
325
+ var DEFAULT_TTL_REFRESH_RATIO, TOKEN_RESPONSE_ERROR;
326
326
  var init_mint_token = __esm({
327
327
  "src/signer/mint-token.ts"() {
328
328
  init_json_fields();
329
- LIVEPEER_REMOTE_SIGNER_AUDIENCE = "livepeer-remote-signer";
330
329
  DEFAULT_TTL_REFRESH_RATIO = 0.8;
331
330
  TOKEN_RESPONSE_ERROR = "invalid_token_response";
332
331
  }
@@ -393,7 +392,7 @@ async function mintSignerTokenFromDeviceToken(options) {
393
392
  code: "oidc_discovery_invalid"
394
393
  });
395
394
  }
396
- const audience = options.audience?.trim() || LIVEPEER_REMOTE_SIGNER_AUDIENCE;
395
+ const audience = options.audience?.trim() || issuerUrl;
397
396
  const params = new URLSearchParams({
398
397
  grant_type: TOKEN_EXCHANGE_GRANT,
399
398
  subject_token: options.deviceToken,
@@ -1626,7 +1625,8 @@ var PmtHouseClient = class {
1626
1625
  const usageByUser = await this.getUsage({
1627
1626
  startDate: input.startDate,
1628
1627
  endDate: input.endDate,
1629
- groupBy: "user"
1628
+ groupBy: "user",
1629
+ includeRetail: input.includeRetail
1630
1630
  });
1631
1631
  const userIds = getEndUserIdsForExternalUser(usageByUser, input.externalUserId);
1632
1632
  const cap = input.maxEndUserIds ?? DEFAULT_MAX_END_USER_IDS;
@@ -1637,7 +1637,8 @@ var PmtHouseClient = class {
1637
1637
  startDate: input.startDate,
1638
1638
  endDate: input.endDate,
1639
1639
  groupBy: "pipeline_model",
1640
- userId
1640
+ userId,
1641
+ includeRetail: input.includeRetail
1641
1642
  })
1642
1643
  )
1643
1644
  );