@notionhq/client
Advanced tools
Comparing version 2.2.2 to 2.2.3
{ | ||
"name": "@notionhq/client", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "A simple and easy to use client for the Notion API", | ||
@@ -5,0 +5,0 @@ "engines": { |
"use strict"; | ||
/* spell-checker: disable */ | ||
// cspell:disable-file | ||
// Note: This is a generated file. | ||
@@ -37,3 +37,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
pathParams: ["page_id"], | ||
queryParams: [], | ||
queryParams: ["filter_properties"], | ||
bodyParams: [], | ||
@@ -146,3 +146,3 @@ path: (p) => `pages/${p.page_id}`, | ||
pathParams: ["database_id"], | ||
queryParams: [], | ||
queryParams: ["filter_properties"], | ||
bodyParams: ["sorts", "filter", "start_cursor", "page_size", "archived"], | ||
@@ -149,0 +149,0 @@ path: (p) => `databases/${p.database_id}/query`, |
@@ -152,5 +152,5 @@ /// <reference types="node" /> | ||
} | ||
declare type Method = "get" | "post" | "patch" | "delete"; | ||
declare type QueryParams = Record<string, string | number> | URLSearchParams; | ||
declare type WithAuth<P> = P & { | ||
type Method = "get" | "post" | "patch" | "delete"; | ||
type QueryParams = Record<string, string | number | string[]> | URLSearchParams; | ||
type WithAuth<P> = P & { | ||
auth?: string; | ||
@@ -157,0 +157,0 @@ }; |
@@ -321,3 +321,8 @@ "use strict"; | ||
if (value !== undefined) { | ||
url.searchParams.append(key, String(value)); | ||
if (Array.isArray(value)) { | ||
value.forEach(val => url.searchParams.append(key, String(val))); | ||
} | ||
else { | ||
url.searchParams.append(key, String(value)); | ||
} | ||
} | ||
@@ -324,0 +329,0 @@ } |
@@ -28,3 +28,3 @@ import { SupportedResponse } from "./fetch-types"; | ||
*/ | ||
export declare type NotionErrorCode = APIErrorCode | ClientErrorCode; | ||
export type NotionErrorCode = APIErrorCode | ClientErrorCode; | ||
/** | ||
@@ -39,3 +39,3 @@ * Base error type. | ||
*/ | ||
export declare type NotionClientError = RequestTimeoutError | UnknownHTTPResponseError | APIResponseError; | ||
export type NotionClientError = RequestTimeoutError | UnknownHTTPResponseError | APIResponseError; | ||
/** | ||
@@ -56,3 +56,3 @@ * @param error any value, usually a caught error. | ||
} | ||
declare type HTTPResponseErrorCode = ClientErrorCode.ResponseError | APIErrorCode; | ||
type HTTPResponseErrorCode = ClientErrorCode.ResponseError | APIErrorCode; | ||
declare class HTTPResponseError<Code extends HTTPResponseErrorCode> extends NotionClientErrorBase<Code> { | ||
@@ -59,0 +59,0 @@ readonly name: string; |
/// <reference lib="dom" /> | ||
import type { RequestInit as NodeRequestInit, Response as NodeResponse } from "node-fetch"; | ||
declare type FetchFn = typeof fetch; | ||
declare type FetchResponse = Awaited<ReturnType<FetchFn>>; | ||
declare type RequestInit = NonNullable<Parameters<FetchFn>[1]>; | ||
export declare type SupportedRequestInfo = string; | ||
export declare type SupportedRequestInit = { | ||
type FetchFn = typeof fetch; | ||
type FetchResponse = Awaited<ReturnType<FetchFn>>; | ||
type RequestInit = NonNullable<Parameters<FetchFn>[1]>; | ||
export type SupportedRequestInfo = string; | ||
export type SupportedRequestInit = { | ||
agent?: NodeRequestInit["agent"]; | ||
@@ -14,5 +14,5 @@ body?: NonNullable<RequestInit["body"]> & NonNullable<NodeRequestInit["body"]>; | ||
}; | ||
export declare type SupportedResponse = FetchResponse | NodeResponse; | ||
export declare type SupportedFetch = (url: SupportedRequestInfo, init?: SupportedRequestInit) => Promise<SupportedResponse>; | ||
export type SupportedResponse = FetchResponse | NodeResponse; | ||
export type SupportedFetch = (url: SupportedRequestInfo, init?: SupportedRequestInit) => Promise<SupportedResponse>; | ||
export {}; | ||
//# sourceMappingURL=fetch-types.d.ts.map |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export declare type Assert<T, U extends T> = U; | ||
export type Assert<T, U extends T> = U; | ||
//# sourceMappingURL=type-utils.d.ts.map |
@@ -9,3 +9,3 @@ /** | ||
export declare function assertNever(value: never): never; | ||
declare type AllKeys<T> = T extends unknown ? keyof T : never; | ||
type AllKeys<T> = T extends unknown ? keyof T : never; | ||
export declare function pick<O, K extends AllKeys<O>>(base: O, keys: readonly K[]): Pick<O, K>; | ||
@@ -12,0 +12,0 @@ export declare function isObject(o: unknown): o is Record<PropertyKey, unknown>; |
{ | ||
"name": "@notionhq/client", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "A simple and easy to use client for the Notion API", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
889149
8499
1