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
31 changes: 2 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
Expand All @@ -21,37 +21,10 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
if [[ ${GITHUB_REF} == *alpha* ]]; then
npm publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
npm publish --access public --tag beta
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polytomic",
"version": "1.16.1",
"name": "",
"version": "1.16.2",
"private": false,
"repository": "https://github.com/polytomic/polytomic-typescript",
"license": "MIT",
Expand Down Expand Up @@ -40,5 +40,6 @@
"fs": false,
"os": false,
"path": false
}
},
"packageManager": "yarn@1.22.22"
}
132 changes: 123 additions & 9 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1275,10 +1275,27 @@ await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668
</dl>
</details>

<details><summary><code>client.connections.<a href="/src/api/resources/connections/client/Client.ts">apiV2CreateSharedConnection</a>(id, { ...params }) -> Polytomic.V2CreateSharedConnectionResponseEnvelope</code></summary>
<details><summary><code>client.connections.<a href="/src/api/resources/connections/client/Client.ts">createSharedConnection</a>(parentConnectionId, { ...params }) -> Polytomic.V2CreateSharedConnectionResponseEnvelope</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

> 🚧 Requires partner key
>
> Shared connections can only be created by using [partner keys](https://apidocs.polytomic.com/guides/obtaining-api-keys#partner-keys).

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand All @@ -1288,8 +1305,8 @@ await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668
<dd>

```typescript
await client.connections.apiV2CreateSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
await client.connections.createSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
child_organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
});
```

Expand All @@ -1306,7 +1323,7 @@ await client.connections.apiV2CreateSharedConnection("248df4b7-aa70-47b8-a036-33
<dl>
<dd>

**id:** `string`
**parentConnectionId:** `string`

</dd>
</dl>
Expand All @@ -1333,12 +1350,75 @@ await client.connections.apiV2CreateSharedConnection("248df4b7-aa70-47b8-a036-33
</dl>
</details>

<details><summary><code>client.connections.<a href="/src/api/resources/connections/client/Client.ts">listSharedConnections</a>(parentConnectionId) -> Polytomic.ConnectionListResponseEnvelope</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.connections.listSharedConnections("248df4b7-aa70-47b8-a036-33ac447e668d");
```

</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**parentConnectionId:** `string`

</dd>
</dl>

<dl>
<dd>

**requestOptions:** `Connections.RequestOptions`

</dd>
</dl>
</dd>
</dl>

</dd>
</dl>
</details>

## QueryRunner

<details><summary><code>client.queryRunner.<a href="/src/api/resources/queryRunner/client/Client.ts">runQuery</a>(connectionId, { ...params }) -> Polytomic.V4RunQueryEnvelope</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Submit a query for asynchronous execution against the connection. The initial response may only contain the query task id and status. Poll GET /api/queries/{id} with the returned id to retrieve completion status, fields, and results.

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand Down Expand Up @@ -1397,6 +1477,21 @@ await client.queryRunner.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

Fetch the latest status for a submitted query and, once complete, return fields and paginated results. Use the query id returned by POST /api/connections/{connection_id}/query.

</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
Expand All @@ -1406,7 +1501,9 @@ await client.queryRunner.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
<dd>

```typescript
await client.queryRunner.getQuery("248df4b7-aa70-47b8-a036-33ac447e668d");
await client.queryRunner.getQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {
page: "page",
});
```

</dd>
Expand Down Expand Up @@ -2080,6 +2177,7 @@ await client.models.post("248df4b7-aa70-47b8-a036-33ac447e668d");

```typescript
await client.models.preview({
async: true,
body: {
configuration: {
table: "public.users",
Expand Down Expand Up @@ -2176,6 +2274,7 @@ await client.models.list();

```typescript
await client.models.create({
async: true,
body: {
configuration: {
table: "public.users",
Expand Down Expand Up @@ -2231,7 +2330,9 @@ await client.models.create({
<dd>

```typescript
await client.models.get("248df4b7-aa70-47b8-a036-33ac447e668d");
await client.models.get("248df4b7-aa70-47b8-a036-33ac447e668d", {
async: true,
});
```

</dd>
Expand Down Expand Up @@ -2350,7 +2451,9 @@ await client.models.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
<dd>

```typescript
await client.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d");
await client.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {
async: true,
});
```

</dd>
Expand Down Expand Up @@ -2421,7 +2524,9 @@ Returns sample records from the model. The first ten records that the source pro
<dd>

```typescript
await client.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d");
await client.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d", {
async: true,
});
```

</dd>
Expand Down Expand Up @@ -2593,6 +2698,7 @@ await client.modelSync.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d");
```typescript
await client.modelSync.list({
active: true,
mode: "create",
target_connection_id: "0b155265-c537-44c9-9359-a3ceb468a4da",
});
```
Expand Down Expand Up @@ -3207,8 +3313,10 @@ await client.modelSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d");
```typescript
await client.events.list({
organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
type: "type",
starting_after: "2020-01-01T00:00:00Z",
ending_before: "2020-01-01T00:00:00Z",
limit: 1,
});
```

Expand Down Expand Up @@ -4910,6 +5018,9 @@ await client.bulkSync.executions.getLogs(
await client.bulkSync.executions.exportLogs(
"248df4b7-aa70-47b8-a036-33ac447e668d",
"248df4b7-aa70-47b8-a036-33ac447e668d",
{
notify: true,
},
);
```

Expand Down Expand Up @@ -5556,7 +5667,10 @@ await client.bulkSync.schedules.delete("248df4b7-aa70-47b8-a036-33ac447e668d", "
<dd>

```typescript
await client.modelSync.targets.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d");
await client.modelSync.targets.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d", {
type: "type",
search: "search",
});
```

</dd>
Expand Down
4 changes: 2 additions & 2 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export declare namespace PolytomicClient {
baseUrl?: core.Supplier<string>;
token: core.Supplier<core.BearerToken>;
/** Override the X-Polytomic-Version header */
version?: core.Supplier<string | undefined>;
version?: core.Supplier<unknown>;
}

export interface RequestOptions {
Expand All @@ -37,7 +37,7 @@ export declare namespace PolytomicClient {
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Override the X-Polytomic-Version header */
version?: string | undefined;
version?: unknown;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
}
Expand Down
4 changes: 3 additions & 1 deletion src/api/errors/BadRequestError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

import * as errors from "../../errors/index";
import * as Polytomic from "../index";
import * as core from "../../core";

export class BadRequestError extends errors.PolytomicError {
constructor(body: Polytomic.ApiError) {
constructor(body: Polytomic.ApiError, rawResponse?: core.RawResponse) {
super({
message: "BadRequestError",
statusCode: 400,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, BadRequestError.prototype);
}
Expand Down
4 changes: 3 additions & 1 deletion src/api/errors/ConflictError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

import * as errors from "../../errors/index";
import * as Polytomic from "../index";
import * as core from "../../core";

export class ConflictError extends errors.PolytomicError {
constructor(body: Polytomic.ApiError) {
constructor(body: Polytomic.ApiError, rawResponse?: core.RawResponse) {
super({
message: "ConflictError",
statusCode: 409,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, ConflictError.prototype);
}
Expand Down
4 changes: 3 additions & 1 deletion src/api/errors/ForbiddenError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

import * as errors from "../../errors/index";
import * as Polytomic from "../index";
import * as core from "../../core";

export class ForbiddenError extends errors.PolytomicError {
constructor(body: Polytomic.ApiError) {
constructor(body: Polytomic.ApiError, rawResponse?: core.RawResponse) {
super({
message: "ForbiddenError",
statusCode: 403,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, ForbiddenError.prototype);
}
Expand Down
4 changes: 3 additions & 1 deletion src/api/errors/InternalServerError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

import * as errors from "../../errors/index";
import * as Polytomic from "../index";
import * as core from "../../core";

export class InternalServerError extends errors.PolytomicError {
constructor(body: Polytomic.ApiError) {
constructor(body: Polytomic.ApiError, rawResponse?: core.RawResponse) {
super({
message: "InternalServerError",
statusCode: 500,
body: body,
rawResponse: rawResponse,
});
Object.setPrototypeOf(this, InternalServerError.prototype);
}
Expand Down
Loading
Loading