@orangecheck/me-client 0.16.0 → 0.18.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.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import { E as EventSubtype, B as BillableEvent, 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-m712Srxt.mjs';
2
+ export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, h as AttestTier, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, l as EVENT_SUBTYPES, m as EventClass, n as EventSubtypeMetadata, o as FederationStatus, p as IntegratorArchetype, q as IntegratorEventConfig, M as MIN_INTEGRATOR_PRICE_SATS, r as PLATFORM_FEE_POLICY, s as SigningMethod, t as SiteFeeShape, W as WebhookHeaders, u as WebhookPayload, v as computeFees, w as subtypesForClass, x as validateIntegratorConfig } from './integrator-m712Srxt.mjs';
1
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
4
  import * as React from 'react';
3
5
 
@@ -75,124 +77,6 @@ declare const webhook: {
75
77
  fetchJwks: typeof fetchJwksForce;
76
78
  };
77
79
 
78
- declare const PLATFORM_FEE_POLICY: {
79
- readonly pct: 0.2;
80
- readonly min_floor_sats: 1;
81
- readonly ratified: "2026-04-30";
82
- };
83
- declare const MIN_INTEGRATOR_PRICE_SATS = 5;
84
- type EventClass = 'A' | 'B' | 'C';
85
- type ClassASubtype = 'account_creation' | 'account_recovery' | 'kyc_tier_upgrade' | 'payment_method_connected' | 'agent_delegation_issued' | 'recovery_method_updated';
86
- type ClassBSubtype = 'payment_authorization' | 'scoped_action_authorization' | 'attest_verification_at_gate' | 'stamp_signing' | 'pledge_resolution';
87
- type ClassCSubtype = 'session_creation';
88
- type EventSubtype = ClassASubtype | ClassBSubtype | ClassCSubtype;
89
- type AttestTier = 'anonymous' | 'bonded' | 'kyc_light' | 'kyc_strong';
90
- type SiteFeeShape = {
91
- kind: 'fixed_sats';
92
- sats: number;
93
- } | {
94
- kind: 'percent_of_amount';
95
- pct: number;
96
- };
97
- interface IntegratorEventConfig {
98
- enabled: boolean;
99
- site_pays: SiteFeeShape;
100
- user_share_pct: number;
101
- }
102
- interface IntegratorPriceConfig {
103
- project_key: string;
104
- display_name: string;
105
- domain: string;
106
- updated_at: string;
107
- events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
108
- }
109
- interface ComputedFees {
110
- gross_fee_sats: number;
111
- platform_fee_sats: number;
112
- user_earned_sats: number;
113
- site_rebate_sats: number;
114
- }
115
- declare function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
116
- interface ValidationResult {
117
- ok: boolean;
118
- errors: {
119
- subtype?: EventSubtype;
120
- message: string;
121
- }[];
122
- }
123
- declare function validateIntegratorConfig(cfg: IntegratorPriceConfig): ValidationResult;
124
- interface BillableEvent {
125
- id: string;
126
- occurred_at: string;
127
- class: EventClass;
128
- subtype: EventSubtype;
129
- site: {
130
- domain: string;
131
- display_name: string;
132
- };
133
- gross_fee_sats: number;
134
- platform_fee_sats: number;
135
- user_earned_sats: number;
136
- site_rebate_sats: number;
137
- verify_url: string;
138
- }
139
- interface SessionPolicy {
140
- duration_seconds: number;
141
- refresh: 'sliding' | 'rolling' | 'none';
142
- sensitive_actions?: 're-auth' | 'none';
143
- }
144
- interface Session {
145
- id: string;
146
- identity: string;
147
- opens_at: string;
148
- expires_at: string;
149
- policy: SessionPolicy;
150
- scope: string[];
151
- }
152
- interface SignInOptions {
153
- scope: string[];
154
- sessionPolicy?: Partial<SessionPolicy>;
155
- returnTo?: string;
156
- }
157
- interface PaymentAuthorizeOptions {
158
- identity: string;
159
- amount_sats?: number;
160
- usd_cents?: number;
161
- description: string;
162
- external_ref?: string;
163
- }
164
- interface PaymentResult {
165
- id: string;
166
- status: 'authorized' | 'failed' | 'cancelled';
167
- sats_charged?: number;
168
- user_envelope_id?: string;
169
- verify_url?: string;
170
- }
171
- interface TelemetryEvent {
172
- code: 'session.intra_signin' | 'session.token_refresh' | 'session.navigation' | 'auth.signin_failed' | 'auth.signin_cancelled' | 'auth.signin_rejected' | 'verify.passive_check';
173
- timestamp: string;
174
- session_id?: string;
175
- }
176
- type FederationStatus = 'recruiting' | 'forming' | 'binding' | 'live';
177
- interface Federation {
178
- slug: string;
179
- name: string;
180
- status: FederationStatus;
181
- threshold: string;
182
- target_guardian_count: number;
183
- invite: string | null;
184
- charter_hash: string | null;
185
- last_attestation_at: string | null;
186
- geography_hint: string;
187
- geography_requirements?: string;
188
- charter_status?: string;
189
- ceremony_window?: string;
190
- why_this_one?: string;
191
- apply_cta?: string;
192
- apply_href?: string;
193
- }
194
- type SigningMethod = 'fedimint_threshold' | 'fedimint_client' | 'bip322';
195
-
196
80
  interface FireEventOptions {
197
81
  project_key: string;
198
82
  subtype: EventSubtype;
@@ -285,6 +169,9 @@ declare const payment: {
285
169
  declare function validate(cfg: IntegratorPriceConfig): ValidationResult;
286
170
  declare const config: {
287
171
  validate: typeof validate;
172
+ fromTemplate: typeof fromTemplate;
173
+ getArchetype: typeof getArchetypeTemplate;
174
+ archetypes: readonly ArchetypeTemplate[];
288
175
  };
289
176
 
290
177
  declare function list(): Promise<Federation[]>;
@@ -336,6 +223,9 @@ declare const oc: {
336
223
  };
337
224
  config: {
338
225
  validate: (cfg: IntegratorPriceConfig) => ValidationResult;
226
+ fromTemplate: typeof fromTemplate;
227
+ getArchetype: typeof getArchetypeTemplate;
228
+ archetypes: readonly ArchetypeTemplate[];
339
229
  };
340
230
  webhook: {
341
231
  verify: typeof verify$1;
@@ -357,4 +247,4 @@ declare const oc: {
357
247
  };
358
248
  };
359
249
 
360
- export { type AttestTier, type BillableEvent, type ClassASubtype, type ClassBSubtype, type ClassCSubtype, type ComputedFees, type EventClass, type EventSubtype, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, type Federation, type FederationStatus, type FireEventOptions, type GrantedOptions, type GrantedResult, type IntegratorEventConfig, type IntegratorPriceConfig, MIN_INTEGRATOR_PRICE_SATS, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, PLATFORM_FEE_POLICY, type PaymentAuthorizeOptions, type PaymentResult, type RequestOptions, type Scope, type Session, type SessionPolicy, type SignInOptions, type SigningMethod, type SiteFeeShape, type TelemetryEvent, type TrustAttestationCount, type ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, computeFees, config, event, family, federations, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payment, scope, session, setBearerToken, setOrigin, validateIntegratorConfig, webhook, withRateLimitRetry };
250
+ export { ArchetypeTemplate, BillableEvent, EventSubtype, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireEventOptions, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, 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, payment, scope, session, setBearerToken, setOrigin, webhook, withRateLimitRetry };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { E as EventSubtype, B as BillableEvent, 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-m712Srxt.js';
2
+ export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, h as AttestTier, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, l as EVENT_SUBTYPES, m as EventClass, n as EventSubtypeMetadata, o as FederationStatus, p as IntegratorArchetype, q as IntegratorEventConfig, M as MIN_INTEGRATOR_PRICE_SATS, r as PLATFORM_FEE_POLICY, s as SigningMethod, t as SiteFeeShape, W as WebhookHeaders, u as WebhookPayload, v as computeFees, w as subtypesForClass, x as validateIntegratorConfig } from './integrator-m712Srxt.js';
1
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
4
  import * as React from 'react';
3
5
 
@@ -75,124 +77,6 @@ declare const webhook: {
75
77
  fetchJwks: typeof fetchJwksForce;
76
78
  };
77
79
 
78
- declare const PLATFORM_FEE_POLICY: {
79
- readonly pct: 0.2;
80
- readonly min_floor_sats: 1;
81
- readonly ratified: "2026-04-30";
82
- };
83
- declare const MIN_INTEGRATOR_PRICE_SATS = 5;
84
- type EventClass = 'A' | 'B' | 'C';
85
- type ClassASubtype = 'account_creation' | 'account_recovery' | 'kyc_tier_upgrade' | 'payment_method_connected' | 'agent_delegation_issued' | 'recovery_method_updated';
86
- type ClassBSubtype = 'payment_authorization' | 'scoped_action_authorization' | 'attest_verification_at_gate' | 'stamp_signing' | 'pledge_resolution';
87
- type ClassCSubtype = 'session_creation';
88
- type EventSubtype = ClassASubtype | ClassBSubtype | ClassCSubtype;
89
- type AttestTier = 'anonymous' | 'bonded' | 'kyc_light' | 'kyc_strong';
90
- type SiteFeeShape = {
91
- kind: 'fixed_sats';
92
- sats: number;
93
- } | {
94
- kind: 'percent_of_amount';
95
- pct: number;
96
- };
97
- interface IntegratorEventConfig {
98
- enabled: boolean;
99
- site_pays: SiteFeeShape;
100
- user_share_pct: number;
101
- }
102
- interface IntegratorPriceConfig {
103
- project_key: string;
104
- display_name: string;
105
- domain: string;
106
- updated_at: string;
107
- events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
108
- }
109
- interface ComputedFees {
110
- gross_fee_sats: number;
111
- platform_fee_sats: number;
112
- user_earned_sats: number;
113
- site_rebate_sats: number;
114
- }
115
- declare function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
116
- interface ValidationResult {
117
- ok: boolean;
118
- errors: {
119
- subtype?: EventSubtype;
120
- message: string;
121
- }[];
122
- }
123
- declare function validateIntegratorConfig(cfg: IntegratorPriceConfig): ValidationResult;
124
- interface BillableEvent {
125
- id: string;
126
- occurred_at: string;
127
- class: EventClass;
128
- subtype: EventSubtype;
129
- site: {
130
- domain: string;
131
- display_name: string;
132
- };
133
- gross_fee_sats: number;
134
- platform_fee_sats: number;
135
- user_earned_sats: number;
136
- site_rebate_sats: number;
137
- verify_url: string;
138
- }
139
- interface SessionPolicy {
140
- duration_seconds: number;
141
- refresh: 'sliding' | 'rolling' | 'none';
142
- sensitive_actions?: 're-auth' | 'none';
143
- }
144
- interface Session {
145
- id: string;
146
- identity: string;
147
- opens_at: string;
148
- expires_at: string;
149
- policy: SessionPolicy;
150
- scope: string[];
151
- }
152
- interface SignInOptions {
153
- scope: string[];
154
- sessionPolicy?: Partial<SessionPolicy>;
155
- returnTo?: string;
156
- }
157
- interface PaymentAuthorizeOptions {
158
- identity: string;
159
- amount_sats?: number;
160
- usd_cents?: number;
161
- description: string;
162
- external_ref?: string;
163
- }
164
- interface PaymentResult {
165
- id: string;
166
- status: 'authorized' | 'failed' | 'cancelled';
167
- sats_charged?: number;
168
- user_envelope_id?: string;
169
- verify_url?: string;
170
- }
171
- interface TelemetryEvent {
172
- code: 'session.intra_signin' | 'session.token_refresh' | 'session.navigation' | 'auth.signin_failed' | 'auth.signin_cancelled' | 'auth.signin_rejected' | 'verify.passive_check';
173
- timestamp: string;
174
- session_id?: string;
175
- }
176
- type FederationStatus = 'recruiting' | 'forming' | 'binding' | 'live';
177
- interface Federation {
178
- slug: string;
179
- name: string;
180
- status: FederationStatus;
181
- threshold: string;
182
- target_guardian_count: number;
183
- invite: string | null;
184
- charter_hash: string | null;
185
- last_attestation_at: string | null;
186
- geography_hint: string;
187
- geography_requirements?: string;
188
- charter_status?: string;
189
- ceremony_window?: string;
190
- why_this_one?: string;
191
- apply_cta?: string;
192
- apply_href?: string;
193
- }
194
- type SigningMethod = 'fedimint_threshold' | 'fedimint_client' | 'bip322';
195
-
196
80
  interface FireEventOptions {
197
81
  project_key: string;
198
82
  subtype: EventSubtype;
@@ -285,6 +169,9 @@ declare const payment: {
285
169
  declare function validate(cfg: IntegratorPriceConfig): ValidationResult;
286
170
  declare const config: {
287
171
  validate: typeof validate;
172
+ fromTemplate: typeof fromTemplate;
173
+ getArchetype: typeof getArchetypeTemplate;
174
+ archetypes: readonly ArchetypeTemplate[];
288
175
  };
289
176
 
290
177
  declare function list(): Promise<Federation[]>;
@@ -336,6 +223,9 @@ declare const oc: {
336
223
  };
337
224
  config: {
338
225
  validate: (cfg: IntegratorPriceConfig) => ValidationResult;
226
+ fromTemplate: typeof fromTemplate;
227
+ getArchetype: typeof getArchetypeTemplate;
228
+ archetypes: readonly ArchetypeTemplate[];
339
229
  };
340
230
  webhook: {
341
231
  verify: typeof verify$1;
@@ -357,4 +247,4 @@ declare const oc: {
357
247
  };
358
248
  };
359
249
 
360
- export { type AttestTier, type BillableEvent, type ClassASubtype, type ClassBSubtype, type ClassCSubtype, type ComputedFees, type EventClass, type EventSubtype, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, type Federation, type FederationStatus, type FireEventOptions, type GrantedOptions, type GrantedResult, type IntegratorEventConfig, type IntegratorPriceConfig, MIN_INTEGRATOR_PRICE_SATS, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, PLATFORM_FEE_POLICY, type PaymentAuthorizeOptions, type PaymentResult, type RequestOptions, type Scope, type Session, type SessionPolicy, type SignInOptions, type SigningMethod, type SiteFeeShape, type TelemetryEvent, type TrustAttestationCount, type ValidationResult, type VerifyEventResult, type VerifyOptions, type VerifyResult, type WithRateLimitRetryOptions, clearBearerToken, computeFees, config, event, family, federations, getBearerToken, getOrigin, oc, onTelemetry, parseTrustAttestationCount, payment, scope, session, setBearerToken, setOrigin, validateIntegratorConfig, webhook, withRateLimitRetry };
250
+ export { ArchetypeTemplate, BillableEvent, EventSubtype, type FamilyScopesOptions, type FamilyScopesResult, type FamilyVerb, Federation, type FireEventOptions, type GrantedOptions, type GrantedResult, IntegratorPriceConfig, MeClientError, type OcPublicJwk, OcSignInButton, type OcSignInButtonProps, 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, payment, scope, session, setBearerToken, setOrigin, webhook, withRateLimitRetry };