corsair 0.1.200 → 0.1.202
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/dist/http.d.ts +121 -1
- package/dist/http.js +1 -1
- package/package.json +2 -2
package/dist/http.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** What `request()` resolves with when `responseType` is `'binary'`. */
|
|
4
|
+
type BinaryResponse = {
|
|
5
|
+
bytes: Uint8Array;
|
|
6
|
+
/** The Content-Type header as sent, or null when there was none. */
|
|
7
|
+
contentType: string | null;
|
|
8
|
+
};
|
|
1
9
|
type ApiRequestOptions = {
|
|
2
10
|
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
3
11
|
readonly url: string;
|
|
@@ -9,6 +17,12 @@ type ApiRequestOptions = {
|
|
|
9
17
|
readonly body?: any;
|
|
10
18
|
readonly mediaType?: string;
|
|
11
19
|
readonly responseHeader?: string;
|
|
20
|
+
/**
|
|
21
|
+
* `'binary'` returns a successful response as `{ bytes, contentType }`
|
|
22
|
+
* (`BinaryResponse`) instead of decoding it as JSON or text, which corrupts
|
|
23
|
+
* a file. An error response is still parsed, so its message survives.
|
|
24
|
+
*/
|
|
25
|
+
readonly responseType?: 'binary';
|
|
12
26
|
readonly errors?: Record<number, string>;
|
|
13
27
|
};
|
|
14
28
|
|
|
@@ -39,6 +53,112 @@ declare class ApiError extends Error {
|
|
|
39
53
|
isRateLimitError(): boolean;
|
|
40
54
|
}
|
|
41
55
|
|
|
56
|
+
/** True for any address the plugin must not connect to. */
|
|
57
|
+
declare function isBlockedAddress(ip: string): boolean;
|
|
58
|
+
declare class UnsafeUrlError extends Error {
|
|
59
|
+
constructor(message: string);
|
|
60
|
+
}
|
|
61
|
+
type TransportResponse = {
|
|
62
|
+
status: number;
|
|
63
|
+
headers: Record<string, string | string[] | undefined>;
|
|
64
|
+
body: AsyncIterable<Uint8Array>;
|
|
65
|
+
/** Frees the connection when the body will not be read. */
|
|
66
|
+
cancel?: () => void;
|
|
67
|
+
};
|
|
68
|
+
type DownloadDeps = {
|
|
69
|
+
/** Resolves a hostname. Injected so tests need no network. */
|
|
70
|
+
resolve?: (hostname: string) => Promise<string[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Performs one request to a pinned address. Injected so the redirect and
|
|
73
|
+
* size logic can be tested without opening a socket.
|
|
74
|
+
*/
|
|
75
|
+
transport?: (url: URL, addresses: readonly string[], signal: AbortSignal) => Promise<TransportResponse>;
|
|
76
|
+
};
|
|
77
|
+
type PublicDownload = {
|
|
78
|
+
bytes: Uint8Array;
|
|
79
|
+
/** The media type the server stated, without parameters. */
|
|
80
|
+
contentType: string;
|
|
81
|
+
/** The address the bytes came from, after any redirects. */
|
|
82
|
+
url: string;
|
|
83
|
+
/** The name in Content-Disposition, when the server sent one. */
|
|
84
|
+
filename?: string;
|
|
85
|
+
};
|
|
86
|
+
type DownloadOptions = {
|
|
87
|
+
maxBytes?: number;
|
|
88
|
+
timeoutMs?: number;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Fetches a public URL and returns its bytes. Each redirect hop is resolved
|
|
92
|
+
* and vetted again, the connection is pinned to a checked address, the whole
|
|
93
|
+
* download shares one deadline, and the body is capped while it is read.
|
|
94
|
+
*/
|
|
95
|
+
declare function downloadPublicFile(fileUrl: string, options?: DownloadOptions, deps?: DownloadDeps): Promise<PublicDownload>;
|
|
96
|
+
|
|
97
|
+
declare const FileInputSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
98
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
99
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
100
|
+
url: z.ZodString;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
103
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
104
|
+
base64: z.ZodString;
|
|
105
|
+
}, z.core.$strip>]>;
|
|
106
|
+
type FileInput = z.infer<typeof FileInputSchema> | Blob;
|
|
107
|
+
type ResolvedFile = {
|
|
108
|
+
bytes: Uint8Array;
|
|
109
|
+
filename: string;
|
|
110
|
+
contentType: string;
|
|
111
|
+
/** The same bytes as a File, ready for a multipart body. */
|
|
112
|
+
file: File;
|
|
113
|
+
};
|
|
114
|
+
type ResolveFileOptions = DownloadOptions & {
|
|
115
|
+
/** The name used when neither the input nor its URL gives one. */
|
|
116
|
+
fallbackName?: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Turns a file input into bytes with a name and a media type.
|
|
120
|
+
*
|
|
121
|
+
* A URL is fetched through `downloadPublicFile`, so it must be public and is
|
|
122
|
+
* capped in size. A `data:` URL and a base64 object are decoded here. A Blob or
|
|
123
|
+
* File is read as it is.
|
|
124
|
+
*/
|
|
125
|
+
declare function resolveFileInput(input: FileInput, options?: ResolveFileOptions, deps?: DownloadDeps): Promise<ResolvedFile>;
|
|
126
|
+
/**
|
|
127
|
+
* A file an endpoint returns. Bytes cannot ride in a JSON result as they are,
|
|
128
|
+
* and a large base64 string can push a result past what a host returns, so the
|
|
129
|
+
* content is included only up to a limit and its size and type always are.
|
|
130
|
+
*/
|
|
131
|
+
declare const FileOutputSchema: z.ZodObject<{
|
|
132
|
+
contentBase64: z.ZodOptional<z.ZodString>;
|
|
133
|
+
text: z.ZodOptional<z.ZodString>;
|
|
134
|
+
contentType: z.ZodString;
|
|
135
|
+
byteLength: z.ZodNumber;
|
|
136
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
137
|
+
contentOmitted: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
not_requested: "not_requested";
|
|
139
|
+
over_limit: "over_limit";
|
|
140
|
+
}>>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
type FileOutput = z.infer<typeof FileOutputSchema>;
|
|
143
|
+
/** Default most bytes returned inline: under the 1 MB a hosted script result may carry, once base64 adds a third. */
|
|
144
|
+
declare const FILE_OUTPUT_MAX_BYTES = 700000;
|
|
145
|
+
/**
|
|
146
|
+
* Shapes downloaded bytes as a `FileOutput`. The content goes in when it was
|
|
147
|
+
* asked for and fits `maxBytes`; the size and type are always reported, so a
|
|
148
|
+
* caller that got no content still knows what it would be.
|
|
149
|
+
*
|
|
150
|
+
* A text file in UTF-8 comes back as `text` instead of base64, so a caller can
|
|
151
|
+
* read a CSV or JSON file as it is. A file served as application/octet-stream
|
|
152
|
+
* counts as text when its `filename` ends in a text extension such as .csv.
|
|
153
|
+
* Pass `text: false` to always get base64.
|
|
154
|
+
*/
|
|
155
|
+
declare function toFileOutput(bytes: Uint8Array, contentType: string | null | undefined, options?: {
|
|
156
|
+
includeContent?: boolean;
|
|
157
|
+
maxBytes?: number;
|
|
158
|
+
filename?: string;
|
|
159
|
+
text?: boolean;
|
|
160
|
+
}): FileOutput;
|
|
161
|
+
|
|
42
162
|
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
43
163
|
type Headers = Record<string, string>;
|
|
44
164
|
type OpenAPIConfig = {
|
|
@@ -110,4 +230,4 @@ declare function verifyHmacSignatureWithPrefix(payload: string | Buffer, secret:
|
|
|
110
230
|
declare function verifyHmacSha256Signature(payload: string, secret: string, timestamp: string, signature: string, maxAgeSeconds?: number): boolean;
|
|
111
231
|
declare function verifySlackSignature(payload: string, secret: string, timestamp: string, signature: string, maxAgeSeconds?: number): boolean;
|
|
112
232
|
|
|
113
|
-
export { ApiError, type ApiRequestOptions, type ApiResult, type BaseHandleWebhookResult, BaseWebhookHandler, type OpenAPIConfig, type RateLimitConfig, type WebhookEventHandler, request, verifyHmacSha256Signature, verifyHmacSignature, verifyHmacSignatureWithPrefix, verifySlackSignature };
|
|
233
|
+
export { ApiError, type ApiRequestOptions, type ApiResult, type BaseHandleWebhookResult, BaseWebhookHandler, type BinaryResponse, type DownloadDeps, type DownloadOptions, FILE_OUTPUT_MAX_BYTES, type FileInput, FileInputSchema, type FileOutput, FileOutputSchema, type OpenAPIConfig, type PublicDownload, type RateLimitConfig, type ResolveFileOptions, type ResolvedFile, UnsafeUrlError, type WebhookEventHandler, downloadPublicFile, isBlockedAddress, request, resolveFileInput, toFileOutput, verifyHmacSha256Signature, verifyHmacSignature, verifyHmacSignatureWithPrefix, verifySlackSignature };
|
package/dist/http.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-SOY77BN4.js";var M=new Set(["apikey","xapikey","key","appkey","appid","token","apitoken","accesstoken","authtoken","clientsecret","secret","password"]);function T(t){let e=t;try{e=decodeURIComponent(t)}catch{e=t}return M.has(e.toLowerCase().replace(/[-_]/g,""))}function F(t){let e=t.indexOf("?");if(e===-1)return t;let n=t.indexOf("#",e),r=t.slice(0,e+1),i=n===-1?t.slice(e+1):t.slice(e+1,n),s=n===-1?"":t.slice(n),a=!1,o=i.split("&").map(c=>{if(!c)return c;let u=c.indexOf("="),d=u===-1?c:c.slice(0,u);return T(d)?(a=!0,`${d}=[REDACTED]`):c}).join("&");return a?r+o+s:t}function q(t){if(!t)return t;try{let e=/^[a-z]+:\/\//i.test(t),n=e?void 0:"http://localhost",r=new URL(t,n),i=!1;for(let s of[...r.searchParams.keys()])T(s)&&(r.searchParams.set(s,"[REDACTED]"),i=!0);return i?e?r.toString():r.pathname+r.search+r.hash:t}catch{return F(t)}}function U(t){let e=q(t.url),n=!1,r=t.query;if(t.query){r={...t.query};for(let i of Object.keys(r))T(i)&&(r[i]="[REDACTED]",n=!0)}return!n&&e===t.url?t:{...t,url:e,...n?{query:r}:{}}}var f=class extends Error{url;status;statusText;body;request;retryAfter;rateLimitReset;rateLimitRemaining;rateLimitLimit;constructor(e,n,r,i){super(r),this.name="ApiError",this.url=q(n.url),this.status=n.status,this.statusText=n.statusText,this.body=n.body,this.request=U(e),this.retryAfter=i?.retryAfter,this.rateLimitReset=i?.rateLimitReset,this.rateLimitRemaining=i?.rateLimitRemaining,this.rateLimitLimit=i?.rateLimitLimit}isRateLimitError(){return this.status===429}};var A=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},g=class{#t;#r;#e;#n;#s;#a;#i;constructor(e){this.#t=!1,this.#r=!1,this.#e=!1,this.#n=[],this.#s=new Promise((n,r)=>{this.#a=n,this.#i=r;let i=o=>{this.#t||this.#r||this.#e||(this.#t=!0,this.#a&&this.#a(o))},s=o=>{this.#t||this.#r||this.#e||(this.#r=!0,this.#i&&this.#i(o))},a=o=>{this.#t||this.#r||this.#e||this.#n.push(o)};return Object.defineProperty(a,"isResolved",{get:()=>this.#t}),Object.defineProperty(a,"isRejected",{get:()=>this.#r}),Object.defineProperty(a,"isCancelled",{get:()=>this.#e}),e(i,s,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,n){return this.#s.then(e,n)}catch(e){return this.#s.catch(e)}finally(e){return this.#s.finally(e)}cancel(){if(!(this.#t||this.#r||this.#e)){if(this.#e=!0,this.#n.length)try{for(let e of this.#n)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.#n.length=0,this.#i&&this.#i(new A("Request aborted"))}}get isCancelled(){return this.#e}};var w={enabled:!0,maxRetries:3,initialRetryDelay:1e3,backoffMultiplier:2,headerNames:{retryAfter:"retry-after",resetTime:"x-ratelimit-reset",remaining:"x-ratelimit-remaining",limit:"x-ratelimit-limit"}};function N(t,e){let n={};if(e.headerNames.retryAfter){let r=t.headers.get(e.headerNames.retryAfter);if(r){let i=parseInt(r,10);isNaN(i)||(n.retryAfter=i*1e3)}}if(e.headerNames.resetTime){let r=t.headers.get(e.headerNames.resetTime);if(r){let i=parseInt(r,10);if(!isNaN(i)){let s=Date.now(),a=i>1e12?i:i*1e3;n.rateLimitReset=a,a>s&&(n.retryAfter=a-s)}}}if(e.headerNames.remaining){let r=t.headers.get(e.headerNames.remaining);if(r){let i=parseInt(r,10);isNaN(i)||(n.rateLimitRemaining=i)}}if(e.headerNames.limit){let r=t.headers.get(e.headerNames.limit);if(r){let i=parseInt(r,10);isNaN(i)||(n.rateLimitLimit=i)}}return n}function I(t,e,n){return n.enabled?t===429?!0:n.isRateLimitError?n.isRateLimitError(t,e):!1:!1}function E(t,e,n){if(e.retryAfter)return e.retryAfter;let r=n.initialRetryDelay*Math.pow(n.backoffMultiplier,t-1);return Math.min(r,6e4)}async function x(t){return new Promise(e=>setTimeout(e,t))}var O=t=>t!=null,h=t=>typeof t=="string",L=t=>h(t)&&t!=="",v=t=>typeof t=="object"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.arrayBuffer=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),D=t=>t instanceof FormData,_=t=>{try{return btoa(t)}catch{return Buffer.from(t).toString("base64")}},J=t=>{let e=[],n=(i,s)=>{e.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`)},r=(i,s)=>{O(s)&&(Array.isArray(s)?s.forEach(a=>{r(i,a)}):typeof s=="object"?Object.entries(s).forEach(([a,o])=>{r(`${i}[${a}]`,o)}):n(i,s))};return Object.entries(t).forEach(([i,s])=>{r(i,s)}),e.length>0?`?${e.join("&")}`:""},z=(t,e)=>{let n=t.ENCODE_PATH||encodeURI,r=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(o,c)=>e.path?.hasOwnProperty(c)?n(String(e.path[c])):o),i=t.BASE.endsWith("/")?t.BASE.slice(0,-1):t.BASE,s=r.startsWith("/")?r.slice(1):r,a=`${i}/${s}`;return e.query?`${a}${J(e.query)}`:a},Q=t=>{if(t.formData){let e=new FormData,n=(r,i)=>{h(i)||v(i)?e.append(r,i):e.append(r,JSON.stringify(i))};return Object.entries(t.formData).filter(([r,i])=>O(i)).forEach(([r,i])=>{Array.isArray(i)?i.forEach(s=>n(r,s)):n(r,i)}),e}},R=async(t,e)=>typeof e=="function"?e(t):e,G=async(t,e)=>{let[n,r,i,s]=await Promise.all([R(e,t.TOKEN),R(e,t.USERNAME),R(e,t.PASSWORD),R(e,t.HEADERS)]),a=Object.entries({Accept:"application/json",...s,...e.headers}).filter(([o,c])=>O(c)).reduce((o,[c,u])=>({...o,[c]:String(u)}),{});if(L(n)&&(a.Authorization=`Bearer ${n}`),L(r)&&L(i)){let o=_(`${r}:${i}`);a.Authorization=`Basic ${o}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:v(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":h(e.body)?a["Content-Type"]="text/plain":D(e.body)||(a["Content-Type"]="application/json")),new Headers(a)},V=t=>{if(t.body!==void 0)return t.mediaType?.includes("/json")?JSON.stringify(t.body):h(t.body)||v(t.body)||D(t.body)?t.body:JSON.stringify(t.body)},K=async(t,e,n,r,i,s,a)=>{let o=new AbortController,c=t.TIMEOUT??2e4,u={headers:s,body:r??i,method:e.method,signal:AbortSignal.any([o.signal,AbortSignal.timeout(c)])};return t.WITH_CREDENTIALS&&(u.credentials=t.CREDENTIALS),a(()=>o.abort()),await fetch(n,u)},Y=(t,e)=>{if(e){let n=t.headers.get(e);if(h(n))return n}},X=async t=>{if(t.status!==204)try{let e=t.headers.get("Content-Type");if(e)return["application/json","application/problem+json"].some(i=>e.toLowerCase().startsWith(i))?await t.json():await t.text()}catch(e){console.error(e)}},k=(t,e,n)=>{let i={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...t.errors}[e.status];if(i)throw new f(t,e,i,n);if(!e.ok){let s=e.status??"unknown",a=e.statusText??"unknown",o=(()=>{try{return JSON.stringify(e.body,null,2)}catch{return}})(),c=e.body?.message||e.body?.error||e.body?.detail||`Generic Error: status: ${s}; status text: ${a}; body: ${o}`;throw new f(t,e,c,n)}},Z=(t,e,n)=>{let r=n?.rateLimitConfig||w;return new g(async(i,s,a)=>{let o=0,c=r.maxRetries+1;for(;o<c;){o++;try{let u=z(t,e),d=Q(e),B=V(e),j=await G(t,e);if(a.isCancelled)return;let l=await K(t,e,u,B,d,j,a),P=await X(l),$=Y(l,e.responseHeader),b={url:u,ok:l.ok,status:l.status,statusText:l.statusText,body:l.ok?$??P:P};if(r.enabled&&I(l.status,b.body,r)){let S=N(l,r);if(o<c){let W=E(o,S,r);await x(W);continue}k(e,b,S)}k(e,b),i(b.body);return}catch(u){if(u instanceof f&&u.isRateLimitError()&&o<c){let d=u.retryAfter?u.retryAfter:E(o,{retryAfter:u.retryAfter,rateLimitReset:u.rateLimitReset},r);await x(d);continue}if(o>=c){s(u);return}if(u instanceof f&&u.isRateLimitError())continue;s(u);return}}})};var C=class{handlers=new Map;on(e,n){let r=this.handlers.get(e)||[];return r.push(n),this.handlers.set(e,r),this}off(e,n){let r=this.handlers.get(e)||[],i=r.indexOf(n);return i!==-1&&(r.splice(i,1),this.handlers.set(e,r)),this}getRegisteredEvents(){return Array.from(this.handlers.keys())}hasHandlers(e){let n=this.handlers.get(e);return!!n&&n.length>0}clearHandlers(e){return e?this.handlers.delete(e):this.handlers.clear(),this}async executeHandlers(e,n){let r=this.handlers.get(e)||[];for(let i of r)await i(n)}};import*as m from"crypto";function ee(t,e,n,r="sha256"){if(!n||!e)return!1;let i=m.createHmac(r,e).update(t).digest("hex");try{return m.timingSafeEqual(Buffer.from(n),Buffer.from(i))}catch{return!1}}function te(t,e,n,r,i="sha256"){if(!n||!e||!n.startsWith(r))return!1;let s=n.slice(r.length),a=m.createHmac(i,e).update(t).digest("hex");try{return m.timingSafeEqual(Buffer.from(s),Buffer.from(a))}catch{return!1}}function H(t,e,n,r,i=300){if(!e||!r||!n)return!1;let s=Math.floor(Date.now()/1e3),a=parseInt(n,10);if(Math.abs(s-a)>i)return!1;let o=`v0:${n}:${t}`,c="v0="+m.createHmac("sha256",e).update(o).digest("hex");try{return m.timingSafeEqual(Buffer.from(r),Buffer.from(c))}catch{return!1}}function re(t,e,n,r,i=300){return H(t,e,n,r,i)}export{f as ApiError,C as BaseWebhookHandler,Z as request,H as verifyHmacSha256Signature,ee as verifyHmacSignature,te as verifyHmacSignatureWithPrefix,re as verifySlackSignature};
|
|
1
|
+
import"./chunk-SOY77BN4.js";var ce=new Set(["apikey","xapikey","key","appkey","appid","token","apitoken","accesstoken","authtoken","clientsecret","secret","password"]);function C(t){let e=t;try{e=decodeURIComponent(t)}catch{e=t}return ce.has(e.toLowerCase().replace(/[-_]/g,""))}function ue(t){let e=t.indexOf("?");if(e===-1)return t;let n=t.indexOf("#",e),r=t.slice(0,e+1),i=n===-1?t.slice(e+1):t.slice(e+1,n),s=n===-1?"":t.slice(n),o=!1,a=i.split("&").map(l=>{if(!l)return l;let c=l.indexOf("="),f=c===-1?l:l.slice(0,c);return C(f)?(o=!0,`${f}=[REDACTED]`):l}).join("&");return o?r+a+s:t}function H(t){if(!t)return t;try{let e=/^[a-z]+:\/\//i.test(t),n=e?void 0:"http://localhost",r=new URL(t,n),i=!1;for(let s of[...r.searchParams.keys()])C(s)&&(r.searchParams.set(s,"[REDACTED]"),i=!0);return i?e?r.toString():r.pathname+r.search+r.hash:t}catch{return ue(t)}}function fe(t){let e=H(t.url),n=!1,r=t.query;if(t.query){r={...t.query};for(let i of Object.keys(r))C(i)&&(r[i]="[REDACTED]",n=!0)}return!n&&e===t.url?t:{...t,url:e,...n?{query:r}:{}}}var h=class extends Error{url;status;statusText;body;request;retryAfter;rateLimitReset;rateLimitRemaining;rateLimitLimit;constructor(e,n,r,i){super(r),this.name="ApiError",this.url=H(n.url),this.status=n.status,this.statusText=n.statusText,this.body=n.body,this.request=fe(e),this.retryAfter=i?.retryAfter,this.rateLimitReset=i?.rateLimitReset,this.rateLimitRemaining=i?.rateLimitRemaining,this.rateLimitLimit=i?.rateLimitLimit}isRateLimitError(){return this.status===429}};import{z as d}from"zod";import{lookup as de}from"dns/promises";import*as V from"http";import*as X from"https";import{pipeline as me,Readable as pe}from"stream";import*as T from"zlib";var he=3e4,ye=25*1024*1024,W=3,be=[["0.0.0.0",8],["10.0.0.0",8],["100.64.0.0",10],["127.0.0.0",8],["169.254.0.0",16],["172.16.0.0",12],["192.0.0.0",24],["192.0.2.0",24],["192.88.99.0",24],["192.168.0.0",16],["198.18.0.0",15],["198.51.100.0",24],["203.0.113.0",24],["224.0.0.0",4],["240.0.0.0",4]];function v(t){let e=t.split(".");if(e.length!==4)return;let n=0;for(let r of e){if(!/^\d{1,3}$/.test(r))return;let i=Number(r);if(i>255)return;n=n*256+i}return n}function G(t){let e=v(t);return e===void 0?!0:be.some(([n,r])=>{let i=v(n);if(i===void 0)return!1;let s=r===0?0:4294967295<<32-r>>>0;return(e&s)===(i&s)})}function ge(t){let e=t,n=e.indexOf("%");n!==-1&&(e=e.slice(0,n));let r=e.lastIndexOf(":");if(r===-1)return;let i=e.slice(r+1);if(i.includes(".")){let u=v(i);if(u===void 0)return;e=`${e.slice(0,r+1)}${(u>>>16).toString(16)}:${(u&65535).toString(16)}`}let s=e.split("::");if(s.length>2)return;let o=u=>u===""?[]:u.split(":").filter(R=>R!==""),a=o(s[0]??""),l=s.length===2?o(s[1]??""):[];if(![...a,...l].every(u=>/^[0-9a-fA-F]{1,4}$/.test(u)))return;if(s.length===1)return a.length===8?a.map(u=>Number.parseInt(u,16)):void 0;let c=8-a.length-l.length;return c<1?void 0:[...a,...Array(c).fill("0"),...l].map(u=>Number.parseInt(u,16))}function Re(t){let e=ge(t);if(!e)return!0;if(e.slice(0,5).every(r=>r===0)&&(e[5]===65535||e[5]===0)){let r=`${e[6]>>8}.${e[6]&255}.${e[7]>>8}.${e[7]&255}`;if(G(r))return!0}return!!(e.every(r=>r===0)||e.slice(0,7).every(r=>r===0)&&e[7]===1||(e[0]&65024)===64512||(e[0]&65472)===65152||(e[0]&65472)===65216||(e[0]&65280)===65280||e[0]===8194||e[0]===100&&e[1]===65435&&e.slice(2,6).every(r=>r===0)||e[0]===100&&e[1]===65435&&e[2]===1)}function J(t){let e=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t;return e.includes(":")?Re(e):G(e)}var m=class extends Error{constructor(e){super(e),this.name="UnsafeUrlError"}};async function Te(t){return(await de(t,{all:!0,verbatim:!0})).map(n=>n.address)}function xe(t){return((e,n,r)=>{let i=r,s=typeof n=="object"&&n!==null&&n.all===!0,o=t.map(l=>({address:l,family:l.includes(":")?6:4}));if(o.length===0){i(new Error("No address to connect to."),"",0);return}if(s){i(null,o);return}let a=o[0];i(null,a.address,a.family)})}var Ae=(t,e,n)=>{let r=t.protocol==="https:",i=t.hostname.replace(/^\[|\]$/g,""),s={method:"GET",protocol:t.protocol,hostname:i,port:t.port===""?void 0:Number(t.port),path:`${t.pathname}${t.search}`,headers:{Accept:"*/*","Accept-Encoding":"identity"},lookup:xe(e),agent:!1,signal:n};return r&&(s.servername=i),new Promise((o,a)=>{let c=(r?X.request:V.request)(s,f=>{o({status:f.statusCode??0,headers:f.headers,body:f,cancel:()=>f.destroy()})});c.on("error",a),c.end()})};function we(t,e){return e?e.aborted?Promise.reject(e.reason):new Promise((n,r)=>{let i=()=>r(e.reason);e.addEventListener("abort",i,{once:!0}),t.then(s=>{e.removeEventListener("abort",i),n(s)},s=>{e.removeEventListener("abort",i),r(s)})}):t}async function z(t,e={},n){let r;try{r=new URL(t)}catch{throw new m("The file URL must be an absolute URL.")}if(r.protocol!=="http:"&&r.protocol!=="https:")throw new m("The file URL must use http or https.");let i=r.hostname.replace(/^\[|\]$/g,"");if(i==="")throw new m("The file URL must include a host.");let o=i.includes(":")||v(i)!==void 0?[i]:await we((e.resolve??Te)(i).catch(()=>{throw new m(`Could not resolve ${i}.`)}),n);if(o.length===0)throw new m(`Could not resolve ${i}.`);for(let a of o)if(J(a))throw new m(`The file URL points at ${i}, which resolves to a private or reserved address. Use a publicly reachable URL.`);return{url:r,addresses:o}}function Y(t,e){try{let n=new URL(t).pathname.split("/").pop();return n&&n.includes(".")?n:e}catch{return e}}function A(t,e){let n=t[e];return Array.isArray(n)?n[0]:n}function P(t){return new m(`The file is larger than the ${Math.round(t/(1024*1024))} MB limit.`)}async function*Le(t,e){let n=0;for await(let r of t){if(n+=r.byteLength,n>e)throw P(e);yield r}}async function ve(t,e){let n=[],r=0;for await(let o of t){if(r+=o.byteLength,r>e)throw P(e);n.push(o)}let i=new Uint8Array(r),s=0;for(let o of n)i.set(o,s),s+=o.byteLength;return i}async function Ee(t,e,n){let r=e?.trim().toLowerCase();if(!r||r==="identity")return t;let i=r==="gzip"||r==="x-gzip"?T.createGunzip():r==="deflate"?T.createInflate():r==="br"?T.createBrotliDecompress():void 0;if(!i)throw new m(`The file was served with an unsupported Content-Encoding (${r}).`);return me(pe.from(Le(t,n)),i,s=>{s&&i.destroy(s)}),i}function E(t){if(t!==void 0&&!(Number.isSafeInteger(t)&&t>=0))throw new RangeError(`maxBytes must be a whole number of bytes, 0 or more; got ${t}.`)}function Oe(t){if(!t)return;let e=/filename\*\s*=\s*(?:UTF-8|utf-8)''([^;]+)/.exec(t)?.[1];if(e)try{return decodeURIComponent(e.trim())}catch{}let n=/filename\s*=\s*("([^"]*)"|[^;]+)/.exec(t);return(n?.[2]??n?.[1]??"").trim()||void 0}async function I(t,e={},n={}){E(e.maxBytes);let r=e.maxBytes??ye,i=n.transport??Ae,s=AbortSignal.timeout(e.timeoutMs??he),o=await z(t,n,s);for(let a=0;;a++){let l=await i(o.url,o.addresses,s),c;try{let u=A(l.headers,"location");if(l.status>=300&&l.status<400&&u){if(l.cancel?.(),a>=W)throw new m(`The file URL redirected more than ${W} times.`);o=await z(new URL(u,o.url).toString(),n,s);continue}if(l.status<200||l.status>=300)throw new Error(`Could not download the file (${l.status}). Its URL must be publicly reachable.`);let R=Number(A(l.headers,"content-length"));if(Number.isFinite(R)&&R>r)throw P(r);c=await ve(await Ee(l.body,A(l.headers,"content-encoding"),r),r)}catch(u){throw l.cancel?.(),u}let f=Oe(A(l.headers,"content-disposition"));return{bytes:c,contentType:A(l.headers,"content-type")?.split(";")[0]?.trim()||"application/octet-stream",url:o.url.toString(),...f?{filename:f}:{}}}}var Q={filename:d.string().optional().describe("What to call the file. Defaults to the name in its URL."),contentType:d.string().optional().describe("Media type, for example application/pdf. Defaults to what the server states.")},Se=d.union([d.string().min(1).describe("A public http(s) URL to the file."),d.object({url:d.string().min(1).describe("A public http(s) URL to the file."),...Q}),d.object({base64:d.string().min(1).describe("The file, base64-encoded."),...Q})]).describe("A file: a public URL to it, or {url, filename?, contentType?}, or {base64, filename?, contentType?} for a small one.");function Ue(t){return typeof Blob<"u"&&t instanceof Blob}function O(t,e,n){return{bytes:t,filename:e,contentType:n,file:new File([new Uint8Array(t)],e,{type:n})}}var Ce=/^data:([^;,]*)((?:;[^;,=]+=[^;,]*)*)(;base64)?,(.*)$/is,x=t=>new Error(`The file is larger than the ${Math.round(t/(1024*1024))} MB limit.`);function D(t,e){if(t.byteLength===0)throw new Error("The file is empty.");if(e!==void 0&&t.byteLength>e)throw x(e);return t}function Pe(t,e){if(e!==void 0&&Math.ceil(t.length/3)>e)throw x(e);let n=new TextEncoder().encode(t),r=new Uint8Array(e===void 0?n.length:Math.min(n.length,e)),i=0;for(let s=0;s<n.length;s++){if(e!==void 0&&i===e)throw x(e);let o=n[s]===37?String.fromCharCode(n[s+1]??0,n[s+2]??0):"";/^[0-9a-fA-F]{2}$/.test(o)?(r[i++]=Number.parseInt(o,16),s+=2):r[i++]=n[s]}return i===r.length?r:r.slice(0,i)}var K=()=>new Error("The file is not valid base64."),Ie=new Set([9,10,11,12,13,32]);function De(t,e){if(!t.includes("%"))return t;let n=t.replace(/\s+/g,""),r=e===void 0?n.length:Math.min(n.length,Math.ceil(e/3)*4),i=new Uint8Array(r),s=0;for(let o=0;o<n.length;o++){let a=n.charCodeAt(o),l=a===37?n.slice(o+1,o+3):"";if(/^[0-9a-fA-F]{2}$/.test(l)&&(a=Number.parseInt(l,16),o+=2),!Ie.has(a)){if(a>127)throw K();if(s===r)throw x(e??r);i[s++]=a}}return Buffer.from(i.buffer,0,s).toString("latin1")}function Z(t,e){let n=t.replace(/\s+/g,"");if(n.length%4===0&&(n.endsWith("==")?n=n.slice(0,-2):n.endsWith("=")&&(n=n.slice(0,-1))),n.length===0||n.length%4===1||!/^[A-Za-z0-9+/_-]+$/.test(n))throw K();if(e!==void 0&&Math.floor(n.length*3/4)>e)throw x(e);return D(new Uint8Array(Buffer.from(n,"base64")),e)}async function ke(t,e={},n={}){E(e.maxBytes);let r=e.fallbackName??"file";if(Ue(t)){let a=typeof File<"u"&&t instanceof File&&t.name?t.name:r;if(e.maxBytes!==void 0&&t.size>e.maxBytes)throw x(e.maxBytes);return O(D(new Uint8Array(await t.arrayBuffer()),e.maxBytes),a,t.type||"application/octet-stream")}let i=typeof t=="string"?{url:t}:t;if("base64"in i)return O(Z(i.base64,e.maxBytes),i.filename??r,i.contentType??"application/octet-stream");let s=Ce.exec(i.url);if(s){let[,a,,l,c=""]=s,f=l?Z(De(c,e.maxBytes),e.maxBytes):D(Pe(c,e.maxBytes),e.maxBytes);return O(f,i.filename??r,i.contentType??(a||"application/octet-stream"))}let o=await I(i.url,e,n);return O(o.bytes,i.filename??o.filename??Y(o.url,r),i.contentType??o.contentType)}var Fe=d.object({contentBase64:d.string().optional().describe("The file, base64-encoded. Missing when the file came back as text or contentOmitted is set."),text:d.string().optional().describe("The file as text, in place of contentBase64, when it is a text file (CSV, JSON, Markdown, XML and the like) in UTF-8."),contentType:d.string().describe("Media type of the file, for example application/pdf."),byteLength:d.number().describe("Size of the file in bytes."),filename:d.string().optional().describe("The file name, when known."),contentOmitted:d.enum(["not_requested","over_limit"]).optional().describe("Set when the content was left out: the caller did not ask for it, or the file was over the limit.")}),ee=7e5,Be=new Set(["application/json","application/xml","application/javascript","application/ecmascript","application/x-javascript","application/yaml","application/x-yaml","application/toml","application/csv","application/ndjson","application/x-ndjson","application/sql","application/graphql","application/x-sh"]);function Ne(t){let e=t.toLowerCase();return e.startsWith("text/")||e.endsWith("+json")||e.endsWith("+xml")||Be.has(e)}var qe=new Set(["application/octet-stream","binary/octet-stream","application/unknown"]),$e=new Set(["txt","text","csv","tsv","md","markdown","json","jsonl","ndjson","xml","yaml","yml","toml","ini","log","html","htm","css","js","mjs","cjs","ts","tsx","jsx","sql","sh","py","rb","go","rs","java","svg","ics","vcf","srt","vtt"]);function je(t,e){if(Ne(t))return!0;if(!qe.has(t.toLowerCase()))return!1;let n=/\.([a-z0-9]+)$/.exec(e?.toLowerCase()??"")?.[1];return n!==void 0&&$e.has(n)}function Me(t){try{return new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t)}catch{return}}function _e(t,e,n={}){E(n.maxBytes);let r={contentType:e?.split(";")[0]?.trim()||"application/octet-stream",byteLength:t.byteLength,...n.filename?{filename:n.filename}:{}};if(n.includeContent===!1)return{...r,contentOmitted:"not_requested"};if(t.byteLength>(n.maxBytes??ee))return{...r,contentOmitted:"over_limit"};let i=n.text!==!1&&je(r.contentType,n.filename)?Me(t):void 0;return i!==void 0?{...r,text:i}:{...r,contentBase64:Buffer.from(t).toString("base64")}}var k=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},S=class{#t;#n;#e;#r;#s;#o;#i;constructor(e){this.#t=!1,this.#n=!1,this.#e=!1,this.#r=[],this.#s=new Promise((n,r)=>{this.#o=n,this.#i=r;let i=a=>{this.#t||this.#n||this.#e||(this.#t=!0,this.#o&&this.#o(a))},s=a=>{this.#t||this.#n||this.#e||(this.#n=!0,this.#i&&this.#i(a))},o=a=>{this.#t||this.#n||this.#e||this.#r.push(a)};return Object.defineProperty(o,"isResolved",{get:()=>this.#t}),Object.defineProperty(o,"isRejected",{get:()=>this.#n}),Object.defineProperty(o,"isCancelled",{get:()=>this.#e}),e(i,s,o)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,n){return this.#s.then(e,n)}catch(e){return this.#s.catch(e)}finally(e){return this.#s.finally(e)}cancel(){if(!(this.#t||this.#n||this.#e)){if(this.#e=!0,this.#r.length)try{for(let e of this.#r)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.#r.length=0,this.#i&&this.#i(new k("Request aborted"))}}get isCancelled(){return this.#e}};var te={enabled:!0,maxRetries:3,initialRetryDelay:1e3,backoffMultiplier:2,headerNames:{retryAfter:"retry-after",resetTime:"x-ratelimit-reset",remaining:"x-ratelimit-remaining",limit:"x-ratelimit-limit"}};function ne(t,e){let n={};if(e.headerNames.retryAfter){let r=t.headers.get(e.headerNames.retryAfter);if(r){let i=parseInt(r,10);isNaN(i)||(n.retryAfter=i*1e3)}}if(e.headerNames.resetTime){let r=t.headers.get(e.headerNames.resetTime);if(r){let i=parseInt(r,10);if(!isNaN(i)){let s=Date.now(),o=i>1e12?i:i*1e3;n.rateLimitReset=o,o>s&&(n.retryAfter=o-s)}}}if(e.headerNames.remaining){let r=t.headers.get(e.headerNames.remaining);if(r){let i=parseInt(r,10);isNaN(i)||(n.rateLimitRemaining=i)}}if(e.headerNames.limit){let r=t.headers.get(e.headerNames.limit);if(r){let i=parseInt(r,10);isNaN(i)||(n.rateLimitLimit=i)}}return n}function re(t,e,n){return n.enabled?t===429?!0:n.isRateLimitError?n.isRateLimitError(t,e):!1:!1}function F(t,e,n){if(e.retryAfter)return e.retryAfter;let r=n.initialRetryDelay*Math.pow(n.backoffMultiplier,t-1);return Math.min(r,6e4)}async function B(t){return new Promise(e=>setTimeout(e,t))}var q=t=>t!=null,w=t=>typeof t=="string",N=t=>w(t)&&t!=="",$=t=>typeof t=="object"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.arrayBuffer=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),se=t=>t instanceof FormData,He=t=>{try{return btoa(t)}catch{return Buffer.from(t).toString("base64")}},We=t=>{let e=[],n=(i,s)=>{e.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`)},r=(i,s)=>{q(s)&&(Array.isArray(s)?s.forEach(o=>{r(i,o)}):typeof s=="object"?Object.entries(s).forEach(([o,a])=>{r(`${i}[${o}]`,a)}):n(i,s))};return Object.entries(t).forEach(([i,s])=>{r(i,s)}),e.length>0?`?${e.join("&")}`:""},ze=(t,e)=>{let n=t.ENCODE_PATH||encodeURI,r=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(a,l)=>e.path?.hasOwnProperty(l)?n(String(e.path[l])):a),i=t.BASE.endsWith("/")?t.BASE.slice(0,-1):t.BASE,s=r.startsWith("/")?r.slice(1):r,o=`${i}/${s}`;return e.query?`${o}${We(e.query)}`:o},Ve=t=>{if(t.formData){let e=new FormData,n=(r,i)=>{w(i)||$(i)?e.append(r,i):e.append(r,JSON.stringify(i))};return Object.entries(t.formData).filter(([r,i])=>q(i)).forEach(([r,i])=>{Array.isArray(i)?i.forEach(s=>n(r,s)):n(r,i)}),e}},U=async(t,e)=>typeof e=="function"?e(t):e,Xe=async(t,e)=>{let[n,r,i,s]=await Promise.all([U(e,t.TOKEN),U(e,t.USERNAME),U(e,t.PASSWORD),U(e,t.HEADERS)]),o=Object.entries({Accept:"application/json",...s,...e.headers}).filter(([a,l])=>q(l)).reduce((a,[l,c])=>({...a,[l]:String(c)}),{});if(N(n)&&(o.Authorization=`Bearer ${n}`),N(r)&&N(i)){let a=He(`${r}:${i}`);o.Authorization=`Basic ${a}`}return e.body!==void 0&&(e.mediaType?o["Content-Type"]=e.mediaType:$(e.body)?o["Content-Type"]=e.body.type||"application/octet-stream":w(e.body)?o["Content-Type"]="text/plain":se(e.body)||(o["Content-Type"]="application/json")),new Headers(o)},Ge=t=>{if(t.body!==void 0)return t.mediaType?.includes("/json")?JSON.stringify(t.body):w(t.body)||$(t.body)||se(t.body)?t.body:JSON.stringify(t.body)},Je=async(t,e,n,r,i,s,o)=>{let a=new AbortController,l=t.TIMEOUT??2e4,c={headers:s,body:r??i,method:e.method,signal:AbortSignal.any([a.signal,AbortSignal.timeout(l)])};return t.WITH_CREDENTIALS&&(c.credentials=t.CREDENTIALS),o(()=>a.abort()),await fetch(n,c)},Ye=(t,e)=>{if(e){let n=t.headers.get(e);if(w(n))return n}},Qe=async(t,e)=>{if(e?.responseType==="binary"&&t.status===204)return{bytes:new Uint8Array(0),contentType:t.headers.get("Content-Type")};if(t.status!==204){if(e?.responseType==="binary"&&t.ok)return{bytes:new Uint8Array(await t.arrayBuffer()),contentType:t.headers.get("Content-Type")};try{let n=t.headers.get("Content-Type");if(n)return["application/json","application/problem+json"].some(s=>n.toLowerCase().startsWith(s))?await t.json():await t.text()}catch(n){console.error(n)}}},ie=(t,e,n)=>{let i={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",...t.errors}[e.status];if(i)throw new h(t,e,i,n);if(!e.ok){let s=e.status??"unknown",o=e.statusText??"unknown",a=(()=>{try{return JSON.stringify(e.body,null,2)}catch{return}})(),l=e.body?.message||e.body?.error||e.body?.detail||`Generic Error: status: ${s}; status text: ${o}; body: ${a}`;throw new h(t,e,l,n)}},Ze=(t,e,n)=>{let r=n?.rateLimitConfig||te;return new S(async(i,s,o)=>{let a=0,l=r.maxRetries+1;for(;a<l;){a++;try{let c=ze(t,e),f=Ve(e),u=Ge(e),R=await Xe(t,e);if(o.isCancelled)return;let p=await Je(t,e,c,u,f,R,o),M=await Qe(p,e),ae=Ye(p,e.responseHeader),L={url:c,ok:p.ok,status:p.status,statusText:p.statusText,body:p.ok?ae??M:M};if(r.enabled&&re(p.status,L.body,r)){let _=ne(p,r);if(a<l){let le=F(a,_,r);await B(le);continue}ie(e,L,_)}ie(e,L),i(L.body);return}catch(c){if(c instanceof h&&c.isRateLimitError()&&a<l){let f=c.retryAfter?c.retryAfter:F(a,{retryAfter:c.retryAfter,rateLimitReset:c.rateLimitReset},r);await B(f);continue}if(a>=l){s(c);return}if(c instanceof h&&c.isRateLimitError())continue;s(c);return}}})};var j=class{handlers=new Map;on(e,n){let r=this.handlers.get(e)||[];return r.push(n),this.handlers.set(e,r),this}off(e,n){let r=this.handlers.get(e)||[],i=r.indexOf(n);return i!==-1&&(r.splice(i,1),this.handlers.set(e,r)),this}getRegisteredEvents(){return Array.from(this.handlers.keys())}hasHandlers(e){let n=this.handlers.get(e);return!!n&&n.length>0}clearHandlers(e){return e?this.handlers.delete(e):this.handlers.clear(),this}async executeHandlers(e,n){let r=this.handlers.get(e)||[];for(let i of r)await i(n)}};import*as g from"crypto";function Ke(t,e,n,r="sha256"){if(!n||!e)return!1;let i=g.createHmac(r,e).update(t).digest("hex");try{return g.timingSafeEqual(Buffer.from(n),Buffer.from(i))}catch{return!1}}function et(t,e,n,r,i="sha256"){if(!n||!e||!n.startsWith(r))return!1;let s=n.slice(r.length),o=g.createHmac(i,e).update(t).digest("hex");try{return g.timingSafeEqual(Buffer.from(s),Buffer.from(o))}catch{return!1}}function oe(t,e,n,r,i=300){if(!e||!r||!n)return!1;let s=Math.floor(Date.now()/1e3),o=parseInt(n,10);if(Math.abs(s-o)>i)return!1;let a=`v0:${n}:${t}`,l="v0="+g.createHmac("sha256",e).update(a).digest("hex");try{return g.timingSafeEqual(Buffer.from(r),Buffer.from(l))}catch{return!1}}function tt(t,e,n,r,i=300){return oe(t,e,n,r,i)}export{h as ApiError,j as BaseWebhookHandler,ee as FILE_OUTPUT_MAX_BYTES,Se as FileInputSchema,Fe as FileOutputSchema,m as UnsafeUrlError,I as downloadPublicFile,J as isBlockedAddress,Ze as request,ke as resolveFileInput,_e as toFileOutput,oe as verifyHmacSha256Signature,Ke as verifyHmacSignature,et as verifyHmacSignatureWithPrefix,tt as verifySlackSignature};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "corsair",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.202",
|
|
4
4
|
"description": "Open-source integration layer for AI agents and apps. Managed OAuth, webhooks, and one API for 350+ integrations, with credentials that stay in your own database.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"optionalDependencies": {
|
|
91
91
|
"@corsair-dev/frpc-darwin-arm64": "0.1.117",
|
|
92
92
|
"@corsair-dev/frpc-darwin-x64": "0.1.117",
|
|
93
|
-
"@corsair-dev/frpc-linux-x64": "0.1.117",
|
|
94
93
|
"@corsair-dev/frpc-linux-arm64": "0.1.117",
|
|
94
|
+
"@corsair-dev/frpc-linux-x64": "0.1.117",
|
|
95
95
|
"@corsair-dev/frpc-win32-arm64": "0.1.117",
|
|
96
96
|
"@corsair-dev/frpc-win32-x64": "0.1.117"
|
|
97
97
|
},
|