Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/pages/sdk/me-client/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ export const metadata = {

## Interfaces

- [ArchetypeTemplate](interfaces/ArchetypeTemplate.mdx)
- [BillableEvent](interfaces/BillableEvent.mdx)
- [ComputedFees](interfaces/ComputedFees.mdx)
- [EventSubtypeMetadata](interfaces/EventSubtypeMetadata.mdx)
- [FamilyScopesOptions](interfaces/FamilyScopesOptions.mdx)
- [FamilyScopesResult](interfaces/FamilyScopesResult.mdx)
- [Federation](interfaces/Federation.mdx)
- [FireEventOptions](interfaces/FireEventOptions.mdx)
- [GrantedOptions](interfaces/GrantedOptions.mdx)
Expand All @@ -32,10 +36,14 @@ export const metadata = {
- [SessionPolicy](interfaces/SessionPolicy.mdx)
- [SignInOptions](interfaces/SignInOptions.mdx)
- [TelemetryEvent](interfaces/TelemetryEvent.mdx)
- [TrustAttestationCount](interfaces/TrustAttestationCount.mdx)
- [ValidationResult](interfaces/ValidationResult.mdx)
- [VerifyEventResult](interfaces/VerifyEventResult.mdx)
- [VerifyOptions](interfaces/VerifyOptions.mdx)
- [VerifyResult](interfaces/VerifyResult.mdx)
- [WebhookHeaders](interfaces/WebhookHeaders.mdx)
- [WebhookPayload](interfaces/WebhookPayload.mdx)
- [WithRateLimitRetryOptions](interfaces/WithRateLimitRetryOptions.mdx)

## Type Aliases

Expand All @@ -45,15 +53,21 @@ export const metadata = {
- [ClassCSubtype](type-aliases/ClassCSubtype.mdx)
- [EventClass](type-aliases/EventClass.mdx)
- [EventSubtype](type-aliases/EventSubtype.mdx)
- [FamilyVerb](type-aliases/FamilyVerb.mdx)
- [FederationStatus](type-aliases/FederationStatus.mdx)
- [IntegratorArchetype](type-aliases/IntegratorArchetype.mdx)
- [Scope](type-aliases/Scope.mdx)
- [SigningMethod](type-aliases/SigningMethod.mdx)
- [SiteFeeShape](type-aliases/SiteFeeShape.mdx)

## Variables

- [ALL\_EVENT\_SUBTYPES](variables/ALL_EVENT_SUBTYPES.mdx)
- [ARCHETYPE\_TEMPLATES](variables/ARCHETYPE_TEMPLATES.mdx)
- [config](variables/config.mdx)
- [event](variables/event.mdx)
- [EVENT\_SUBTYPES](variables/EVENT_SUBTYPES.mdx)
- [family](variables/family.mdx)
- [federations](variables/federations.mdx)
- [MIN\_INTEGRATOR\_PRICE\_SATS](variables/MIN_INTEGRATOR_PRICE_SATS.mdx)
- [oc](variables/oc.mdx)
Expand All @@ -67,10 +81,15 @@ export const metadata = {

- [clearBearerToken](functions/clearBearerToken.mdx)
- [computeFees](functions/computeFees.mdx)
- [configFromTemplate](functions/configFromTemplate.mdx)
- [getArchetypeTemplate](functions/getArchetypeTemplate.mdx)
- [getBearerToken](functions/getBearerToken.mdx)
- [getOrigin](functions/getOrigin.mdx)
- [OcSignInButton](functions/OcSignInButton.mdx)
- [onTelemetry](functions/onTelemetry.mdx)
- [parseTrustAttestationCount](functions/parseTrustAttestationCount.mdx)
- [setBearerToken](functions/setBearerToken.mdx)
- [setOrigin](functions/setOrigin.mdx)
- [subtypesForClass](functions/subtypesForClass.mdx)
- [validateIntegratorConfig](functions/validateIntegratorConfig.mdx)
- [withRateLimitRetry](functions/withRateLimitRetry.mdx)
121 changes: 24 additions & 97 deletions src/pages/sdk/me-client/classes/MeClientError.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const metadata = {

# Class: MeClientError

Defined in: [me-client/src/transport.ts:73](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L73)
Defined in: [me-client/src/transport.ts:103](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L103)

## Extends

Expand All @@ -22,17 +22,26 @@ Defined in: [me-client/src/transport.ts:73](https://github.com/orangecheck/oc-pa
### Constructor

```ts
new MeClientError(message: string, status: number): MeClientError;
new MeClientError(
message: string,
status: number,
opts?: {
errorCode?: string;
retryAfterSeconds?: number;
}): MeClientError;
```

Defined in: [me-client/src/transport.ts:75](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L75)
Defined in: [me-client/src/transport.ts:114](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L114)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `message` | `string` |
| `status` | `number` |
| `opts?` | \{ `errorCode?`: `string`; `retryAfterSeconds?`: `number`; \} |
| `opts.errorCode?` | `string` |
| `opts.retryAfterSeconds?` | `number` |

#### Returns

Expand All @@ -48,110 +57,28 @@ Error.constructor

| Property | Modifier | Type | Description | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| <a id="property-errorcode"></a> `errorCode` | `readonly` | `string` \| `undefined` | Server-side error code (the `error` field on the JSON body, e.g. `project_rate_limit_exceeded`). Stable across versions; safe to match on. The human-readable `message` may change. | - | [me-client/src/transport.ts:108](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L108) |
| <a id="property-message"></a> `message` | `public` | `string` | - | `Error.message` | node\_modules/typescript/lib/lib.es5.d.ts:1077 |
| <a id="property-name"></a> `name` | `public` | `string` | - | `Error.name` | node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| <a id="property-retryafterseconds"></a> `retryAfterSeconds` | `readonly` | `number` \| `undefined` | Seconds to wait before retrying. Set when the server responded 429 with a Retry-After header (or a `retry_after_seconds` body field). Undefined for any other status. Use with `withRateLimitRetry()` or your own backoff loop. | - | [me-client/src/transport.ts:113](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L113) |
| <a id="property-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1078 |
| <a id="property-status"></a> `status` | `readonly` | `number` | - | - | [me-client/src/transport.ts:74](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L74) |
| <a id="property-stacktracelimit"></a> `stackTraceLimit` | `static` | `number` | The `Error.stackTraceLimit` property specifies the number of stack frames collected by a stack trace (whether generated by `new Error().stack` or `Error.captureStackTrace(obj)`). The default value is `10` but may be set to any valid JavaScript number. Changes will affect any stack trace captured _after_ the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames. | `Error.stackTraceLimit` | me-client/node\_modules/@types/node/globals.d.ts:68 |
| <a id="property-status"></a> `status` | `readonly` | `number` | - | - | [me-client/src/transport.ts:104](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L104) |

## Methods
## Accessors

### captureStackTrace()
### isRateLimited

```ts
static captureStackTrace(targetObject: object, constructorOpt?: Function): void;
```

Defined in: me-client/node\_modules/@types/node/globals.d.ts:52

Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.

```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`
```

The first line of the trace will be prefixed with
`${myObject.name}: ${myObject.message}`.

The optional `constructorOpt` argument accepts a function. If given, all frames
above `constructorOpt`, including `constructorOpt`, will be omitted from the
generated stack trace.

The `constructorOpt` argument is useful for hiding implementation
details of error generation from the user. For instance:

```js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

#### Returns

`void`

#### Inherited from

```ts
Error.captureStackTrace
```

***

### prepareStackTrace()
#### Get Signature

```ts
static prepareStackTrace(err: Error, stackTraces: CallSite[]): any;
get isRateLimited(): boolean;
```

Defined in: me-client/node\_modules/@types/node/globals.d.ts:56

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `err` | `Error` |
| `stackTraces` | `CallSite`[] |

#### Returns

`any`

#### See
Defined in: [me-client/src/transport.ts:127](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/transport.ts#L127)

https://v8.dev/docs/stack-trace-api#customizing-stack-traces
True for the 429 surface · convenience boolean so callers don't
have to compare status === 429 every time.

#### Inherited from
##### Returns

```ts
Error.prepareStackTrace
```
`boolean`
4 changes: 2 additions & 2 deletions src/pages/sdk/me-client/functions/OcSignInButton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata = {
# Function: OcSignInButton()

```ts
function OcSignInButton(__namedParameters: OcSignInButtonProps): Element;
function OcSignInButton(__namedParameters: OcSignInButtonProps): any;
```

Defined in: [me-client/src/SignInButton.tsx:29](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/SignInButton.tsx#L29)
Expand All @@ -34,4 +34,4 @@ useOcSession() across the rest of the app.

## Returns

`Element`
`any`
2 changes: 1 addition & 1 deletion src/pages/sdk/me-client/functions/computeFees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const metadata = {
function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
```

Defined in: [me-client/src/types.ts:110](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/types.ts#L110)
Defined in: [me-client/src/types.ts:120](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/types.ts#L120)

Compute the four-way fee split for an event given an integrator's
config and (for percent_of_amount events) the underlying payment
Expand Down
38 changes: 38 additions & 0 deletions src/pages/sdk/me-client/functions/configFromTemplate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export const metadata = {
title: "Function: configFromTemplate()",
description: "Auto-generated API reference for Function: configFromTemplate(). Source: TypeScript types in oc-packages.",
};

[**@orangecheck/me-client**](../README.mdx)

***

[@orangecheck/me-client](../README.mdx) / configFromTemplate

# Function: configFromTemplate()

```ts
function configFromTemplate(useCase: IntegratorArchetype, identity: ProjectIdentity): IntegratorPriceConfig;
```

Defined in: [me-client/src/templates.ts:292](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/templates.ts#L292)

Build a complete IntegratorPriceConfig from an archetype id + the
project's identity fields. Every subtype gets an entry — the
archetype's listed subtypes get the template's pricing; everything
else gets `enabled: false` with conservative defaults so the config
is type-complete and the integrator can flip-on later subtypes
without re-deriving prices.

Throws synchronously if `useCase` isn't a known archetype id.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `useCase` | [`IntegratorArchetype`](../type-aliases/IntegratorArchetype.mdx) |
| `identity` | `ProjectIdentity` |

## Returns

[`IntegratorPriceConfig`](../interfaces/IntegratorPriceConfig.mdx)
31 changes: 31 additions & 0 deletions src/pages/sdk/me-client/functions/getArchetypeTemplate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const metadata = {
title: "Function: getArchetypeTemplate()",
description: "Auto-generated API reference for Function: getArchetypeTemplate(). Source: TypeScript types in oc-packages.",
};

[**@orangecheck/me-client**](../README.mdx)

***

[@orangecheck/me-client](../README.mdx) / getArchetypeTemplate

# Function: getArchetypeTemplate()

```ts
function getArchetypeTemplate(id: IntegratorArchetype): ArchetypeTemplate;
```

Defined in: [me-client/src/templates.ts:319](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/templates.ts#L319)

Look up a template's metadata · used by config-editor UIs to render
"you're on the X template · here's what it enables" copy.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `id` | [`IntegratorArchetype`](../type-aliases/IntegratorArchetype.mdx) |

## Returns

[`ArchetypeTemplate`](../interfaces/ArchetypeTemplate.mdx)
36 changes: 36 additions & 0 deletions src/pages/sdk/me-client/functions/parseTrustAttestationCount.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export const metadata = {
title: "Function: parseTrustAttestationCount()",
description: "Auto-generated API reference for Function: parseTrustAttestationCount(). Source: TypeScript types in oc-packages.",
};

[**@orangecheck/me-client**](../README.mdx)

***

[@orangecheck/me-client](../README.mdx) / parseTrustAttestationCount

# Function: parseTrustAttestationCount()

```ts
function parseTrustAttestationCount(value: string):
| TrustAttestationCount
| null;
```

Defined in: [me-client/src/scope.ts:84](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/scope.ts#L84)

Decode the `trust_attestation_count` scope's wire-format string into
a typed quad. Returns null if the input is malformed (defensive ·
the resolver always emits well-formed strings, but third-party
consumers may hand us anything).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `string` |

## Returns

\| [`TrustAttestationCount`](../interfaces/TrustAttestationCount.mdx)
\| `null`
30 changes: 30 additions & 0 deletions src/pages/sdk/me-client/functions/subtypesForClass.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const metadata = {
title: "Function: subtypesForClass()",
description: "Auto-generated API reference for Function: subtypesForClass(). Source: TypeScript types in oc-packages.",
};

[**@orangecheck/me-client**](../README.mdx)

***

[@orangecheck/me-client](../README.mdx) / subtypesForClass

# Function: subtypesForClass()

```ts
function subtypesForClass(cls: EventClass): EventSubtypeMetadata[];
```

Defined in: [me-client/src/subtypes.ts:179](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/subtypes.ts#L179)

All subtypes for a given class · convenience accessor.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `cls` | [`EventClass`](../type-aliases/EventClass.mdx) |

## Returns

[`EventSubtypeMetadata`](../interfaces/EventSubtypeMetadata.mdx)[]
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const metadata = {
function validateIntegratorConfig(cfg: IntegratorPriceConfig): ValidationResult;
```

Defined in: [me-client/src/types.ts:147](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/types.ts#L147)
Defined in: [me-client/src/types.ts:157](https://github.com/orangecheck/oc-packages/blob/main/me-client/src/types.ts#L157)

Validate an integrator's pricing config against the platform's
non-negotiable rules. Run client-side before posting; the server runs
Expand Down
Loading