New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hn-api-sdk

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hn-api-sdk - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

10

lib/axios.js

@@ -23,4 +23,4 @@ "use strict";

var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }

@@ -78,7 +78,7 @@ function step(op) {

return __awaiter(this, void 0, void 0, function () {
var axiosInstance, path, headers, method, payload, data_1, data;
var instance, path, headers, method, payload, data_1, data;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
axiosInstance = (0, exports.getAxiosInstance)();
instance = (0, exports.getAxiosInstance)();
if (!axiosInstance) {

@@ -108,3 +108,3 @@ throw new error_1.NoHandlerError("Call `setAxiosInstance` first");

}
return [4 /*yield*/, axiosInstance.request(payload)];
return [4 /*yield*/, instance.request(payload)];
case 1:

@@ -111,0 +111,0 @@ data = (_a.sent()).data;

@@ -5,2 +5,3 @@ import { APIConfig, ObjectLiteral } from './shared/tsdk-helper';

declare let handler: (apiConfig: APIConfig, requestData: any, requestConfig?: any | RequestConfig<any> | ObjectLiteral | XiorRequestConfig<any>) => Promise<any>;
export type Handler = typeof handler;
/**

@@ -30,5 +31,11 @@ * @example

export default function genAPICall<ReqPayload, ResData>(apiConfig: APIConfig): {
(data: ReqPayload, requestConfig?: RequestConfig<ReqPayload> | ObjectLiteral): Promise<ResData>;
(data: ReqPayload, requestConfig?: RequestConfig<ReqPayload> | ObjectLiteral, customHandler?: typeof handler): Promise<ResData>;
config: APIConfig;
};
export type Expand<T> = T extends (...args: infer A) => infer R ? (...args: Expand<A>) => Expand<R> : T extends infer O ? {
[K in keyof O]: O[K];
} : never;
export type ExpandRecursively<T> = T extends (...args: infer A) => infer R ? (...args: ExpandRecursively<A>) => ExpandRecursively<R> : T extends object ? T extends infer O ? {
[K in keyof O]: ExpandRecursively<O[K]>;
} : never : T;
export {};

@@ -38,4 +38,4 @@ "use strict";

function genAPICall(apiConfig) {
function APICall(data, requestConfig) {
return getHandler()(apiConfig, data, requestConfig);
function APICall(data, requestConfig, customHandler) {
return (customHandler ? customHandler : getHandler())(apiConfig, data, requestConfig);
}

@@ -42,0 +42,0 @@ // now you can access the config with api

@@ -62,3 +62,5 @@ "use strict";

_id: msgId,
payload: data instanceof FormData ? Object.fromEntries(data) : data,
payload: data instanceof FormData
? Object.fromEntries(data)
: data,
});

@@ -65,0 +67,0 @@ var timer = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.timeout)

import { SWRConfiguration } from "swr";
import type { XiorRequestConfig as AxiosRequestConfig } from "xior";
import { Handler } from './gen-api';
import { type GetAskReq, type GetAskRes, type GetChangedItemsAndProfilesReq, type GetChangedItemsAndProfilesRes, type GetCommentReq, type GetCommentRes, type GetJobReq, type GetJobRes, type GetMaxItemIdReq, type GetMaxItemIdRes, type GetPartReq, type GetPartRes, type GetPollReq, type GetPollRes, type GetStoriesReq, type GetStoriesRes, type GetStoryReq, type GetStoryRes, type GetUserDetailReq, type GetUserDetailRes } from './apiconf-refs';

@@ -9,3 +10,13 @@ /**

*/
export declare function useGetAsk(payload: GetAskReq | undefined, options?: SWRConfiguration<GetAskRes | undefined>, requestConfig?: AxiosRequestConfig<GetAskReq>): import("swr").SWRResponse<GetAskRes | undefined, any, SWRConfiguration<GetAskRes | undefined> | undefined>;
export declare function useGetAsk(payload?: GetAskReq, options?: SWRConfiguration<GetAskRes | undefined>, requestConfig?: AxiosRequestConfig<GetAskReq>, customHandler?: Handler): import("swr").SWRResponse<{
by: string;
id: number;
kids: number[];
text: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
descendants: number;
score: number;
title: string;
} | undefined, any, SWRConfiguration<GetAskRes | undefined> | undefined>;
/**

@@ -16,3 +27,6 @@ * Changed Items and Profiles

*/
export declare function useGetChangedItemsAndProfiles(payload: GetChangedItemsAndProfilesReq | undefined, options?: SWRConfiguration<GetChangedItemsAndProfilesRes | undefined>, requestConfig?: AxiosRequestConfig<GetChangedItemsAndProfilesReq>): import("swr").SWRResponse<GetChangedItemsAndProfilesRes | undefined, any, SWRConfiguration<GetChangedItemsAndProfilesRes | undefined> | undefined>;
export declare function useGetChangedItemsAndProfiles(payload?: GetChangedItemsAndProfilesReq, options?: SWRConfiguration<GetChangedItemsAndProfilesRes | undefined>, requestConfig?: AxiosRequestConfig<GetChangedItemsAndProfilesReq>, customHandler?: Handler): import("swr").SWRResponse<{
items: number[];
profiles: string[];
} | undefined, any, SWRConfiguration<GetChangedItemsAndProfilesRes | undefined> | undefined>;
/**

@@ -23,3 +37,11 @@ * Get commend detail

*/
export declare function useGetComment(payload: GetCommentReq | undefined, options?: SWRConfiguration<GetCommentRes | undefined>, requestConfig?: AxiosRequestConfig<GetCommentReq>): import("swr").SWRResponse<GetCommentRes | undefined, any, SWRConfiguration<GetCommentRes | undefined> | undefined>;
export declare function useGetComment(payload?: GetCommentReq, options?: SWRConfiguration<GetCommentRes | undefined>, requestConfig?: AxiosRequestConfig<GetCommentReq>, customHandler?: Handler): import("swr").SWRResponse<{
by: string;
id: number;
kids: number[];
parent: number;
text: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
} | undefined, any, SWRConfiguration<GetCommentRes | undefined> | undefined>;
/**

@@ -30,3 +52,12 @@ * Get job detail

*/
export declare function useGetJob(payload: GetJobReq | undefined, options?: SWRConfiguration<GetJobRes | undefined>, requestConfig?: AxiosRequestConfig<GetJobReq>): import("swr").SWRResponse<GetJobRes | undefined, any, SWRConfiguration<GetJobRes | undefined> | undefined>;
export declare function useGetJob(payload?: GetJobReq, options?: SWRConfiguration<GetJobRes | undefined>, requestConfig?: AxiosRequestConfig<GetJobReq>, customHandler?: Handler): import("swr").SWRResponse<{
by: string;
id: number;
text: string;
time: number;
url: string;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
title: string;
} | undefined, any, SWRConfiguration<GetJobRes | undefined> | undefined>;
/**

@@ -37,3 +68,3 @@ * Get the current largest item id.

*/
export declare function useGetMaxItemId(payload: GetMaxItemIdReq | undefined, options?: SWRConfiguration<GetMaxItemIdRes | undefined>, requestConfig?: AxiosRequestConfig<GetMaxItemIdReq>): import("swr").SWRResponse<number | undefined, any, SWRConfiguration<number | undefined> | undefined>;
export declare function useGetMaxItemId(payload?: GetMaxItemIdReq, options?: SWRConfiguration<GetMaxItemIdRes | undefined>, requestConfig?: AxiosRequestConfig<GetMaxItemIdReq>, customHandler?: Handler): import("swr").SWRResponse<number | undefined, any, SWRConfiguration<number | undefined> | undefined>;
/**

@@ -44,3 +75,11 @@ * Get part detail

*/
export declare function useGetPart(payload: GetPartReq | undefined, options?: SWRConfiguration<GetPartRes | undefined>, requestConfig?: AxiosRequestConfig<GetPartReq>): import("swr").SWRResponse<GetPartRes | undefined, any, SWRConfiguration<GetPartRes | undefined> | undefined>;
export declare function useGetPart(payload?: GetPartReq, options?: SWRConfiguration<GetPartRes | undefined>, requestConfig?: AxiosRequestConfig<GetPartReq>, customHandler?: Handler): import("swr").SWRResponse<{
poll: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
by: string;
id: number;
text: string;
time: number;
} | undefined, any, SWRConfiguration<GetPartRes | undefined> | undefined>;
/**

@@ -51,3 +90,14 @@ * Get poll detail

*/
export declare function useGetPoll(payload: GetPollReq | undefined, options?: SWRConfiguration<GetPollRes | undefined>, requestConfig?: AxiosRequestConfig<GetPollReq>): import("swr").SWRResponse<GetPollRes | undefined, any, SWRConfiguration<GetPollRes | undefined> | undefined>;
export declare function useGetPoll(payload?: GetPollReq, options?: SWRConfiguration<GetPollRes | undefined>, requestConfig?: AxiosRequestConfig<GetPollReq>, customHandler?: Handler): import("swr").SWRResponse<{
descendants: number;
kids: number[];
parts: number[];
title: string;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
by: string;
id: number;
text: string;
time: number;
} | undefined, any, SWRConfiguration<GetPollRes | undefined> | undefined>;
/**

@@ -58,3 +108,3 @@ * Up to 200-500 stories, query `new/top/best/ask/show/job` stories

*/
export declare function useGetStories(payload: GetStoriesReq | undefined, options?: SWRConfiguration<GetStoriesRes | undefined>, requestConfig?: AxiosRequestConfig<GetStoriesReq>): import("swr").SWRResponse<GetStoriesRes | undefined, any, SWRConfiguration<GetStoriesRes | undefined> | undefined>;
export declare function useGetStories(payload?: GetStoriesReq, options?: SWRConfiguration<GetStoriesRes | undefined>, requestConfig?: AxiosRequestConfig<GetStoriesReq>, customHandler?: Handler): import("swr").SWRResponse<number[] | undefined, any, SWRConfiguration<GetStoriesRes | undefined> | undefined>;
/**

@@ -65,3 +115,13 @@ * Get story detail

*/
export declare function useGetStory(payload: GetStoryReq | undefined, options?: SWRConfiguration<GetStoryRes | undefined>, requestConfig?: AxiosRequestConfig<GetStoryReq>): import("swr").SWRResponse<GetStoryRes | undefined, any, SWRConfiguration<GetStoryRes | undefined> | undefined>;
export declare function useGetStory(payload?: GetStoryReq, options?: SWRConfiguration<GetStoryRes | undefined>, requestConfig?: AxiosRequestConfig<GetStoryReq>, customHandler?: Handler): import("swr").SWRResponse<{
by: string;
id: number;
descendants: number;
kids: number[];
score: number;
title: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
url: string;
} | undefined, any, SWRConfiguration<GetStoryRes | undefined> | undefined>;
/**

@@ -72,2 +132,9 @@ * Query user detail

*/
export declare function useGetUserDetail(payload: GetUserDetailReq | undefined, options?: SWRConfiguration<GetUserDetailRes | undefined>, requestConfig?: AxiosRequestConfig<GetUserDetailReq>): import("swr").SWRResponse<GetUserDetailRes | undefined, any, SWRConfiguration<GetUserDetailRes | undefined> | undefined>;
export declare function useGetUserDetail(payload?: GetUserDetailReq, options?: SWRConfiguration<GetUserDetailRes | undefined>, requestConfig?: AxiosRequestConfig<GetUserDetailReq>, customHandler?: Handler): import("swr").SWRResponse<{
id: string;
created: number;
karma: number;
about?: string | undefined;
delay: number;
submitted: number[];
} | undefined, any, SWRConfiguration<GetUserDetailRes | undefined> | undefined>;

@@ -23,3 +23,3 @@ "use strict";

*/
function useGetAsk(payload, options, requestConfig) {
function useGetAsk(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetAsk.config.path, arg: payload }); }, function (_a) {

@@ -29,3 +29,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetAsk)(arg, requestConfig);
return (0, user_api_1.GetAsk)(arg, requestConfig, customHandler);
}, options);

@@ -38,3 +38,3 @@ }

*/
function useGetChangedItemsAndProfiles(payload, options, requestConfig) {
function useGetChangedItemsAndProfiles(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetChangedItemsAndProfiles.config.path, arg: payload }); }, function (_a) {

@@ -44,3 +44,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetChangedItemsAndProfiles)(arg, requestConfig);
return (0, user_api_1.GetChangedItemsAndProfiles)(arg, requestConfig, customHandler);
}, options);

@@ -53,3 +53,3 @@ }

*/
function useGetComment(payload, options, requestConfig) {
function useGetComment(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetComment.config.path, arg: payload }); }, function (_a) {

@@ -59,3 +59,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetComment)(arg, requestConfig);
return (0, user_api_1.GetComment)(arg, requestConfig, customHandler);
}, options);

@@ -68,3 +68,3 @@ }

*/
function useGetJob(payload, options, requestConfig) {
function useGetJob(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetJob.config.path, arg: payload }); }, function (_a) {

@@ -74,3 +74,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetJob)(arg, requestConfig);
return (0, user_api_1.GetJob)(arg, requestConfig, customHandler);
}, options);

@@ -83,3 +83,3 @@ }

*/
function useGetMaxItemId(payload, options, requestConfig) {
function useGetMaxItemId(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetMaxItemId.config.path, arg: payload }); }, function (_a) {

@@ -89,3 +89,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetMaxItemId)(arg, requestConfig);
return (0, user_api_1.GetMaxItemId)(arg, requestConfig, customHandler);
}, options);

@@ -98,3 +98,3 @@ }

*/
function useGetPart(payload, options, requestConfig) {
function useGetPart(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetPart.config.path, arg: payload }); }, function (_a) {

@@ -104,3 +104,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetPart)(arg, requestConfig);
return (0, user_api_1.GetPart)(arg, requestConfig, customHandler);
}, options);

@@ -113,3 +113,3 @@ }

*/
function useGetPoll(payload, options, requestConfig) {
function useGetPoll(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetPoll.config.path, arg: payload }); }, function (_a) {

@@ -119,3 +119,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetPoll)(arg, requestConfig);
return (0, user_api_1.GetPoll)(arg, requestConfig, customHandler);
}, options);

@@ -128,3 +128,3 @@ }

*/
function useGetStories(payload, options, requestConfig) {
function useGetStories(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetStories.config.path, arg: payload }); }, function (_a) {

@@ -134,3 +134,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetStories)(arg, requestConfig);
return (0, user_api_1.GetStories)(arg, requestConfig, customHandler);
}, options);

@@ -143,3 +143,3 @@ }

*/
function useGetStory(payload, options, requestConfig) {
function useGetStory(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetStory.config.path, arg: payload }); }, function (_a) {

@@ -149,3 +149,3 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetStory)(arg, requestConfig);
return (0, user_api_1.GetStory)(arg, requestConfig, customHandler);
}, options);

@@ -158,3 +158,3 @@ }

*/
function useGetUserDetail(payload, options, requestConfig) {
function useGetUserDetail(payload, options, requestConfig, customHandler) {
return (0, swr_1.default)(function () { return ({ url: user_api_1.GetUserDetail.config.path, arg: payload }); }, function (_a) {

@@ -164,4 +164,4 @@ var arg = _a.arg;

return undefined;
return (0, user_api_1.GetUserDetail)(arg, requestConfig);
return (0, user_api_1.GetUserDetail)(arg, requestConfig, customHandler);
}, options);
}

@@ -7,3 +7,2 @@ /**

**/
import { type GetAskReq, type GetAskRes, type GetChangedItemsAndProfilesRes, type GetCommentReq, type GetCommentRes, type GetJobReq, type GetJobRes, type GetPartReq, type GetPartRes, type GetPollReq, type GetPollRes, type GetStoriesReq, type GetStoriesRes, type GetStoryReq, type GetStoryRes, type GetUserDetailReq, type GetUserDetailRes } from './apiconf-refs';
/**

@@ -15,5 +14,21 @@ * Get ask detail

export declare const GetAsk: {
(data: GetAskReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetAskReq | undefined;
}) | undefined): Promise<GetAskRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
by: string;
id: number;
kids: number[];
text: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
descendants: number;
score: number;
title: string;
}>;
config: import("./shared-refs").APIConfig;

@@ -29,3 +44,8 @@ };

data?: object | undefined;
}) | undefined): Promise<GetChangedItemsAndProfilesRes>;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
items: number[];
profiles: string[];
}>;
config: import("./shared-refs").APIConfig;

@@ -39,5 +59,19 @@ };

export declare const GetComment: {
(data: GetCommentReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetCommentReq | undefined;
}) | undefined): Promise<GetCommentRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
by: string;
id: number;
kids: number[];
parent: number;
text: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
}>;
config: import("./shared-refs").APIConfig;

@@ -51,5 +85,20 @@ };

export declare const GetJob: {
(data: GetJobReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetJobReq | undefined;
}) | undefined): Promise<GetJobRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
by: string;
id: number;
text: string;
time: number;
url: string;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
title: string;
}>;
config: import("./shared-refs").APIConfig;

@@ -65,3 +114,5 @@ };

data?: object | undefined;
}) | undefined): Promise<number>;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<number>;
config: import("./shared-refs").APIConfig;

@@ -75,5 +126,19 @@ };

export declare const GetPart: {
(data: GetPartReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetPartReq | undefined;
}) | undefined): Promise<GetPartRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
poll: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
by: string;
id: number;
text: string;
time: number;
}>;
config: import("./shared-refs").APIConfig;

@@ -87,5 +152,22 @@ };

export declare const GetPoll: {
(data: GetPollReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetPollReq | undefined;
}) | undefined): Promise<GetPollRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
descendants: number;
kids: number[];
parts: number[];
title: string;
type: "job" | "story" | "comment" | "poll" | "pollopt";
score: number;
by: string;
id: number;
text: string;
time: number;
}>;
config: import("./shared-refs").APIConfig;

@@ -99,5 +181,11 @@ };

export declare const GetStories: {
(data: GetStoriesReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetStoriesReq | undefined;
}) | undefined): Promise<GetStoriesRes>;
(data: {
type: "new" | "top" | "best" | "ask" | "show" | "job";
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
type: "new" | "top" | "best" | "ask" | "show" | "job";
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<number[]>;
config: import("./shared-refs").APIConfig;

@@ -111,5 +199,21 @@ };

export declare const GetStory: {
(data: GetStoryReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetStoryReq | undefined;
}) | undefined): Promise<GetStoryRes>;
(data: {
id: number;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: number;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
by: string;
id: number;
descendants: number;
kids: number[];
score: number;
title: string;
time: number;
type: "job" | "story" | "comment" | "poll" | "pollopt";
url: string;
}>;
config: import("./shared-refs").APIConfig;

@@ -123,6 +227,19 @@ };

export declare const GetUserDetail: {
(data: GetUserDetailReq, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: GetUserDetailReq | undefined;
}) | undefined): Promise<GetUserDetailRes>;
(data: {
id: string;
}, requestConfig?: import("./shared-refs").ObjectLiteral | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: {
id: string;
} | undefined;
}) | undefined, customHandler?: (apiConfig: import("./shared-refs").APIConfig, requestData: any, requestConfig?: any | (Omit<import("xior").XiorRequestConfig<any>, "data"> & {
data?: any;
}) | import("./shared-refs").ObjectLiteral | import("./xior").XiorRequestConfig<any>) => Promise<any>): Promise<{
id: string;
created: number;
karma: number;
about?: string | undefined;
delay: number;
submitted: number[];
}>;
config: import("./shared-refs").APIConfig;
};

@@ -23,4 +23,4 @@ "use strict";

var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }

@@ -27,0 +27,0 @@ function step(op) {

{
"name": "hn-api-sdk",
"description": "HackerNews API with TypeScript, generated by tsdk",
"version": "1.6.0",
"version": "1.7.0",
"main": "lib/index.js",

@@ -21,6 +21,6 @@ "keywords": [

"dependencies": {
"zod": "^3",
"xior": "^0.5.5",
"zod": "^3.24.2",
"xior": "^0.6.3",
"change-case": "^4.1.2",
"swr": "^2.2.5"
"swr": "^2.3.2"
},

@@ -30,3 +30,3 @@ "devDependencies": {

"typedoc": "^0.26.6",
"@tsconfig/recommended": "^1.0.7"
"@tsconfig/recommended": "^1.0.8"
},

@@ -33,0 +33,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc