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â–¸ Const
extractCollectionData(__namedParameters
: ICollection | CollectionExtracted): CollectionExtracted
#
Parameters:Name | Type |
---|---|
__namedParameters | ICollection | CollectionExtracted |
Returns: CollectionExtracted
Defined in: utils/extractData.ts:4
#
extractDataâ–¸ Const
extractData(data
: DataShape): LocalFileStructure
#
Parameters:Name | Type |
---|---|
data | DataShape |
Returns: LocalFileStructure
Defined in: utils/extractData.ts:47
#
extractPagesDataâ–¸ Const
extractPagesData(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â–¸ Const
extractViewsData(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â–¸ Const
idToUuid(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