phenoml 17.10.0 → 17.10.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.
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "phenoml",
46
- "X-Fern-SDK-Version": "17.10.0",
47
- "User-Agent": "phenoml/17.10.0",
46
+ "X-Fern-SDK-Version": "17.10.1",
47
+ "User-Agent": "phenoml/17.10.1",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -126,6 +126,33 @@ const RUNTIME_DISPLAY_NAMES = {
126
126
  "edge-runtime": undefined,
127
127
  unknown: undefined,
128
128
  };
129
+ /**
130
+ * CPU architecture aliases that all refer to 64-bit x86. They are normalized to
131
+ * the single canonical token `x86_64` so the User-Agent architecture label is
132
+ * consistent regardless of which runtime reports it (Node reports `x64`, others
133
+ * report `amd64` or `x86_64`).
134
+ */
135
+ const X86_64_ARCH_ALIASES = new Set(["x64", "amd64", "x86_64"]);
136
+ /**
137
+ * Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases
138
+ * (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned
139
+ * unchanged.
140
+ */
141
+ function normalizeArch(arch) {
142
+ if (arch == null) {
143
+ return arch;
144
+ }
145
+ return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? "x86_64" : arch;
146
+ }
147
+ /**
148
+ * Percent-encodes the `@` and `/` characters in an npm package name so the
149
+ * User-Agent product token stays within the RFC 7230 token grammar. The
150
+ * original scoped package name can be recovered by URL-decoding (e.g.
151
+ * `@dummy/sdk` becomes `%40dummy%2Fsdk`).
152
+ */
153
+ function encodeProductName(sdkName) {
154
+ return sdkName.replace(/@/g, "%40").replace(/\//g, "%2F");
155
+ }
129
156
  /**
130
157
  * Builds a structured User-Agent string of the form
131
158
  * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
@@ -133,8 +160,8 @@ const RUNTIME_DISPLAY_NAMES = {
133
160
  * underlying values cannot be determined (e.g. in a browser).
134
161
  */
135
162
  function getUserAgent(sdkName, sdkVersion) {
136
- let userAgent = `${sdkName}/${sdkVersion}`;
137
- const platform = [exports.RUNTIME.os, exports.RUNTIME.arch].filter((part) => part != null && part.length > 0);
163
+ let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;
164
+ const platform = [exports.RUNTIME.os, normalizeArch(exports.RUNTIME.arch)].filter((part) => part != null && part.length > 0);
138
165
  if (platform.length > 0) {
139
166
  userAgent += ` (${platform.join("; ")})`;
140
167
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "17.10.0";
1
+ export declare const SDK_VERSION = "17.10.1";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "17.10.0";
4
+ exports.SDK_VERSION = "17.10.1";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phenoml",
9
- "X-Fern-SDK-Version": "17.10.0",
10
- "User-Agent": "phenoml/17.10.0",
9
+ "X-Fern-SDK-Version": "17.10.1",
10
+ "User-Agent": "phenoml/17.10.1",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -122,6 +122,33 @@ const RUNTIME_DISPLAY_NAMES = {
122
122
  "edge-runtime": undefined,
123
123
  unknown: undefined,
124
124
  };
125
+ /**
126
+ * CPU architecture aliases that all refer to 64-bit x86. They are normalized to
127
+ * the single canonical token `x86_64` so the User-Agent architecture label is
128
+ * consistent regardless of which runtime reports it (Node reports `x64`, others
129
+ * report `amd64` or `x86_64`).
130
+ */
131
+ const X86_64_ARCH_ALIASES = new Set(["x64", "amd64", "x86_64"]);
132
+ /**
133
+ * Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases
134
+ * (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned
135
+ * unchanged.
136
+ */
137
+ function normalizeArch(arch) {
138
+ if (arch == null) {
139
+ return arch;
140
+ }
141
+ return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? "x86_64" : arch;
142
+ }
143
+ /**
144
+ * Percent-encodes the `@` and `/` characters in an npm package name so the
145
+ * User-Agent product token stays within the RFC 7230 token grammar. The
146
+ * original scoped package name can be recovered by URL-decoding (e.g.
147
+ * `@dummy/sdk` becomes `%40dummy%2Fsdk`).
148
+ */
149
+ function encodeProductName(sdkName) {
150
+ return sdkName.replace(/@/g, "%40").replace(/\//g, "%2F");
151
+ }
125
152
  /**
126
153
  * Builds a structured User-Agent string of the form
127
154
  * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
@@ -129,8 +156,8 @@ const RUNTIME_DISPLAY_NAMES = {
129
156
  * underlying values cannot be determined (e.g. in a browser).
130
157
  */
131
158
  export function getUserAgent(sdkName, sdkVersion) {
132
- let userAgent = `${sdkName}/${sdkVersion}`;
133
- const platform = [RUNTIME.os, RUNTIME.arch].filter((part) => part != null && part.length > 0);
159
+ let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;
160
+ const platform = [RUNTIME.os, normalizeArch(RUNTIME.arch)].filter((part) => part != null && part.length > 0);
134
161
  if (platform.length > 0) {
135
162
  userAgent += ` (${platform.join("; ")})`;
136
163
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "17.10.0";
1
+ export declare const SDK_VERSION = "17.10.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "17.10.0";
1
+ export const SDK_VERSION = "17.10.1";
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Phenoml API",
5
- "version": "4303ef3d3e7bb2159a5d8301937194e8bb681125"
5
+ "version": "8c63b16b085fcf9b05835232378d834802257e7a"
6
6
  },
7
7
  "x-services": [
8
8
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phenoml",
3
- "version": "17.10.0",
3
+ "version": "17.10.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",