@texonom/nclient 1.1.2 → 1.1.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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@texonom/nclient",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "description": "Robust TypeScript client for the unofficial Notion API.",
6
- "repository": "texonom/notion",
6
+ "repository": "texonom/notion-node",
7
7
  "author": "Alan Jo <sungle3737@gmail.com>",
8
8
  "license": "MIT",
9
9
  "main": "./build/index.js",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "p-map": "^5.5.0",
21
- "@texonom/ntypes": "^1.1.2",
22
- "@texonom/nutils": "^1.1.2"
21
+ "@texonom/ntypes": "^1.1.3",
22
+ "@texonom/nutils": "^1.1.3"
23
23
  },
24
24
  "standard-version": {
25
25
  "skip": {
package/readme.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <p align="center">
2
- <img alt="React Notion X" src="https://raw.githubusercontent.com/texonom/notion/master/media/notion-ts.png" width="689">
2
+ <img alt="React Notion X" src="https://raw.githubusercontent.com/texonom/notion-node/master/media/notion-ts.png" width="689">
3
3
  </p>
4
4
 
5
5
  # nclient
6
6
 
7
7
  > Robust TypeScript client for the unofficial Notion API.
8
8
 
9
- [![NPM](https://img.shields.io/npm/v/nclient.svg)](https://www.npmjs.com/package/nclient) [![Build Status](https://github.com/texonom/notion/actions/workflows/test.yml/badge.svg)](https://github.com/texonom/notion/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
9
+ [![NPM](https://img.shields.io/npm/v/nclient.svg)](https://www.npmjs.com/package/nclient) [![Build Status](https://github.com/texonom/notion-node/actions/workflows/test.yml/badge.svg)](https://github.com/texonom/notion-node/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
10
10
 
11
11
  ## Install
12
12
 
@@ -152,7 +152,7 @@ Example of a block object of type `collection_view`:
152
152
 
153
153
  ## Docs
154
154
 
155
- See the [full docs](https://github.com/texonom/notion).
155
+ See the [full docs](https://github.com/texonom/notion-node).
156
156
 
157
157
  ## License
158
158
 
@@ -1,3 +0,0 @@
1
- export * from './notion-api';
2
- export * from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -1,57 +0,0 @@
1
- import * as notion from '@texonom/ntypes';
2
- import * as types from './types';
3
- /**
4
- * Main Notion API client.
5
- */
6
- export declare class NotionAPI {
7
- private readonly _apiBaseUrl;
8
- private readonly _authToken?;
9
- private readonly _activeUser?;
10
- private readonly _userTimeZone;
11
- constructor({ apiBaseUrl, authToken, activeUser, userTimeZone }?: {
12
- apiBaseUrl?: string;
13
- authToken?: string;
14
- userLocale?: string;
15
- userTimeZone?: string;
16
- activeUser?: string;
17
- });
18
- getPage(pageId: string, { concurrency, fetchMissingBlocks, fetchCollections, signFileUrls, chunkLimit, chunkNumber, fetchOption }?: {
19
- concurrency?: number;
20
- fetchMissingBlocks?: boolean;
21
- fetchCollections?: boolean;
22
- signFileUrls?: boolean;
23
- chunkLimit?: number;
24
- chunkNumber?: number;
25
- fetchOption?: types.FetchOption;
26
- }): Promise<notion.ExtendedRecordMap>;
27
- addSignedUrls({ recordMap, contentBlockIds, fetchOption }: {
28
- recordMap: notion.ExtendedRecordMap;
29
- contentBlockIds?: string[];
30
- fetchOption?: types.FetchOption;
31
- }): Promise<void>;
32
- getPageRaw(pageId: string, { fetchOption, chunkLimit, chunkNumber }?: {
33
- chunkLimit?: number;
34
- chunkNumber?: number;
35
- fetchOption?: types.FetchOption;
36
- }): Promise<notion.PageChunk>;
37
- getCollectionData(collectionId: string, collectionViewId: string, collectionView: notion.BaseCollectionView, { limit, searchQuery, userTimeZone, loadContentCover, fetchOption }?: {
38
- type?: notion.CollectionViewType;
39
- limit?: number;
40
- searchQuery?: string;
41
- userTimeZone?: string;
42
- userLocale?: string;
43
- loadContentCover?: boolean;
44
- fetchOption?: types.FetchOption;
45
- }): Promise<notion.CollectionInstance>;
46
- getUsers(userIds: string[], fetchOption?: types.FetchOption): Promise<notion.RecordValues<notion.User>>;
47
- getBlocks(blockIds: string[], fetchOption?: types.FetchOption): Promise<notion.PageChunk>;
48
- getSignedFileUrls(urls: types.SignedUrlRequest[], fetchOption?: types.FetchOption): Promise<types.SignedUrlResponse>;
49
- search(params: notion.SearchParams, fetchOption?: types.FetchOption): Promise<notion.SearchResults>;
50
- fetch<T>({ endpoint, body, fetchOption, headers: clientHeaders }: {
51
- endpoint: string;
52
- body: object;
53
- fetchOption?: types.FetchOption;
54
- headers?: HeadersInit;
55
- }): Promise<T>;
56
- }
57
- //# sourceMappingURL=notion-api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notion-api.d.ts","sourceRoot":"","sources":["../../src/notion-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAIzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAEhC;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAQ;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;gBAE1B,EACV,UAA2C,EAC3C,SAAS,EACT,UAAU,EACV,YAAiC,EAClC,GAAE;QACD,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,YAAY,CAAC,EAA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AAE,MAAM,CAAA;QACpB,YAAY,CAAC,EAAE,MAAM,CAAA;QACrB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;QAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;KAC3B;IA2IK,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW;IAQ3D,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW;IAQ7D,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,EAAE,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW;IAQjF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW;IA6BnE,KAAK,CAAC,CAAC,EAAE,EACpB,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,OAAO,EAAE,aAAa,EACvB,EAAE;QACD,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;QAC/B,OAAO,CAAC,EAAE,WAAW,CAAA;KACtB,GAAG,OAAO,CAAC,CAAC,CAAC;CAyBf"}
@@ -1,16 +0,0 @@
1
- import * as notion from '@texonom/ntypes';
2
- export interface SignedUrlRequest {
3
- permissionRecord: PermissionRecord;
4
- url: string;
5
- }
6
- export interface PermissionRecord {
7
- table: string;
8
- id: notion.ID;
9
- }
10
- export interface SignedUrlResponse {
11
- signedUrls: string[];
12
- }
13
- export type FetchOption = RequestInit & {
14
- timeout?: number;
15
- };
16
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAEzC,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAC,EAAE,CAAA;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=notion-api.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notion-api.test.d.ts","sourceRoot":"","sources":["../../test/notion-api.test.ts"],"names":[],"mappings":""}