@pilot-status/sdk 0.21.0 → 0.23.0
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 +58 -0
- package/README.md +50 -1
- package/dist/client.d.ts +5 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/templates.d.ts +37 -1
- package/dist/resources/templates.d.ts.map +1 -1
- package/dist/resources/templates.js +52 -0
- package/dist/resources/templates.js.map +1 -1
- package/dist/resources/webhooks.d.ts +37 -5
- package/dist/resources/webhooks.d.ts.map +1 -1
- package/dist/resources/webhooks.js +45 -3
- package/dist/resources/webhooks.js.map +1 -1
- package/dist/resources/workspace.d.ts +52 -2
- package/dist/resources/workspace.d.ts.map +1 -1
- package/dist/resources/workspace.js +85 -1
- package/dist/resources/workspace.js.map +1 -1
- package/dist/types.d.ts +139 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/user-agent.d.ts +15 -0
- package/dist/user-agent.d.ts.map +1 -0
- package/dist/user-agent.js +23 -0
- package/dist/user-agent.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-agent.d.ts","sourceRoot":"","sources":["../src/user-agent.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,cAAc,6BAAqC,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAKtD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SDK_VERSION } from "./version.js";
|
|
2
|
+
/**
|
|
3
|
+
* Product token sent on every request. The Pilot Status API buckets `/v1` callers
|
|
4
|
+
* by User-Agent and only recognises the SDK when the header STARTS with
|
|
5
|
+
* `pilot-status-node/<version>`.
|
|
6
|
+
*/
|
|
7
|
+
export const SDK_USER_AGENT = `pilot-status-node/${SDK_VERSION}`;
|
|
8
|
+
/**
|
|
9
|
+
* The User-Agent actually sent. A caller-supplied value is kept, never replaced:
|
|
10
|
+
* - a third-party UA gets the SDK token in FRONT (`pilot-status-node/x.y.z my-app/1.0`),
|
|
11
|
+
* because the server parser is anchored at the start of the header;
|
|
12
|
+
* - a UA that already starts with `pilot-status-` is another Pilot Status product
|
|
13
|
+
* built on this SDK, so it stays first and the SDK token goes after it.
|
|
14
|
+
*/
|
|
15
|
+
export function buildUserAgent(custom) {
|
|
16
|
+
const theirs = custom?.trim();
|
|
17
|
+
if (!theirs)
|
|
18
|
+
return SDK_USER_AGENT;
|
|
19
|
+
if (theirs.toLowerCase().startsWith("pilot-status-"))
|
|
20
|
+
return `${theirs} ${SDK_USER_AGENT}`;
|
|
21
|
+
return `${SDK_USER_AGENT} ${theirs}`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=user-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-agent.js","sourceRoot":"","sources":["../src/user-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,WAAW,EAAE,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC1C,MAAM,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,MAAM;QAAE,OAAO,cAAc,CAAC;IACnC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC;QAAE,OAAO,GAAG,MAAM,IAAI,cAAc,EAAE,CAAC;IAC3F,OAAO,GAAG,cAAc,IAAI,MAAM,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,WAAW,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilot-status/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Official TypeScript SDK for the Pilot Status public API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"typescript"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
+
"prebuild": "node scripts/write-version.mjs",
|
|
36
37
|
"build": "tsc -p tsconfig.json",
|
|
37
38
|
"prepublishOnly": "npm run build",
|
|
38
39
|
"test": "vitest run",
|