Hypertable Client Library / Exports / TestModeHypClientLib
Class: TestModeHypClientLib
Hierarchy
-
↳
TestModeHypClientLib
Table of contents
Constructors
Accessors
Methods
- alertConfirm
- alertNotify
- alertPrompt
- alertToast
- cloneRecord
- createBatch
- createRecord
- createRecordWithoutSaving
- deleteRecord
- findCollection
- findFieldFromKey
- findRecord
- findRecords
- getAllRecords
- getCollection
- getCollectionById
- getRecord
- getRecords
- getView
- getViewRecords
- log
- logTestCall
- openPreview
- openRecordPreview
- openView
- printMarkdown
- queryRecords
- saveBatch
- selectRecord
- selectRecords
- showCustomModal
- updateRecord
Constructors
constructor
• new TestModeHypClientLib(api)
Parameters
| Name | Type |
|---|---|
api |
HypClientLibApi |
Overrides
Accessors
utils
• get utils(): Object
Get a reference to the collection of utility functions
Returns
Object
| Name | Type |
|---|---|
dereference |
<T>(object: T) => any |
log |
(...message: any[]) => never |
readFromClipboard |
() => Promise<undefined | string> |
wait |
(ms: number) => Promise<void> |
writeToClipboard |
(toWrite: string) => never |
Inherited from
HypClientLib.utils
Methods
alertConfirm
▸ alertConfirm(message, opts?): Promise<boolean>
Display a message to the user in a styled modal, requiring them to either confirm or cancel.
Parameters
| Name | Type |
|---|---|
message |
string |
opts? |
ClientLibApiAlertOptions |
Returns
Promise<boolean>
The returned promise resolves with true if the user selects the confirm option.
Overrides
alertNotify
▸ alertNotify(message, opts?): Promise<undefined>
Display a message to the user in a styled modal.
The returned promise resolves once they dismiss the modal.
Parameters
| Name | Type |
|---|---|
message |
string |
opts? |
ClientLibApiAlertOptions |
Returns
Promise<undefined>
Overrides
alertPrompt
▸ alertPrompt(message, opts?): Promise<undefined>
Prompt the user to enter some text in an input, displayed in a styled modal.
Parameters
| Name | Type |
|---|---|
message |
string |
opts? |
ClientLibApiAlertOptions |
Returns
Promise<undefined>
The string the user entered, or undefined if the user cancelled the modal
Overrides
alertToast
▸ alertToast(message): Promise<undefined>
Display a short message to the user, in a non-interrupting toast pop-up (AKA candybar)
Parameters
| Name | Type |
|---|---|
message |
string |
Returns
Promise<undefined>
Overrides
cloneRecord
▸ cloneRecord(collectionId, recordId, opts?): Promise<undefined | HypRecord>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
opts? |
Object |
opts.references? |
"discard" | "keep" | "clone" |
Returns
Promise<undefined | HypRecord>
Inherited from
createBatch
▸ createBatch(): HypBatch
Returns
Inherited from
createRecord
▸ createRecord(collectionId): Promise<undefined>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<undefined>
Overrides
createRecordWithoutSaving
▸ createRecordWithoutSaving(collection): HypRecord
Parameters
| Name | Type |
|---|---|
collection |
HypCollection |
Returns
Inherited from
HypClientLib.createRecordWithoutSaving
deleteRecord
▸ deleteRecord(collectionId, recordId): Promise<boolean>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
Returns
Promise<boolean>
Overrides
findCollection
▸ findCollection(collectionId): Promise<undefined>
Find the collection with the given ID
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<undefined>
Overrides
findFieldFromKey
▸ findFieldFromKey(collectionId, fieldKey): undefined | HypField
Parameters
| Name | Type |
|---|---|
collectionId |
string |
fieldKey |
string |
Returns
undefined | HypField
Inherited from
findRecord
▸ findRecord(collectionId, recordId): Promise<undefined>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
Returns
Promise<undefined>
Overrides
findRecords
▸ findRecords(collectionId, recordIds): Promise<HypRecord[]>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordIds |
string[] |
Returns
Promise<HypRecord[]>
Inherited from
getAllRecords
▸ getAllRecords(collectionId): Promise<HypRecord[]>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<HypRecord[]>
Inherited from
getCollection
▸ getCollection(collectionId): Promise<HypCollection>
Get the collection with the given name. If the collection is renamed, this call will need to be updated.
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<HypCollection>
The specified collection
Overrides
getCollectionById
▸ getCollectionById(id): Promise<HypCollection>
Get the collection with the given ID.
throws An error if the specified collection is not found
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The ID of the desired collection |
Returns
Promise<HypCollection>
The specified collection
Inherited from
HypClientLib.getCollectionById
getRecord
▸ getRecord(collectionId, recordId): Promise<HypRecord>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
Returns
Promise<HypRecord>
Overrides
getRecords
▸ getRecords(collectionId, recordIds): Promise<HypRecord[]>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordIds |
string[] |
Returns
Promise<HypRecord[]>
Inherited from
getView
▸ getView(viewId): Promise<undefined | HypView>
Get the View with the given ID. Returns undefined if the View was not found.
Parameters
| Name | Type |
|---|---|
viewId |
string |
Returns
Promise<undefined | HypView>
Inherited from
getViewRecords
▸ getViewRecords(viewId): Promise<undefined | HypRecord[]>
Get the Records visible in the given View. Returns undefined if the View was not found, or if the View is not a "collection" View.
Parameters
| Name | Type | Description |
|---|---|---|
viewId |
string |
The ID of the spceified View |
Returns
Promise<undefined | HypRecord[]>
Inherited from
log
▸ log(message, level?): void
Log a message to the Hypertable custom function log
Parameters
| Name | Type |
|---|---|
message |
string |
level? |
ClientLibApiLogLevel |
Returns
void
Overrides
logTestCall
▸ Private logTestCall(methodName): Promise<void>
Parameters
| Name | Type |
|---|---|
methodName |
string |
Returns
Promise<void>
openPreview
▸ openPreview(record): Promise<boolean>
Open the specified record in the record preview modal
Parameters
| Name | Type |
|---|---|
record |
HypRecord |
Returns
Promise<boolean>
Inherited from
openRecordPreview
▸ openRecordPreview(collectionId, recordId): Promise<boolean>
Open the specified record in the record preview modal
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
Returns
Promise<boolean>
Inherited from
HypClientLib.openRecordPreview
openView
▸ openView(viewId, recordId?): Promise<boolean>
Immediately open the specified View
Parameters
| Name | Type | Description |
|---|---|---|
viewId |
string |
The View to open |
recordId? |
string |
Specify a record to select if the View is a Record View |
Returns
Promise<boolean>
Whether the specified View was opened
Inherited from
printMarkdown
▸ printMarkdown(markdown, options?): Promise<any>
Parameters
| Name | Type |
|---|---|
markdown |
string |
options? |
any |
Returns
Promise<any>
Inherited from
queryRecords
▸ queryRecords(collectionId, query): Promise<never[]>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
query |
any |
Returns
Promise<never[]>
Overrides
saveBatch
▸ saveBatch(batch): Promise<boolean>
Parameters
| Name | Type |
|---|---|
batch |
HypBatch |
Returns
Promise<boolean>
Inherited from
selectRecord
▸ selectRecord(collectionId): Promise<undefined | HypRecord>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<undefined | HypRecord>
Inherited from
selectRecords
▸ selectRecords(collectionId): Promise<undefined | HypRecord[]>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
Returns
Promise<undefined | HypRecord[]>
Inherited from
showCustomModal
▸ showCustomModal(customViewId, opts?): Promise<boolean>
Parameters
| Name | Type |
|---|---|
customViewId |
string |
opts? |
ClientLibApiAlertOptions |
Returns
Promise<boolean>
Overrides
updateRecord
▸ updateRecord(collectionId, recordId, updates): Promise<boolean>
Parameters
| Name | Type |
|---|---|
collectionId |
string |
recordId |
string |
updates |
any |
Returns
Promise<boolean>