Skip to content
Merged
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
23 changes: 21 additions & 2 deletions src/pages/sdk/agent-core/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export const metadata = {
- [DelegationCanonicalInput](interfaces/DelegationCanonicalInput.mdx)
- [DelegationEnvelope](interfaces/DelegationEnvelope.mdx)
- [DelegationRevocationRef](interfaces/DelegationRevocationRef.mdx)
- [FederationDelegationEnvelope](interfaces/FederationDelegationEnvelope.mdx)
- [FederationDescriptor](interfaces/FederationDescriptor.mdx)
- [FederationGuardian](interfaces/FederationGuardian.mdx)
- [FederationPrincipal](interfaces/FederationPrincipal.mdx)
- [FederationRevocationEnvelope](interfaces/FederationRevocationEnvelope.mdx)
- [FederationSignature](interfaces/FederationSignature.mdx)
- [RevocationCanonicalInput](interfaces/RevocationCanonicalInput.mdx)
- [RevocationEnvelope](interfaces/RevocationEnvelope.mdx)
- [Scope](interfaces/Scope.mdx)
Expand All @@ -42,6 +48,9 @@ export const metadata = {
- [VerifyBase](interfaces/VerifyBase.mdx)
- [VerifyDelegationInput](interfaces/VerifyDelegationInput.mdx)
- [VerifyErr](interfaces/VerifyErr.mdx)
- [VerifyFederationBase](interfaces/VerifyFederationBase.mdx)
- [VerifyFederationDelegationInput](interfaces/VerifyFederationDelegationInput.mdx)
- [VerifyFederationRevocationInput](interfaces/VerifyFederationRevocationInput.mdx)
- [VerifyOk](interfaces/VerifyOk.mdx)
- [VerifyRevocationInput](interfaces/VerifyRevocationInput.mdx)
- [VerifySubdelegationInput](interfaces/VerifySubdelegationInput.mdx)
Expand All @@ -51,6 +60,7 @@ export const metadata = {
- [AgentErrorCode](type-aliases/AgentErrorCode.mdx)
- [ChainLink](type-aliases/ChainLink.mdx)
- [EnvelopeKind](type-aliases/EnvelopeKind.mdx)
- [FederationVerifyResult](type-aliases/FederationVerifyResult.mdx)
- [RevocationHolder](type-aliases/RevocationHolder.mdx)
- [ScopeOp](type-aliases/ScopeOp.mdx)
- [VerifyActionResult](type-aliases/VerifyActionResult.mdx)
Expand All @@ -60,6 +70,7 @@ export const metadata = {

## Variables

- [canonicalize](variables/canonicalize.mdx)
- [DEFAULT\_MAX\_CHAIN\_DEPTH](variables/DEFAULT_MAX_CHAIN_DEPTH.mdx)
- [ENVELOPE\_VERSION](variables/ENVELOPE_VERSION.mdx)
- [REGISTERED\_SCOPES](variables/REGISTERED_SCOPES.mdx)
Expand All @@ -70,7 +81,6 @@ export const metadata = {
- [actionCanonicalMessage](functions/actionCanonicalMessage.mdx)
- [canonicalActionBytes](functions/canonicalActionBytes.mdx)
- [canonicalDelegationBytes](functions/canonicalDelegationBytes.mdx)
- [canonicalize](functions/canonicalize.mdx)
- [canonicalizeAction](functions/canonicalizeAction.mdx)
- [canonicalizeDelegation](functions/canonicalizeDelegation.mdx)
- [canonicalizeRevocation](functions/canonicalizeRevocation.mdx)
Expand All @@ -80,14 +90,15 @@ export const metadata = {
- [canonicalRevocationBytes](functions/canonicalRevocationBytes.mdx)
- [computeActionId](functions/computeActionId.mdx)
- [computeDelegationId](functions/computeDelegationId.mdx)
- [computeFederationDescriptorId](functions/computeFederationDescriptorId.mdx)
- [computeRevocationId](functions/computeRevocationId.mdx)
- [computeSubdelegationId](functions/computeSubdelegationId.mdx)
- [decodeScopesPayload](functions/decodeScopesPayload.mdx)
- [delegationCanonicalBytes](functions/delegationCanonicalBytes.mdx)
- [delegationCanonicalMessage](functions/delegationCanonicalMessage.mdx)
- [encodeScopesPayload](functions/encodeScopesPayload.mdx)
- [federationDescriptorCanonicalMessage](functions/federationDescriptorCanonicalMessage.mdx)
- [hasPrivateScopes](functions/hasPrivateScopes.mdx)
- [hexEncode](functions/hexEncode.mdx)
- [isSubScope](functions/isSubScope.mdx)
- [parseAndCanonicalizeScopes](functions/parseAndCanonicalizeScopes.mdx)
- [parseScope](functions/parseScope.mdx)
Expand All @@ -101,5 +112,13 @@ export const metadata = {
- [validateScope](functions/validateScope.mdx)
- [verifyAction](functions/verifyAction.mdx)
- [verifyDelegation](functions/verifyDelegation.mdx)
- [verifyFederationDelegation](functions/verifyFederationDelegation.mdx)
- [verifyFederationRevocation](functions/verifyFederationRevocation.mdx)
- [verifyRevocation](functions/verifyRevocation.mdx)
- [verifySubdelegation](functions/verifySubdelegation.mdx)

## References

### hexEncode

Renames and re-exports [canonicalize](variables/canonicalize.mdx)
115 changes: 6 additions & 109 deletions src/pages/sdk/agent-core/classes/AgentError.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,112 +46,9 @@ Error.constructor

## Properties

| Property | Modifier | Type | Description | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| <a id="property-code"></a> `code` | `public` | [`AgentErrorCode`](../type-aliases/AgentErrorCode.mdx) | - | - | [agent-core/src/verify.ts:54](https://github.com/orangecheck/oc-packages/blob/main/agent-core/src/verify.ts#L54) |
| <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-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1078 |
| <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` | agent-core/node\_modules/@types/node/globals.d.ts:68 |

## Methods

### captureStackTrace()

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

Defined in: agent-core/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()

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

Defined in: agent-core/node\_modules/@types/node/globals.d.ts:56

#### Parameters

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

#### Returns

`any`

#### See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

#### Inherited from

```ts
Error.prepareStackTrace
```
| Property | Type | Inherited from | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="property-code"></a> `code` | [`AgentErrorCode`](../type-aliases/AgentErrorCode.mdx) | - | [agent-core/src/verify.ts:54](https://github.com/orangecheck/oc-packages/blob/main/agent-core/src/verify.ts#L54) |
| <a id="property-message"></a> `message` | `string` | `Error.message` | node\_modules/typescript/lib/lib.es5.d.ts:1077 |
| <a id="property-name"></a> `name` | `string` | `Error.name` | node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| <a id="property-stack"></a> `stack?` | `string` | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1078 |
113 changes: 5 additions & 108 deletions src/pages/sdk/agent-core/classes/ScopeParseError.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,111 +45,8 @@ Error.constructor

## Properties

| Property | Modifier | Type | Description | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| <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-stack"></a> `stack?` | `public` | `string` | - | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1078 |
| <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` | agent-core/node\_modules/@types/node/globals.d.ts:68 |

## Methods

### captureStackTrace()

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

Defined in: agent-core/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()

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

Defined in: agent-core/node\_modules/@types/node/globals.d.ts:56

#### Parameters

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

#### Returns

`any`

#### See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

#### Inherited from

```ts
Error.prepareStackTrace
```
| Property | Type | Inherited from | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="property-message"></a> `message` | `string` | `Error.message` | node\_modules/typescript/lib/lib.es5.d.ts:1077 |
| <a id="property-name"></a> `name` | `string` | `Error.name` | node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| <a id="property-stack"></a> `stack?` | `string` | `Error.stack` | node\_modules/typescript/lib/lib.es5.d.ts:1078 |
28 changes: 0 additions & 28 deletions src/pages/sdk/agent-core/functions/canonicalize.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const metadata = {
title: "Function: computeFederationDescriptorId()",
description: "Auto-generated API reference for Function: computeFederationDescriptorId(). Source: TypeScript types in oc-packages.",
};

[**@orangecheck/agent-core**](../README.mdx)

***

[@orangecheck/agent-core](../README.mdx) / computeFederationDescriptorId

# Function: computeFederationDescriptorId()

```ts
function computeFederationDescriptorId(descriptor: FederationDescriptor): string;
```

Defined in: [agent-core/src/federation.ts:121](https://github.com/orangecheck/oc-packages/blob/main/agent-core/src/federation.ts#L121)

descriptor_id := H(canonical_descriptor_bytes). 64 lowercase hex.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `descriptor` | [`FederationDescriptor`](../interfaces/FederationDescriptor.mdx) |

## Returns

`string`
Loading