Skip to content

Commit 1de08df

Browse files
feat(api): manual updates to open api
1 parent 7e6b11f commit 1de08df

24 files changed

Lines changed: 205 additions & 52 deletions

.github/workflows/publish-npm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/getformo/sdk-node/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
24+
- name: Set up pnpm
25+
uses: pnpm/action-setup@v4
26+
27+
- name: Install dependencies
28+
run: |
29+
pnpm install
30+
31+
- name: Publish to NPM
32+
run: |
33+
bash ./bin/publish-npm
34+
env:
35+
NPM_TOKEN: ${{ secrets.FORMO_NPM_TOKEN || secrets.NPM_TOKEN }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'getformo/sdk-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.FORMO_NPM_TOKEN || secrets.NPM_TOKEN }}
22+

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/formo%2Fsdk-server-side-b7482fb20536be5e4af119a4cea5e4c9a67dc52bbd9ec9f9d9bc8501ac882e52.yml
33
openapi_spec_hash: fd24c348c81fd638e871ee2b17047c04
4-
config_hash: 1fa813bc056db3ef9560fb7e1641748a
4+
config_hash: b28d4d9643edb35bbeac23e2c36d860d

CONTRIBUTING.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g
4242
To install via git:
4343

4444
```sh
45-
$ npm install git+ssh://git@github.com:stainless-sdks/sdk-server-side-typescript.git
45+
$ npm install git+ssh://git@github.com:getformo/sdk-node.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

5050
```sh
5151
# Clone
52-
$ git clone https://www.github.com/stainless-sdks/sdk-server-side-typescript
53-
$ cd sdk-server-side-typescript
52+
$ git clone https://www.github.com/getformo/sdk-node
53+
$ cd sdk-node
5454

5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link @formo/sdk-server-side
58+
$ yarn link @formo/analytics-node
5959

6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -—global @formo/sdk-server-side
63+
$ pnpm link -—global @formo/analytics-node
6464
```
6565

6666
## Running tests
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ pnpm fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/getformo/sdk-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Formo TypeScript API Library
22

3-
[![NPM version](<https://img.shields.io/npm/v/@formo/sdk-server-side.svg?label=npm%20(stable)>)](https://npmjs.org/package/@formo/sdk-server-side) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@formo/sdk-server-side)
3+
[![NPM version](<https://img.shields.io/npm/v/@formo/analytics-node.svg?label=npm%20(stable)>)](https://npmjs.org/package/@formo/analytics-node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@formo/analytics-node)
44

55
This library provides convenient access to the Formo REST API from server-side TypeScript or JavaScript.
66

@@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://git@github.com:stainless-sdks/sdk-server-side-typescript.git
14+
npm install @formo/analytics-node
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install @formo/sdk-server-side`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).
2320

2421
<!-- prettier-ignore -->
2522
```js
26-
import Formo from '@formo/sdk-server-side';
23+
import Formo from '@formo/analytics-node';
2724

2825
const client = new Formo({
2926
apiKey: process.env['FORMO_API_KEY'], // This is the default and can be omitted
@@ -52,7 +49,7 @@ This library includes TypeScript definitions for all request params and response
5249

5350
<!-- prettier-ignore -->
5451
```ts
55-
import Formo from '@formo/sdk-server-side';
52+
import Formo from '@formo/analytics-node';
5653

5754
const client = new Formo({
5855
apiKey: process.env['FORMO_API_KEY'], // This is the default and can be omitted
@@ -233,7 +230,7 @@ The log level can be configured in two ways:
233230
2. Using the `logLevel` client option (overrides the environment variable if set)
234231

235232
```ts
236-
import Formo from '@formo/sdk-server-side';
233+
import Formo from '@formo/analytics-node';
237234

238235
const client = new Formo({
239236
logLevel: 'debug', // Show all log messages
@@ -261,7 +258,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
261258
below the configured level will not be sent to your logger.
262259

263260
```ts
264-
import Formo from '@formo/sdk-server-side';
261+
import Formo from '@formo/analytics-node';
265262
import pino from 'pino';
266263

267264
const logger = pino();
@@ -330,7 +327,7 @@ globalThis.fetch = fetch;
330327
Or pass it to the client:
331328

332329
```ts
333-
import Formo from '@formo/sdk-server-side';
330+
import Formo from '@formo/analytics-node';
334331
import fetch from 'my-fetch';
335332

336333
const client = new Formo({ fetch });
@@ -341,7 +338,7 @@ const client = new Formo({ fetch });
341338
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
342339

343340
```ts
344-
import Formo from '@formo/sdk-server-side';
341+
import Formo from '@formo/analytics-node';
345342

346343
const client = new Formo({
347344
fetchOptions: {
@@ -358,7 +355,7 @@ options to requests:
358355
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
359356

360357
```ts
361-
import Formo from '@formo/sdk-server-side';
358+
import Formo from '@formo/analytics-node';
362359
import * as undici from 'undici';
363360

364361
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
@@ -372,7 +369,7 @@ const client = new Formo({
372369
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
373370

374371
```ts
375-
import Formo from '@formo/sdk-server-side';
372+
import Formo from '@formo/analytics-node';
376373

377374
const client = new Formo({
378375
fetchOptions: {
@@ -384,7 +381,7 @@ const client = new Formo({
384381
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
385382

386383
```ts
387-
import Formo from 'npm:@formo/sdk-server-side';
384+
import Formo from 'npm:@formo/analytics-node';
388385

389386
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
390387
const client = new Formo({
@@ -406,7 +403,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
406403

407404
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
408405

409-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/sdk-server-side-typescript/issues) with questions, bugs, or suggestions.
406+
We are keen for your feedback; please open an [issue](https://www.github.com/getformo/sdk-node/issues) with questions, bugs, or suggestions.
410407

411408
## Requirements
412409

bin/check-release-environment

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
9+
lenErrors=${#errors[@]}
10+
11+
if [[ lenErrors -gt 0 ]]; then
12+
echo -e "Found the following errors in the release environment:\n"
13+
14+
for error in "${errors[@]}"; do
15+
echo -e "- $error\n"
16+
done
17+
18+
exit 1
19+
fi
20+
21+
echo "The environment is ready to push releases!"
22+

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default tseslint.config(
2525
{
2626
patterns: [
2727
{
28-
regex: '^@formo/sdk-server-side(/.*)?',
28+
regex: '^@formo/analytics-node(/.*)?',
2929
message: 'Use a relative import, not a package import.',
3030
},
3131
],

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = {
77
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
88
},
99
moduleNameMapper: {
10-
'^@formo/sdk-server-side$': '<rootDir>/src/index.ts',
11-
'^@formo/sdk-server-side/(.*)$': '<rootDir>/src/$1',
10+
'^@formo/analytics-node$': '<rootDir>/src/index.ts',
11+
'^@formo/analytics-node/(.*)$': '<rootDir>/src/$1',
1212
},
1313
modulePathIgnorePatterns: [
1414
'<rootDir>/ecosystem-tests/',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@formo/sdk-server-side",
2+
"name": "@formo/analytics-node",
33
"version": "0.0.1",
44
"description": "The official TypeScript library for the Formo API",
55
"author": "Formo <>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
9-
"repository": "github:stainless-sdks/sdk-server-side-typescript",
9+
"repository": "github:getformo/sdk-node",
1010
"license": "Apache-2.0",
1111
"packageManager": "pnpm@10.24.0",
1212
"files": [

0 commit comments

Comments
 (0)