Javascript client for Sheetbase app.
npm install @sheetbase/clientJavascript client for Sheetbase app.
| Name | Type | Description |
| ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ----------- |
| apiKey? | undefined \| string | |
| authEndpoint? | undefined \| string | |
| authProviders? | undefined \| object | |
| backendUrl? | undefined \| string | |
| databaseAutoContent? | undefined \| false \| true | |
| databaseCacheTime? | undefined \| number | |
| databaseDocsStyle? | DocsContentStyle | |
| databaseEndpoint? | undefined \| string | |
| databaseGids? | DatabaseGids | |
| databaseId? | undefined \| string | |
| databaseUseCached? | undefined \| false \| true | |
| loggingEndpoint? | undefined \| string | |
| mailEndpoint? | undefined \| string | |
| storageAllowTypes? | string[] | |
| storageEndpoint? | undefined \| string | |
| storageMaxSize? | undefined \| number | |
The AppObject class
The AppObject class.
AppObject properties
| Name | Type | Description |
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| apiService | undefined \| ApiService | |
| authService | undefined \| AuthService | |
| cacheService | CacheService | |
| databaseService | undefined \| DatabaseService | |
| fetchService | FetchService | |
| helperService | HelperService | |
| localstorageService | LocalstorageService | |
| mailService | undefined \| MailService | |
| optionService | OptionService | |
| storageService | undefined \| StorageService | |
AppObject methods
| Function | Returns type | Description |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| api() | ApiService | |
| auth() | AuthService | |
| cache() | CacheService | |
| database() | DatabaseService | |
| fetch() | FetchService | |
| helper() | HelperService | |
| localstorage() | LocalstorageService | |
| mail() | MailService | |
| option() | OptionService | |
| storage() | StorageService | |
api()
The api call signature.
Returns
---
auth()
The auth call signature.
Returns
---
cache()
The cache call signature.
Returns
---
database()
The database call signature.
Returns
---
fetch()
The fetch call signature.
Returns
---
helper()
The helper call signature.
Returns
---
localstorage()
The localstorage call signature.
Returns
---
mail()
The mail call signature.
Returns
---
option()
The option call signature.
Returns
---
storage()
The storage call signature.
Returns
---
| Function | Returns type | Description |
| ------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ----------- |
| createPopup(config) | void | |
| decodeJWTPayload(token) | any | |
| getHost() | string | |
| isExpiredInSeconds(expiredTime, costMore?) | boolean | |
| isExpiredJWT(token) | boolean | |
| md5(str, key?, raw?) | string | |
| orderBy(collection, iteratees, orders, guard?) | any | |
@sheetbase/client is released under the MIT license.
| Function | Returns type | Description |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----------- |
| getOptions() | Options | |
| Function | Returns type | Description |
| ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| clear() | Promise | |
| extend(storageConfigs) | LocalstorageService | |
| get(key) | Promise | |
| iterate(handler) | Promise | |
| iterateKeys(handler) | Promise | |
| keys() | Promise | |
| remove(key) | Promise | |
| removeBulk(keys) | Promise | |
| removeByPrefix(prefix) | Promise | |
| removeBySuffix(suffix) | Promise | |
| set(key, data) | Promise | |
| Function | Returns type | Description |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------- |
| extend(storageConfigs) | CacheService | |
| flush() | Promise | |
| flushExpired() | Promise | |
| get(key, refresher?, cacheTime?, keyBuilder?) | Promise | |
| iterate(handler) | Promise | |
| iterateKeys(handler) | Promise | |
| remove(key) | Promise | |
| removeBulk(keys) | Promise | |
| removeByPrefix(prefix) | Promise | |
| removeBySuffix(suffix) | Promise | |
| set(key, data, cacheTime?) | Promise | |
| Function | Returns type | Description |
| ------------------------------------------------------------------------------------------------------ | ---------------------------------- | ----------- |
| delete(url, init?) | Promise | |
| fetch(input, init?, json?) | Promise | |
| get(url, init?, json?, cacheTime?) | Promise | |
| patch(url, init?) | Promise | |
| post(url, init?) | Promise | |
| put(url, init?) | Promise | |
| Function | Returns type | Description |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ----------- |
| addBeforeHooks(hooks) | ApiService | |
| addBody(body) | ApiService | |
| addQuery(query) | ApiService | |
| delete(endpoint?, query?, body?) | Promise | |
| error(value) | Promise | |
| extend() | ApiService | |
| get(endpoint?, query?, cacheTime?) | Promise | |
| info(value) | Promise | |
| log(value) | Promise | |
| logging(value, level?) | Promise | |
| patch(endpoint?, query?, body?) | Promise | |
| post(endpoint?, query?, body?) | Promise | |
| put(endpoint?, query?, body?) | Promise | |
| request(inputs?) | Promise | |
| setData(data) | ApiService | |
| setEndpoint(endpoint) | ApiService | |
| system() | Promise | |
| warn(value) | Promise | |
| Function | Returns type | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----------- |
| add(sheet, key, data) | Promise | |
| all(sheet, cacheTime?) | Promise | |
| clearCachedAll(input) | void | |
| clearCachedContent(cachedInput) | Promise | |
| clearCachedItem(sheet, key) | Promise | |
| commenting(sheet, key) | Promise | |
| direct() | DirectObject | |
| docsContent(docId, docsStyle?, cacheTime?) | Promise | |
| increase(sheet, key, increasing) | Promise | |
| indirect() | IndirectObject | |
| item(sheet, finder, options?) | Promise | |
| items(sheet, filter?, options?) | Promise | |
| itemsArchived(sheet, options?) | Promise | |
| itemsByAuthor(sheet, authorKey, options?) | Promise | |
| itemsByCategory(sheet, categoryKey, options?) | Promise | |
| itemsByKeyword(sheet, keyword, options?) | Promise | |
| itemsByLocale(sheet, locale, options?) | Promise | |
| itemsByMetaEquals(sheet, metaKey, equalTo, options?) | Promise | |
| itemsByMetaExists(sheet, metaKey, options?) | Promise | |
| itemsByOrigin(sheet, origin, options?) | Promise | |
| itemsByParent(sheet, parentKey, options?) | Promise | |
| itemsByRelated(sheet, baseItem, options?) | Promise | |
| itemsByTag(sheet, tagKey, options?) | Promise | |
| itemsByTerm(sheet, taxonomy, termKey, options?) | Promise | |
| itemsByType(sheet, type, options?) | Promise | |
| itemsByTypeDefault(sheet, options?) | Promise | |
| itemsDraft(sheet, options?) | Promise | |
| itemsOriginal(sheet, options?) | Promise | |
| itemsPublished(sheet, options?) | Promise | |
| jsonContent(url, cacheTime?) | Promise | |
| liking(sheet, key) | Promise | |
| query(sheet, filter, options?) | Promise | |
| rating(sheet, key, stars) | Promise | |
| registerDataParser(parser) | DatabaseService | |
| remove(sheet, key) | Promise | |
| set(sheet, key, data) | Promise | |
| setSegmentation(globalSegment) | DatabaseService | |
| sharing(sheet, key, providers?) | Promise | |
| textContent(url, cacheTime?) | Promise | |
| update(sheet, key, data) | Promise | |
| viewing(sheet, key) | Promise | |
| Function | Returns type | Description |
| --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ----------- |
| info(id, cacheTime?) | Promise | |
| read(\_file) | Promise | |
| remove(id) | Promise | |
| update(id, data) | Promise | |
| upload(fileData, customFolder?, renamePolicy?, sharing?) | Promise | |
| uploadMultiple(uploadResources) | Promise | |
| Function | Returns type | Description |
| -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ----------- |
| quota() | Promise | |
| send(mailingData, category?, template?, silent?) | Promise | |
| threads(category?) | Promise | |
| Function | Returns type | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------- |
| checkActionCode(code) | Promise | |
| confirmPasswordReset(code, newPassword) | Promise | |
| createUserWithEmailAndPassword(email, password) | Promise | |
| facebookAuthProvider() | ProviderObject | |
| googleAuthProvider() | ProviderObject | |
| onAuthStateChanged(next) | void | |
| sendPasswordResetEmail(email) | Promise | |
| signInAnonymously() | Promise | |
| signInWithCustomToken(token) | Promise | |
| signInWithEmailAndPassword(email, password) | Promise | |
| signInWithPopup(provider) | Promise | |
| signOut() | Promise | |
| verifyPasswordResetCode(code) | Promise | |