increase 0.578.0 → 0.580.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts.map +1 -1
  4. package/client.js +1 -8
  5. package/client.js.map +1 -1
  6. package/client.mjs +1 -8
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/beneficial-owners.d.mts +9 -10
  10. package/resources/beneficial-owners.d.mts.map +1 -1
  11. package/resources/beneficial-owners.d.ts +9 -10
  12. package/resources/beneficial-owners.d.ts.map +1 -1
  13. package/resources/beneficial-owners.js +1 -0
  14. package/resources/beneficial-owners.js.map +1 -1
  15. package/resources/beneficial-owners.mjs +1 -0
  16. package/resources/beneficial-owners.mjs.map +1 -1
  17. package/resources/entities.d.mts +32 -40
  18. package/resources/entities.d.mts.map +1 -1
  19. package/resources/entities.d.ts +32 -40
  20. package/resources/entities.d.ts.map +1 -1
  21. package/resources/event-subscriptions.d.mts +10 -2
  22. package/resources/event-subscriptions.d.mts.map +1 -1
  23. package/resources/event-subscriptions.d.ts +10 -2
  24. package/resources/event-subscriptions.d.ts.map +1 -1
  25. package/resources/events.d.mts +11 -3
  26. package/resources/events.d.mts.map +1 -1
  27. package/resources/events.d.ts +11 -3
  28. package/resources/events.d.ts.map +1 -1
  29. package/resources/files.d.mts +24 -1
  30. package/resources/files.d.mts.map +1 -1
  31. package/resources/files.d.ts +24 -1
  32. package/resources/files.d.ts.map +1 -1
  33. package/resources/files.js +28 -0
  34. package/resources/files.js.map +1 -1
  35. package/resources/files.mjs +28 -0
  36. package/resources/files.mjs.map +1 -1
  37. package/src/client.ts +1 -8
  38. package/src/resources/beneficial-owners.ts +9 -10
  39. package/src/resources/entities.ts +32 -40
  40. package/src/resources/event-subscriptions.ts +12 -0
  41. package/src/resources/events.ts +14 -0
  42. package/src/resources/files.ts +32 -1
  43. package/src/version.ts +1 -1
  44. package/version.d.mts +1 -1
  45. package/version.d.ts +1 -1
  46. package/version.js +1 -1
  47. package/version.mjs +1 -1
  48. package/internal/detect-platform.d.mts +0 -15
  49. package/internal/detect-platform.d.mts.map +0 -1
  50. package/internal/detect-platform.d.ts +0 -15
  51. package/internal/detect-platform.d.ts.map +0 -1
  52. package/internal/detect-platform.js +0 -162
  53. package/internal/detect-platform.js.map +0 -1
  54. package/internal/detect-platform.mjs +0 -157
  55. package/internal/detect-platform.mjs.map +0 -1
  56. package/src/internal/detect-platform.ts +0 -196
@@ -1,196 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { VERSION } from '../version';
4
-
5
- export const isRunningInBrowser = () => {
6
- return (
7
- // @ts-ignore
8
- typeof window !== 'undefined' &&
9
- // @ts-ignore
10
- typeof window.document !== 'undefined' &&
11
- // @ts-ignore
12
- typeof navigator !== 'undefined'
13
- );
14
- };
15
-
16
- type DetectedPlatform = 'deno' | 'node' | 'edge' | 'unknown';
17
-
18
- /**
19
- * Note this does not detect 'browser'; for that, use getBrowserInfo().
20
- */
21
- function getDetectedPlatform(): DetectedPlatform {
22
- if (typeof Deno !== 'undefined' && Deno.build != null) {
23
- return 'deno';
24
- }
25
- if (typeof EdgeRuntime !== 'undefined') {
26
- return 'edge';
27
- }
28
- if (
29
- Object.prototype.toString.call(
30
- typeof (globalThis as any).process !== 'undefined' ? (globalThis as any).process : 0,
31
- ) === '[object process]'
32
- ) {
33
- return 'node';
34
- }
35
- return 'unknown';
36
- }
37
-
38
- declare const Deno: any;
39
- declare const EdgeRuntime: any;
40
- type Arch = 'x32' | 'x64' | 'arm' | 'arm64' | `other:${string}` | 'unknown';
41
- type PlatformName =
42
- | 'MacOS'
43
- | 'Linux'
44
- | 'Windows'
45
- | 'FreeBSD'
46
- | 'OpenBSD'
47
- | 'iOS'
48
- | 'Android'
49
- | `Other:${string}`
50
- | 'Unknown';
51
- type Browser = 'ie' | 'edge' | 'chrome' | 'firefox' | 'safari';
52
- type PlatformProperties = {
53
- 'X-Stainless-Lang': 'js';
54
- 'X-Stainless-Package-Version': string;
55
- 'X-Stainless-OS': PlatformName;
56
- 'X-Stainless-Arch': Arch;
57
- 'X-Stainless-Runtime': 'node' | 'deno' | 'edge' | `browser:${Browser}` | 'unknown';
58
- 'X-Stainless-Runtime-Version': string;
59
- };
60
- const getPlatformProperties = (): PlatformProperties => {
61
- const detectedPlatform = getDetectedPlatform();
62
- if (detectedPlatform === 'deno') {
63
- return {
64
- 'X-Stainless-Lang': 'js',
65
- 'X-Stainless-Package-Version': VERSION,
66
- 'X-Stainless-OS': normalizePlatform(Deno.build.os),
67
- 'X-Stainless-Arch': normalizeArch(Deno.build.arch),
68
- 'X-Stainless-Runtime': 'deno',
69
- 'X-Stainless-Runtime-Version':
70
- typeof Deno.version === 'string' ? Deno.version : (Deno.version?.deno ?? 'unknown'),
71
- };
72
- }
73
- if (typeof EdgeRuntime !== 'undefined') {
74
- return {
75
- 'X-Stainless-Lang': 'js',
76
- 'X-Stainless-Package-Version': VERSION,
77
- 'X-Stainless-OS': 'Unknown',
78
- 'X-Stainless-Arch': `other:${EdgeRuntime}`,
79
- 'X-Stainless-Runtime': 'edge',
80
- 'X-Stainless-Runtime-Version': (globalThis as any).process.version,
81
- };
82
- }
83
- // Check if Node.js
84
- if (detectedPlatform === 'node') {
85
- return {
86
- 'X-Stainless-Lang': 'js',
87
- 'X-Stainless-Package-Version': VERSION,
88
- 'X-Stainless-OS': normalizePlatform((globalThis as any).process.platform ?? 'unknown'),
89
- 'X-Stainless-Arch': normalizeArch((globalThis as any).process.arch ?? 'unknown'),
90
- 'X-Stainless-Runtime': 'node',
91
- 'X-Stainless-Runtime-Version': (globalThis as any).process.version ?? 'unknown',
92
- };
93
- }
94
-
95
- const browserInfo = getBrowserInfo();
96
- if (browserInfo) {
97
- return {
98
- 'X-Stainless-Lang': 'js',
99
- 'X-Stainless-Package-Version': VERSION,
100
- 'X-Stainless-OS': 'Unknown',
101
- 'X-Stainless-Arch': 'unknown',
102
- 'X-Stainless-Runtime': `browser:${browserInfo.browser}`,
103
- 'X-Stainless-Runtime-Version': browserInfo.version,
104
- };
105
- }
106
-
107
- // TODO add support for Cloudflare workers, etc.
108
- return {
109
- 'X-Stainless-Lang': 'js',
110
- 'X-Stainless-Package-Version': VERSION,
111
- 'X-Stainless-OS': 'Unknown',
112
- 'X-Stainless-Arch': 'unknown',
113
- 'X-Stainless-Runtime': 'unknown',
114
- 'X-Stainless-Runtime-Version': 'unknown',
115
- };
116
- };
117
-
118
- type BrowserInfo = {
119
- browser: Browser;
120
- version: string;
121
- };
122
-
123
- declare const navigator: { userAgent: string } | undefined;
124
-
125
- // Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
126
- function getBrowserInfo(): BrowserInfo | null {
127
- if (typeof navigator === 'undefined' || !navigator) {
128
- return null;
129
- }
130
-
131
- // NOTE: The order matters here!
132
- const browserPatterns = [
133
- { key: 'edge' as const, pattern: /Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
134
- { key: 'ie' as const, pattern: /MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
135
- { key: 'ie' as const, pattern: /Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/ },
136
- { key: 'chrome' as const, pattern: /Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
137
- { key: 'firefox' as const, pattern: /Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/ },
138
- { key: 'safari' as const, pattern: /(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/ },
139
- ];
140
-
141
- // Find the FIRST matching browser
142
- for (const { key, pattern } of browserPatterns) {
143
- const match = pattern.exec(navigator.userAgent);
144
- if (match) {
145
- const major = match[1] || 0;
146
- const minor = match[2] || 0;
147
- const patch = match[3] || 0;
148
-
149
- return { browser: key, version: `${major}.${minor}.${patch}` };
150
- }
151
- }
152
-
153
- return null;
154
- }
155
-
156
- const normalizeArch = (arch: string): Arch => {
157
- // Node docs:
158
- // - https://nodejs.org/api/process.html#processarch
159
- // Deno docs:
160
- // - https://doc.deno.land/deno/stable/~/Deno.build
161
- if (arch === 'x32') return 'x32';
162
- if (arch === 'x86_64' || arch === 'x64') return 'x64';
163
- if (arch === 'arm') return 'arm';
164
- if (arch === 'aarch64' || arch === 'arm64') return 'arm64';
165
- if (arch) return `other:${arch}`;
166
- return 'unknown';
167
- };
168
-
169
- const normalizePlatform = (platform: string): PlatformName => {
170
- // Node platforms:
171
- // - https://nodejs.org/api/process.html#processplatform
172
- // Deno platforms:
173
- // - https://doc.deno.land/deno/stable/~/Deno.build
174
- // - https://github.com/denoland/deno/issues/14799
175
-
176
- platform = platform.toLowerCase();
177
-
178
- // NOTE: this iOS check is untested and may not work
179
- // Node does not work natively on IOS, there is a fork at
180
- // https://github.com/nodejs-mobile/nodejs-mobile
181
- // however it is unknown at the time of writing how to detect if it is running
182
- if (platform.includes('ios')) return 'iOS';
183
- if (platform === 'android') return 'Android';
184
- if (platform === 'darwin') return 'MacOS';
185
- if (platform === 'win32') return 'Windows';
186
- if (platform === 'freebsd') return 'FreeBSD';
187
- if (platform === 'openbsd') return 'OpenBSD';
188
- if (platform === 'linux') return 'Linux';
189
- if (platform) return `Other:${platform}`;
190
- return 'Unknown';
191
- };
192
-
193
- let _platformHeaders: PlatformProperties;
194
- export const getPlatformHeaders = () => {
195
- return (_platformHeaders ??= getPlatformProperties());
196
- };