@orangecheck/me-client 0.31.0 → 0.32.2

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  > Hand-written prose below is the high-level overview; the docs site is the source of truth for every export, type, and signature.
5
5
 
6
6
 
7
- Client for [me.ochk.io](https://me.ochk.io). Popup sign-in for any site, framework-agnostic server-side verification, session lifecycle hooks, payment authorization, webhook signature verification, the canonical billable-event taxonomy as TypeScript types. Sign people in with `signInWithOc()` from `/popup`; the deprecated `OcSignInButton` rides the family cookie and works only on orangecheck's own sites.
7
+ Client for [me.ochk.io](https://me.ochk.io). Popup sign-in for any site, framework-agnostic server-side verification, session lifecycle hooks, payment authorization, webhook signature verification, the canonical billable-event taxonomy as TypeScript types. Sign people in with `signInWithOc()` from `/popup`. No React needed.
8
8
 
9
9
  > Sign-in is free. Paying your users is optional: always, in promos you schedule, or never.
10
10
 
package/dist/index.d.mts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { v as verifyActivityAttestation, r as refreshEnvelopeJwks } from './identity-1VYMOhzV.mjs';
2
2
  export { A as ActivityAttestation, a as ActivityAttestationBundle, b as ActivityVerifyCheck, c as ActivityVerifyResult, V as VerifyActivityOptions, i as identity } from './identity-1VYMOhzV.mjs';
3
- import { B as BillableEvent, E as EventKey, I as IntegratorPriceConfig, S as SessionPolicy, a as Session, T as TelemetryEvent, b as SignInOptions, P as PaymentAuthorizeOptions, c as PaymentResult, V as ValidationResult, f as fromTemplate, g as getArchetypeTemplate, A as ArchetypeTemplate, F as Federation } from './integrator-BVzzkZ6l.mjs';
4
- export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, h as AgentClassOverride, i as AttestTier, C as ClassASubtype, j as ClassBSubtype, k as ClassCSubtype, l as ComputedFees, D as DropCadence, m as DropClosedWebhookPayload, n as DropResponseBlock, o as DropScheduleSummary, p as EVENT_SUBTYPES, q as EventClass, r as EventSubtype, s as EventSubtypeMetadata, t as FederationStatus, u as IntegratorArchetype, v as IntegratorEventConfig, M as MAX_DROP_WINDOW_DAYS, w as MIN_INTEGRATOR_PRICE_SATS, x as PLATFORM_FEE_POLICY, y as SigningMethod, z as SiteFeeShape, G as SystemWebhookPayload, W as WebhookHeaders, H as WebhookPayload, J as computeFees, K as subtypesForClass, L as validateIntegratorConfig } from './integrator-BVzzkZ6l.mjs';
5
- import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import * as React from 'react';
3
+ import { B as BillableEvent, E as EventKey, I as IntegratorPriceConfig, T as TelemetryEvent, S as SignInOptions, a as Session, P as PaymentAuthorizeOptions, b as PaymentResult, V as ValidationResult, f as fromTemplate, g as getArchetypeTemplate, A as ArchetypeTemplate, F as Federation } from './integrator-C-enR55c.mjs';
4
+ export { c as ALL_EVENT_SUBTYPES, d as ARCHETYPE_TEMPLATES, e as AgentClassOverride, h as AttestTier, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, D as DropCadence, l as DropClosedWebhookPayload, m as DropResponseBlock, n as DropScheduleSummary, o as EVENT_SUBTYPES, p as EventClass, q as EventSubtype, r as EventSubtypeMetadata, s as FederationStatus, t as IntegratorArchetype, u as IntegratorEventConfig, M as MAX_DROP_WINDOW_DAYS, v as MIN_INTEGRATOR_PRICE_SATS, w as PLATFORM_FEE_POLICY, x as SessionPolicy, y as SigningMethod, z as SiteFeeShape, G as SystemWebhookPayload, W as WebhookHeaders, H as WebhookPayload, J as computeFees, K as subtypesForClass, L as validateIntegratorConfig } from './integrator-C-enR55c.mjs';
7
5
 
8
6
  type Scope = 'bitcoin_address' | 'email' | 'attest_tier' | 'display_name' | 'cross_integrator_event_count' | 'cross_integrator_human_event_count' | 'trust_attestation_count';
9
7
  interface TrustAttestationCount {
@@ -72,7 +70,7 @@ interface VerifyOptions {
72
70
  jwk?: OcPublicJwk;
73
71
  jwksCacheTtlMs?: number;
74
72
  }
75
- declare function verify$1(rawBody: string | Uint8Array, sigHex: string, kid: string, options?: VerifyOptions): Promise<VerifyResult>;
73
+ declare function verify$1(rawBody: string | Uint8Array, sigHex: string | null | undefined, kid: string | null | undefined, options?: VerifyOptions): Promise<VerifyResult>;
76
74
  declare function fetchJwksForce(issuer?: string): Promise<void>;
77
75
  declare const webhook: {
78
76
  verify: typeof verify$1;
@@ -185,16 +183,6 @@ declare const event: {
185
183
  verify: typeof verify;
186
184
  };
187
185
 
188
- interface OcSignInButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onError'> {
189
- scope: string[];
190
- sessionPolicy?: Partial<SessionPolicy>;
191
- returnTo?: string;
192
- onSignin?: (session: Session) => void;
193
- onSignInError?: (error: Error) => void;
194
- label?: string;
195
- }
196
- declare function OcSignInButton({ scope, sessionPolicy, returnTo, onSignin, onSignInError, label, children, onClick, style, ...rest }: OcSignInButtonProps): react_jsx_runtime.JSX.Element;
197
-
198
186
  declare function onTelemetry(listener: (e: TelemetryEvent) => void): () => void;
199
187
  declare function create(opts: SignInOptions): Promise<Session>;
200
188
  declare function refresh(sessionId: string): Promise<Session>;
@@ -297,4 +285,4 @@ declare const oc: {
297
285
  };
298
286
  };
299
287
 
300
- export { ArchetypeTemplate, type BatchEventResult, BillableEvent, EventKey, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireBatchResponse, type FireEventOptions, type FireEventResult, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, type PayPeriod, type PayingState, PaymentAuthorizeOptions, PaymentResult, type RequestOptions, type Scope, Session, SessionPolicy, SignInOptions, TelemetryEvent, type TrustAttestationCount, ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, verifyActivityAttestation, webhook, withRateLimitRetry };
288
+ export { ArchetypeTemplate, type BatchEventResult, BillableEvent, EventKey, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireBatchResponse, type FireEventOptions, type FireEventResult, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, type PayPeriod, type PayingState, PaymentAuthorizeOptions, PaymentResult, type RequestOptions, type Scope, Session, SignInOptions, TelemetryEvent, type TrustAttestationCount, ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, verifyActivityAttestation, webhook, withRateLimitRetry };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { v as verifyActivityAttestation, r as refreshEnvelopeJwks } from './identity-1VYMOhzV.js';
2
2
  export { A as ActivityAttestation, a as ActivityAttestationBundle, b as ActivityVerifyCheck, c as ActivityVerifyResult, V as VerifyActivityOptions, i as identity } from './identity-1VYMOhzV.js';
3
- import { B as BillableEvent, E as EventKey, I as IntegratorPriceConfig, S as SessionPolicy, a as Session, T as TelemetryEvent, b as SignInOptions, P as PaymentAuthorizeOptions, c as PaymentResult, V as ValidationResult, f as fromTemplate, g as getArchetypeTemplate, A as ArchetypeTemplate, F as Federation } from './integrator-BVzzkZ6l.js';
4
- export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, h as AgentClassOverride, i as AttestTier, C as ClassASubtype, j as ClassBSubtype, k as ClassCSubtype, l as ComputedFees, D as DropCadence, m as DropClosedWebhookPayload, n as DropResponseBlock, o as DropScheduleSummary, p as EVENT_SUBTYPES, q as EventClass, r as EventSubtype, s as EventSubtypeMetadata, t as FederationStatus, u as IntegratorArchetype, v as IntegratorEventConfig, M as MAX_DROP_WINDOW_DAYS, w as MIN_INTEGRATOR_PRICE_SATS, x as PLATFORM_FEE_POLICY, y as SigningMethod, z as SiteFeeShape, G as SystemWebhookPayload, W as WebhookHeaders, H as WebhookPayload, J as computeFees, K as subtypesForClass, L as validateIntegratorConfig } from './integrator-BVzzkZ6l.js';
5
- import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import * as React from 'react';
3
+ import { B as BillableEvent, E as EventKey, I as IntegratorPriceConfig, T as TelemetryEvent, S as SignInOptions, a as Session, P as PaymentAuthorizeOptions, b as PaymentResult, V as ValidationResult, f as fromTemplate, g as getArchetypeTemplate, A as ArchetypeTemplate, F as Federation } from './integrator-C-enR55c.js';
4
+ export { c as ALL_EVENT_SUBTYPES, d as ARCHETYPE_TEMPLATES, e as AgentClassOverride, h as AttestTier, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, D as DropCadence, l as DropClosedWebhookPayload, m as DropResponseBlock, n as DropScheduleSummary, o as EVENT_SUBTYPES, p as EventClass, q as EventSubtype, r as EventSubtypeMetadata, s as FederationStatus, t as IntegratorArchetype, u as IntegratorEventConfig, M as MAX_DROP_WINDOW_DAYS, v as MIN_INTEGRATOR_PRICE_SATS, w as PLATFORM_FEE_POLICY, x as SessionPolicy, y as SigningMethod, z as SiteFeeShape, G as SystemWebhookPayload, W as WebhookHeaders, H as WebhookPayload, J as computeFees, K as subtypesForClass, L as validateIntegratorConfig } from './integrator-C-enR55c.js';
7
5
 
8
6
  type Scope = 'bitcoin_address' | 'email' | 'attest_tier' | 'display_name' | 'cross_integrator_event_count' | 'cross_integrator_human_event_count' | 'trust_attestation_count';
9
7
  interface TrustAttestationCount {
@@ -72,7 +70,7 @@ interface VerifyOptions {
72
70
  jwk?: OcPublicJwk;
73
71
  jwksCacheTtlMs?: number;
74
72
  }
75
- declare function verify$1(rawBody: string | Uint8Array, sigHex: string, kid: string, options?: VerifyOptions): Promise<VerifyResult>;
73
+ declare function verify$1(rawBody: string | Uint8Array, sigHex: string | null | undefined, kid: string | null | undefined, options?: VerifyOptions): Promise<VerifyResult>;
76
74
  declare function fetchJwksForce(issuer?: string): Promise<void>;
77
75
  declare const webhook: {
78
76
  verify: typeof verify$1;
@@ -185,16 +183,6 @@ declare const event: {
185
183
  verify: typeof verify;
186
184
  };
187
185
 
188
- interface OcSignInButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onError'> {
189
- scope: string[];
190
- sessionPolicy?: Partial<SessionPolicy>;
191
- returnTo?: string;
192
- onSignin?: (session: Session) => void;
193
- onSignInError?: (error: Error) => void;
194
- label?: string;
195
- }
196
- declare function OcSignInButton({ scope, sessionPolicy, returnTo, onSignin, onSignInError, label, children, onClick, style, ...rest }: OcSignInButtonProps): react_jsx_runtime.JSX.Element;
197
-
198
186
  declare function onTelemetry(listener: (e: TelemetryEvent) => void): () => void;
199
187
  declare function create(opts: SignInOptions): Promise<Session>;
200
188
  declare function refresh(sessionId: string): Promise<Session>;
@@ -297,4 +285,4 @@ declare const oc: {
297
285
  };
298
286
  };
299
287
 
300
- export { ArchetypeTemplate, type BatchEventResult, BillableEvent, EventKey, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireBatchResponse, type FireEventOptions, type FireEventResult, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, type PayPeriod, type PayingState, PaymentAuthorizeOptions, PaymentResult, type RequestOptions, type Scope, Session, SessionPolicy, SignInOptions, TelemetryEvent, type TrustAttestationCount, ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, verifyActivityAttestation, webhook, withRateLimitRetry };
288
+ export { ArchetypeTemplate, type BatchEventResult, BillableEvent, EventKey, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireBatchResponse, type FireEventOptions, type FireEventResult, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, type PayPeriod, type PayingState, PaymentAuthorizeOptions, PaymentResult, type RequestOptions, type Scope, Session, SignInOptions, TelemetryEvent, type TrustAttestationCount, ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, verifyActivityAttestation, webhook, withRateLimitRetry };
package/dist/index.js CHANGED
@@ -1,28 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- function _interopNamespace(e) {
7
- if (e && e.__esModule) return e;
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
23
-
24
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
-
26
3
  var __defProp = Object.defineProperty;
27
4
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
28
5
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -179,75 +156,6 @@ async function invalidate(sessionId) {
179
156
  });
180
157
  }
181
158
  var session = { create, refresh, invalidate };
182
- function OcSignInButton({
183
- scope: scope2,
184
- sessionPolicy,
185
- returnTo,
186
- onSignin,
187
- onSignInError,
188
- label = "sign in with oc",
189
- children,
190
- onClick,
191
- style,
192
- ...rest
193
- }) {
194
- const [pending, setPending] = React__namespace.useState(false);
195
- return /* @__PURE__ */ jsxRuntime.jsxs(
196
- "button",
197
- {
198
- type: "button",
199
- onClick: async (event2) => {
200
- onClick?.(event2);
201
- if (event2.defaultPrevented) return;
202
- setPending(true);
203
- try {
204
- const result = await session.create({ scope: scope2, sessionPolicy, returnTo });
205
- onSignin?.(result);
206
- } catch (err) {
207
- onSignInError?.(err instanceof Error ? err : new Error(String(err)));
208
- } finally {
209
- setPending(false);
210
- }
211
- },
212
- style: {
213
- display: "inline-flex",
214
- alignItems: "center",
215
- gap: 8,
216
- padding: "10px 16px",
217
- fontSize: 13,
218
- fontWeight: 600,
219
- fontFamily: 'ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace',
220
- letterSpacing: "0.18em",
221
- textTransform: "uppercase",
222
- background: "#f97316",
223
- color: "#0b0909",
224
- border: "1px solid #f97316",
225
- borderRadius: 4,
226
- cursor: pending ? "progress" : "pointer",
227
- opacity: pending ? 0.7 : 1,
228
- ...style ?? {}
229
- },
230
- disabled: pending || rest.disabled,
231
- "data-oc-signin": true,
232
- ...rest,
233
- children: [
234
- /* @__PURE__ */ jsxRuntime.jsx(
235
- "span",
236
- {
237
- "aria-hidden": true,
238
- style: {
239
- display: "inline-block",
240
- width: 12,
241
- height: 12,
242
- background: "#0b0909"
243
- }
244
- }
245
- ),
246
- children ?? (pending ? "opening\u2026" : label)
247
- ]
248
- }
249
- );
250
- }
251
159
 
252
160
  // src/payment.ts
253
161
  async function authorize(opts) {
@@ -1585,7 +1493,6 @@ exports.EVENT_SUBTYPES = EVENT_SUBTYPES;
1585
1493
  exports.MAX_DROP_WINDOW_DAYS = MAX_DROP_WINDOW_DAYS;
1586
1494
  exports.MIN_INTEGRATOR_PRICE_SATS = MIN_INTEGRATOR_PRICE_SATS;
1587
1495
  exports.MeClientError = MeClientError;
1588
- exports.OcSignInButton = OcSignInButton;
1589
1496
  exports.PLATFORM_FEE_POLICY = PLATFORM_FEE_POLICY;
1590
1497
  exports.clearBearerToken = clearBearerToken;
1591
1498
  exports.computeFees = computeFees;