polytomic 25.9.3 → 25.9.4

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.
Files changed (117) hide show
  1. package/BaseClient.d.ts +15 -0
  2. package/BaseClient.js +17 -2
  3. package/api/errors/BadGatewayError.d.ts +1 -0
  4. package/api/errors/BadGatewayError.js +1 -1
  5. package/api/errors/BadRequestError.d.ts +1 -0
  6. package/api/errors/BadRequestError.js +1 -1
  7. package/api/errors/ConflictError.d.ts +1 -0
  8. package/api/errors/ConflictError.js +1 -1
  9. package/api/errors/ForbiddenError.d.ts +1 -0
  10. package/api/errors/ForbiddenError.js +1 -1
  11. package/api/errors/GatewayTimeoutError.d.ts +1 -0
  12. package/api/errors/GatewayTimeoutError.js +1 -1
  13. package/api/errors/InternalServerError.d.ts +1 -0
  14. package/api/errors/InternalServerError.js +1 -1
  15. package/api/errors/NotFoundError.d.ts +1 -0
  16. package/api/errors/NotFoundError.js +1 -1
  17. package/api/errors/RequestTimeoutError.d.ts +1 -0
  18. package/api/errors/RequestTimeoutError.js +1 -1
  19. package/api/errors/ServiceUnavailableError.d.ts +1 -0
  20. package/api/errors/ServiceUnavailableError.js +1 -1
  21. package/api/errors/TooManyRequestsError.d.ts +1 -0
  22. package/api/errors/TooManyRequestsError.js +1 -1
  23. package/api/errors/UnauthorizedError.d.ts +1 -0
  24. package/api/errors/UnauthorizedError.js +1 -1
  25. package/api/errors/UnprocessableEntityError.d.ts +1 -0
  26. package/api/errors/UnprocessableEntityError.js +1 -1
  27. package/api/resources/bulkSync/client/Client.d.ts +22 -0
  28. package/api/resources/bulkSync/client/Client.js +27 -4
  29. package/api/resources/bulkSync/resources/errorHandling/client/Client.d.ts +4 -0
  30. package/api/resources/bulkSync/resources/errorHandling/client/Client.js +6 -1
  31. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +18 -0
  32. package/api/resources/bulkSync/resources/executions/client/Client.js +18 -0
  33. package/api/resources/bulkSync/resources/schedules/client/Client.d.ts +10 -0
  34. package/api/resources/bulkSync/resources/schedules/client/Client.js +13 -2
  35. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +10 -0
  36. package/api/resources/bulkSync/resources/schemas/client/Client.js +13 -2
  37. package/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.d.ts +1 -1
  38. package/api/resources/connections/client/Client.d.ts +26 -0
  39. package/api/resources/connections/client/Client.js +32 -5
  40. package/api/resources/connections/resources/proxy/client/Client.d.ts +8 -0
  41. package/api/resources/connections/resources/proxy/client/Client.js +11 -2
  42. package/api/resources/connections/resources/sharedConnections/client/Client.d.ts +6 -0
  43. package/api/resources/connections/resources/sharedConnections/client/Client.js +8 -1
  44. package/api/resources/entities/client/Client.d.ts +4 -0
  45. package/api/resources/entities/client/Client.js +4 -0
  46. package/api/resources/events/client/Client.d.ts +5 -0
  47. package/api/resources/events/client/Client.js +5 -0
  48. package/api/resources/harbors/client/Client.d.ts +67 -64
  49. package/api/resources/harbors/client/Client.js +77 -73
  50. package/api/resources/identity/client/Client.d.ts +2 -0
  51. package/api/resources/identity/client/Client.js +2 -0
  52. package/api/resources/jobs/client/Client.d.ts +2 -0
  53. package/api/resources/jobs/client/Client.js +2 -0
  54. package/api/resources/modelSync/client/Client.d.ts +24 -0
  55. package/api/resources/modelSync/client/Client.js +29 -4
  56. package/api/resources/modelSync/client/requests/ModelSyncGetSourceFieldsRequest.d.ts +1 -1
  57. package/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.d.ts +1 -1
  58. package/api/resources/modelSync/resources/errorHandling/client/Client.d.ts +4 -0
  59. package/api/resources/modelSync/resources/errorHandling/client/Client.js +6 -1
  60. package/api/resources/modelSync/resources/executions/client/Client.d.ts +14 -0
  61. package/api/resources/modelSync/resources/executions/client/Client.js +14 -0
  62. package/api/resources/modelSync/resources/targets/client/Client.d.ts +6 -0
  63. package/api/resources/modelSync/resources/targets/client/Client.js +6 -0
  64. package/api/resources/modelSync/resources/targets/client/requests/TargetsGetTargetFieldsRequest.d.ts +1 -1
  65. package/api/resources/models/client/Client.d.ts +18 -0
  66. package/api/resources/models/client/Client.js +23 -4
  67. package/api/resources/models/client/requests/ModelsGetEnrichmentSourceRequest.d.ts +1 -1
  68. package/api/resources/notifications/client/Client.d.ts +4 -0
  69. package/api/resources/notifications/client/Client.js +6 -1
  70. package/api/resources/organization/client/Client.d.ts +16 -0
  71. package/api/resources/organization/client/Client.js +20 -3
  72. package/api/resources/permissions/resources/policies/client/Client.d.ts +10 -0
  73. package/api/resources/permissions/resources/policies/client/Client.js +13 -2
  74. package/api/resources/permissions/resources/roles/client/Client.d.ts +10 -0
  75. package/api/resources/permissions/resources/roles/client/Client.js +13 -2
  76. package/api/resources/queryRunner/client/Client.d.ts +4 -0
  77. package/api/resources/queryRunner/client/Client.js +6 -1
  78. package/api/resources/recordViewLinks/client/Client.d.ts +4 -4
  79. package/api/resources/recordViewLinks/client/Client.js +6 -5
  80. package/api/resources/schemas/client/Client.d.ts +18 -0
  81. package/api/resources/schemas/client/Client.js +22 -3
  82. package/api/resources/temporaryCredentials/client/Client.d.ts +2 -2
  83. package/api/resources/temporaryCredentials/client/Client.js +4 -3
  84. package/api/resources/users/client/Client.d.ts +22 -0
  85. package/api/resources/users/client/Client.js +27 -4
  86. package/api/resources/webhooks/client/Client.d.ts +14 -0
  87. package/api/resources/webhooks/client/Client.js +17 -2
  88. package/api/types/ConnectionParameterValuesResponseEnvelope.d.ts +1 -1
  89. package/api/types/ConnectionProxyResponse.d.ts +1 -1
  90. package/api/types/HarborPipelineStatusResponse.d.ts +1 -1
  91. package/api/types/HarborSourceMappingResponse.d.ts +1 -1
  92. package/api/types/SyncSourceMetaResponse.d.ts +1 -1
  93. package/core/auth/AuthProvider.d.ts +1 -0
  94. package/core/auth/AuthProvider.js +7 -0
  95. package/core/auth/index.d.ts +1 -1
  96. package/core/auth/index.js +3 -1
  97. package/core/fetcher/Fetcher.js +9 -92
  98. package/core/fetcher/getResponseBody.js +11 -0
  99. package/core/fetcher/makePassthroughRequest.js +26 -4
  100. package/core/fetcher/redactUrl.d.ts +2 -0
  101. package/core/fetcher/redactUrl.js +88 -0
  102. package/core/fetcher/requestWithRetries.js +4 -1
  103. package/core/fetcher/signals.js +9 -1
  104. package/core/requestBody.d.ts +12 -0
  105. package/core/requestBody.js +26 -0
  106. package/core/runtime/index.d.ts +1 -1
  107. package/core/runtime/index.js +2 -1
  108. package/core/runtime/runtime.d.ts +19 -0
  109. package/core/runtime/runtime.js +74 -2
  110. package/core/url/qs.js +2 -2
  111. package/errors/PolytomicError.d.ts +1 -0
  112. package/errors/PolytomicError.js +5 -1
  113. package/errors/PolytomicTimeoutError.d.ts +2 -2
  114. package/errors/PolytomicTimeoutError.js +40 -6
  115. package/package.json +2 -2
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RUNTIME = void 0;
4
+ exports.getUserAgent = getUserAgent;
4
5
  /**
5
6
  * A constant that indicates which environment and version the SDK is running in.
6
7
  */
7
8
  exports.RUNTIME = evaluateRuntime();
8
9
  function evaluateRuntime() {
9
- var _a, _b, _c, _d, _e;
10
+ var _a, _b, _c, _d, _e, _f, _g;
10
11
  /**
11
12
  * A constant that indicates whether the environment the code is running is a Web Browser.
12
13
  */
@@ -59,6 +60,8 @@ function evaluateRuntime() {
59
60
  return {
60
61
  type: "deno",
61
62
  version: Deno.version.deno,
63
+ os: (_e = Deno.build) === null || _e === void 0 ? void 0 : _e.os,
64
+ arch: (_f = Deno.build) === null || _f === void 0 ? void 0 : _f.arch,
62
65
  };
63
66
  }
64
67
  /**
@@ -69,6 +72,8 @@ function evaluateRuntime() {
69
72
  return {
70
73
  type: "bun",
71
74
  version: Bun.version,
75
+ os: typeof process !== "undefined" ? process.platform : undefined,
76
+ arch: typeof process !== "undefined" ? process.arch : undefined,
72
77
  };
73
78
  }
74
79
  /**
@@ -90,15 +95,82 @@ function evaluateRuntime() {
90
95
  * Edge Runtime warns about Node.js APIs even when they are guarded).
91
96
  */
92
97
  const _process = typeof process !== "undefined" ? process : undefined;
93
- const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) === null || _e === void 0 ? void 0 : _e.node) === "string";
98
+ const isNode = typeof _process !== "undefined" && typeof ((_g = _process.versions) === null || _g === void 0 ? void 0 : _g.node) === "string";
94
99
  if (isNode) {
95
100
  return {
96
101
  type: "node",
97
102
  version: _process.versions.node,
98
103
  parsedVersion: Number(_process.versions.node.split(".")[0]),
104
+ os: _process.platform,
105
+ arch: _process.arch,
99
106
  };
100
107
  }
101
108
  return {
102
109
  type: "unknown",
103
110
  };
104
111
  }
112
+ /**
113
+ * Display names for the language runtimes whose version is meaningful to encode
114
+ * in a User-Agent. Environments where a version string is not useful (e.g.
115
+ * browsers, where `version` is the full navigator UA) are intentionally mapped
116
+ * to `undefined` so they are omitted from the User-Agent.
117
+ */
118
+ const RUNTIME_DISPLAY_NAMES = {
119
+ node: "Node",
120
+ deno: "Deno",
121
+ bun: "Bun",
122
+ browser: undefined,
123
+ "web-worker": undefined,
124
+ "react-native": undefined,
125
+ workerd: undefined,
126
+ "edge-runtime": undefined,
127
+ unknown: undefined,
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
+ }
156
+ /**
157
+ * Builds a structured User-Agent string of the form
158
+ * `{sdkName}/{sdkVersion} ({os}; {arch}) {runtime}/{runtimeVersion}`
159
+ * where the platform group and runtime segment are omitted gracefully when the
160
+ * underlying values cannot be determined (e.g. in a browser).
161
+ */
162
+ function getUserAgent(sdkName, sdkVersion) {
163
+ let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;
164
+ const platform = [exports.RUNTIME.os, normalizeArch(exports.RUNTIME.arch)].filter((part) => part != null && part.length > 0);
165
+ if (platform.length > 0) {
166
+ userAgent += ` (${platform.join("; ")})`;
167
+ }
168
+ const runtimeName = RUNTIME_DISPLAY_NAMES[exports.RUNTIME.type];
169
+ if (runtimeName != null) {
170
+ userAgent += ` ${runtimeName}`;
171
+ if (exports.RUNTIME.version != null && exports.RUNTIME.version.length > 0) {
172
+ userAgent += `/${exports.RUNTIME.version}`;
173
+ }
174
+ }
175
+ return userAgent;
176
+ }
package/core/url/qs.js CHANGED
@@ -19,7 +19,7 @@ function stringifyObject(obj, prefix = "", options) {
19
19
  const parts = [];
20
20
  for (const [key, value] of Object.entries(obj)) {
21
21
  const fullKey = prefix ? `${prefix}[${key}]` : key;
22
- if (value === undefined) {
22
+ if (value == null) {
23
23
  continue;
24
24
  }
25
25
  if (Array.isArray(value)) {
@@ -39,7 +39,7 @@ function stringifyObject(obj, prefix = "", options) {
39
39
  else {
40
40
  for (let i = 0; i < value.length; i++) {
41
41
  const item = value[i];
42
- if (item === undefined) {
42
+ if (item == null) {
43
43
  continue;
44
44
  }
45
45
  if (typeof item === "object" && !Array.isArray(item) && item !== null) {
@@ -11,4 +11,5 @@ export declare class PolytomicError extends Error {
11
11
  rawResponse?: core.RawResponse;
12
12
  cause?: unknown;
13
13
  });
14
+ get requestId(): string | undefined;
14
15
  }
@@ -10,7 +10,7 @@ class PolytomicError extends Error {
10
10
  if (Error.captureStackTrace) {
11
11
  Error.captureStackTrace(this, this.constructor);
12
12
  }
13
- this.name = this.constructor.name;
13
+ this.name = "PolytomicError";
14
14
  this.statusCode = statusCode;
15
15
  this.body = body;
16
16
  this.rawResponse = rawResponse;
@@ -18,6 +18,10 @@ class PolytomicError extends Error {
18
18
  this.cause = cause;
19
19
  }
20
20
  }
21
+ get requestId() {
22
+ var _a, _b, _c;
23
+ return (_c = (_b = (_a = this.rawResponse) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.get("x-request-id")) !== null && _c !== void 0 ? _c : undefined;
24
+ }
21
25
  }
22
26
  exports.PolytomicError = PolytomicError;
23
27
  function buildMessage({ message, statusCode, body, }) {
@@ -1,5 +1,5 @@
1
- export declare class PolytomicTimeoutError extends Error {
2
- readonly cause?: unknown;
1
+ import * as errors from "./index";
2
+ export declare class PolytomicTimeoutError extends errors.PolytomicError {
3
3
  constructor(message: string, opts?: {
4
4
  cause?: unknown;
5
5
  });
@@ -1,18 +1,52 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
3
36
  Object.defineProperty(exports, "__esModule", { value: true });
4
37
  exports.PolytomicTimeoutError = void 0;
5
- class PolytomicTimeoutError extends Error {
38
+ const errors = __importStar(require("./index"));
39
+ class PolytomicTimeoutError extends errors.PolytomicError {
6
40
  constructor(message, opts) {
7
- super(message);
41
+ super({
42
+ message: message,
43
+ cause: opts === null || opts === void 0 ? void 0 : opts.cause,
44
+ });
8
45
  Object.setPrototypeOf(this, new.target.prototype);
9
46
  if (Error.captureStackTrace) {
10
47
  Error.captureStackTrace(this, this.constructor);
11
48
  }
12
- this.name = this.constructor.name;
13
- if ((opts === null || opts === void 0 ? void 0 : opts.cause) != null) {
14
- this.cause = opts.cause;
15
- }
49
+ this.name = "PolytomicTimeoutError";
16
50
  }
17
51
  }
18
52
  exports.PolytomicTimeoutError = PolytomicTimeoutError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytomic",
3
- "version": "25.9.3",
3
+ "version": "25.9.4",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,7 @@
32
32
  "ts-jest": "^29.3.4",
33
33
  "jest-environment-jsdom": "^29.7.0",
34
34
  "msw": "2.11.2",
35
- "@types/node": "^18.19.70",
35
+ "@types/node": "^20.0.0",
36
36
  "typescript": "~5.9.3",
37
37
  "@biomejs/biome": "2.4.10"
38
38
  },
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "25.9.3";
1
+ export declare const SDK_VERSION = "25.9.4";
package/version.js CHANGED
@@ -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 = "25.9.3";
4
+ exports.SDK_VERSION = "25.9.4";