modules
@nishans/sync / Exports
@nishans/sync#
Index#
Interfaces#
Type aliases#
Functions#
- createTransaction
- extractCollectionData
- extractData
- extractPagesData
- extractViewsData
- idToUuid
- readFromFile
- readFromMongodb
- readFromNotion
- restoreNotionFromLocalFile
- restoreNotionFromMongodb
- storeInFile
- storeInFileFromMongodb
- storeInFileFromNotion
- storeInMongodb
- storeInMongodbFromAtlas
- storeInMongodbFromFile
- storeInMongodbFromNotion
- storeInNotion
Type aliases#
CollectionExtracted#
Ƭ CollectionExtracted: Pick<ICollection, name | description | icon | cover | schema> & { name: string }
Defined in: src/types.ts:10
PageExtracted#
Ƭ PageExtracted: Pick<IPage, format | properties>
Defined in: src/types.ts:14
TViewExtracted#
Ƭ TViewExtracted: Pick<TView, type | name | query2 | format>
Defined in: src/types.ts:13
Functions#
createTransaction#
â–¸ createTransaction(shardId: number, spaceId: string, operations: IOperation[]): SaveTransactionParams
Parameters:#
| Name | Type |
|---|---|
shardId | number |
spaceId | string |
operations | IOperation[] |
Returns: SaveTransactionParams
Defined in: utils/createTransaction.ts:5
extractCollectionData#
â–¸ ConstextractCollectionData(__namedParameters: ICollection | CollectionExtracted): CollectionExtracted
Parameters:#
| Name | Type |
|---|---|
__namedParameters | ICollection | CollectionExtracted |
Returns: CollectionExtracted
Defined in: utils/extractData.ts:4
extractData#
â–¸ ConstextractData(data: DataShape): LocalFileStructure
Parameters:#
| Name | Type |
|---|---|
data | DataShape |
Returns: LocalFileStructure
Defined in: utils/extractData.ts:47
extractPagesData#
â–¸ ConstextractPagesData(row_pages: IPage[] | Pick<IPage, format | properties>[]): any
Parameters:#
| Name | Type |
|---|---|
row_pages | IPage[] | Pick<IPage, format | properties>[] |
Returns: any
Defined in: utils/extractData.ts:31
extractViewsData#
â–¸ ConstextractViewsData(views_data: TView[] | Pick<TView, name | type | query2 | format>[]): any
Parameters:#
| Name | Type |
|---|---|
views_data | TView[] | Pick<TView, name | type | query2 | format>[] |
Returns: any
Defined in: utils/extractData.ts:20
idToUuid#
â–¸ ConstidToUuid(id?: string): string
Parameters:#
| Name | Type | Default value |
|---|---|---|
id | string | '' |
Returns: string
Defined in: utils/idToUuid.ts:1
readFromFile#
â–¸ readFromFile(file_path: string): Promise<LocalFileStructure>
Parameters:#
| Name | Type |
|---|---|
file_path | string |
Returns: Promise<LocalFileStructure>
Defined in: utils/readFromFile.ts:8
readFromMongodb#
â–¸ readFromMongodb(connection_uri: string): Promise<LocalFileStructure>
Parameters:#
| Name | Type |
|---|---|
connection_uri | string |
Returns: Promise<LocalFileStructure>
Defined in: utils/readFromMongodb.ts:6
readFromNotion#
â–¸ readFromNotion(token: string, database_id: string): Promise<LocalFileStructure>
Parameters:#
| Name | Type |
|---|---|
token | string |
database_id | string |
Returns: Promise<LocalFileStructure>
Defined in: utils/readFromNotion.ts:14
restoreNotionFromLocalFile#
â–¸ restoreNotionFromLocalFile(token: string, filepath: string, space_cb: (space: ISpace) => any): Promise<void>
Restore notion from data stored in local file
Parameters:#
| Name | Type | Description |
|---|---|---|
token | string | Notion token of the user |
filepath | string | Absolute file path of the local file |
space_cb | (space: ISpace) => any | A callback to get the space where the restoration will take place |
Returns: Promise<void>
Defined in: src/restoreNotion.ts:25
restoreNotionFromMongodb#
â–¸ restoreNotionFromMongodb(token: string, connection_uri: string, space_cb: (space: ISpace) => any): Promise<void>
Restore notion from data stored in local or remote mongodb instance
Parameters:#
| Name | Type | Description |
|---|---|---|
token | string | Notion token of the user |
connection_uri | string | Connection uri of the remote or local mongodb instance |
space_cb | (space: ISpace) => any | A callback to get the space where the restoration will take place |
Returns: Promise<void>
Defined in: src/restoreNotion.ts:11
storeInFile#
â–¸ storeInFile(filepath: string, result_data: LocalFileStructure): Promise<void>
Parameters:#
| Name | Type |
|---|---|
filepath | string |
result_data | LocalFileStructure |
Returns: Promise<void>
Defined in: utils/storeInFile.ts:8
storeInFileFromMongodb#
â–¸ storeInFileFromMongodb(connection_uri: string, filepath: string): Promise<void>
Stores data from remote/local mongodb instance into a local file
Parameters:#
| Name | Type | Description |
|---|---|---|
connection_uri | string | Connection uri of the local or remote mongodb instance |
filepath | string | full path of the output file |
Returns: Promise<void>
Defined in: src/storeInFile.ts:18
storeInFileFromNotion#
â–¸ storeInFileFromNotion(token: string, database_id: string, filepath: string): Promise<void>
Stores data from notion collection block into a local file
Parameters:#
| Name | Type | Description |
|---|---|---|
token | string | Notion token |
database_id | string | Id of the notion collection block |
filepath | string | full path of the output file |
Returns: Promise<void>
Defined in: src/storeInFile.ts:9
storeInMongodb#
â–¸ storeInMongodb(connection_uri: string, result_data: LocalFileStructure): Promise<void>
Parameters:#
| Name | Type |
|---|---|
connection_uri | string |
result_data | LocalFileStructure |
Returns: Promise<void>
Defined in: utils/storeInMongodb.ts:5
storeInMongodbFromAtlas#
â–¸ storeInMongodbFromAtlas(local_connection_uri: string, remote_collection_uri: string): Promise<void>
Stores data from remote atlas instance into local mongodb instance
Parameters:#
| Name | Type |
|---|---|
local_connection_uri | string |
remote_collection_uri | string |
Returns: Promise<void>
Defined in: src/storeInMongodb.ts:24
storeInMongodbFromFile#
â–¸ storeInMongodbFromFile(connection_uri: string, file_path: string): Promise<void>
Stores data from local file from file system into local/remote mongodb instance
Parameters:#
| Name | Type | Description |
|---|---|---|
connection_uri | string | - |
file_path | string | Full path to the output file |
Returns: Promise<void>
Defined in: src/storeInMongodb.ts:16
storeInMongodbFromNotion#
â–¸ storeInMongodbFromNotion(connection_uri: string, token: string, database_id: string): Promise<void>
Stores data from notion collection block into local/remote mongodb instance
Parameters:#
| Name | Type | Description |
|---|---|---|
connection_uri | string | - |
token | string | Notion token |
database_id | string | Id of the notion collection block |
Returns: Promise<void>
Defined in: src/storeInMongodb.ts:8
storeInNotion#
â–¸ storeInNotion(token: string, space_cb: (space: ISpace) => undefined | boolean, result_data: LocalFileStructure): Promise<void>
Parameters:#
| Name | Type |
|---|---|
token | string |
space_cb | (space: ISpace) => undefined | boolean |
result_data | LocalFileStructure |
Returns: Promise<void>
Defined in: utils/storeInNotion.ts:8