@notionhq/client 2.2.7 → 2.2.8

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.
@@ -1,17 +1,17 @@
1
- /// <reference lib="dom" />
2
- import type { RequestInit as NodeRequestInit, Response as NodeResponse } from "node-fetch";
3
- type FetchFn = typeof fetch;
4
- type FetchResponse = Awaited<ReturnType<FetchFn>>;
5
- type RequestInit = NonNullable<Parameters<FetchFn>[1]>;
1
+ /// <reference types="node" />
2
+ import type { Agent } from "http";
6
3
  export type SupportedRequestInfo = string;
7
4
  export type SupportedRequestInit = {
8
- agent?: NodeRequestInit["agent"];
9
- body?: NonNullable<RequestInit["body"]> & NonNullable<NodeRequestInit["body"]>;
10
- headers?: NonNullable<RequestInit["headers"]> & NonNullable<NodeRequestInit["headers"]>;
11
- method?: RequestInit["method"];
12
- redirect?: RequestInit["redirect"];
5
+ agent?: Agent;
6
+ body?: string;
7
+ headers?: Record<string, string>;
8
+ method?: string;
9
+ };
10
+ export type SupportedResponse = {
11
+ ok: boolean;
12
+ text: () => Promise<string>;
13
+ headers: unknown;
14
+ status: number;
13
15
  };
14
- export type SupportedResponse = FetchResponse | NodeResponse;
15
16
  export type SupportedFetch = (url: SupportedRequestInfo, init?: SupportedRequestInit) => Promise<SupportedResponse>;
16
- export {};
17
17
  //# sourceMappingURL=fetch-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-types.d.ts","sourceRoot":"","sources":["../../src/fetch-types.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,IAAI,YAAY,EACzB,MAAM,YAAY,CAAA;AAEnB,KAAK,OAAO,GAAG,OAAO,KAAK,CAAA;AAC3B,KAAK,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;AAEjD,KAAK,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAA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,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAMD,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,oBAAoB,EACzB,IAAI,CAAC,EAAE,oBAAoB,KACxB,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-types.js","sourceRoot":"","sources":["../../src/fetch-types.ts"],"names":[],"mappings":"","sourcesContent":["/// <reference lib=\"dom\" />\nimport type { Assert } from \"./type-utils\"\nimport type {\n RequestInit as NodeRequestInit,\n Response as NodeResponse,\n} from \"node-fetch\"\n\ntype FetchFn = typeof fetch\ntype FetchResponse = Awaited<ReturnType<FetchFn>>\ntype RequestInfo = Parameters<FetchFn>[0]\ntype RequestInit = NonNullable<Parameters<FetchFn>[1]>\n\nexport type SupportedRequestInfo = string\ntype _assertSupportedInfoIsSubtype = Assert<RequestInfo, SupportedRequestInfo>\n\nexport type SupportedRequestInit = {\n agent?: NodeRequestInit[\"agent\"]\n body?: NonNullable<RequestInit[\"body\"]> & NonNullable<NodeRequestInit[\"body\"]>\n headers?: NonNullable<RequestInit[\"headers\"]> &\n NonNullable<NodeRequestInit[\"headers\"]>\n method?: RequestInit[\"method\"]\n redirect?: RequestInit[\"redirect\"]\n}\ntype _assertSupportedInitIsSubtype = Assert<RequestInit, SupportedRequestInit>\n\nexport type SupportedResponse = FetchResponse | NodeResponse\n\nexport type SupportedFetch = (\n url: SupportedRequestInfo,\n init?: SupportedRequestInit\n) => Promise<SupportedResponse>\n"]}
1
+ {"version":3,"file":"fetch-types.js","sourceRoot":"","sources":["../../src/fetch-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Agent } from \"http\"\nimport type { Assert } from \"./type-utils\"\nimport type NodeFetchFn from \"node-fetch\"\nimport type {\n RequestInfo as NodeFetchRequestInfo,\n RequestInit as NodeFetchRequestInit,\n Response as NodeFetchResponse,\n} from \"node-fetch\"\n\n// The `Supported` types should be kept up to date in order to exactly match what we use in the client. This ensures maximal compatibility with other `fetch` implementations.\nexport type SupportedRequestInfo = string\n// We can't assert against the browser or native Node fetch types without complicating the package structure (see #401), so perform a best effort against `node-fetch`, which we use by default.\ntype _assertSupportedInfoIsSubtypeOfNodeFetch = Assert<\n NodeFetchRequestInfo,\n SupportedRequestInfo\n>\n\nexport type SupportedRequestInit = {\n agent?: Agent\n body?: string\n headers?: Record<string, string>\n method?: string\n}\ntype _assertSupportedInitIsSubtypeOfNodeFetch = Assert<\n NodeFetchRequestInit,\n SupportedRequestInit\n>\n\nexport type SupportedResponse = {\n ok: boolean\n text: () => Promise<string>\n headers: unknown\n status: number\n}\ntype _assertSupportedResponseIsSubtypeOfNodeFetch = Assert<\n SupportedResponse,\n NodeFetchResponse\n>\n\nexport type SupportedFetch = (\n url: SupportedRequestInfo,\n init?: SupportedRequestInit\n) => Promise<SupportedResponse>\ntype _assertSupportedFetchIsSubtypeOfNodeFetch = Assert<\n SupportedFetch,\n typeof NodeFetchFn\n>\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/client",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "A simple and easy to use client for the Notion API",
5
5
  "engines": {
6
6
  "node": ">=12"