@stable_sea/sdk 0.2.10 → 0.2.12

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/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export { createStableSeaClient, type StableSeaClient, type StableSeaMutation, ty
2
2
  export type { StableSeaClientOptions } from "./client.js";
3
3
  export type { components, operations, paths } from "./gen/schema.js";
4
4
  export { verifyWebhookSignature, type VerifyWebhookSignatureOptions, } from "./webhooks.js";
5
+ export { createStableSeaSessionClient, type StableSeaSessionClient, type StableSeaSessionClientOptions, } from "./session-client.js";
6
+ export type { components as SessionComponents, operations as SessionOperations, paths as SessionPaths, } from "./gen/session-schema.js";
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { createStableSeaClient, } from "./client.js";
2
2
  export { verifyWebhookSignature, } from "./webhooks.js";
3
+ export { createStableSeaSessionClient, } from "./session-client.js";
@@ -0,0 +1,10 @@
1
+ import createClient, { type ClientOptions } from "openapi-fetch";
2
+ import type { paths } from "./gen/session-schema.js";
3
+ export interface StableSeaSessionClientOptions {
4
+ baseUrl: string;
5
+ deviceId?: string;
6
+ fetch?: ClientOptions["fetch"];
7
+ }
8
+ export type StableSeaSessionClient = ReturnType<typeof createClient<paths>>;
9
+ /** Customer member operations use an existing user session, never an API key. */
10
+ export declare function createStableSeaSessionClient(options: StableSeaSessionClientOptions): StableSeaSessionClient;
@@ -0,0 +1,12 @@
1
+ import createClient, {} from "openapi-fetch";
2
+ /** Customer member operations use an existing user session, never an API key. */
3
+ export function createStableSeaSessionClient(options) {
4
+ if (!options.baseUrl)
5
+ throw new Error("baseUrl is required");
6
+ return createClient({
7
+ baseUrl: options.baseUrl,
8
+ credentials: "include",
9
+ fetch: options.fetch,
10
+ headers: options.deviceId ? { "X-Device-Id": options.deviceId } : undefined,
11
+ });
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stable_sea/sdk",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "repository": "git+https://github.com/StableSea/monorepo.git",
23
23
  "scripts": {
24
- "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/gen && cp -f src/gen/schema.d.ts dist/gen/schema.d.ts",
24
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/gen && cp src/gen/schema.d.ts src/gen/session-schema.d.ts dist/gen/",
25
25
  "generate": "bash scripts/generate.sh",
26
26
  "prepack": "npm run build",
27
27
  "test": "npm run build && npm run test:unit && npm run test:consumer",