johnjones4 / Standard-Notes-Clipper

A browser add-on (Firefox and Chrome) that allows you to clip web pages to your Standard Notes account.
MIT License
124 stars 13 forks source link

Try this ? #1

Closed DiamondYuan closed 5 years ago

DiamondYuan commented 5 years ago

https://github.com/webclipper/web-clipper

It's easy to support Standard Notes.

https://github.com/webclipper/web-clipper/tree/master/src/common/backend/services

export interface DocumentService<T = any> {
  getId(): string;

  getRepositories(): Promise<Repository[]>;

  createDocument(request: CreateDocumentRequest): Promise<CompleteStatus>;

  getUserInfo(): Promise<UserInfo>;

  refreshToken?(info: T): Promise<T>;
}
johnjones4 commented 5 years ago

Thanks! Do you have published documentation on how to add new services?

DiamondYuan commented 5 years ago

Thanks! Do you have published documentation on how to add new services?

Sorry,I don't have any document.

  1. create a new folder in src/common/backend/services

3.create new Service implements DocumentService

3.export service info in index.ts

https://github.com/webclipper/web-clipper/blob/master/src/common/backend/services/onenote_oauth/index.ts

johnjones4 commented 5 years ago

Thanks! I was a little confused about how authentication works in this as well, and so I worry without a decent set of documentation I'd be a little hesitant to jump in - particularly because I'm just getting the hang of the Standard File API as well. If you ever end up publishing any sort of guide to adding new services, I'd be happy to take another look!