Giter Site home page Giter Site logo

observable-client's People

Contributors

bryangingechen avatar mootari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

observable-client's Issues

Authentication fails

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 )

Provide an API layer

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.