Skip to content
Snippets Groups Projects

Profile Service

Functions

  • getProfile: Tries fetching the profile if it exists. If not, it creates a new one and returns it.
  • updateProfile: Updates the profile.
  • parseProfile: Returns the Profile passed as a parameter without the following properties: _id, id, _type, _rev, cozyMetadata.

Notes Service

Functions

  • parseNote: Returns the Note passed as a parameter without the following properties: _id, _type, _rev, cozyMetadata.
  • getNoteByIDs: Returns a list of Notes from a list of ids.
  • createNote: Creates a new Note.
  • updateNote: Updates a Note.
  • getCurrentNoteOrCreate: Returns the Note linked to the current Appointment. If id does not exist, it creates and returns a new one.
  • getAllNotes: Returns a list of all Notes.

Appointments Service

Functions

  • parseAppointment: Returns an Appointment from an AppointmentEntity.
  • getLastAppointment: Returns the last Appointment, which a user can see first in /actions.
  • getAllAppointment: returns a list of all Appointments.
  • getAppointmentByID: Returns an Appointment from its id.
  • createAppointment: Creates a new Appointment.
  • updateAppointment: Updates an Appointment.

Documents Service

Functions

  • getAllDocuments: Returns the list of all documents.
  • getDocumentsByQualification: Returns a document by a qualification.
  • getDocumentsByQualifications: Uses getDocumentsByQualification to return a list of documents from a list of qualifications.
  • getDocumentByID: Returns a document by its id.
  • saveDocument: Creates a new file.
  • editDocumentName: Edits a document's name by its id.
  • deleteDocumentById: Deletes the document by its id.
  • downloadDocument: Downloads a file from its id.
  • downloadArchive: Downloads an archive containing all the files whom ids are passed as a parameter.
  • getLinkDoc: Returns the file download link.
  • getReferencedFolders: Gets a folder by a reference.
  • getOrCreateFolderWithReference: Gets a folder by a reference or creates it if it does not exist.
  • getDocumentsWithQualifications: Returns the qualified documents along with the not qualified ones ({ qualified, other }).
  • replaceFile: Replaces a file.
  • keepFile: Changes a file's name and saves it.

Contacts Service

Functions

  • getCurrentUser: Returns the contact with an existing me field, which represents the current user.
  • getAllContacts: Returns a list of all contacts.
  • findContactById: Returns a contact by its id.
  • createContact: Creates a new contact.
  • updateContact: Updates an existing contact.
  • deleteContactById: Deletes a contact by its id.

Groups Service

Function

  • createMetroGroup: Creates a new group and returns it.
  • getMetroGroup: Returns the group if it exists or creates it if it doesn't.

Initialization Service

  • Initialization: {Object} Initializes the profile, actions, and the appDirectory.

Konnectors Service

Functions

  • getAllKonnectors: Returns a list of all the Konnectors.
  • getAllKonnectorSlugs: Returns a list of all the Konnectors' slugs.
  • getKonnectorNameBySlug: Returns a Konnector name from a slug.
  • getKonnectorBySlug: Returns a Konnector from a slug.
  • getKonnectorByName: Returns a Konnector from its name.
  • getKonnectorsFromDocuments: Returns a list of Konnectors from a passed DocumentEntity list.

Objectives Service

Functions

  • parseObjective: Returns the Objective passed as a parameter without the following properties: _type, _rev, _id, cozyMetadata, relationships.
  • getObjectiveByIDs: Returns a list of Objectives from a list of ids.
  • getOldObjectives: Returns a list of the archived Objectives not belonging to the last Appointment.
  • createObjective: Creates a new Objective.
  • updateObjective: Updates an existing Objective.

Tasks Service

Functions

  • parseTaskJSONToTask: Returns a Task from a TaskJSON.
  • parseTask: Returns the Task passed as a parameter without the following properties: _type, _rev, _id, cozyMetadata, relationships.
  • getTasksByIDs: Returns a list of Tasks from a list of ids.
  • createTask: Creates a new Task.
  • updateTask: Updates a Task from its id.

TaskItems Service

Functions

  • parseTaskItem: Returns the TaskItem passed as a parameter without the following properties: _type, _rev, _id, cozyMetadata, relationships.
  • getTaskItemByIDs: Returns a list of TaskItems from a list of ids.
  • createTaskItem: Creates a new TaskItem.
  • updateTaskItem: Updates a TaskItem from its id.

Triggers Service

Functions

  • getAllTriggers: Returns All the triggers filtred by type if passed as parameter.