@sheetbase/client

Javascript client for Sheetbase app.

Usage no npm install needed!

<script type="module">
  import sheetbaseClient from 'https://cdn.skypack.dev/@sheetbase/client';
</script>

README

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

ApiService


auth()

The auth call signature.

Returns

AuthService


cache()

The cache call signature.

Returns

CacheService


database()

The database call signature.

Returns

DatabaseService


fetch()

The fetch call signature.

Returns

FetchService


helper()

The helper call signature.

Returns

HelperService


localstorage()

The localstorage call signature.

Returns

LocalstorageService


mail()

The mail call signature.

Returns

MailService


option()

The option call signature.

Returns

OptionService


storage()

The storage call signature.

Returns

StorageService


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

License

@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<null | Data>
iterate(handler) Promise
iterateKeys(handler) Promise
keys() Promise<string[]>
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<null | Data>
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<null | Data>
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<null | Data>
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<null | Data>
setData(data) ApiService
setEndpoint(endpoint) ApiService
system() Promise<null | Data>
warn(value) Promise
Function Returns type Description
add(sheet, key, data) Promise
all(sheet, cacheTime?) Promise<null | Item[]>
clearCachedAll(input) void
clearCachedContent(cachedInput) Promise
clearCachedItem(sheet, key) Promise
commenting(sheet, key) Promise
direct() DirectObject
docsContent(docId, docsStyle?, cacheTime?) Promise<null | string>
increase(sheet, key, increasing) Promise
indirect() IndirectObject
item(sheet, finder, options?) Promise<null | Item>
items(sheet, filter?, options?) Promise<null | Item[]>
itemsArchived(sheet, options?) Promise<null | Item[]>
itemsByAuthor(sheet, authorKey, options?) Promise<null | Item[]>
itemsByCategory(sheet, categoryKey, options?) Promise<null | Item[]>
itemsByKeyword(sheet, keyword, options?) Promise<null | Item[]>
itemsByLocale(sheet, locale, options?) Promise<null | Item[]>
itemsByMetaEquals(sheet, metaKey, equalTo, options?) Promise<null | Item[]>
itemsByMetaExists(sheet, metaKey, options?) Promise<null | Item[]>
itemsByOrigin(sheet, origin, options?) Promise<null | Item[]>
itemsByParent(sheet, parentKey, options?) Promise<null | Item[]>
itemsByRelated(sheet, baseItem, options?) Promise<Item[]>
itemsByTag(sheet, tagKey, options?) Promise<null | Item[]>
itemsByTerm(sheet, taxonomy, termKey, options?) Promise<null | Item[]>
itemsByType(sheet, type, options?) Promise<null | Item[]>
itemsByTypeDefault(sheet, options?) Promise<null | Item[]>
itemsDraft(sheet, options?) Promise<null | Item[]>
itemsOriginal(sheet, options?) Promise<null | Item[]>
itemsPublished(sheet, options?) Promise<null | Item[]>
jsonContent(url, cacheTime?) Promise<null | Data>
liking(sheet, key) Promise
query(sheet, filter, options?) Promise<null | Item[]>
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<null | string>
update(sheet, key, data) Promise
viewing(sheet, key) Promise
Function Returns type Description
info(id, cacheTime?) Promise<null | FileInfo>
read(_file) Promise
remove(id) Promise
update(id, data) Promise
upload(fileData, customFolder?, renamePolicy?, sharing?) Promise
uploadMultiple(uploadResources) Promise<FileInfo[]>
Function Returns type Description
quota() Promise<null | MailingQuota>
send(mailingData, category?, template?, silent?) Promise
threads(category?) Promise<null | MailingThread[]>
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