Newer
Older
## 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`.
- `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.
- `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.
### 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.
### 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.
## Function
- `createMetroGroup`: Creates a new group and returns it.
- `getMetroGroup`: Returns the group if it exists or creates it if it doesn't.
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
## 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.