@orangecheck/me-client 0.57.0 → 0.59.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/dist/index.mjs CHANGED
@@ -162,9 +162,11 @@ async function authorize(opts) {
162
162
  if (opts.amount_sats == null && opts.usd_cents == null) {
163
163
  throw new Error("payment.authorize requires amount_sats or usd_cents");
164
164
  }
165
+ const { bearerToken: bearerToken2, ...body } = opts;
165
166
  return api("/api/payment/authorize", {
166
167
  method: "POST",
167
- body: opts
168
+ body,
169
+ bearerToken: bearerToken2
168
170
  });
169
171
  }
170
172
  var payment = { authorize };
@@ -1299,15 +1301,20 @@ async function defaultLive() {
1299
1301
  }
1300
1302
  var federations = { list, live, get, defaultLive };
1301
1303
  var CONSENT_ORIGIN = "https://ochk.app";
1302
- var VALID_SCOPES = [
1304
+ var SCOPE_IDS = Object.freeze([
1303
1305
  "bitcoin_address",
1304
1306
  "email",
1305
1307
  "attest_tier",
1306
1308
  "display_name",
1307
1309
  "cross_integrator_event_count",
1308
1310
  "cross_integrator_human_event_count",
1309
- "trust_attestation_count"
1310
- ];
1311
+ "cross_integrator_lifetime_sats",
1312
+ "cross_integrator_distinct_count",
1313
+ "cross_integrator_oldest_event_at",
1314
+ "cross_integrator_active_days",
1315
+ "trust_attestation_count",
1316
+ "trust_attestations_bundle"
1317
+ ]);
1311
1318
  function parseTrustAttestationCount(value) {
1312
1319
  const parts = value.split(",");
1313
1320
  if (parts.length !== 4) return null;
@@ -1364,9 +1371,9 @@ function request(scopes2, options) {
1364
1371
  throw new Error("oc.scope.request: scopes must be a non-empty array");
1365
1372
  }
1366
1373
  for (const s of scopes2) {
1367
- if (!VALID_SCOPES.includes(s)) {
1374
+ if (!SCOPE_IDS.includes(s)) {
1368
1375
  throw new Error(
1369
- `oc.scope.request: unknown scope "${s}" \xB7 valid: ${VALID_SCOPES.join(", ")}`
1376
+ `oc.scope.request: unknown scope "${s}" \xB7 valid: ${SCOPE_IDS.join(", ")}`
1370
1377
  );
1371
1378
  }
1372
1379
  }
@@ -1728,6 +1735,6 @@ var oc = {
1728
1735
  identity
1729
1736
  };
1730
1737
 
1731
- export { ALL_EVENT_SUBTYPES, ARCHETYPE_TEMPLATES, CONNECT_CONSENT_BLURB, CONNECT_CONSENT_LABEL, CUSTOM_EVENT_KEY_RE, EVENT_SUBTYPES, MAX_DROP_WINDOW_DAYS, MIN_INTEGRATOR_PRICE_SATS, MeClientError, PLATFORM_FEE_POLICY, clearBearerToken, computeFees, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, identity, isEventClass, isInheritedName, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, safeReturnPath, scope, session, setBearerToken, setOrigin, subtypesForClass, validateIntegratorConfig, verifyActivityAttestation, webhook, withRateLimitRetry };
1738
+ export { ALL_EVENT_SUBTYPES, ARCHETYPE_TEMPLATES, CONNECT_CONSENT_BLURB, CONNECT_CONSENT_LABEL, CUSTOM_EVENT_KEY_RE, EVENT_SUBTYPES, MAX_DROP_WINDOW_DAYS, MIN_INTEGRATOR_PRICE_SATS, MeClientError, PLATFORM_FEE_POLICY, SCOPE_IDS, clearBearerToken, computeFees, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, identity, isEventClass, isInheritedName, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, safeReturnPath, scope, session, setBearerToken, setOrigin, subtypesForClass, validateIntegratorConfig, verifyActivityAttestation, webhook, withRateLimitRetry };
1732
1739
  //# sourceMappingURL=index.mjs.map
1733
1740
  //# sourceMappingURL=index.mjs.map