@interfere/sdk 0.0.1 → 0.1.0-alpha.32

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/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @interfere/sdk
2
+
3
+ ## 0.1.0-alpha.32
4
+
5
+ ### Minor Changes
6
+
7
+ - [`949b3e2`](https://github.com/interfere-inc/interfere/commit/949b3e27002091477e4fdbd37e6c77d6de4ff780) Thanks [@skve](https://github.com/skve)! - Fixed dependency graph
8
+
9
+ ## 0.0.1-alpha.31
10
+
11
+ ### Patch Changes
12
+
13
+ - [`2847cd7`](https://github.com/interfere-inc/interfere/commit/2847cd75cd9a067e6b265864f1ed01c01ffe8a22) Thanks [@skve](https://github.com/skve)! - Improvements, Native Next.js 16 support, and huge performance improvements.
package/FUNCTIONS.md ADDED
@@ -0,0 +1,85 @@
1
+ # Standalone Functions
2
+
3
+ > [!NOTE]
4
+ > This section is useful if you are using a bundler and targetting browsers and
5
+ > runtimes where the size of an application affects performance and load times.
6
+
7
+ Every method in this SDK is also available as a standalone function. This
8
+ alternative API is suitable when targetting the browser or serverless runtimes
9
+ and using a bundler to build your application since all unused functionality
10
+ will be tree-shaken away. This includes code for unused methods, Zod schemas,
11
+ encoding helpers and response handlers. The result is dramatically smaller
12
+ impact on the application's final bundle size which grows very slowly as you use
13
+ more and more functionality from this SDK.
14
+
15
+ Calling methods through the main SDK class remains a valid and generally more
16
+ more ergonomic option. Standalone functions represent an optimisation for a
17
+ specific category of applications.
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import { InterfereCore } from "@interfere/sdk/core.js";
23
+ import { getHealth } from "@interfere/sdk/funcs/get-health.js";
24
+
25
+ // Use `InterfereCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const interfere = new InterfereCore();
28
+
29
+ async function run() {
30
+ const res = await getHealth(interfere);
31
+ if (res.ok) {
32
+ const { value: result } = res;
33
+ console.log(result);
34
+ } else {
35
+ console.log("getHealth failed:", res.error);
36
+ }
37
+ }
38
+
39
+ run();
40
+ ```
41
+
42
+ ## Result types
43
+
44
+ Standalone functions differ from SDK methods in that they return a
45
+ `Result<Value, Error>` type to capture _known errors_ and document them using
46
+ the type system. By avoiding throwing errors, application code maintains clear
47
+ control flow and error-handling become part of the regular flow of application
48
+ code.
49
+
50
+ > We use the term "known errors" because standalone functions, and JavaScript
51
+ > code in general, can still throw unexpected errors such as `TypeError`s,
52
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
53
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
54
+ > of benefit from capturing most errors and turning them into values.
55
+
56
+ The second reason for this style of programming is because these functions will
57
+ typically be used in front-end applications where exception throwing is
58
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
59
+ and libraries tend to promote this style of programming so that components
60
+ render useful content under all states (loading, success, error and so on).
61
+
62
+ The general pattern when calling standalone functions looks like this:
63
+
64
+ ```typescript
65
+ import { Core } from "<sdk-package-name>";
66
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
67
+
68
+ const client = new Core();
69
+
70
+ async function run() {
71
+ const result = await fetchSomething(client, { id: "123" });
72
+ if (!result.ok) {
73
+ // You can throw the error or handle it. It's your choice now.
74
+ throw result.error;
75
+ }
76
+
77
+ console.log(result.value);
78
+ }
79
+
80
+ run();
81
+ ```
82
+
83
+ Notably, `result.error` above will have an explicit type compared to a try-catch
84
+ variation where the error in the catch block can only be of type `unknown` (or
85
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,426 @@
1
+ # openapi
2
+
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *openapi* API.
4
+
5
+ [![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=openapi&utm_campaign=typescript)
6
+ [![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)
7
+
8
+
9
+ <br /><br />
10
+ > [!IMPORTANT]
11
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/interfere/api). Delete this section before > publishing to a package manager.
12
+
13
+ <!-- Start Summary [summary] -->
14
+ ## Summary
15
+
16
+ Interfere Collector API: Public ingestion API for Interfere SDKs
17
+ <!-- End Summary [summary] -->
18
+
19
+ <!-- Start Table of Contents [toc] -->
20
+ ## Table of Contents
21
+ <!-- $toc-max-depth=2 -->
22
+ * [openapi](#openapi)
23
+ * [SDK Installation](#sdk-installation)
24
+ * [Requirements](#requirements)
25
+ * [SDK Example Usage](#sdk-example-usage)
26
+ * [Available Resources and Operations](#available-resources-and-operations)
27
+ * [Standalone functions](#standalone-functions)
28
+ * [File uploads](#file-uploads)
29
+ * [Retries](#retries)
30
+ * [Error Handling](#error-handling)
31
+ * [Server Selection](#server-selection)
32
+ * [Custom HTTP Client](#custom-http-client)
33
+ * [Debugging](#debugging)
34
+ * [Development](#development)
35
+ * [Maturity](#maturity)
36
+ * [Contributions](#contributions)
37
+
38
+ <!-- End Table of Contents [toc] -->
39
+
40
+ <!-- Start SDK Installation [installation] -->
41
+ ## SDK Installation
42
+
43
+ > [!TIP]
44
+ > To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
45
+
46
+
47
+ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
48
+
49
+ ### NPM
50
+
51
+ ```bash
52
+ npm add <UNSET>
53
+ ```
54
+
55
+ ### PNPM
56
+
57
+ ```bash
58
+ pnpm add <UNSET>
59
+ ```
60
+
61
+ ### Bun
62
+
63
+ ```bash
64
+ bun add <UNSET>
65
+ ```
66
+
67
+ ### Yarn
68
+
69
+ ```bash
70
+ yarn add <UNSET>
71
+ ```
72
+
73
+ > [!NOTE]
74
+ > This package is published with CommonJS and ES Modules (ESM) support.
75
+ <!-- End SDK Installation [installation] -->
76
+
77
+ <!-- Start Requirements [requirements] -->
78
+ ## Requirements
79
+
80
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
81
+ <!-- End Requirements [requirements] -->
82
+
83
+ <!-- Start SDK Example Usage [usage] -->
84
+ ## SDK Example Usage
85
+
86
+ ### Example
87
+
88
+ ```typescript
89
+ import { Interfere } from "@interfere/sdk";
90
+
91
+ const interfere = new Interfere();
92
+
93
+ async function run() {
94
+ const result = await interfere.getHealth();
95
+
96
+ console.log(result);
97
+ }
98
+
99
+ run();
100
+
101
+ ```
102
+ <!-- End SDK Example Usage [usage] -->
103
+
104
+ <!-- Start Available Resources and Operations [operations] -->
105
+ ## Available Resources and Operations
106
+
107
+ <details open>
108
+ <summary>Available methods</summary>
109
+
110
+ ### [Interfere SDK](docs/sdks/interfere/README.md)
111
+
112
+ * [getHealth](docs/sdks/interfere/README.md#gethealth)
113
+
114
+ ### [Releases](docs/sdks/releases/README.md)
115
+
116
+ * [createRelease](docs/sdks/releases/README.md#createrelease)
117
+ * [uploadSourceMaps](docs/sdks/releases/README.md#uploadsourcemaps)
118
+
119
+ ### [Session](docs/sdks/session/README.md)
120
+
121
+ * [identifySession](docs/sdks/session/README.md#identifysession)
122
+ * [createSession](docs/sdks/session/README.md#createsession)
123
+
124
+ </details>
125
+ <!-- End Available Resources and Operations [operations] -->
126
+
127
+ <!-- Start Standalone functions [standalone-funcs] -->
128
+ ## Standalone functions
129
+
130
+ All the methods listed above are available as standalone functions. These
131
+ functions are ideal for use in applications running in the browser, serverless
132
+ runtimes or other environments where application bundle size is a primary
133
+ concern. When using a bundler to build your application, all unused
134
+ functionality will be either excluded from the final bundle or tree-shaken away.
135
+
136
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
137
+
138
+ <details>
139
+
140
+ <summary>Available standalone functions</summary>
141
+
142
+ - [`getHealth`](docs/sdks/interfere/README.md#gethealth)
143
+ - [`releasesCreateRelease`](docs/sdks/releases/README.md#createrelease)
144
+ - [`releasesUploadSourceMaps`](docs/sdks/releases/README.md#uploadsourcemaps)
145
+ - [`sessionCreateSession`](docs/sdks/session/README.md#createsession)
146
+ - [`sessionIdentifySession`](docs/sdks/session/README.md#identifysession)
147
+
148
+ </details>
149
+ <!-- End Standalone functions [standalone-funcs] -->
150
+
151
+ <!-- Start File uploads [file-upload] -->
152
+ ## File uploads
153
+
154
+ Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
155
+
156
+ > [!TIP]
157
+ >
158
+ > Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
159
+ >
160
+ > - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
161
+ > - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
162
+ > - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
163
+ > - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
164
+
165
+ ```typescript
166
+ import { Interfere } from "@interfere/sdk";
167
+
168
+ const interfere = new Interfere();
169
+
170
+ async function run() {
171
+ const result = await interfere.releases.uploadSourceMaps({
172
+ releaseSlug: "<value>",
173
+ body: {
174
+ files: [],
175
+ metadata: {
176
+ sourceMapToGenerated: {
177
+ "key": "<value>",
178
+ "key1": "<value>",
179
+ "key2": "<value>",
180
+ },
181
+ hashes: {},
182
+ },
183
+ },
184
+ });
185
+
186
+ console.log(result);
187
+ }
188
+
189
+ run();
190
+
191
+ ```
192
+ <!-- End File uploads [file-upload] -->
193
+
194
+ <!-- Start Retries [retries] -->
195
+ ## Retries
196
+
197
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
198
+
199
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
200
+ ```typescript
201
+ import { Interfere } from "@interfere/sdk";
202
+
203
+ const interfere = new Interfere();
204
+
205
+ async function run() {
206
+ const result = await interfere.getHealth({
207
+ retries: {
208
+ strategy: "backoff",
209
+ backoff: {
210
+ initialInterval: 1,
211
+ maxInterval: 50,
212
+ exponent: 1.1,
213
+ maxElapsedTime: 100,
214
+ },
215
+ retryConnectionErrors: false,
216
+ },
217
+ });
218
+
219
+ console.log(result);
220
+ }
221
+
222
+ run();
223
+
224
+ ```
225
+
226
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
227
+ ```typescript
228
+ import { Interfere } from "@interfere/sdk";
229
+
230
+ const interfere = new Interfere({
231
+ retryConfig: {
232
+ strategy: "backoff",
233
+ backoff: {
234
+ initialInterval: 1,
235
+ maxInterval: 50,
236
+ exponent: 1.1,
237
+ maxElapsedTime: 100,
238
+ },
239
+ retryConnectionErrors: false,
240
+ },
241
+ });
242
+
243
+ async function run() {
244
+ const result = await interfere.getHealth();
245
+
246
+ console.log(result);
247
+ }
248
+
249
+ run();
250
+
251
+ ```
252
+ <!-- End Retries [retries] -->
253
+
254
+ <!-- Start Error Handling [errors] -->
255
+ ## Error Handling
256
+
257
+ [`InterfereHTTPError`](./src/models/errors/interfere-http-error.ts) is the base class for all HTTP error responses. It has the following properties:
258
+
259
+ | Property | Type | Description |
260
+ | ------------------- | ---------- | ------------------------------------------------------ |
261
+ | `error.message` | `string` | Error message |
262
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
263
+ | `error.headers` | `Headers` | HTTP response headers |
264
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
265
+ | `error.rawResponse` | `Response` | Raw HTTP response |
266
+
267
+ ### Example
268
+ ```typescript
269
+ import { Interfere } from "@interfere/sdk";
270
+ import { InterfereHTTPError } from "@interfere/sdk/models/errors/interfere-http-error.js.js";
271
+
272
+ const interfere = new Interfere();
273
+
274
+ async function run() {
275
+ try {
276
+ const result = await interfere.getHealth();
277
+
278
+ console.log(result);
279
+ } catch (error) {
280
+ if (error instanceof InterfereHTTPError) {
281
+ console.log(error.message);
282
+ console.log(error.statusCode);
283
+ console.log(error.body);
284
+ console.log(error.headers);
285
+ }
286
+ }
287
+ }
288
+
289
+ run();
290
+
291
+ ```
292
+
293
+ ### Error Classes
294
+ **Primary error:**
295
+ * [`InterfereHTTPError`](./src/models/errors/interfere-http-error.ts): The base class for HTTP error responses.
296
+
297
+ <details><summary>Less common errors (6)</summary>
298
+
299
+ <br />
300
+
301
+ **Network errors:**
302
+ * [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
303
+ * [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
304
+ * [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
305
+ * [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
306
+ * [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
307
+
308
+
309
+ **Inherit from [`InterfereHTTPError`](./src/models/errors/interfere-http-error.ts)**:
310
+ * [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
311
+
312
+ </details>
313
+ <!-- End Error Handling [errors] -->
314
+
315
+ <!-- Start Server Selection [server] -->
316
+ ## Server Selection
317
+
318
+ ### Override Server URL Per-Client
319
+
320
+ The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
321
+ ```typescript
322
+ import { Interfere } from "@interfere/sdk";
323
+
324
+ const interfere = new Interfere({
325
+ serverURL: "https://in.interfere.com",
326
+ });
327
+
328
+ async function run() {
329
+ const result = await interfere.getHealth();
330
+
331
+ console.log(result);
332
+ }
333
+
334
+ run();
335
+
336
+ ```
337
+ <!-- End Server Selection [server] -->
338
+
339
+ <!-- Start Custom HTTP Client [http-client] -->
340
+ ## Custom HTTP Client
341
+
342
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
343
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
344
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
345
+ around the request lifecycle that can be used to modify the request or handle
346
+ errors and response.
347
+
348
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
349
+ used to integrate a third-party HTTP client or when writing tests to mock out
350
+ the HTTP client and feed in fixtures.
351
+
352
+ The following example shows how to:
353
+ - route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
354
+ - use the `"beforeRequest"` hook to add a custom header and a timeout to requests
355
+ - use the `"requestError"` hook to log errors
356
+
357
+ ```typescript
358
+ import { Interfere } from "@interfere/sdk";
359
+ import { ProxyAgent } from "undici";
360
+ import { HTTPClient } from "@interfere/sdk/lib/http";
361
+
362
+ const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
363
+
364
+ const httpClient = new HTTPClient({
365
+ // 'fetcher' takes a function that has the same signature as native 'fetch'.
366
+ fetcher: (input, init) =>
367
+ // 'dispatcher' is specific to undici and not part of the standard Fetch API.
368
+ fetch(input, { ...init, dispatcher } as RequestInit),
369
+ });
370
+
371
+ httpClient.addHook("beforeRequest", (request) => {
372
+ const nextRequest = new Request(request, {
373
+ signal: request.signal || AbortSignal.timeout(5000)
374
+ });
375
+
376
+ nextRequest.headers.set("x-custom-header", "custom value");
377
+
378
+ return nextRequest;
379
+ });
380
+
381
+ httpClient.addHook("requestError", (error, request) => {
382
+ console.group("Request Error");
383
+ console.log("Reason:", `${error}`);
384
+ console.log("Endpoint:", `${request.method} ${request.url}`);
385
+ console.groupEnd();
386
+ });
387
+
388
+ const sdk = new Interfere({ httpClient: httpClient });
389
+ ```
390
+ <!-- End Custom HTTP Client [http-client] -->
391
+
392
+ <!-- Start Debugging [debug] -->
393
+ ## Debugging
394
+
395
+ You can setup your SDK to emit debug logs for SDK requests and responses.
396
+
397
+ You can pass a logger that matches `console`'s interface as an SDK option.
398
+
399
+ > [!WARNING]
400
+ > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
401
+
402
+ ```typescript
403
+ import { Interfere } from "@interfere/sdk";
404
+
405
+ const sdk = new Interfere({ debugLogger: console });
406
+ ```
407
+
408
+ You can also enable a default debug logger by setting an environment variable `INTERFERE_DEBUG` to true.
409
+ <!-- End Debugging [debug] -->
410
+
411
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
412
+
413
+ # Development
414
+
415
+ ## Maturity
416
+
417
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
418
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
419
+ looking for the latest version.
420
+
421
+ ## Contributions
422
+
423
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
424
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
425
+
426
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=openapi&utm_campaign=typescript)
package/RUNTIMES.md ADDED
@@ -0,0 +1,48 @@
1
+ # Supported JavaScript runtimes
2
+
3
+ This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
4
+
5
+ - [Web Fetch API][web-fetch]
6
+ - [Web Streams API][web-streams] and in particular `ReadableStream`
7
+ - [Async iterables][async-iter] using `Symbol.asyncIterator`
8
+
9
+ [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
10
+ [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
11
+ [async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
12
+
13
+ Runtime environments that are explicitly supported are:
14
+
15
+ - Evergreen browsers which include: Chrome, Safari, Edge, Firefox
16
+ - Node.js active and maintenance LTS releases
17
+ - Currently, this is v18 and v20
18
+ - Bun v1 and above
19
+ - Deno v1.39
20
+ - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
21
+
22
+ [deno-file-streaming]: https://github.com/denoland/deno/issues/11018
23
+
24
+ ## Recommended TypeScript compiler options
25
+
26
+ The following `tsconfig.json` options are recommended for projects using this
27
+ SDK in order to get static type support for features like async iterables,
28
+ streams and `fetch`-related APIs ([`for await...of`][for-await-of],
29
+ [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
30
+ so on):
31
+
32
+ [for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
33
+ [abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
34
+ [request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
35
+ [response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
36
+
37
+ ```jsonc
38
+ {
39
+ "compilerOptions": {
40
+ "target": "es2020", // or higher
41
+ "lib": ["es2020", "dom", "dom.iterable"]
42
+ }
43
+ }
44
+ ```
45
+
46
+ While `target` can be set to older ECMAScript versions, it may result in extra,
47
+ unnecessary compatibility code being generated if you are not targeting old
48
+ runtimes.
package/jsr.json ADDED
@@ -0,0 +1,27 @@
1
+
2
+
3
+ {
4
+ "name": "@interfere/sdk",
5
+ "version": "0.0.1-alpha.30",
6
+ "exports": {
7
+ ".": "./src/index.ts",
8
+ "./models/errors": "./src/models/errors/index.ts",
9
+ "./models": "./src/models/index.ts",
10
+ "./models/operations": "./src/models/operations/index.ts",
11
+ "./lib/config": "./src/lib/config.ts",
12
+ "./lib/http": "./src/lib/http.ts",
13
+ "./lib/retries": "./src/lib/retries.ts",
14
+ "./lib/sdks": "./src/lib/sdks.ts",
15
+ "./types": "./src/types/index.ts"
16
+ },
17
+ "publish": {
18
+ "include": [
19
+ "LICENSE",
20
+ "README.md",
21
+ "RUNTIMES.md",
22
+ "USAGE.md",
23
+ "jsr.json",
24
+ "src/**/*.ts"
25
+ ]
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,18 +1,83 @@
1
1
  {
2
2
  "name": "@interfere/sdk",
3
- "version": "0.0.1",
4
- "main": "./dist/index.js",
5
- "module": "./dist/index.mjs",
6
- "types": "./dist/index.d.ts",
3
+ "version": "0.1.0-alpha.32",
4
+ "author": "Interfere",
5
+ "bugs": {
6
+ "url": "mailto:support@interfere.com"
7
+ },
8
+ "homepage": "https://interfere.com",
9
+ "license": "UNLICENSED",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "tshy": {
14
+ "sourceDialects": [
15
+ "@source"
16
+ ],
17
+ "exports": {
18
+ ".": "./src/index.ts",
19
+ "./package.json": "./package.json",
20
+ "./*.js": "./src/*.ts",
21
+ "./*": "./src/*.ts"
22
+ }
23
+ },
24
+ "type": "module",
25
+ "sideEffects": false,
7
26
  "scripts": {
8
- "build": "tsup src/index.ts --format cjs,esm --dts",
9
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
10
- "check-types": "tsc --noEmit"
27
+ "lint": "eslint --cache --max-warnings=0 src",
28
+ "build": "tshy",
29
+ "prepublishOnly": "npm run build",
30
+ "format": "biome format --write src",
31
+ "postbuild": "rm -rf dist/node_modules"
11
32
  },
33
+ "module": "./dist/esm/index.js",
12
34
  "devDependencies": {
13
- "tsup": "^8.5.0",
14
- "@interfere/typescript-config": "workspace:*",
15
- "@types/node": "22.15.29",
16
- "typescript": "5.8.3"
17
- }
35
+ "@eslint/js": "^10.0.1",
36
+ "eslint": "^10.0.0",
37
+ "globals": "^17.3.0",
38
+ "tshy": "^3.2.0",
39
+ "typescript": "5.9.3",
40
+ "typescript-eslint": "^8.57.0"
41
+ },
42
+ "dependencies": {
43
+ "zod": "^4.3.6"
44
+ },
45
+ "exports": {
46
+ ".": {
47
+ "import": {
48
+ "@source": "./src/index.ts",
49
+ "types": "./dist/esm/index.d.ts",
50
+ "default": "./dist/esm/index.js"
51
+ },
52
+ "require": {
53
+ "types": "./dist/commonjs/index.d.ts",
54
+ "default": "./dist/commonjs/index.js"
55
+ }
56
+ },
57
+ "./package.json": "./package.json",
58
+ "./*.js": {
59
+ "import": {
60
+ "@source": "./src/*.ts",
61
+ "types": "./dist/esm/*.d.ts",
62
+ "default": "./dist/esm/*.js"
63
+ },
64
+ "require": {
65
+ "types": "./dist/commonjs/*.d.ts",
66
+ "default": "./dist/commonjs/*.js"
67
+ }
68
+ },
69
+ "./*": {
70
+ "import": {
71
+ "@source": "./src/*.ts",
72
+ "types": "./dist/esm/*.d.ts",
73
+ "default": "./dist/esm/*.js"
74
+ },
75
+ "require": {
76
+ "types": "./dist/commonjs/*.d.ts",
77
+ "default": "./dist/commonjs/*.js"
78
+ }
79
+ }
80
+ },
81
+ "main": "./dist/commonjs/index.js",
82
+ "types": "./dist/commonjs/index.d.ts"
18
83
  }
@@ -1,4 +0,0 @@
1
-
2
- > @ordinary/fonts@0.0.0 check-types /home/runner/work/repo/repo/packages/fonts
3
- > tsc --noEmit
4
-
@@ -1,5 +0,0 @@
1
-
2
- 
3
- > @ordinary/fonts@0.0.0 lint /Users/sh/Developer/repo/packages/fonts
4
- > eslint . --max-warnings 0
5
-
package/dist/index.d.mts DELETED
@@ -1,3 +0,0 @@
1
- declare function test(): string;
2
-
3
- export { test };
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare function test(): string;
2
-
3
- export { test };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,WAEnB"}
package/dist/index.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- test: () => test
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
- function test() {
27
- return "Hello, world!";
28
- }
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- test
32
- });
package/dist/index.mjs DELETED
@@ -1,7 +0,0 @@
1
- // src/index.ts
2
- function test() {
3
- return "Hello, world!";
4
- }
5
- export {
6
- test
7
- };
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export function test() {
2
- return 'Hello, world!';
3
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@interfere/typescript-config/base.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "rootDir": "src"
6
- },
7
- "include": ["src"],
8
- "exclude": ["node_modules", "dist"]
9
- }
package/turbo.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": ["//"],
3
- "tasks": {
4
- "build": {
5
- "inputs": ["./src/**"],
6
- "outputs": ["./dist/**"]
7
- }
8
- }
9
- }