@hellopivot/sdk 0.0.1
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/index.d.mts +1664 -0
- package/dist/index.mjs +829 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pivot Technologies Holdings Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @hellopivot/sdk
|
|
2
|
+
|
|
3
|
+
The official Pivot SDK for JavaScript and TypeScript.
|
|
4
|
+
|
|
5
|
+
- **Type-safe** — All API types are generated from the Pivot OpenAPI specification
|
|
6
|
+
- **Retries** — Automatic retries with exponential backoff and jitter
|
|
7
|
+
- **Pagination** — Helpers for both offset-based and cursor-based pagination
|
|
8
|
+
- **ESM-only** — Modern ES module package for Node.js 18+
|
|
9
|
+
- **Zero dependencies** — Uses only the built-in Fetch API
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @hellopivot/sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import Pivot from '@hellopivot/sdk';
|
|
21
|
+
|
|
22
|
+
const pivot = new Pivot({ apiKey: 'your-api-key' });
|
|
23
|
+
|
|
24
|
+
// List spaces
|
|
25
|
+
const { spaces } = await pivot.spaces.getSpacesByOrganizationId(orgId, 0);
|
|
26
|
+
|
|
27
|
+
// Get a block
|
|
28
|
+
const { block } = await pivot.blocks.getBlockById(blockId);
|
|
29
|
+
|
|
30
|
+
// Create a webhook
|
|
31
|
+
const { webhook, secret } = await pivot.webhooks.createWebhook(orgId, {
|
|
32
|
+
name: 'My Webhook',
|
|
33
|
+
endpointUrl: 'https://example.com/webhook',
|
|
34
|
+
subscriptions: [{ eventType: 'message.created', scope: 'organization' }],
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
Full documentation is available at [pivot.app/docs/developers/sdks/javascript-typescript](https://pivot.app/docs/developers/sdks/javascript-typescript).
|
|
41
|
+
|
|
42
|
+
## Development
|
|
43
|
+
|
|
44
|
+
This SDK lives in the Pivot monorepo at `libs/pivot-sdk/`.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Generate types from OpenAPI spec
|
|
48
|
+
pnpm nx codegen pivot-sdk
|
|
49
|
+
|
|
50
|
+
# Run tests
|
|
51
|
+
pnpm nx test pivot-sdk
|
|
52
|
+
|
|
53
|
+
# Build
|
|
54
|
+
pnpm nx build pivot-sdk
|
|
55
|
+
|
|
56
|
+
# Lint
|
|
57
|
+
pnpm nx lint pivot-sdk
|
|
58
|
+
|
|
59
|
+
# Type-check
|
|
60
|
+
pnpm nx type-check pivot-sdk
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Code Generation
|
|
64
|
+
|
|
65
|
+
The SDK types and resource classes are generated from `apps/rest/openapi.yaml` by running the codegen script. This ensures the SDK stays in sync with the API. When the OpenAPI spec changes, re-run codegen:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pnpm nx codegen pivot-sdk
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|