modules

@nishans/sync / Exports

@nishans/sync#

Index#

Interfaces#

Type aliases#

Functions#

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:#

NameType
shardIdnumber
spaceIdstring
operationsIOperation[]

Returns: SaveTransactionParams

Defined in: utils/createTransaction.ts:5


extractCollectionData#

â–¸ ConstextractCollectionData(__namedParameters: ICollection | CollectionExtracted): CollectionExtracted

Parameters:#

NameType
__namedParametersICollection | CollectionExtracted

Returns: CollectionExtracted

Defined in: utils/extractData.ts:4


extractData#

â–¸ ConstextractData(data: DataShape): LocalFileStructure

Parameters:#

NameType
dataDataShape

Returns: LocalFileStructure

Defined in: utils/extractData.ts:47


extractPagesData#

â–¸ ConstextractPagesData(row_pages: IPage[] | Pick<IPage, format | properties>[]): any

Parameters:#

NameType
row_pagesIPage[] | 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:#

NameType
views_dataTView[] | Pick<TView, name | type | query2 | format>[]

Returns: any

Defined in: utils/extractData.ts:20


idToUuid#

â–¸ ConstidToUuid(id?: string): string

Parameters:#

NameTypeDefault value
idstring''

Returns: string

Defined in: utils/idToUuid.ts:1


readFromFile#

â–¸ readFromFile(file_path: string): Promise<LocalFileStructure>

Parameters:#

NameType
file_pathstring

Returns: Promise<LocalFileStructure>

Defined in: utils/readFromFile.ts:8


readFromMongodb#

â–¸ readFromMongodb(connection_uri: string): Promise<LocalFileStructure>

Parameters:#

NameType
connection_uristring

Returns: Promise<LocalFileStructure>

Defined in: utils/readFromMongodb.ts:6


readFromNotion#

â–¸ readFromNotion(token: string, database_id: string): Promise<LocalFileStructure>

Parameters:#

NameType
tokenstring
database_idstring

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:#

NameTypeDescription
tokenstringNotion token of the user
filepathstringAbsolute file path of the local file
space_cb(space: ISpace) => anyA 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:#

NameTypeDescription
tokenstringNotion token of the user
connection_uristringConnection uri of the remote or local mongodb instance
space_cb(space: ISpace) => anyA 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:#

NameType
filepathstring
result_dataLocalFileStructure

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:#

NameTypeDescription
connection_uristringConnection uri of the local or remote mongodb instance
filepathstringfull 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:#

NameTypeDescription
tokenstringNotion token
database_idstringId of the notion collection block
filepathstringfull 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:#

NameType
connection_uristring
result_dataLocalFileStructure

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:#

NameType
local_connection_uristring
remote_collection_uristring

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:#

NameTypeDescription
connection_uristring-
file_pathstringFull 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:#

NameTypeDescription
connection_uristring-
tokenstringNotion token
database_idstringId 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:#

NameType
tokenstring
space_cb(space: ISpace) => undefined | boolean
result_dataLocalFileStructure

Returns: Promise<void>

Defined in: utils/storeInNotion.ts:8