mootari / observable-client Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
log:
cd /Users/fil/Source/observable/backup && /usr/local/bin/node api.js backup-user fil
T=11111111111111redacted00; Domain=observablehq.com; Path=/; Expires=Sat, 15 Aug 2020 19:23:54 GMT; Secure
(node:93053) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
Please enter github username:fil
Please enter github password:*****
Please enter 2FA:111141
failed to authenticate!
( I deleted ./node_modules/flat-cache/.cache/cacheId )
Time to revisit a possible API. Observable's internal API has grown a lot since I created this repository, and their scripts provide a nice index of potential API functions. I'd argue that we shouldn't create our own abstraction, but instead replicate the existing API as close as possible.
The existing API signatures are listed below (extracted and unminified).
Batch 1:
activityLoadUser({type = "all", days = "7", all})
collectionLoad(user, collection, {before, page} = {})
collectionLoadPublic(user, collection, {before, page} = {})
collectionsLoadUser(user ,{type, page} = {})
collectionsLoadUserPublic(user, {page} = {})
documentLoad(id, version)
documentLoadForks(id, {before, page, type} = {})
documentLoadHead(id)
documentLoadHistory(id)
documentLoadLiked(id)
documentLoadLikes(id)
documentLoadMeta(id)
documentLoadSecrets(id)
documentMembers()
documentSearch(query, page) // "query" trimmed and lowercased before request
documentsLoadByUser(user, {before, page} = {})
documentsLoadPopular({date, limit} = {})
documentsLoadPublic({before, page, limit} = {})
documentsLoadTop({page, limit} = {})
documentsLoadTrending({page, limit} = {})
documentsLoadUser({before, page, types} = {})
documentsLoadUserLikes({before, page} = {})
documentVersion(id)
userApiKeys()
userIdentity(user)
userLoad(user) // param is optional
userPublicStats(user) // param is optional
userSecrets()
userStats()
userSuggestions({before, page, type} = {})
Batch 2:
activityLoadTeam(team, {type = "all", days = "7"})
documentLoadDataConnector(id, name)
documentsLoadTeam(team, {before, page, types, share_level} = {})
teamApiKeys(team)
teamDataConnectors(team)
teamInvitations(team)
teamMembers(team)
teamSecrets(team)
teamStats(team)
teamSuggestions(team, {before, page, type} = {})
userDataConnectors()
Backlog:
collectionAddDocument({id, document_id})
collectionDelete(collection)
collectionEdit({id, title, description, feature_rank, pinned, type, ordered})
collectionNew({title, description, owner, type, ordered})
collectionRemoveDocument({id, document_id})
collectionReorderDocument({id, document_id, order})
collectionThumbnail(collection, thumbnail) // format for "thumbnail" unclear
continueEditing(unified) // param format and use unclear
continueEditingTeam(team)
documentAllowDataConnector(id, name, allow) // format for "allow" unclear
documentAllowSecrets(id, allow) // format for "allow" unclear
documentDeleteFile(id, name)
documentFork(id, version, {events, team, comments = [], temporary_id = null}) // some params might be flags
documentLike(id, like) // "like" value unclear, possibly status flag
documentMerge(id, version, {events, target, files = []})
documentNew(doc, team)
documentPublish(id, version, title, unlisted = false)
documentPutBack(id)
documentRevert(id, version)
documentsEmptyTrash(team) // optional param, format unclear
documentsLoadCommonAncestry(id, t) // "t" param unclear, use: `/documents/${id}/${t}/ancestry`
documentSubscribe(id, status) // "status" values unclear, also see documentUnsubscribe
documentSuggest(id, {to_id, from_title, version, description})
documentThumbnail(id, thumbnail) // format for "thumbnail" unclear
documentTransfer(id, user)
documentTrash(id)
documentUnpublish(id)
documentUnsubscribe(id)
documentUpdateRoles(id, roles) // format for "roles" unclear
documentUploadFile(id, file) // format for "file" unclear
suggestionClose(e) // "e" might be document id, use: `/suggestion/${e}/close`
teamAcceptInvitation(team, id)
teamDeleteApiKey(team, key) // might be key or id, use: `/team/${team}/api-key/${key}/delete`
teamDeleteDataConnector(team, name)
teamEdit(team, data) // "data" possibly an object with various keys; need to check form
teamEditAvatar(team, avatar) // format for "avatar" unclear
teamEditEmail(team, email)
teamGenerateDataConnectorSecret(team, name)
teamInvite(team, email, role) // "role" values unclear
teamLoadDataConnectorCheckToken(team, name)
teamMemberRemove(team, user)
teamMemberRole(team, user, role)
teamNew({login, name, email, stripe_token, cycle, coupon})
teamNewApiKey(team,{description})
teamRescindInvitation(team, id)
teamSetDataConnector(team ,{name, type, local, credentials}) // some param formats unclear
teamSetSecret(team, {name, value})
unsubscribeAnonymous(id, user, code, status = "none") // "code" unclear, possibly OTP mail token?
uploadAnonymousFile(e, data) // param "e" unclear, data is object with at least key/object "file.size" (blob? no special handling in formdata)
userDeleteApiKey(key) // might be key or id, use: `/user/api-key/${key}/delete`
userDeleteDataConnector(name)
userEdit(data) // "data" possibly an object with various keys; need to check form
userEditAvatar(avatar) // format for "avatar" unclear
userEditEmail(email)
userEmailConfirm(id)
userGenerateDataConnectorSecret(name)
userLoadDataConnectorCheckToken(name)
userNewApiKey({description})
userSetDataConnector({name, type, local, credentials})
userSetLogin(login)
userSetSecret({name, value})
Out of scope:
couponLoad(e) // value unclear (coupon code?), use: (`/coupon/${e}`
recoverLogin(email)
report({anonymous, subject, reason}) // param formats unclear
teamBilling(team)
teamBillingCycleUpdate(team, cycle) // "cycle" values unclear
teamBillingDelete(team))
teamBillingUpdate(team, stripe_token)
teamInvoices(team, starting_after)
teamInvoiceUpcoming(team)
teamSubscriptionNew(team, stripe_token, cycle, coupon)
usersExist(logins) // "login" is array; possibly a check for available user names
TBD
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.