@lepsto/sdk-app 85.0.0 → 87.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/README.md +38 -6
- package/dist/{chunk-HRKHYP5B.js → chunk-EMK3O6JA.js} +4 -4
- package/dist/{chunk-HRKHYP5B.js.map → chunk-EMK3O6JA.js.map} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/playground/index.cjs.map +1 -1
- package/dist/playground/index.js +1 -1
- package/docs/README.md +6 -6
- package/docs/recipes/access.md +12 -12
- package/docs/recipes/local-dev.md +2 -2
- package/docs/recipes/sdk-usage.md +11 -11
- package/docs/rules.md +10 -10
- package/package.json +13 -2
- package/src/gen/bindings.gen.ts +2 -2
- package/src/gen/manifest.gen.ts +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,49 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @lepsto/sdk-app
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The Lepsto SDK for App is a TypeScript SDK that provides runtime bindings and type-safe generated code for interacting with Lepsto Platform APIs and services. This package generates type definitions and client bindings from API catalogs, enabling developers to build applications that consume Lepsto platform services with full type safety and autocompletion.
|
|
4
4
|
|
|
5
5
|
**Note:** The `src/gen` directory contains generated SDK code and should not be edited by hand. Generated files are produced by running `npm run generate` with an API catalog.
|
|
6
6
|
|
|
7
7
|
The committed `src/gen` is a **convenience snapshot** — it lets the repo type-check, test, and build offline. It is **not** the source of truth: canonical generation happens **at publish time**, when Cloud Build regenerates `src/gen` from the live catalog before publishing. The catalog is **mid-migration**, so the committed snapshot's namespaces (currently `organization` and `playground`) will **grow as platform extensions migrate to `@lessly-platform/tools`** — a namespace only appears once its tools carry a REST binding (tools without one are excluded until migrated). Regenerate the snapshot with `npx tsx scripts/generate.ts <catalog.json> src/gen && npm run sync-exports` against the live catalog (`https://api.lessly.dev/catalog/tools`).
|
|
8
8
|
|
|
9
|
+
## Package name: `@lepsto/sdk-app` (and legacy `@lessly/sdk-app`)
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i @lepsto/sdk-app
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The package is published on public npmjs as **`@lepsto/sdk-app`** and, during the transition,
|
|
16
|
+
**also** as `@lessly/sdk-app` — same build, same version, identical `exports` map. The old name is
|
|
17
|
+
not deprecated.
|
|
18
|
+
|
|
19
|
+
`package.json` keeps `name: @lessly/sdk-app` on purpose: the dev-console SDK-rebuild Cloud Build
|
|
20
|
+
job derives `PKG` from it (`require('./package.json').name`) for its `npm view` probe and runs
|
|
21
|
+
`npm run publish:npmjs -- --tag <channel>`. The new name is the **derived** tarball.
|
|
22
|
+
|
|
23
|
+
| Script | Publishes | Contract |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `npm run publish:npmjs -- --tag <channel>` | `@lessly/sdk-app` | unchanged; token with write on `@lessly` |
|
|
26
|
+
| `npm run publish:npmjs:lepsto -- --tag <channel>` | `@lepsto/sdk-app` | same args as `publish:npmjs`; token with write on `@lepsto` |
|
|
27
|
+
|
|
28
|
+
`publish:npmjs:lepsto` (`scripts/publish-alias.ts`) builds once, `npm pack`s, rewrites `name` and `description`
|
|
29
|
+
(the Lepsto text; `package.json` keeps the legacy description for `@lessly/sdk-app`),
|
|
30
|
+
checks every `exports` target is in the tarball, and publishes with `--registry` and
|
|
31
|
+
`--@lepsto:registry` pinned. Run it after `publish:npmjs` against the same checkout so both names
|
|
32
|
+
carry the same version.
|
|
33
|
+
|
|
34
|
+
**Bootstrap** (`.github/workflows/publish-lepsto.yml`, manual): mirrors already-published legacy
|
|
35
|
+
tarballs instead of rebuilding — `npm pack @lessly/sdk-app@<v>`, rewrite `name` and `description`, drop
|
|
36
|
+
`publishConfig.registry`, publish as `@lepsto/sdk-app@<v>` (`tsx scripts/publish-alias.ts --mirror
|
|
37
|
+
84.0.0:latest,85.0.0:next`). Versions that already exist are skipped. It uses `NPM_BOOTSTRAP_TOKEN`
|
|
38
|
+
and is ready for npm Trusted Publishing (`id-token: write`, npm >= 11.5.1, token only in the publish
|
|
39
|
+
step's env).
|
|
40
|
+
|
|
9
41
|
## Usage
|
|
10
42
|
|
|
11
43
|
Create a client with `createLesslyApp`, then call operations through the Proxy namespace tree:
|
|
12
44
|
|
|
13
45
|
```ts
|
|
14
|
-
import { createLesslyApp } from '@
|
|
46
|
+
import { createLesslyApp } from '@lepsto/sdk-app';
|
|
15
47
|
|
|
16
48
|
const sdk = createLesslyApp({
|
|
17
49
|
baseUrl: 'https://api.lessly.dev', // or a page-relative '/api' in the browser
|
|
@@ -52,7 +84,7 @@ operation as a **step**. `src/gen/manifest.gen.ts` exports the whole table, re-e
|
|
|
52
84
|
package root:
|
|
53
85
|
|
|
54
86
|
```ts
|
|
55
|
-
import { compositions } from '@
|
|
87
|
+
import { compositions } from '@lepsto/sdk-app';
|
|
56
88
|
|
|
57
89
|
if ('mail_domain_create' in compositions) {
|
|
58
90
|
const step = compositions['mail_domain_create'];
|
|
@@ -86,7 +118,7 @@ without the `lessly_csrf` cookie fail before the network with `status: 0` and
|
|
|
86
118
|
|
|
87
119
|
### TanStack Query
|
|
88
120
|
|
|
89
|
-
Each namespace subpath (`@
|
|
121
|
+
Each namespace subpath (`@lepsto/sdk-app/<namespace>`) also ships framework-agnostic
|
|
90
122
|
query/mutation **option factories** — plain objects, not hooks — usable with any
|
|
91
123
|
TanStack Query adapter (React, Solid, Vue, Svelte). You pass the `sdk` instance
|
|
92
124
|
explicitly:
|
|
@@ -97,7 +129,7 @@ import { useQuery, useMutation } from '@tanstack/react-query';
|
|
|
97
129
|
import {
|
|
98
130
|
organizationConnectorsListQueryOptions,
|
|
99
131
|
organizationProductCreateMutationOptions,
|
|
100
|
-
} from '@
|
|
132
|
+
} from '@lepsto/sdk-app/organization';
|
|
101
133
|
|
|
102
134
|
function Connectors() {
|
|
103
135
|
const { data } = useQuery(organizationConnectorsListQueryOptions(sdk, { productId: 'prod_123' }));
|
|
@@ -11045,7 +11045,7 @@ var bindings = {
|
|
|
11045
11045
|
"readOnly": true
|
|
11046
11046
|
},
|
|
11047
11047
|
"set": {
|
|
11048
|
-
"level": "
|
|
11048
|
+
"level": "admin",
|
|
11049
11049
|
"method": "POST",
|
|
11050
11050
|
"operationKey": "workflow_killswitch_set",
|
|
11051
11051
|
"params": [
|
|
@@ -11355,7 +11355,7 @@ var bindings = {
|
|
|
11355
11355
|
},
|
|
11356
11356
|
"wait-list": {
|
|
11357
11357
|
"all": {
|
|
11358
|
-
"level": "
|
|
11358
|
+
"level": "admin",
|
|
11359
11359
|
"method": "GET",
|
|
11360
11360
|
"operationKey": "workflow_wait_list_all",
|
|
11361
11361
|
"params": [
|
|
@@ -11393,5 +11393,5 @@ var wsBindings = {
|
|
|
11393
11393
|
};
|
|
11394
11394
|
|
|
11395
11395
|
export { bindings, wsBindings };
|
|
11396
|
-
//# sourceMappingURL=chunk-
|
|
11397
|
-
//# sourceMappingURL=chunk-
|
|
11396
|
+
//# sourceMappingURL=chunk-EMK3O6JA.js.map
|
|
11397
|
+
//# sourceMappingURL=chunk-EMK3O6JA.js.map
|