Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC auto-generate online documentation #23

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
427 changes: 427 additions & 0 deletions api-extractor.json

Large diffs are not rendered by default.

506 changes: 506 additions & 0 deletions dist/fauna.d.ts

Large diffs are not rendered by default.

247 changes: 247 additions & 0 deletions etc/fauna.api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
## API Report File for "fauna"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="node" />

import { AxiosInstance } from "axios";

// @public
export class AuthenticationError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 401;
summary?: string;
});
}

// @public
export class AuthorizationError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 403;
summary?: string;
});
}

// @public
export class Client {
constructor(clientConfiguration?: Partial<ClientConfiguration>);
readonly client: AxiosInstance;
readonly clientConfiguration: ClientConfiguration;
query<T = any>(
request: QueryRequest | QueryBuilder,
headers?: QueryRequestHeaders
): Promise<QueryResponse<T>>;
}

// @public
export interface ClientConfiguration {
endpoint: URL;
linearized?: boolean;
max_conns: number;
max_contention_retries?: number;
secret: string;
tags?: {
[key: string]: string;
};
timeout_ms: number;
traceparent?: string;
}

// @public
export class ClientError extends Error {
constructor(
message: string,
options: {
cause: any;
}
);
}

// @public
export interface Endpoints {
[key: string]: URL;
cloud: URL;
local: URL;
localhost: URL;
preview: URL;
}

// @public
export const endpoints: Endpoints;

// @public
export function fql(
queryFragments: TemplateStringsArray,
...queryArgs: (JSONValue | QueryBuilder)[]
): QueryBuilder;

// @public
export type JSONObject = {
[key: string]: JSONValue;
};

// @public
export type JSONValue =
| null
| string
| number
| boolean
| JSONObject
| Array<JSONValue>;

// @public
export class NetworkError extends Error {
constructor(
message: string,
options: {
cause: any;
}
);
}

// @public
export class ProtocolError extends Error {
constructor(error: { message: string; httpStatus: number });
readonly httpStatus: number;
}

// @public (undocumented)
export interface QueryBuilder {
// (undocumented)
toQuery: (
headers?: QueryRequestHeaders,
intialArgNumber?: number
) => QueryRequest;
}

// @public
export class QueryCheckError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 400;
summary?: string;
failures: QueryCheckFailure[];
});
readonly failures: Array<QueryCheckFailure>;
}

// @public
export interface QueryCheckFailure {
readonly annotation?: string;
readonly code: string;
readonly location?: Span;
readonly message: string;
}

// @public
export interface QueryRequest extends QueryRequestHeaders {
arguments?: JSONObject;
query: string;
}

// @public (undocumented)
export interface QueryRequestHeaders {
last_txn?: string;
linearized?: boolean;
max_contention_retries?: number;
tags?: {
[key: string]: string;
};
timeout_ms?: number;
traceparent?: string;
}

// @public
export interface QueryResponse<T> {
data: T;
stats: {
[key: string]: number;
};
txn_time: string;
}

// @public
export class QueryRuntimeError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 400;
summary?: string;
});
}

// @public
export class QueryTimeoutError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 440;
summary?: string;
stats?: {
[key: string]: number;
};
});
readonly stats?: {
[key: string]: number;
};
}

// @public
export class ServiceError extends Error {
constructor(error: {
code: string;
message: string;
httpStatus: number;
summary?: string;
});
readonly code: string;
readonly httpStatus: number;
readonly summary?: string;
}

// @public
export class ServiceInternalError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 500;
summary?: string;
});
}

// @public
export class ServiceTimeoutError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 503;
summary?: string;
});
}

// @public
export interface Span {
end: number;
function: string;
src: string;
start: number;
}

// @public
export class ThrottlingError extends ServiceError {
constructor(error: {
code: string;
message: string;
httpStatus: 429;
summary?: string;
});
}

// (No @packageDocumentation comment for this package)
```
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions lib/tsdoc-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
// It should be published with your NPM package. It should not be tracked by Git.
{
"tsdocVersion": "0.12",
"toolPackages": [
{
"packageName": "@microsoft/api-extractor",
"packageVersion": "7.33.6"
}
]
}
24 changes: 24 additions & 0 deletions markdown/fauna.authenticationerror._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [fauna](./fauna.md) &gt; [AuthenticationError](./fauna.authenticationerror.md) &gt; [(constructor)](./fauna.authenticationerror._constructor_.md)

## AuthenticationError.(constructor)

Constructs a new instance of the `AuthenticationError` class

<b>Signature:</b>

```typescript
constructor(error: {
code: string;
message: string;
httpStatus: 401;
summary?: string;
});
```

## Parameters

| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------- | ----------- |
| error | { code: string; message: string; httpStatus: 401; summary?: string; } | |
21 changes: 21 additions & 0 deletions markdown/fauna.authenticationerror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [fauna](./fauna.md) &gt; [AuthenticationError](./fauna.authenticationerror.md)

## AuthenticationError class

AuthenticationError indicates invalid credentials were used.

<b>Signature:</b>

```typescript
export declare class AuthenticationError extends ServiceError
```

<b>Extends:</b> [ServiceError](./fauna.serviceerror.md)

## Constructors

| Constructor | Modifiers | Description |
| -------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------- |
| [(constructor)(error)](./fauna.authenticationerror._constructor_.md) | | Constructs a new instance of the <code>AuthenticationError</code> class |
24 changes: 24 additions & 0 deletions markdown/fauna.authorizationerror._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [fauna](./fauna.md) &gt; [AuthorizationError](./fauna.authorizationerror.md) &gt; [(constructor)](./fauna.authorizationerror._constructor_.md)

## AuthorizationError.(constructor)

Constructs a new instance of the `AuthorizationError` class

<b>Signature:</b>

```typescript
constructor(error: {
code: string;
message: string;
httpStatus: 403;
summary?: string;
});
```

## Parameters

| Parameter | Type | Description |
| --------- | --------------------------------------------------------------------- | ----------- |
| error | { code: string; message: string; httpStatus: 403; summary?: string; } | |
21 changes: 21 additions & 0 deletions markdown/fauna.authorizationerror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [fauna](./fauna.md) &gt; [AuthorizationError](./fauna.authorizationerror.md)

## AuthorizationError class

AuthorizationError indicates the credentials used do not have permission to perform the requested action.

<b>Signature:</b>

```typescript
export declare class AuthorizationError extends ServiceError
```

<b>Extends:</b> [ServiceError](./fauna.serviceerror.md)

## Constructors

| Constructor | Modifiers | Description |
| ------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------- |
| [(constructor)(error)](./fauna.authorizationerror._constructor_.md) | | Constructs a new instance of the <code>AuthorizationError</code> class |
30 changes: 30 additions & 0 deletions markdown/fauna.client._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [fauna](./fauna.md) &gt; [Client](./fauna.client.md) &gt; [(constructor)](./fauna.client._constructor_.md)

## Client.(constructor)

Constructs a new [Client](./fauna.client.md)<!-- -->.

<b>Signature:</b>

```typescript
constructor(clientConfiguration?: Partial<ClientConfiguration>);
```

## Parameters

| Parameter | Type | Description |
| ------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| clientConfiguration | Partial&lt;[ClientConfiguration](./fauna.clientconfiguration.md)<!-- -->&gt; | <i>(Optional)</i> the [ClientConfiguration](./fauna.clientconfiguration.md) to apply. |

## Example

```typescript
const myClient = new Client({
endpoint: endpoints.cloud,
max_conns: 10,
secret: "foo",
timeout_ms: 60_000,
});
```
Loading