@openmeshtak/sdk 0.2.0 → 0.2.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 CHANGED
@@ -4,30 +4,10 @@ The official TypeScript and JavaScript client for the OpenMeshTak REST API.
4
4
 
5
5
  The SDK is generated from the released OpenAPI contract and adds a small handwritten layer for
6
6
  authentication, common operations and predictable problem-details errors. It does not duplicate
7
- Core business rules.
7
+ Core business rules. The SDK version always matches the OpenMeshTak version it was built from and
8
+ works with the later patch releases of that version line. Node.js 24 or newer is required.
8
9
 
9
- ## Local development
10
-
11
- This checkout currently targets OpenMeshTak API `>=0.2.0 <0.3.0` and contains the OpenAPI artifact
12
- from Core `v0.2.0`. It requires Node.js 24 or newer.
13
-
14
- ```powershell
15
- pnpm install
16
- pnpm check
17
- ```
18
-
19
- The SDK is a library, not a server, so there is no long-running development process. `pnpm build`
20
- generates the contract types and writes the importable package to `dist/`.
21
-
22
- To refresh the checked-in contract from a verified Core release checkout:
23
-
24
- ```powershell
25
- pnpm api:sync -- ..\openmeshtak\openapi\openapi.json
26
- pnpm check
27
- ```
28
-
29
- Commit the OpenAPI artifact and generated declarations together. Do not edit
30
- `src/generated/schema.ts` or `src/version.ts` by hand.
10
+ Documentation: https://openmeshtak.github.io/openmeshtak-docs/sdk/
31
11
 
32
12
  ## Usage
33
13
 
@@ -94,42 +74,6 @@ for await (const member of paginate((page) => client.listEventMembers(eventId, {
94
74
  Generated DTOs and operation types for every other operation are exported from
95
75
  `@openmeshtak/sdk/generated`.
96
76
 
97
- ## Releases
98
-
99
- The SDK version always equals the OpenMeshTak Core version it was built from: SDK `0.2.0` belongs
100
- to Core `0.2.0`, SDK `0.2.1` to Core `0.2.1`. It supports every Core patch release of the same
101
- minor version (`>=0.2.0 <0.3.0`), so an older SDK keeps working after a Core patch update. The SDK
102
- is released together with Core and Web.
103
-
104
- Releases are driven by annotated `vMAJOR.MINOR.PATCH[-PRERELEASE]` tags. The release workflow:
105
-
106
- 1. verifies the tag, package version, API compatibility range and OpenAPI checksum;
107
- 2. installs with the frozen lockfile, audits dependencies and runs the complete check;
108
- 3. packs the npm tarball and generates third-party notices plus a CycloneDX SBOM;
109
- 4. publishes `@openmeshtak/sdk` to npm (`latest` for stable versions, `next` for prereleases);
110
- 5. creates a GitHub Release containing the verified tarball, notices and SBOM.
111
-
112
- To prepare a release for Core `0.2.1` by hand:
113
-
114
- ```powershell
115
- pnpm api:sync -- ..openmeshtakopenapiopenapi.json # from Core at tag v0.2.1
116
- pnpm version:set -- 0.2.1
117
- # set openmeshtak.apiVersionRange in package.json to ">=0.2.1 <0.3.0"
118
- pnpm generate
119
- pnpm check
120
- git commit -am "chore(release): 0.2.1"
121
- git tag -a v0.2.1 -m "OpenMeshTak SDK 0.2.1"
122
- git push origin main
123
- git push origin v0.2.1
124
- ```
125
-
126
- The workflow refuses mismatched tags or version metadata. Publishing happens only after the pushed
127
- tag passes all checks.
128
-
129
- npm publishing uses trusted publishing for organization `OpenMeshTAK`, repository
130
- `openmeshtak-sdk` and workflow `release.yml`. For the package's very first publication, a
131
- short-lived granular `NPM_TOKEN` repository secret is used once and removed afterwards.
132
-
133
77
  ## License
134
78
 
135
79
  Apache-2.0
@@ -322,7 +322,7 @@ export interface paths {
322
322
  put: operations["AddTakServerCertificate"];
323
323
  post?: never;
324
324
  /**
325
- * @description Removes an added or ACME certificate and disables ACME; the server then uses one issued by the
325
+ * @description Removes an added, ACME or file certificate and disables ACME and the file reload; the server then uses one issued by the
326
326
  * OpenMeshTak CA.
327
327
  */
328
328
  delete: operations["RemoveTakServerCertificate"];
@@ -331,6 +331,26 @@ export interface paths {
331
331
  patch?: never;
332
332
  trace?: never;
333
333
  };
334
+ "/tak-server/server-certificate/files": {
335
+ parameters: {
336
+ query?: never;
337
+ header?: never;
338
+ path?: never;
339
+ cookie?: never;
340
+ };
341
+ get?: never;
342
+ /**
343
+ * @description Uses the reverse proxy's certificate files, mounted read-only below `certificateDirectory`.
344
+ * Core reloads them every twelve hours, so a certificate the proxy renews is picked up. Disables ACME.
345
+ */
346
+ put: operations["UseTakCertificateFiles"];
347
+ post?: never;
348
+ delete?: never;
349
+ options?: never;
350
+ head?: never;
351
+ patch?: never;
352
+ trace?: never;
353
+ };
334
354
  "/events/{eventId}/tak-traffic": {
335
355
  parameters: {
336
356
  query?: never;
@@ -575,6 +595,26 @@ export interface paths {
575
595
  patch?: never;
576
596
  trace?: never;
577
597
  };
598
+ "/tak-server/acme/test": {
599
+ parameters: {
600
+ query?: never;
601
+ header?: never;
602
+ path?: never;
603
+ cookie?: never;
604
+ };
605
+ get?: never;
606
+ put?: never;
607
+ /**
608
+ * @description Runs the saved settings against Let's Encrypt staging to check the setup without touching the
609
+ * production rate limits. Nothing is installed; a failure is returned as `succeeded: false`.
610
+ */
611
+ post: operations["Test"];
612
+ delete?: never;
613
+ options?: never;
614
+ head?: never;
615
+ patch?: never;
616
+ trace?: never;
617
+ };
578
618
  "/events/{eventId}/tak/configuration": {
579
619
  parameters: {
580
620
  query?: never;
@@ -2420,16 +2460,22 @@ export interface components {
2420
2460
  /** @description The certificate the TAK listeners present. The private key is never returned. */
2421
2461
  TakServerCertificateDto: {
2422
2462
  /**
2423
- * @description OpenMeshTak-issued, administrator-added, or obtained automatically through ACME.
2463
+ * @description OpenMeshTak-issued, administrator-added, obtained automatically through ACME, or read from the reverse proxy's files.
2424
2464
  * @enum {string}
2425
2465
  */
2426
- source: "issued" | "added" | "acme";
2466
+ source: "issued" | "added" | "acme" | "file";
2427
2467
  hostName: string;
2428
2468
  subject: string;
2429
2469
  fingerprintSha256: string;
2430
2470
  /** Format: date-time */
2431
2471
  notAfter: string;
2432
2472
  };
2473
+ TakCertificateFilesDto: {
2474
+ /** @description Full chain, server certificate first, e.g. `live/tak.example.org/fullchain.pem`. */
2475
+ certificateFile: string;
2476
+ /** @description Unencrypted private key, e.g. `live/tak.example.org/privkey.pem`. */
2477
+ keyFile: string;
2478
+ };
2433
2479
  TakServerSettingsDto: {
2434
2480
  /** @description Whether the TAK listeners run. Requires a host name. */
2435
2481
  enabled: boolean;
@@ -2448,6 +2494,10 @@ export interface components {
2448
2494
  clientCertificateDays: number;
2449
2495
  /** @description `null` until the server first starts or a certificate is added. */
2450
2496
  serverCertificate: components["schemas"]["TakServerCertificateDto"] | null;
2497
+ /** @description The reverse proxy's certificate files Core reads, relative to `certificateDirectory`; `null` unless used. */
2498
+ certificateFiles: components["schemas"]["TakCertificateFilesDto"] | null;
2499
+ /** @description Where the proxy's certificate directory must be mounted for `certificateFiles`. */
2500
+ certificateDirectory: string;
2451
2501
  /**
2452
2502
  * Format: date-time
2453
2503
  * @description When the public host name or a port last changed after setup; `null` if never. Apps enrolled
@@ -2505,6 +2555,11 @@ export interface components {
2505
2555
  */
2506
2556
  privateKeyPem: string;
2507
2557
  };
2558
+ /** @description Use the reverse proxy's certificate files; both paths are relative to the mounted directory. */
2559
+ UseTakCertificateFilesRequest: {
2560
+ certificateFile: string;
2561
+ keyFile: string;
2562
+ };
2508
2563
  LiveTakConnectionDto: {
2509
2564
  id: components["schemas"]["Uuid"];
2510
2565
  userId: components["schemas"]["Uuid"];
@@ -2669,6 +2724,12 @@ export interface components {
2669
2724
  /** @description Omit to keep the stored token, `null` to remove it. The token is encrypted and write-only. */
2670
2725
  apiToken?: string | null;
2671
2726
  };
2727
+ /** @description Result of a test run against Let's Encrypt staging. */
2728
+ TakAcmeTestResultDto: {
2729
+ succeeded: boolean;
2730
+ /** @description What happened, safe to show to the administrator. */
2731
+ message: string;
2732
+ };
2672
2733
  /**
2673
2734
  * @description - `none`: OpenMeshTak gives no TAK connection guidance.
2674
2735
  * - `meshtastic-local-server`: each participant enables the Meshtastic app's local TAK server and
@@ -5935,6 +5996,57 @@ export interface operations {
5935
5996
  };
5936
5997
  };
5937
5998
  };
5999
+ UseTakCertificateFiles: {
6000
+ parameters: {
6001
+ query?: never;
6002
+ header?: never;
6003
+ path?: never;
6004
+ cookie?: never;
6005
+ };
6006
+ requestBody: {
6007
+ content: {
6008
+ "application/json": components["schemas"]["UseTakCertificateFilesRequest"];
6009
+ };
6010
+ };
6011
+ responses: {
6012
+ /** @description Certificate files in use */
6013
+ 200: {
6014
+ headers: {
6015
+ [name: string]: unknown;
6016
+ };
6017
+ content: {
6018
+ "application/json": components["schemas"]["TakServerSettingsDto"];
6019
+ };
6020
+ };
6021
+ /** @description Authentication required */
6022
+ 401: {
6023
+ headers: {
6024
+ [name: string]: unknown;
6025
+ };
6026
+ content: {
6027
+ "application/json": components["schemas"]["ProblemDetails"];
6028
+ };
6029
+ };
6030
+ /** @description Access denied */
6031
+ 403: {
6032
+ headers: {
6033
+ [name: string]: unknown;
6034
+ };
6035
+ content: {
6036
+ "application/json": components["schemas"]["ProblemDetails"];
6037
+ };
6038
+ };
6039
+ /** @description Validation failed */
6040
+ 422: {
6041
+ headers: {
6042
+ [name: string]: unknown;
6043
+ };
6044
+ content: {
6045
+ "application/json": components["schemas"]["ProblemDetails"];
6046
+ };
6047
+ };
6048
+ };
6049
+ };
5938
6050
  GetLiveTakTraffic: {
5939
6051
  parameters: {
5940
6052
  query?: never;
@@ -6570,6 +6682,53 @@ export interface operations {
6570
6682
  };
6571
6683
  };
6572
6684
  };
6685
+ Test: {
6686
+ parameters: {
6687
+ query?: never;
6688
+ header?: never;
6689
+ path?: never;
6690
+ cookie?: never;
6691
+ };
6692
+ requestBody?: never;
6693
+ responses: {
6694
+ /** @description Test finished */
6695
+ 200: {
6696
+ headers: {
6697
+ [name: string]: unknown;
6698
+ };
6699
+ content: {
6700
+ "application/json": components["schemas"]["TakAcmeTestResultDto"];
6701
+ };
6702
+ };
6703
+ /** @description Authentication required */
6704
+ 401: {
6705
+ headers: {
6706
+ [name: string]: unknown;
6707
+ };
6708
+ content: {
6709
+ "application/json": components["schemas"]["ProblemDetails"];
6710
+ };
6711
+ };
6712
+ /** @description Access denied */
6713
+ 403: {
6714
+ headers: {
6715
+ [name: string]: unknown;
6716
+ };
6717
+ content: {
6718
+ "application/json": components["schemas"]["ProblemDetails"];
6719
+ };
6720
+ };
6721
+ /** @description Validation failed */
6722
+ 422: {
6723
+ headers: {
6724
+ [name: string]: unknown;
6725
+ };
6726
+ content: {
6727
+ "application/json": components["schemas"]["ProblemDetails"];
6728
+ };
6729
+ };
6730
+ };
6731
+ };
6573
6732
  GetTakConfiguration: {
6574
6733
  parameters: {
6575
6734
  query?: never;