@alyvro/api-service 1.3.0 → 1.3.3
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/README.md +13 -3
- package/dist/api-X5uDFWSi.d.mts +41 -0
- package/dist/api-X5uDFWSi.d.ts +41 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/package.json +1 -1
- package/dist/api-BD94m-ym.d.mts +0 -16
- package/dist/api-BD94m-ym.d.ts +0 -16
package/README.md
CHANGED
|
@@ -131,8 +131,18 @@ Define your API schema once and get full auto-completion and type inference for
|
|
|
131
131
|
import { ApiService } from "@alyvro/api-service";
|
|
132
132
|
|
|
133
133
|
type ApiSchema = {
|
|
134
|
-
"/users": {
|
|
135
|
-
|
|
134
|
+
"/users": {
|
|
135
|
+
GET: {
|
|
136
|
+
response: { id: number; name: string }[];
|
|
137
|
+
params: { page: number; index: number };
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
"/auth/login": {
|
|
141
|
+
POST: {
|
|
142
|
+
body: { username: string };
|
|
143
|
+
response: { token: string };
|
|
144
|
+
};
|
|
145
|
+
};
|
|
136
146
|
};
|
|
137
147
|
|
|
138
148
|
const api = new ApiService({
|
|
@@ -145,7 +155,7 @@ api.post("/auth/login", { username: "admin" }).then((res) => {
|
|
|
145
155
|
});
|
|
146
156
|
|
|
147
157
|
// ✅ TypeScript knows this returns Array<{ id: number; name: string }>
|
|
148
|
-
api.get("/users").then((res) => {
|
|
158
|
+
api.get("/users", { params: { page: 1 } }).then((res) => {
|
|
149
159
|
console.log(res.data[0].name);
|
|
150
160
|
});
|
|
151
161
|
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
|
|
3
|
+
type ServiceMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
4
|
+
type ServiceSchema = {
|
|
5
|
+
[url: string]: Partial<Record<ServiceMethod, {
|
|
6
|
+
response: any;
|
|
7
|
+
body?: any;
|
|
8
|
+
params?: any;
|
|
9
|
+
}>>;
|
|
10
|
+
};
|
|
11
|
+
type RoutesWithMethod<S extends ServiceSchema, M extends ServiceMethod> = {
|
|
12
|
+
[K in keyof S]: M extends keyof S[K] ? K : never;
|
|
13
|
+
}[keyof S];
|
|
14
|
+
type ExtractBody<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
15
|
+
body: infer B;
|
|
16
|
+
} ? B : undefined : undefined;
|
|
17
|
+
type ExtractResponse<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
18
|
+
response: infer R;
|
|
19
|
+
} ? R : any : any;
|
|
20
|
+
type ExtractParams<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
21
|
+
params: infer P;
|
|
22
|
+
} ? P : undefined : undefined;
|
|
23
|
+
type AlyvroAxiosInstance<S extends ServiceSchema = any> = Omit<AxiosInstance, "request" | "get" | "post" | "patch" | "delete" | "put"> & {
|
|
24
|
+
get<U extends RoutesWithMethod<S, "GET">>(url: U, config?: AxiosRequestConfig & {
|
|
25
|
+
params?: ExtractParams<S, U, "GET">;
|
|
26
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, "GET">>>;
|
|
27
|
+
delete<U extends RoutesWithMethod<S, "DELETE">>(url: U, config?: AxiosRequestConfig & {
|
|
28
|
+
params?: ExtractParams<S, U, "DELETE">;
|
|
29
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, "DELETE">>>;
|
|
30
|
+
post<U extends RoutesWithMethod<S, "POST">>(url: U, ...args: ExtractBody<S, U, "POST"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "POST">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "POST">>>;
|
|
31
|
+
put<U extends RoutesWithMethod<S, "PUT">>(url: U, ...args: ExtractBody<S, U, "PUT"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "PUT">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "PUT">>>;
|
|
32
|
+
patch<U extends RoutesWithMethod<S, "PATCH">>(url: U, ...args: ExtractBody<S, U, "PATCH"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "PATCH">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "PATCH">>>;
|
|
33
|
+
request<U extends keyof S, M extends ServiceMethod>(config: AxiosRequestConfig & {
|
|
34
|
+
url: U;
|
|
35
|
+
method: M;
|
|
36
|
+
data?: ExtractBody<S, U, M>;
|
|
37
|
+
params?: ExtractParams<S, U, M>;
|
|
38
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, M>>>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type { AlyvroAxiosInstance as A, ServiceSchema as S };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
|
|
3
|
+
type ServiceMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
4
|
+
type ServiceSchema = {
|
|
5
|
+
[url: string]: Partial<Record<ServiceMethod, {
|
|
6
|
+
response: any;
|
|
7
|
+
body?: any;
|
|
8
|
+
params?: any;
|
|
9
|
+
}>>;
|
|
10
|
+
};
|
|
11
|
+
type RoutesWithMethod<S extends ServiceSchema, M extends ServiceMethod> = {
|
|
12
|
+
[K in keyof S]: M extends keyof S[K] ? K : never;
|
|
13
|
+
}[keyof S];
|
|
14
|
+
type ExtractBody<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
15
|
+
body: infer B;
|
|
16
|
+
} ? B : undefined : undefined;
|
|
17
|
+
type ExtractResponse<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
18
|
+
response: infer R;
|
|
19
|
+
} ? R : any : any;
|
|
20
|
+
type ExtractParams<S extends ServiceSchema, U extends keyof S, M extends ServiceMethod> = M extends keyof S[U] ? S[U][M] extends {
|
|
21
|
+
params: infer P;
|
|
22
|
+
} ? P : undefined : undefined;
|
|
23
|
+
type AlyvroAxiosInstance<S extends ServiceSchema = any> = Omit<AxiosInstance, "request" | "get" | "post" | "patch" | "delete" | "put"> & {
|
|
24
|
+
get<U extends RoutesWithMethod<S, "GET">>(url: U, config?: AxiosRequestConfig & {
|
|
25
|
+
params?: ExtractParams<S, U, "GET">;
|
|
26
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, "GET">>>;
|
|
27
|
+
delete<U extends RoutesWithMethod<S, "DELETE">>(url: U, config?: AxiosRequestConfig & {
|
|
28
|
+
params?: ExtractParams<S, U, "DELETE">;
|
|
29
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, "DELETE">>>;
|
|
30
|
+
post<U extends RoutesWithMethod<S, "POST">>(url: U, ...args: ExtractBody<S, U, "POST"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "POST">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "POST">>>;
|
|
31
|
+
put<U extends RoutesWithMethod<S, "PUT">>(url: U, ...args: ExtractBody<S, U, "PUT"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "PUT">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "PUT">>>;
|
|
32
|
+
patch<U extends RoutesWithMethod<S, "PATCH">>(url: U, ...args: ExtractBody<S, U, "PATCH"> extends undefined ? [data?: any, config?: AxiosRequestConfig] : [data: ExtractBody<S, U, "PATCH">, config?: AxiosRequestConfig]): Promise<AxiosResponse<ExtractResponse<S, U, "PATCH">>>;
|
|
33
|
+
request<U extends keyof S, M extends ServiceMethod>(config: AxiosRequestConfig & {
|
|
34
|
+
url: U;
|
|
35
|
+
method: M;
|
|
36
|
+
data?: ExtractBody<S, U, M>;
|
|
37
|
+
params?: ExtractParams<S, U, M>;
|
|
38
|
+
}): Promise<AxiosResponse<ExtractResponse<S, U, M>>>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type { AlyvroAxiosInstance as A, ServiceSchema as S };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as g,b as x,c as
|
|
2
|
-
please set on .env config or in ApiService options`);g({...t,env:{PRIVATE_KEY:s,PUBLIC_KEY:o}})}get client(){return{axios:{request:()=>
|
|
1
|
+
import{a as g,b as x,c as v}from"./chunk-OO3Q5EY3.js";import{a as T,b as S,c as b}from"./chunk-TSDIGLLM.js";import"axios";import E from"axios";import w from"jsonwebtoken";import{gunzipSync as A,gzipSync as I}from"zlib";var{sign:R}=w;function C(u,t,s,o){let a=E.create({baseURL:u,auth:t});return a.interceptors.request.use(e=>{let{encryptSecureBlob:y}=v(s),n=e.secret;if(e.headers[o?.headers?.apiKey??"x-alyvro-api-key"]=R({data:"alyvro-secret-api-service"},s?.PRIVATE_KEY,{expiresIn:"10min"}),e.headers[o?.headers?.bodyType??"x-alyvro-body-type"]=n?.body?"sec":"none",e.headers[o?.headers?.status??"x-alyvro-status"]=e.status??!0,e.plugins?.compressor&&e?.data){let i=JSON.stringify(e.data);e.data=I(i),e.headers["Content-Encoding"]="gzip"}return n?.body&&e?.data&&(e.data=y(typeof e.data=="string"?e.data:JSON.stringify(e.data))),e}),a.interceptors.response.use(e=>{let y=e.data;if(e.headers["content-encoding"]==="gzip"&&Buffer.isBuffer(e.data))try{y=JSON.parse(A(e.data).toString("utf-8"))}catch(i){console.error("Failed to decompress response",i)}let n=y;if(e.config?.plugins?.cache){let i=e.config.url;return{...e,data:e.config.plugins.cache.set(i,n)}}return{...e,data:n}}),T(a),a}var d=class extends Error{status;statusText;data;response_return_status_check;config;constructor(t,s,o,a){super(`Request failed with status ${t}`),this.status=t,this.statusText=s,this.data=o,this.config=a}};import _ from"jsonwebtoken";var{sign:P}=_;async function l(u,t){let s=x();if(!s)throw new Error("please set config");let{url:o,auth:a,env:e}=s,n={...t,headers:(()=>{let r=new Headers(t?.headers);return r.set(s.middleware?.headers?.apiKey??"x-alyvro-api-key",P({data:"alyvro-secret-api-service"},e?.PRIVATE_KEY,{expiresIn:"10min"})),r.set(s.middleware?.headers?.bodyType??"x-alyvro-body-type","none"),r.set(s.middleware?.headers?.status??"x-alyvro-status",String(t?.status??!0)),a?.username&&a?.password&&r.set("Authorization","Basic "+Buffer.from(`${a.username}:${a.password}`).toString("base64")),t?.method==="POST"&&r.set("Content-Type","application/json"),r})(),...t?.body?{body:typeof t.body=="string"?t.body:JSON.stringify(t.body)}:void 0},i=o.concat(u);if(t?.response_return){let r=await fetch(i,n);if(!t.response_return_status_check&&!r.ok){let m=await r.json();throw new d(r.status,r.statusText,m,t)}if(t.response_return_status_check&&t.response_return_status_check!==r.status){let m=await r.json();throw new d(r.status,r.statusText,m,t)}return await r.json()}return fetch(i,n)}var f=class{data;constructor(t){this.data=t}};var h=class extends f{constructor(t){super(t);let s=t.env?.PRIVATE_KEY??process.env.PRIVATE_KEY,o=t.env?.PUBLIC_KEY??process.env.PUBLIC_KEY;if(!s||!o)throw new Error(`Error to get ${s?"PRIVATE_KEY":"PUBLIC_KEY"}
|
|
2
|
+
please set on .env config or in ApiService options`);g({...t,env:{PRIVATE_KEY:s,PUBLIC_KEY:o}})}get client(){return{axios:{request:()=>C(this.data.url,this.data.auth,this.data.env,this.data.middleware)},fetch:{request:l}}}static get plugins(){return{cache:{server:b}}}static get storages(){return{server:{cache:S}}}};export{h as ApiService};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/axios.d.ts","../../src/client/api.ts","../../src/error/api-error.ts","../../src/client/fetcher.ts","../../src/types/api-service.ts","../../src/config/main.ts"],"sourcesContent":["import \"axios\";\r\nimport { ReturnFunction } from \"./cache\";\r\nimport { RetryOptions } from \"./retry\";\r\n\r\ndeclare module \"axios\" {\r\n export interface AxiosRequestConfig extends ApiExteraConfigRequest {}\r\n}\r\n\r\nexport {};\r\n","import { retry } from \"@/plugins/retry\";\r\nimport type { AlyvroAxiosInstance, ApiResponseMapDefault } from \"@/types/api\";\r\nimport type { ConfigEnvType, ConfigMiddlewareType } from \"@/types/config\";\r\nimport Encrypt from \"@/utils/enc\";\r\nimport axios, { type AxiosBasicCredentials } from \"axios\";\r\nimport jwt from \"jsonwebtoken\";\r\nimport { gunzipSync, gzipSync } from \"zlib\";\r\n\r\nconst { sign } = jwt;\r\n\r\nexport default function <M extends Record<string, any> = ApiResponseMapDefault>(\r\n base: string,\r\n auth?: AxiosBasicCredentials,\r\n env?: ConfigEnvType,\r\n config_middleware?: Partial<ConfigMiddlewareType>\r\n): AlyvroAxiosInstance<M> {\r\n const api = axios.create({\r\n baseURL: base,\r\n auth,\r\n }) as AlyvroAxiosInstance<M>;\r\n\r\n api.interceptors.request.use((config) => {\r\n const { encryptSecureBlob } = Encrypt(env);\r\n const secret = (config as any).secret;\r\n\r\n config.headers[config_middleware?.headers?.apiKey ?? \"x-alyvro-api-key\"] =\r\n sign({ data: \"alyvro-secret-api-service\" }, env?.PRIVATE_KEY!, {\r\n expiresIn: \"10min\",\r\n });\r\n\r\n config.headers[\r\n config_middleware?.headers?.bodyType ?? \"x-alyvro-body-type\"\r\n ] = secret?.body ? \"sec\" : \"none\";\r\n\r\n config.headers[config_middleware?.headers?.status ?? \"x-alyvro-status\"] =\r\n (config as any).status ?? true;\r\n\r\n if ((config as any).plugins?.compressor && config?.data) {\r\n const str = JSON.stringify(config.data);\r\n config.data = gzipSync(str);\r\n config.headers[\"Content-Encoding\"] = \"gzip\";\r\n }\r\n\r\n if (secret?.body && config?.data) {\r\n config.data = encryptSecureBlob(\r\n typeof config.data === \"string\"\r\n ? config.data\r\n : JSON.stringify(config.data)\r\n );\r\n }\r\n\r\n return config;\r\n });\r\n\r\n api.interceptors.response.use((res) => {\r\n let data = res.data;\r\n\r\n if (\r\n res.headers[\"content-encoding\"] === \"gzip\" &&\r\n Buffer.isBuffer(res.data)\r\n ) {\r\n try {\r\n data = JSON.parse(gunzipSync(res.data).toString(\"utf-8\"));\r\n } catch (error) {\r\n console.error(\"Failed to decompress response\", error);\r\n }\r\n }\r\n\r\n const parsed = data;\r\n\r\n if ((res.config as any)?.plugins?.cache) {\r\n const key = res.config.url!;\r\n return {\r\n ...res,\r\n data: (res.config as any).plugins.cache.set(key, parsed),\r\n };\r\n }\r\n\r\n return { ...res, data: parsed };\r\n });\r\n\r\n retry(api);\r\n\r\n return api;\r\n}\r\n","import type { RequestInitType } from \"@/types/fetch\";\r\n\r\nexport class ApiError<T = any> extends Error {\r\n public status: number;\r\n public statusText: string;\r\n public data: T;\r\n public response_return_status_check?: number;\r\n public config: RequestInitType;\r\n\r\n constructor(\r\n status: number,\r\n statusText: string,\r\n data: T,\r\n config: RequestInitType\r\n ) {\r\n super(`Request failed with status ${status}`);\r\n this.status = status;\r\n this.statusText = statusText;\r\n this.data = data;\r\n this.config = config;\r\n }\r\n}\r\n","import { ApiError } from \"@/error/api-error\";\r\nimport { getConfigStorage } from \"@/storage\";\r\nimport type { RequestInitType } from \"@/types/fetch\";\r\nimport jwt from \"jsonwebtoken\";\r\n\r\nconst { sign } = jwt;\r\n\r\nexport default async function fetcher<T = unknown>(\r\n input: string,\r\n init?: RequestInitType | undefined\r\n) {\r\n const config = getConfigStorage();\r\n\r\n if (!config) throw new Error(\"please set config\");\r\n\r\n const { url, auth, env } = config;\r\n\r\n // const secret = init?.secret;\r\n\r\n const buildHeaders = (): Headers => {\r\n const headers = new Headers(init?.headers);\r\n\r\n headers.set(\r\n config.middleware?.headers?.apiKey ?? \"x-alyvro-api-key\",\r\n sign({ data: \"alyvro-secret-api-service\" }, env?.PRIVATE_KEY!, {\r\n expiresIn: \"10min\",\r\n })\r\n );\r\n headers.set(\r\n config.middleware?.headers?.bodyType ?? \"x-alyvro-body-type\",\r\n \"none\"\r\n );\r\n headers.set(\r\n config.middleware?.headers?.status ?? \"x-alyvro-status\",\r\n String(init?.status ?? true)\r\n );\r\n\r\n if (auth?.username && auth?.password) {\r\n headers.set(\r\n \"Authorization\",\r\n \"Basic \" +\r\n Buffer.from(`${auth.username}:${auth.password}`).toString(\"base64\")\r\n );\r\n }\r\n\r\n if (init?.method === \"POST\") {\r\n headers.set(\"Content-Type\", \"application/json\");\r\n }\r\n\r\n return headers;\r\n };\r\n\r\n const finalInit: RequestInitType = {\r\n ...init,\r\n headers: buildHeaders(),\r\n ...(init?.body\r\n ? {\r\n body:\r\n typeof init.body === \"string\"\r\n ? init.body\r\n : JSON.stringify(init.body),\r\n }\r\n : undefined),\r\n };\r\n\r\n const finalUrl = url.concat(input);\r\n\r\n // if (init?.plugins?.compressor && init?.body) {\r\n // const str =\r\n // typeof init.body === \"string\" ? init.body : JSON.stringify(init.body);\r\n // const compressed = gzipSync(str);\r\n\r\n // finalInit.body = new Uint8Array(compressed);\r\n // (finalInit.headers as Record<string, string>)[\"Content-Encoding\"] = \"gzip\";\r\n // }\r\n\r\n if (init?.response_return) {\r\n const res = await fetch(finalUrl, finalInit);\r\n\r\n if (!init.response_return_status_check && !res.ok) {\r\n const data = await res.json();\r\n\r\n throw new ApiError(res.status, res.statusText, data, init);\r\n }\r\n\r\n if (\r\n init.response_return_status_check &&\r\n init.response_return_status_check !== res.status\r\n ) {\r\n const data = await res.json();\r\n\r\n throw new ApiError(res.status, res.statusText, data, init);\r\n }\r\n\r\n return (await res.json()) as T;\r\n }\r\n\r\n return fetch(finalUrl, finalInit);\r\n}\r\n","import type { ConfigType } from \"@/types/config\";\r\nimport type { AlyvroAxiosInstance, ApiResponseMapDefault } from \"./api\";\r\n\r\nexport abstract class ApiServiceType {\r\n protected data: ConfigType;\r\n\r\n constructor(obj: ConfigType) {\r\n this.data = obj;\r\n }\r\n\r\n abstract get client(): {\r\n axios: {\r\n request: <\r\n M extends Record<string, any> = ApiResponseMapDefault,\r\n >() => AlyvroAxiosInstance<M>;\r\n };\r\n fetch: {\r\n request: typeof import(\"@/client/fetcher\").default;\r\n };\r\n };\r\n}\r\n\r\nexport interface ApiServiceTypeConstructor {\r\n new (obj: ConfigType): ApiServiceType;\r\n plugins: {\r\n cache: {\r\n server: typeof import(\"@/plugins/cache/server\").serverCachePlugin;\r\n };\r\n };\r\n}\r\n","import api from \"@/client/api\";\r\nimport fetcher from \"@/client/fetcher\";\r\nimport { serverCache, serverCachePlugin } from \"@/plugins/cache/server\";\r\nimport { setConfigStorage } from \"@/storage\";\r\nimport { ApiResponseMapDefault } from \"@/types/api\";\r\nimport { ApiServiceType } from \"@/types/api-service\";\r\nimport type { ConfigType } from \"@/types/config\";\r\n\r\nexport class ApiService extends ApiServiceType {\r\n constructor(obj: ConfigType) {\r\n super(obj);\r\n\r\n const privateKey = obj.env?.PRIVATE_KEY ?? process.env.PRIVATE_KEY;\r\n const publicKey = obj.env?.PUBLIC_KEY ?? process.env.PUBLIC_KEY;\r\n\r\n if (!privateKey || !publicKey) {\r\n throw new Error(\r\n `Error to get ${\r\n privateKey ? \"PRIVATE_KEY\" : \"PUBLIC_KEY\"\r\n }\\nplease set on .env config or in ApiService options`,\r\n );\r\n }\r\n\r\n setConfigStorage({\r\n ...obj,\r\n env: {\r\n PRIVATE_KEY: privateKey,\r\n PUBLIC_KEY: publicKey,\r\n },\r\n });\r\n }\r\n\r\n public get client() {\r\n return {\r\n axios: {\r\n request: <M extends Record<string, any> = ApiResponseMapDefault>() =>\r\n api<M>(\r\n this.data.url,\r\n this.data.auth,\r\n this.data.env,\r\n this.data.middleware,\r\n ),\r\n },\r\n fetch: {\r\n request: fetcher,\r\n },\r\n };\r\n }\r\n\r\n static get plugins() {\r\n return {\r\n cache: {\r\n server: serverCachePlugin,\r\n },\r\n };\r\n }\r\n\r\n static get storages() {\r\n return {\r\n server: {\r\n cache: serverCache,\r\n },\r\n };\r\n }\r\n}\r\n"],"mappings":"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","names":["axios","jwt","gunzipSync","gzipSync","sign","api_default","base","auth","env","config_middleware","api","config","encryptSecureBlob","enc_default","secret","str","res","data","error","parsed","key","retry","ApiError","status","statusText","data","config","jwt","sign","fetcher","input","init","config","getConfigStorage","url","auth","env","finalInit","headers","finalUrl","res","data","ApiError","ApiServiceType","obj","ApiService","ApiServiceType","obj","privateKey","publicKey","setConfigStorage","api_default","fetcher","serverCachePlugin","serverCache"]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/axios.d.ts","../../src/client/api.ts","../../src/error/api-error.ts","../../src/client/fetcher.ts","../../src/types/api-service.ts","../../src/config/main.ts"],"sourcesContent":["import \"axios\";\r\nimport { ReturnFunction } from \"./cache\";\r\nimport { RetryOptions } from \"./retry\";\r\n\r\ndeclare module \"axios\" {\r\n export interface AxiosRequestConfig extends ApiExteraConfigRequest {}\r\n}\r\n\r\nexport {};\r\n","import { retry } from \"@/plugins/retry\";\r\nimport type { AlyvroAxiosInstance, ServiceSchema } from \"@/types/api\";\r\nimport type { ConfigEnvType, ConfigMiddlewareType } from \"@/types/config\";\r\nimport Encrypt from \"@/utils/enc\";\r\nimport axios, { type AxiosBasicCredentials } from \"axios\";\r\nimport jwt from \"jsonwebtoken\";\r\nimport { gunzipSync, gzipSync } from \"zlib\";\r\n\r\nconst { sign } = jwt;\r\n\r\nexport default function <S extends ServiceSchema = any>(\r\n base: string,\r\n auth?: AxiosBasicCredentials,\r\n env?: ConfigEnvType,\r\n config_middleware?: Partial<ConfigMiddlewareType>,\r\n): AlyvroAxiosInstance<S> {\r\n const api = axios.create({\r\n baseURL: base,\r\n auth,\r\n }) as unknown as AlyvroAxiosInstance<S>;\r\n\r\n api.interceptors.request.use((config) => {\r\n const { encryptSecureBlob } = Encrypt(env);\r\n const secret = (config as any).secret;\r\n\r\n config.headers[config_middleware?.headers?.apiKey ?? \"x-alyvro-api-key\"] =\r\n sign({ data: \"alyvro-secret-api-service\" }, env?.PRIVATE_KEY!, {\r\n expiresIn: \"10min\",\r\n });\r\n\r\n config.headers[\r\n config_middleware?.headers?.bodyType ?? \"x-alyvro-body-type\"\r\n ] = secret?.body ? \"sec\" : \"none\";\r\n\r\n config.headers[config_middleware?.headers?.status ?? \"x-alyvro-status\"] =\r\n (config as any).status ?? true;\r\n\r\n if ((config as any).plugins?.compressor && config?.data) {\r\n const str = JSON.stringify(config.data);\r\n config.data = gzipSync(str);\r\n config.headers[\"Content-Encoding\"] = \"gzip\";\r\n }\r\n\r\n if (secret?.body && config?.data) {\r\n config.data = encryptSecureBlob(\r\n typeof config.data === \"string\"\r\n ? config.data\r\n : JSON.stringify(config.data),\r\n );\r\n }\r\n\r\n return config;\r\n });\r\n\r\n api.interceptors.response.use((res) => {\r\n let data = res.data;\r\n\r\n if (\r\n res.headers[\"content-encoding\"] === \"gzip\" &&\r\n Buffer.isBuffer(res.data)\r\n ) {\r\n try {\r\n data = JSON.parse(gunzipSync(res.data).toString(\"utf-8\"));\r\n } catch (error) {\r\n console.error(\"Failed to decompress response\", error);\r\n }\r\n }\r\n\r\n const parsed = data;\r\n\r\n if ((res.config as any)?.plugins?.cache) {\r\n const key = res.config.url!;\r\n return {\r\n ...res,\r\n data: (res.config as any).plugins.cache.set(key, parsed),\r\n } as any;\r\n }\r\n\r\n return { ...res, data: parsed } as any;\r\n });\r\n\r\n retry(api as any);\r\n\r\n return api;\r\n}\r\n","import type { RequestInitType } from \"@/types/fetch\";\r\n\r\nexport class ApiError<T = any> extends Error {\r\n public status: number;\r\n public statusText: string;\r\n public data: T;\r\n public response_return_status_check?: number;\r\n public config: RequestInitType;\r\n\r\n constructor(\r\n status: number,\r\n statusText: string,\r\n data: T,\r\n config: RequestInitType\r\n ) {\r\n super(`Request failed with status ${status}`);\r\n this.status = status;\r\n this.statusText = statusText;\r\n this.data = data;\r\n this.config = config;\r\n }\r\n}\r\n","import { ApiError } from \"@/error/api-error\";\r\nimport { getConfigStorage } from \"@/storage\";\r\nimport type { RequestInitType } from \"@/types/fetch\";\r\nimport jwt from \"jsonwebtoken\";\r\n\r\nconst { sign } = jwt;\r\n\r\nexport default async function fetcher<T = unknown>(\r\n input: string,\r\n init?: RequestInitType | undefined\r\n) {\r\n const config = getConfigStorage();\r\n\r\n if (!config) throw new Error(\"please set config\");\r\n\r\n const { url, auth, env } = config;\r\n\r\n // const secret = init?.secret;\r\n\r\n const buildHeaders = (): Headers => {\r\n const headers = new Headers(init?.headers);\r\n\r\n headers.set(\r\n config.middleware?.headers?.apiKey ?? \"x-alyvro-api-key\",\r\n sign({ data: \"alyvro-secret-api-service\" }, env?.PRIVATE_KEY!, {\r\n expiresIn: \"10min\",\r\n })\r\n );\r\n headers.set(\r\n config.middleware?.headers?.bodyType ?? \"x-alyvro-body-type\",\r\n \"none\"\r\n );\r\n headers.set(\r\n config.middleware?.headers?.status ?? \"x-alyvro-status\",\r\n String(init?.status ?? true)\r\n );\r\n\r\n if (auth?.username && auth?.password) {\r\n headers.set(\r\n \"Authorization\",\r\n \"Basic \" +\r\n Buffer.from(`${auth.username}:${auth.password}`).toString(\"base64\")\r\n );\r\n }\r\n\r\n if (init?.method === \"POST\") {\r\n headers.set(\"Content-Type\", \"application/json\");\r\n }\r\n\r\n return headers;\r\n };\r\n\r\n const finalInit: RequestInitType = {\r\n ...init,\r\n headers: buildHeaders(),\r\n ...(init?.body\r\n ? {\r\n body:\r\n typeof init.body === \"string\"\r\n ? init.body\r\n : JSON.stringify(init.body),\r\n }\r\n : undefined),\r\n };\r\n\r\n const finalUrl = url.concat(input);\r\n\r\n // if (init?.plugins?.compressor && init?.body) {\r\n // const str =\r\n // typeof init.body === \"string\" ? init.body : JSON.stringify(init.body);\r\n // const compressed = gzipSync(str);\r\n\r\n // finalInit.body = new Uint8Array(compressed);\r\n // (finalInit.headers as Record<string, string>)[\"Content-Encoding\"] = \"gzip\";\r\n // }\r\n\r\n if (init?.response_return) {\r\n const res = await fetch(finalUrl, finalInit);\r\n\r\n if (!init.response_return_status_check && !res.ok) {\r\n const data = await res.json();\r\n\r\n throw new ApiError(res.status, res.statusText, data, init);\r\n }\r\n\r\n if (\r\n init.response_return_status_check &&\r\n init.response_return_status_check !== res.status\r\n ) {\r\n const data = await res.json();\r\n\r\n throw new ApiError(res.status, res.statusText, data, init);\r\n }\r\n\r\n return (await res.json()) as T;\r\n }\r\n\r\n return fetch(finalUrl, finalInit);\r\n}\r\n","import type { ConfigType } from \"@/types/config\";\r\nimport type { AlyvroAxiosInstance, ServiceSchema } from \"./api\";\r\n\r\nexport abstract class ApiServiceType {\r\n protected data: ConfigType;\r\n\r\n constructor(obj: ConfigType) {\r\n this.data = obj;\r\n }\r\n\r\n abstract get client(): {\r\n axios: {\r\n request: <S extends ServiceSchema = any>() => AlyvroAxiosInstance<S>;\r\n };\r\n fetch: {\r\n request: typeof import(\"@/client/fetcher\").default;\r\n };\r\n };\r\n}\r\n\r\nexport interface ApiServiceTypeConstructor {\r\n new (obj: ConfigType): ApiServiceType;\r\n plugins: {\r\n cache: {\r\n server: typeof import(\"@/plugins/cache/server\").serverCachePlugin;\r\n };\r\n };\r\n}\r\n","import api from \"@/client/api\";\r\nimport fetcher from \"@/client/fetcher\";\r\nimport { serverCache, serverCachePlugin } from \"@/plugins/cache/server\";\r\nimport { setConfigStorage } from \"@/storage\";\r\nimport type { ServiceSchema } from \"@/types/api\";\r\nimport { ApiServiceType } from \"@/types/api-service\";\r\nimport type { ConfigType } from \"@/types/config\";\r\n\r\nexport class ApiService extends ApiServiceType {\r\n constructor(obj: ConfigType) {\r\n super(obj);\r\n\r\n const privateKey = obj.env?.PRIVATE_KEY ?? process.env.PRIVATE_KEY;\r\n const publicKey = obj.env?.PUBLIC_KEY ?? process.env.PUBLIC_KEY;\r\n\r\n if (!privateKey || !publicKey) {\r\n throw new Error(\r\n `Error to get ${\r\n privateKey ? \"PRIVATE_KEY\" : \"PUBLIC_KEY\"\r\n }\\nplease set on .env config or in ApiService options`,\r\n );\r\n }\r\n\r\n setConfigStorage({\r\n ...obj,\r\n env: {\r\n PRIVATE_KEY: privateKey,\r\n PUBLIC_KEY: publicKey,\r\n },\r\n });\r\n }\r\n\r\n public get client() {\r\n return {\r\n axios: {\r\n request: <S extends ServiceSchema = any>() =>\r\n api<S>(\r\n this.data.url,\r\n this.data.auth,\r\n this.data.env,\r\n this.data.middleware,\r\n ),\r\n },\r\n fetch: {\r\n request: fetcher,\r\n },\r\n };\r\n }\r\n\r\n static get plugins() {\r\n return {\r\n cache: {\r\n server: serverCachePlugin,\r\n },\r\n };\r\n }\r\n\r\n static get storages() {\r\n return {\r\n server: {\r\n cache: serverCache,\r\n },\r\n };\r\n }\r\n}\r\n"],"mappings":"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","names":["axios","jwt","gunzipSync","gzipSync","sign","api_default","base","auth","env","config_middleware","api","config","encryptSecureBlob","enc_default","secret","str","res","data","error","parsed","key","retry","ApiError","status","statusText","data","config","jwt","sign","fetcher","input","init","config","getConfigStorage","url","auth","env","finalInit","headers","finalUrl","res","data","ApiError","ApiServiceType","obj","ApiService","ApiServiceType","obj","privateKey","publicKey","setConfigStorage","api_default","fetcher","serverCachePlugin","serverCache"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { R as ReturnFunction, C as CacheEntry } from './cache-BA2IH48s.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { S as ServiceSchema, A as AlyvroAxiosInstance } from './api-X5uDFWSi.mjs';
|
|
3
3
|
import { C as ConfigType } from './config-RQ9pTCQd.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
@@ -34,14 +34,14 @@ type RequestInitType = Readonly<{
|
|
|
34
34
|
body?: any;
|
|
35
35
|
}> & RequestInit;
|
|
36
36
|
|
|
37
|
-
declare function fetcher<T = unknown>(input: string, init?: RequestInitType | undefined): Promise<
|
|
37
|
+
declare function fetcher<T = unknown>(input: string, init?: RequestInitType | undefined): Promise<T | Response>;
|
|
38
38
|
|
|
39
39
|
declare abstract class ApiServiceType {
|
|
40
40
|
protected data: ConfigType;
|
|
41
41
|
constructor(obj: ConfigType);
|
|
42
42
|
abstract get client(): {
|
|
43
43
|
axios: {
|
|
44
|
-
request: <
|
|
44
|
+
request: <S extends ServiceSchema = any>() => AlyvroAxiosInstance<S>;
|
|
45
45
|
};
|
|
46
46
|
fetch: {
|
|
47
47
|
request: typeof fetcher;
|
|
@@ -53,7 +53,7 @@ declare class ApiService extends ApiServiceType {
|
|
|
53
53
|
constructor(obj: ConfigType);
|
|
54
54
|
get client(): {
|
|
55
55
|
axios: {
|
|
56
|
-
request: <
|
|
56
|
+
request: <S extends ServiceSchema = any>() => AlyvroAxiosInstance<S>;
|
|
57
57
|
};
|
|
58
58
|
fetch: {
|
|
59
59
|
request: typeof fetcher;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { R as ReturnFunction, C as CacheEntry } from './cache-BA2IH48s.js';
|
|
2
|
-
import {
|
|
2
|
+
import { S as ServiceSchema, A as AlyvroAxiosInstance } from './api-X5uDFWSi.js';
|
|
3
3
|
import { C as ConfigType } from './config-RQ9pTCQd.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
@@ -34,14 +34,14 @@ type RequestInitType = Readonly<{
|
|
|
34
34
|
body?: any;
|
|
35
35
|
}> & RequestInit;
|
|
36
36
|
|
|
37
|
-
declare function fetcher<T = unknown>(input: string, init?: RequestInitType | undefined): Promise<
|
|
37
|
+
declare function fetcher<T = unknown>(input: string, init?: RequestInitType | undefined): Promise<T | Response>;
|
|
38
38
|
|
|
39
39
|
declare abstract class ApiServiceType {
|
|
40
40
|
protected data: ConfigType;
|
|
41
41
|
constructor(obj: ConfigType);
|
|
42
42
|
abstract get client(): {
|
|
43
43
|
axios: {
|
|
44
|
-
request: <
|
|
44
|
+
request: <S extends ServiceSchema = any>() => AlyvroAxiosInstance<S>;
|
|
45
45
|
};
|
|
46
46
|
fetch: {
|
|
47
47
|
request: typeof fetcher;
|
|
@@ -53,7 +53,7 @@ declare class ApiService extends ApiServiceType {
|
|
|
53
53
|
constructor(obj: ConfigType);
|
|
54
54
|
get client(): {
|
|
55
55
|
axios: {
|
|
56
|
-
request: <
|
|
56
|
+
request: <S extends ServiceSchema = any>() => AlyvroAxiosInstance<S>;
|
|
57
57
|
};
|
|
58
58
|
fetch: {
|
|
59
59
|
request: typeof fetcher;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkMPSUEEQGjs = require('./chunk-MPSUEEQG.js');var _chunkCXFF7RVFjs = require('./chunk-CXFF7RVF.js');var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var _jsonwebtoken = require('jsonwebtoken'); var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);var _zlib = require('zlib');var{sign:I}=_jsonwebtoken2.default;function b(c,t,s,o){let a=_axios2.default.create({baseURL:c,auth:t});return a.interceptors.request.use(e=>{let{encryptSecureBlob:u}=_chunkMPSUEEQGjs.c.call(void 0, s),n=e.secret;if(e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _2 => _2.headers, 'optionalAccess', _3 => _3.apiKey]), () => ("x-alyvro-api-key"))]=I({data:"alyvro-secret-api-service"},_optionalChain([s, 'optionalAccess', _4 => _4.PRIVATE_KEY]),{expiresIn:"10min"}),e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _5 => _5.headers, 'optionalAccess', _6 => _6.bodyType]), () => ("x-alyvro-body-type"))]=_optionalChain([n, 'optionalAccess', _7 => _7.body])?"sec":"none",e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _8 => _8.headers, 'optionalAccess', _9 => _9.status]), () => ("x-alyvro-status"))]=_nullishCoalesce(e.status, () => (!0)),_optionalChain([e, 'access', _10 => _10.plugins, 'optionalAccess', _11 => _11.compressor])&&_optionalChain([e, 'optionalAccess', _12 => _12.data])){let i=JSON.stringify(e.data);e.data=_zlib.gzipSync.call(void 0, i),e.headers["Content-Encoding"]="gzip"}return _optionalChain([n, 'optionalAccess', _13 => _13.body])&&_optionalChain([e, 'optionalAccess', _14 => _14.data])&&(e.data=u(typeof e.data=="string"?e.data:JSON.stringify(e.data))),e}),a.interceptors.response.use(e=>{let u=e.data;if(e.headers["content-encoding"]==="gzip"&&Buffer.isBuffer(e.data))try{u=JSON.parse(_zlib.gunzipSync.call(void 0, e.data).toString("utf-8"))}catch(i){console.error("Failed to decompress response",i)}let n=u;if(_optionalChain([e, 'access', _15 => _15.config, 'optionalAccess', _16 => _16.plugins, 'optionalAccess', _17 => _17.cache])){let i=e.config.url;return{...e,data:e.config.plugins.cache.set(i,n)}}return{...e,data:n}}),_chunkCXFF7RVFjs.a.call(void 0, a),a}var y=class extends Error{constructor(t,s,o,a){super(`Request failed with status ${t}`),this.status=t,this.statusText=s,this.data=o,this.config=a}};var{sign:
|
|
2
|
-
please set on .env config or in ApiService options`);_chunkMPSUEEQGjs.a.call(void 0, {...t,env:{PRIVATE_KEY:s,PUBLIC_KEY:o}})}get client(){return{axios:{request:()=>b(this.data.url,this.data.auth,this.data.env,this.data.middleware)},fetch:{request:
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkMPSUEEQGjs = require('./chunk-MPSUEEQG.js');var _chunkCXFF7RVFjs = require('./chunk-CXFF7RVF.js');var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);var _jsonwebtoken = require('jsonwebtoken'); var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);var _zlib = require('zlib');var{sign:I}=_jsonwebtoken2.default;function b(c,t,s,o){let a=_axios2.default.create({baseURL:c,auth:t});return a.interceptors.request.use(e=>{let{encryptSecureBlob:u}=_chunkMPSUEEQGjs.c.call(void 0, s),n=e.secret;if(e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _2 => _2.headers, 'optionalAccess', _3 => _3.apiKey]), () => ("x-alyvro-api-key"))]=I({data:"alyvro-secret-api-service"},_optionalChain([s, 'optionalAccess', _4 => _4.PRIVATE_KEY]),{expiresIn:"10min"}),e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _5 => _5.headers, 'optionalAccess', _6 => _6.bodyType]), () => ("x-alyvro-body-type"))]=_optionalChain([n, 'optionalAccess', _7 => _7.body])?"sec":"none",e.headers[_nullishCoalesce(_optionalChain([o, 'optionalAccess', _8 => _8.headers, 'optionalAccess', _9 => _9.status]), () => ("x-alyvro-status"))]=_nullishCoalesce(e.status, () => (!0)),_optionalChain([e, 'access', _10 => _10.plugins, 'optionalAccess', _11 => _11.compressor])&&_optionalChain([e, 'optionalAccess', _12 => _12.data])){let i=JSON.stringify(e.data);e.data=_zlib.gzipSync.call(void 0, i),e.headers["Content-Encoding"]="gzip"}return _optionalChain([n, 'optionalAccess', _13 => _13.body])&&_optionalChain([e, 'optionalAccess', _14 => _14.data])&&(e.data=u(typeof e.data=="string"?e.data:JSON.stringify(e.data))),e}),a.interceptors.response.use(e=>{let u=e.data;if(e.headers["content-encoding"]==="gzip"&&Buffer.isBuffer(e.data))try{u=JSON.parse(_zlib.gunzipSync.call(void 0, e.data).toString("utf-8"))}catch(i){console.error("Failed to decompress response",i)}let n=u;if(_optionalChain([e, 'access', _15 => _15.config, 'optionalAccess', _16 => _16.plugins, 'optionalAccess', _17 => _17.cache])){let i=e.config.url;return{...e,data:e.config.plugins.cache.set(i,n)}}return{...e,data:n}}),_chunkCXFF7RVFjs.a.call(void 0, a),a}var y=class extends Error{constructor(t,s,o,a){super(`Request failed with status ${t}`),this.status=t,this.statusText=s,this.data=o,this.config=a}};var{sign:_}=_jsonwebtoken2.default;async function m(c,t){let s=_chunkMPSUEEQGjs.b.call(void 0, );if(!s)throw new Error("please set config");let{url:o,auth:a,env:e}=s,n={...t,headers:(()=>{let r=new Headers(_optionalChain([t, 'optionalAccess', _18 => _18.headers]));return r.set(_nullishCoalesce(_optionalChain([s, 'access', _19 => _19.middleware, 'optionalAccess', _20 => _20.headers, 'optionalAccess', _21 => _21.apiKey]), () => ("x-alyvro-api-key")),_({data:"alyvro-secret-api-service"},_optionalChain([e, 'optionalAccess', _22 => _22.PRIVATE_KEY]),{expiresIn:"10min"})),r.set(_nullishCoalesce(_optionalChain([s, 'access', _23 => _23.middleware, 'optionalAccess', _24 => _24.headers, 'optionalAccess', _25 => _25.bodyType]), () => ("x-alyvro-body-type")),"none"),r.set(_nullishCoalesce(_optionalChain([s, 'access', _26 => _26.middleware, 'optionalAccess', _27 => _27.headers, 'optionalAccess', _28 => _28.status]), () => ("x-alyvro-status")),String(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _29 => _29.status]), () => (!0)))),_optionalChain([a, 'optionalAccess', _30 => _30.username])&&_optionalChain([a, 'optionalAccess', _31 => _31.password])&&r.set("Authorization","Basic "+Buffer.from(`${a.username}:${a.password}`).toString("base64")),_optionalChain([t, 'optionalAccess', _32 => _32.method])==="POST"&&r.set("Content-Type","application/json"),r})(),..._optionalChain([t, 'optionalAccess', _33 => _33.body])?{body:typeof t.body=="string"?t.body:JSON.stringify(t.body)}:void 0},i=o.concat(c);if(_optionalChain([t, 'optionalAccess', _34 => _34.response_return])){let r=await fetch(i,n);if(!t.response_return_status_check&&!r.ok){let f=await r.json();throw new y(r.status,r.statusText,f,t)}if(t.response_return_status_check&&t.response_return_status_check!==r.status){let f=await r.json();throw new y(r.status,r.statusText,f,t)}return await r.json()}return fetch(i,n)}var d=class{constructor(t){this.data=t}};var l=class extends d{constructor(t){super(t);let s=_nullishCoalesce(_optionalChain([t, 'access', _35 => _35.env, 'optionalAccess', _36 => _36.PRIVATE_KEY]), () => (process.env.PRIVATE_KEY)),o=_nullishCoalesce(_optionalChain([t, 'access', _37 => _37.env, 'optionalAccess', _38 => _38.PUBLIC_KEY]), () => (process.env.PUBLIC_KEY));if(!s||!o)throw new Error(`Error to get ${s?"PRIVATE_KEY":"PUBLIC_KEY"}
|
|
2
|
+
please set on .env config or in ApiService options`);_chunkMPSUEEQGjs.a.call(void 0, {...t,env:{PRIVATE_KEY:s,PUBLIC_KEY:o}})}get client(){return{axios:{request:()=>b(this.data.url,this.data.auth,this.data.env,this.data.middleware)},fetch:{request:m}}}static get plugins(){return{cache:{server:_chunkCXFF7RVFjs.c}}}static get storages(){return{server:{cache:_chunkCXFF7RVFjs.b}}}};exports.ApiService = l;
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/metafile-cjs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5/node_modules/tsup/assets/cjs_shims.js":{"bytes":498,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":108,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/network/telegram.ts":{"bytes":2061,"imports":[{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"src/utils/logger.ts","kind":"import-statement","original":"@/utils/logger"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/storage/index.ts":{"bytes":287,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils/enc.ts":{"bytes":2446,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/middleware.ts":{"bytes":3995,"imports":[{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/express.ts":{"bytes":77,"imports":[{"path":"src/server/middleware.ts","kind":"import-statement","original":"@/server/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/fastify/middleware.ts":{"bytes":4322,"imports":[{"path":"fastify","kind":"import-statement","external":true},{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/fastify.ts":{"bytes":83,"imports":[{"path":"src/server/fastify/middleware.ts","kind":"import-statement","original":"@/server/fastify/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/axios.d.ts":{"bytes":219,"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"./cache","kind":"import-statement","external":true},{"path":"./retry","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/global.d.ts":{"bytes":379,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/retry.ts":{"bytes":934,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/api.ts":{"bytes":2443,"imports":[{"path":"src/plugins/retry.ts","kind":"import-statement","original":"@/plugins/retry"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/error/api-error.ts":{"bytes":550,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/fetcher.ts":{"bytes":2617,"imports":[{"path":"src/error/api-error.ts","kind":"import-statement","original":"@/error/api-error"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cache/server.ts":{"bytes":628,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/api-service.ts":{"bytes":732,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/config/main.ts":{"bytes":1570,"imports":[{"path":"src/client/api.ts","kind":"import-statement","original":"@/client/api"},{"path":"src/client/fetcher.ts","kind":"import-statement","original":"@/client/fetcher"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"@/plugins/cache/server"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"@/types/api","kind":"import-statement","external":true},{"path":"src/types/api-service.ts","kind":"import-statement","original":"@/types/api-service"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/index.ts":{"bytes":138,"imports":[{"path":"src/types/axios.d.ts","kind":"import-statement","original":"src/types/axios.d.ts"},{"path":"src/types/global.d.ts","kind":"import-statement","original":"src/types/global.d.ts"},{"path":"src/config/main.ts","kind":"import-statement","original":"@/config/main"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cancel.ts":{"bytes":83,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/index.ts":{"bytes":147,"imports":[{"path":"src/plugins/cancel.ts","kind":"import-statement","original":"./cancel"},{"path":"src/plugins/retry.ts","kind":"import-statement","original":"./retry"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"./cache/server"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/plugins.ts":{"bytes":28,"imports":[{"path":"src/plugins/index.ts","kind":"import-statement","original":"@/plugins"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/types.ts":{"bytes":119,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/express.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6916},"dist/express.js":{"imports":[{"path":"dist/chunk-MTW6IRZT.js","kind":"import-statement"},{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/express.ts","inputs":{"src/server/middleware.ts":{"bytesInOutput":1856},"main/express.ts":{"bytesInOutput":0}},"bytes":1968},"dist/fastify.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7374},"dist/fastify.js":{"imports":[{"path":"dist/chunk-MTW6IRZT.js","kind":"import-statement"},{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/fastify.ts","inputs":{"src/server/fastify/middleware.ts":{"bytesInOutput":1961},"main/fastify.ts":{"bytesInOutput":0}},"bytes":2073},"dist/chunk-MTW6IRZT.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3652},"dist/chunk-MTW6IRZT.js":{"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true}],"exports":["a"],"inputs":{"src/utils/logger.ts":{"bytesInOutput":43},"src/network/telegram.ts":{"bytesInOutput":1041}},"bytes":1100},"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":13130},"dist/index.js":{"imports":[{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"dist/chunk-CXFF7RVF.js","kind":"import-statement"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true}],"exports":["ApiService"],"entryPoint":"main/index.ts","inputs":{"src/types/axios.d.ts":{"bytesInOutput":14},"src/client/api.ts":{"bytesInOutput":1064},"src/error/api-error.ts":{"bytesInOutput":207},"src/client/fetcher.ts":{"bytesInOutput":1086},"src/types/api-service.ts":{"bytesInOutput":46},"src/config/main.ts":{"bytesInOutput":529},"main/index.ts":{"bytesInOutput":0}},"bytes":3079},"dist/chunk-MPSUEEQG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4848},"dist/chunk-MPSUEEQG.js":{"imports":[{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["a","b","c"],"inputs":{"src/storage/index.ts":{"bytesInOutput":51},"src/utils/enc.ts":{"bytesInOutput":1216}},"bytes":1297},"dist/plugins.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":261},"dist/plugins.js":{"imports":[{"path":"dist/chunk-CXFF7RVF.js","kind":"import-statement"}],"exports":["cache","createAbortController","retry"],"entryPoint":"main/plugins.ts","inputs":{"src/plugins/cancel.ts":{"bytesInOutput":30},"src/plugins/index.ts":{"bytesInOutput":0},"main/plugins.ts":{"bytesInOutput":0}},"bytes":135},"dist/chunk-CXFF7RVF.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":2736},"dist/chunk-CXFF7RVF.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/plugins/retry.ts":{"bytesInOutput":346},"src/plugins/cache/server.ts":{"bytesInOutput":199}},"bytes":570},"dist/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/types.js":{"imports":[],"exports":[],"entryPoint":"main/types.ts","inputs":{"main/types.ts":{"bytesInOutput":0}},"bytes":0}}}
|
|
1
|
+
{"inputs":{"node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5/node_modules/tsup/assets/cjs_shims.js":{"bytes":498,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":108,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/network/telegram.ts":{"bytes":2061,"imports":[{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"src/utils/logger.ts","kind":"import-statement","original":"@/utils/logger"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/storage/index.ts":{"bytes":287,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils/enc.ts":{"bytes":2446,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/middleware.ts":{"bytes":3995,"imports":[{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/express.ts":{"bytes":77,"imports":[{"path":"src/server/middleware.ts","kind":"import-statement","original":"@/server/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/fastify/middleware.ts":{"bytes":4322,"imports":[{"path":"fastify","kind":"import-statement","external":true},{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/fastify.ts":{"bytes":83,"imports":[{"path":"src/server/fastify/middleware.ts","kind":"import-statement","original":"@/server/fastify/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/axios.d.ts":{"bytes":219,"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"./cache","kind":"import-statement","external":true},{"path":"./retry","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/global.d.ts":{"bytes":379,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/retry.ts":{"bytes":934,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/api.ts":{"bytes":2445,"imports":[{"path":"src/plugins/retry.ts","kind":"import-statement","original":"@/plugins/retry"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/error/api-error.ts":{"bytes":550,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/fetcher.ts":{"bytes":2617,"imports":[{"path":"src/error/api-error.ts","kind":"import-statement","original":"@/error/api-error"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cache/server.ts":{"bytes":628,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/api-service.ts":{"bytes":681,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/config/main.ts":{"bytes":1543,"imports":[{"path":"src/client/api.ts","kind":"import-statement","original":"@/client/api"},{"path":"src/client/fetcher.ts","kind":"import-statement","original":"@/client/fetcher"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"@/plugins/cache/server"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/types/api-service.ts","kind":"import-statement","original":"@/types/api-service"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/index.ts":{"bytes":138,"imports":[{"path":"src/types/axios.d.ts","kind":"import-statement","original":"src/types/axios.d.ts"},{"path":"src/types/global.d.ts","kind":"import-statement","original":"src/types/global.d.ts"},{"path":"src/config/main.ts","kind":"import-statement","original":"@/config/main"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cancel.ts":{"bytes":83,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/index.ts":{"bytes":147,"imports":[{"path":"src/plugins/cancel.ts","kind":"import-statement","original":"./cancel"},{"path":"src/plugins/retry.ts","kind":"import-statement","original":"./retry"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"./cache/server"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/plugins.ts":{"bytes":28,"imports":[{"path":"src/plugins/index.ts","kind":"import-statement","original":"@/plugins"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/types.ts":{"bytes":119,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/express.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6916},"dist/express.js":{"imports":[{"path":"dist/chunk-MTW6IRZT.js","kind":"import-statement"},{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/express.ts","inputs":{"src/server/middleware.ts":{"bytesInOutput":1856},"main/express.ts":{"bytesInOutput":0}},"bytes":1968},"dist/fastify.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7374},"dist/fastify.js":{"imports":[{"path":"dist/chunk-MTW6IRZT.js","kind":"import-statement"},{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/fastify.ts","inputs":{"src/server/fastify/middleware.ts":{"bytesInOutput":1961},"main/fastify.ts":{"bytesInOutput":0}},"bytes":2073},"dist/chunk-MTW6IRZT.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3652},"dist/chunk-MTW6IRZT.js":{"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true}],"exports":["a"],"inputs":{"src/utils/logger.ts":{"bytesInOutput":43},"src/network/telegram.ts":{"bytesInOutput":1041}},"bytes":1100},"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":13050},"dist/index.js":{"imports":[{"path":"dist/chunk-MPSUEEQG.js","kind":"import-statement"},{"path":"dist/chunk-CXFF7RVF.js","kind":"import-statement"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true}],"exports":["ApiService"],"entryPoint":"main/index.ts","inputs":{"src/types/axios.d.ts":{"bytesInOutput":14},"src/client/api.ts":{"bytesInOutput":1064},"src/error/api-error.ts":{"bytesInOutput":207},"src/client/fetcher.ts":{"bytesInOutput":1086},"src/types/api-service.ts":{"bytesInOutput":46},"src/config/main.ts":{"bytesInOutput":529},"main/index.ts":{"bytesInOutput":0}},"bytes":3079},"dist/chunk-MPSUEEQG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4848},"dist/chunk-MPSUEEQG.js":{"imports":[{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["a","b","c"],"inputs":{"src/storage/index.ts":{"bytesInOutput":51},"src/utils/enc.ts":{"bytesInOutput":1216}},"bytes":1297},"dist/plugins.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":261},"dist/plugins.js":{"imports":[{"path":"dist/chunk-CXFF7RVF.js","kind":"import-statement"}],"exports":["cache","createAbortController","retry"],"entryPoint":"main/plugins.ts","inputs":{"src/plugins/cancel.ts":{"bytesInOutput":30},"src/plugins/index.ts":{"bytesInOutput":0},"main/plugins.ts":{"bytesInOutput":0}},"bytes":135},"dist/chunk-CXFF7RVF.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":2736},"dist/chunk-CXFF7RVF.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/plugins/retry.ts":{"bytesInOutput":346},"src/plugins/cache/server.ts":{"bytesInOutput":199}},"bytes":570},"dist/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/types.js":{"imports":[],"exports":[],"entryPoint":"main/types.ts","inputs":{"main/types.ts":{"bytesInOutput":0}},"bytes":0}}}
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5/node_modules/tsup/assets/esm_shims.js":{"bytes":322,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"url","kind":"import-statement","external":true}],"format":"esm"},"src/utils/logger.ts":{"bytes":108,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/network/telegram.ts":{"bytes":2061,"imports":[{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"src/utils/logger.ts","kind":"import-statement","original":"@/utils/logger"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/storage/index.ts":{"bytes":287,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils/enc.ts":{"bytes":2446,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/middleware.ts":{"bytes":3995,"imports":[{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/express.ts":{"bytes":77,"imports":[{"path":"src/server/middleware.ts","kind":"import-statement","original":"@/server/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/fastify/middleware.ts":{"bytes":4322,"imports":[{"path":"fastify","kind":"import-statement","external":true},{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/fastify.ts":{"bytes":83,"imports":[{"path":"src/server/fastify/middleware.ts","kind":"import-statement","original":"@/server/fastify/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/axios.d.ts":{"bytes":219,"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"./cache","kind":"import-statement","external":true},{"path":"./retry","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/global.d.ts":{"bytes":379,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/retry.ts":{"bytes":934,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/api.ts":{"bytes":2443,"imports":[{"path":"src/plugins/retry.ts","kind":"import-statement","original":"@/plugins/retry"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/error/api-error.ts":{"bytes":550,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/fetcher.ts":{"bytes":2617,"imports":[{"path":"src/error/api-error.ts","kind":"import-statement","original":"@/error/api-error"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cache/server.ts":{"bytes":628,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/api-service.ts":{"bytes":732,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/config/main.ts":{"bytes":1570,"imports":[{"path":"src/client/api.ts","kind":"import-statement","original":"@/client/api"},{"path":"src/client/fetcher.ts","kind":"import-statement","original":"@/client/fetcher"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"@/plugins/cache/server"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"@/types/api","kind":"import-statement","external":true},{"path":"src/types/api-service.ts","kind":"import-statement","original":"@/types/api-service"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/index.ts":{"bytes":138,"imports":[{"path":"src/types/axios.d.ts","kind":"import-statement","original":"src/types/axios.d.ts"},{"path":"src/types/global.d.ts","kind":"import-statement","original":"src/types/global.d.ts"},{"path":"src/config/main.ts","kind":"import-statement","original":"@/config/main"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cancel.ts":{"bytes":83,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/index.ts":{"bytes":147,"imports":[{"path":"src/plugins/cancel.ts","kind":"import-statement","original":"./cancel"},{"path":"src/plugins/retry.ts","kind":"import-statement","original":"./retry"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"./cache/server"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/plugins.ts":{"bytes":28,"imports":[{"path":"src/plugins/index.ts","kind":"import-statement","original":"@/plugins"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/types.ts":{"bytes":119,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/esm/express.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6919},"dist/esm/express.js":{"imports":[{"path":"dist/esm/chunk-EY444KLS.js","kind":"import-statement"},{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/express.ts","inputs":{"src/server/middleware.ts":{"bytesInOutput":1856},"main/express.ts":{"bytesInOutput":0}},"bytes":1968},"dist/esm/fastify.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7377},"dist/esm/fastify.js":{"imports":[{"path":"dist/esm/chunk-EY444KLS.js","kind":"import-statement"},{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/fastify.ts","inputs":{"src/server/fastify/middleware.ts":{"bytesInOutput":1961},"main/fastify.ts":{"bytesInOutput":0}},"bytes":2073},"dist/esm/chunk-EY444KLS.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3658},"dist/esm/chunk-EY444KLS.js":{"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true}],"exports":["a"],"inputs":{"src/utils/logger.ts":{"bytesInOutput":43},"src/network/telegram.ts":{"bytesInOutput":1041}},"bytes":1100},"dist/esm/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":13148},"dist/esm/index.js":{"imports":[{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"dist/esm/chunk-TSDIGLLM.js","kind":"import-statement"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true}],"exports":["ApiService"],"entryPoint":"main/index.ts","inputs":{"src/types/axios.d.ts":{"bytesInOutput":14},"src/client/api.ts":{"bytesInOutput":1064},"src/error/api-error.ts":{"bytesInOutput":207},"src/client/fetcher.ts":{"bytesInOutput":1086},"src/types/api-service.ts":{"bytesInOutput":46},"src/config/main.ts":{"bytesInOutput":529},"main/index.ts":{"bytesInOutput":0}},"bytes":3079},"dist/esm/chunk-OO3Q5EY3.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4854},"dist/esm/chunk-OO3Q5EY3.js":{"imports":[{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["a","b","c"],"inputs":{"src/storage/index.ts":{"bytesInOutput":51},"src/utils/enc.ts":{"bytesInOutput":1216}},"bytes":1297},"dist/esm/plugins.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":264},"dist/esm/plugins.js":{"imports":[{"path":"dist/esm/chunk-TSDIGLLM.js","kind":"import-statement"}],"exports":["cache","createAbortController","retry"],"entryPoint":"main/plugins.ts","inputs":{"src/plugins/cancel.ts":{"bytesInOutput":30},"src/plugins/index.ts":{"bytesInOutput":0},"main/plugins.ts":{"bytesInOutput":0}},"bytes":135},"dist/esm/chunk-TSDIGLLM.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":2742},"dist/esm/chunk-TSDIGLLM.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/plugins/retry.ts":{"bytesInOutput":346},"src/plugins/cache/server.ts":{"bytesInOutput":199}},"bytes":575},"dist/esm/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/esm/types.js":{"imports":[],"exports":[],"entryPoint":"main/types.ts","inputs":{"main/types.ts":{"bytesInOutput":0}},"bytes":0}}}
|
|
1
|
+
{"inputs":{"node_modules/.pnpm/tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5/node_modules/tsup/assets/esm_shims.js":{"bytes":322,"imports":[{"path":"path","kind":"import-statement","external":true},{"path":"url","kind":"import-statement","external":true}],"format":"esm"},"src/utils/logger.ts":{"bytes":108,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/network/telegram.ts":{"bytes":2061,"imports":[{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"src/utils/logger.ts","kind":"import-statement","original":"@/utils/logger"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/storage/index.ts":{"bytes":287,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/utils/enc.ts":{"bytes":2446,"imports":[{"path":"@/types/config","kind":"import-statement","external":true},{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/middleware.ts":{"bytes":3995,"imports":[{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/express.ts":{"bytes":77,"imports":[{"path":"src/server/middleware.ts","kind":"import-statement","original":"@/server/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/server/fastify/middleware.ts":{"bytes":4322,"imports":[{"path":"fastify","kind":"import-statement","external":true},{"path":"src/network/telegram.ts","kind":"import-statement","original":"@/network/telegram"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"main/types","kind":"import-statement","external":true},{"path":"@/types/telegram","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/fastify.ts":{"bytes":83,"imports":[{"path":"src/server/fastify/middleware.ts","kind":"import-statement","original":"@/server/fastify/middleware"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/axios.d.ts":{"bytes":219,"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"./cache","kind":"import-statement","external":true},{"path":"./retry","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/global.d.ts":{"bytes":379,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/retry.ts":{"bytes":934,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/api.ts":{"bytes":2445,"imports":[{"path":"src/plugins/retry.ts","kind":"import-statement","original":"@/plugins/retry"},{"path":"src/utils/enc.ts","kind":"import-statement","original":"@/utils/enc"},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/error/api-error.ts":{"bytes":550,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/client/fetcher.ts":{"bytes":2617,"imports":[{"path":"src/error/api-error.ts","kind":"import-statement","original":"@/error/api-error"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cache/server.ts":{"bytes":628,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/types/api-service.ts":{"bytes":681,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/config/main.ts":{"bytes":1543,"imports":[{"path":"src/client/api.ts","kind":"import-statement","original":"@/client/api"},{"path":"src/client/fetcher.ts","kind":"import-statement","original":"@/client/fetcher"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"@/plugins/cache/server"},{"path":"src/storage/index.ts","kind":"import-statement","original":"@/storage"},{"path":"src/types/api-service.ts","kind":"import-statement","original":"@/types/api-service"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/index.ts":{"bytes":138,"imports":[{"path":"src/types/axios.d.ts","kind":"import-statement","original":"src/types/axios.d.ts"},{"path":"src/types/global.d.ts","kind":"import-statement","original":"src/types/global.d.ts"},{"path":"src/config/main.ts","kind":"import-statement","original":"@/config/main"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/cancel.ts":{"bytes":83,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"src/plugins/index.ts":{"bytes":147,"imports":[{"path":"src/plugins/cancel.ts","kind":"import-statement","original":"./cancel"},{"path":"src/plugins/retry.ts","kind":"import-statement","original":"./retry"},{"path":"src/plugins/cache/server.ts","kind":"import-statement","original":"./cache/server"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/plugins.ts":{"bytes":28,"imports":[{"path":"src/plugins/index.ts","kind":"import-statement","original":"@/plugins"},{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"},"main/types.ts":{"bytes":119,"imports":[{"path":"D:\\AlyvroService\\api-service\\node_modules\\.pnpm\\tsup@8.5.0_jiti@2.6.1_postc_64e87b0dba51d6faa23fd098ab7fb0c5\\node_modules\\tsup\\assets\\esm_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/esm/express.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6919},"dist/esm/express.js":{"imports":[{"path":"dist/esm/chunk-EY444KLS.js","kind":"import-statement"},{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/express.ts","inputs":{"src/server/middleware.ts":{"bytesInOutput":1856},"main/express.ts":{"bytesInOutput":0}},"bytes":1968},"dist/esm/fastify.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7377},"dist/esm/fastify.js":{"imports":[{"path":"dist/esm/chunk-EY444KLS.js","kind":"import-statement"},{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["middleware"],"entryPoint":"main/fastify.ts","inputs":{"src/server/fastify/middleware.ts":{"bytesInOutput":1961},"main/fastify.ts":{"bytesInOutput":0}},"bytes":2073},"dist/esm/chunk-EY444KLS.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3658},"dist/esm/chunk-EY444KLS.js":{"imports":[{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true}],"exports":["a"],"inputs":{"src/utils/logger.ts":{"bytesInOutput":43},"src/network/telegram.ts":{"bytesInOutput":1041}},"bytes":1100},"dist/esm/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":13068},"dist/esm/index.js":{"imports":[{"path":"dist/esm/chunk-OO3Q5EY3.js","kind":"import-statement"},{"path":"dist/esm/chunk-TSDIGLLM.js","kind":"import-statement"},{"path":"axios","kind":"import-statement","external":true},{"path":"axios","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true},{"path":"jsonwebtoken","kind":"import-statement","external":true}],"exports":["ApiService"],"entryPoint":"main/index.ts","inputs":{"src/types/axios.d.ts":{"bytesInOutput":14},"src/client/api.ts":{"bytesInOutput":1064},"src/error/api-error.ts":{"bytesInOutput":207},"src/client/fetcher.ts":{"bytesInOutput":1086},"src/types/api-service.ts":{"bytesInOutput":46},"src/config/main.ts":{"bytesInOutput":529},"main/index.ts":{"bytesInOutput":0}},"bytes":3079},"dist/esm/chunk-OO3Q5EY3.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4854},"dist/esm/chunk-OO3Q5EY3.js":{"imports":[{"path":"crypto","kind":"import-statement","external":true},{"path":"zlib","kind":"import-statement","external":true}],"exports":["a","b","c"],"inputs":{"src/storage/index.ts":{"bytesInOutput":51},"src/utils/enc.ts":{"bytesInOutput":1216}},"bytes":1297},"dist/esm/plugins.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":264},"dist/esm/plugins.js":{"imports":[{"path":"dist/esm/chunk-TSDIGLLM.js","kind":"import-statement"}],"exports":["cache","createAbortController","retry"],"entryPoint":"main/plugins.ts","inputs":{"src/plugins/cancel.ts":{"bytesInOutput":30},"src/plugins/index.ts":{"bytesInOutput":0},"main/plugins.ts":{"bytesInOutput":0}},"bytes":135},"dist/esm/chunk-TSDIGLLM.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":2742},"dist/esm/chunk-TSDIGLLM.js":{"imports":[],"exports":["a","b","c"],"inputs":{"src/plugins/retry.ts":{"bytesInOutput":346},"src/plugins/cache/server.ts":{"bytesInOutput":199}},"bytes":575},"dist/esm/types.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/esm/types.js":{"imports":[],"exports":[],"entryPoint":"main/types.ts","inputs":{"main/types.ts":{"bytesInOutput":0}},"bytes":0}}}
|
package/dist/plugins.d.mts
CHANGED
package/dist/plugins.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alyvro/api-service",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "A minimal yet powerful service for sending HTTP requests on the client and handling them gracefully on the server. No complicated setup. Just plug in your keys — and you're ready to go.",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
package/dist/api-BD94m-ym.d.mts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
|
|
3
|
-
type ApiResponseMapDefault = {
|
|
4
|
-
[url: string]: any;
|
|
5
|
-
};
|
|
6
|
-
type AlyvroAxiosInstance<M extends Record<string, any> = ApiResponseMapDefault> = Omit<AxiosInstance, "request" | "get" | "post" | "patch" | "delete"> & {
|
|
7
|
-
request<P extends keyof M>(config: AxiosRequestConfig & {
|
|
8
|
-
url: P;
|
|
9
|
-
}): Promise<AxiosResponse<M[P], any>>;
|
|
10
|
-
get<P extends keyof M>(url: P, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
11
|
-
post<P extends keyof M, D = any>(url: P, data?: D, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
12
|
-
patch<P extends keyof M, D = any>(url: P, data?: D, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
13
|
-
delete<P extends keyof M, D = any>(url: P, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type { ApiResponseMapDefault as A, AlyvroAxiosInstance as a };
|
package/dist/api-BD94m-ym.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
|
|
3
|
-
type ApiResponseMapDefault = {
|
|
4
|
-
[url: string]: any;
|
|
5
|
-
};
|
|
6
|
-
type AlyvroAxiosInstance<M extends Record<string, any> = ApiResponseMapDefault> = Omit<AxiosInstance, "request" | "get" | "post" | "patch" | "delete"> & {
|
|
7
|
-
request<P extends keyof M>(config: AxiosRequestConfig & {
|
|
8
|
-
url: P;
|
|
9
|
-
}): Promise<AxiosResponse<M[P], any>>;
|
|
10
|
-
get<P extends keyof M>(url: P, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
11
|
-
post<P extends keyof M, D = any>(url: P, data?: D, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
12
|
-
patch<P extends keyof M, D = any>(url: P, data?: D, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
13
|
-
delete<P extends keyof M, D = any>(url: P, config?: AxiosRequestConfig): Promise<AxiosResponse<M[P], any>>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type { ApiResponseMapDefault as A, AlyvroAxiosInstance as a };
|