Add Activepieces integration for workflow automation

- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,36 @@
import { wedofAuth } from '../../index';
import { Property, createAction } from '@activepieces/pieces-framework';
export const addExecutionTag = createAction({
auth: wedofAuth,
name: 'addExecutionTag',
displayName: 'Associer le run à wedof',
description:
"Permet d'associer une exécution de workflow à un ou plusieurs dossiers de (formations / certifications) dans wedof",
errorHandlingOptions: {
continueOnFailure: {
hide: true,
},
retryOnFailure: {
hide: true,
},
},
props: {
externalId: Property.Array({
displayName: 'Numéros de dossier',
description:
'Entrez un ou plusieurs numéros de dossier à associer à cette exécution.',
required: true,
defaultValue: [],
}),
},
async run(context) {
for (const id of context.propsValue.externalId as string[]) {
await context.tags.add({ name: id });
}
return {
success: true,
tagsAjoutes: context.propsValue.externalId,
};
},
});

View File

@@ -0,0 +1,34 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getCertificationFolderSurvey = createAction({
auth: wedofAuth,
name: 'getCertificationFolderSurvey',
displayName: "Récupération d'une enquête",
description: "Permet de récupérer une enquête associée à un dossier de certification",
props: {
certificationFolderExternalId: Property.ShortText({
displayName: 'N° de dossier de certification',
description: "Sélectionner la propriété {externalId} du dossier de certification",
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url: wedofCommon.baseUrl + '/surveys/'+ context.propsValue.certificationFolderExternalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,108 @@
import { HttpMethod, QueryParams, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const listCertificationFolderSurveys = createAction({
auth: wedofAuth,
name: 'listCertificationFolderSurveys',
displayName: 'Liste les enquêtes selon des critères',
description: "Récupérer l'ensemble des enquêtes de l'organisme de l'utilisateur connecté",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: "Permet de n'obtenir que les enquêtes liées à la certification considérée",
required: false,
}),
limit: Property.ShortText({
displayName: "Nombre d'enquêtes",
description: "Nombre d'éléments retourné par requête - par défaut 100",
required: false,
}),
order: Property.StaticDropdown({
displayName: "Ordre",
description: "Tri les résultats par ordre ascendant ou descendant",
required: false,
options: {
options: [
{
value: 'asc',
label: 'Ascendant',
},
{
value: 'desc',
label: 'Descendant',
},
],
disabled: false,
},
}),
page: Property.Number({
displayName: 'N° de page de la requête',
description: 'Par défaut : 1',
defaultValue: 1,
required: false,
}),
state: Property.StaticDropdown({
displayName: "Etat",
description: "Permet de n'obtenir que les enquêtes en fonction de l'état considéré",
required: false,
options: {
options: [
{
value: 'all',
label: 'Tous',
},
{
value: 'created',
label: 'Créé',
},
{
value: 'beforeCertificationSuccess',
label: 'Avant la réussite de la certification',
},
{
value: 'afterSixMonthsCertificationSuccess',
label: 'Six mois après la réussite de la certification',
},
{
value: 'finished',
label: 'Terminé',
},
],
disabled: false,
},
}),
},
async run(context) {
const params = {
certifInfo: context.propsValue.certifInfo ?? null,
limit: context.propsValue.limit ?? null,
page: context.propsValue.page ?? null,
state: context.propsValue.state ?? null,
order:context.propsValue.order ?? null,
};
const queryParams: QueryParams = {};
Object.keys(params).forEach((value) => {
const key = value as keyof typeof params;
if (params[key] != null && params[key] != undefined) {
queryParams[value] = params[key] as string;
}
});
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
queryParams: queryParams,
url: wedofCommon.baseUrl + '/surveys',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,43 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const abortCertificationFolder = createAction({
auth: wedofAuth,
name: 'abortCertificationFolder',
displayName: 'Passer un dossier de certification à létat : Abandonné',
description: "Change l'état d'un dossier de certification vers : Abandonné",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/abort',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,129 @@
import { wedofAuth } from '../../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const createCertificationFolder = createAction({
auth: wedofAuth,
name: 'createCertificationFolder',
displayName: "Créer un dossier de certification hors CPF",
description: "Permet de créer un nouveau dossier de certification",
props: {
certifInfo: Property.ShortText({
displayName: 'N° du certification',
description:'Le certifInfo de la certification sélectionnée',
required: true,
}),
attendeeId: Property.ShortText({
displayName: "L'ID de l'apprenant",
description:"ID de l'apprenant sélectionné",
required: true,
}),
optionName: Property.ShortText({
displayName: "Option si appliquée",
required: false,
}),
enrollmentDate : Property.DateTime({
displayName: "Date d'inscription à la certification",
description: 'Date au format YYYY-MM-DD - peut être modifié dans les états toRegister, registered, toTake, toControl',
required: false,
}),
dataProvider: Property.StaticDropdown({
displayName: "Type de financement",
description: "Type de financement du dossier de certification",
required: true,
options: {
options: [
{ label: 'Individuel', value: 'individual' },
{ label: 'OPCO', value: 'opco' },
{ label: 'Pôle Emploi', value: 'poleEmploi' },
{ label: 'Entreprise', value: 'company' }
],
disabled: false,
},
}),
type: Property.StaticDropdown({
displayName: "Dossier à l'initiative de",
description: "Initiative à laquelle l'inscription a été réalisée",
required: false,
options: {
options: [
{ label: 'Certifié(e)', value: 'CERTIFIE' },
{ label: 'Organisme de formation', value: 'OF' },
{ label: 'Pôle Emploi', value: 'POLE_EMPLOI' },
{ label: 'Employeur', value: 'EMPLOYEUR' },
{ label: 'Autre', value: 'AUTRE' }
],
disabled: false,
},
}),
accesModality: Property.StaticDropdown({
displayName: "accessModality",
description: "Si accessModality est de type VAE, accessModalityVae doit être déclaré",
required: false,
options: {
options: [
{ label: 'Formation initiale hors apprentissage', value: 'FORMATION_INITIALE_HORS_APPRENTISSAGE' },
{ label: 'Formation initiale apprentissage', value: 'FORMATION_INITIALE_APPRENTISSAGE' },
{ label: 'Formation continue hors contrat de professionnalisation', value: 'FORMATION_CONTINUE_HORS_CONTRAT_DE_PROFESSIONNALISATION' },
{ label: 'Formation continue contrat de professionnalisation', value: 'FORMATION_CONTINUE_CONTRAT_DE_PROFESSIONNALISATION' },
{ label: 'Vae', value: 'VAE' },
{ label: 'Equivalence (Diplome etranger)', value: 'EQUIVALENCE_(DIPLOME_ETRANGER)' },
{ label: 'Candidat libre', value: 'CANDIDAT_LIBRE' },
],
disabled: false,
},
}),
accesModalityVae: Property.StaticDropdown({
displayName: "accessModality Vae",
description: "Requis si la valeur accessModality est 'VAE'",
required: false,
options: {
options: [
{ label: 'Congés Vae', value: 'CONGES_VAE' },
{ label: 'Vae classique', value: 'VAE_CLASSIQUE' }
],
disabled: false,
},
}),
tags: Property.Array({
displayName: 'Tags',
description: 'Liste de tags associée au dossier de certification, uniquement pour le certificateur',
required: false,
}),
metadata: Property.Array({
displayName: 'Données personnalisées',
description: 'tableau associatif clé - valeur, disponible uniquement pour le certificateur',
required: false,
})
},
async run(context) {
const message = {
certifInfo: context.propsValue.certifInfo ?? null,
attendeeId: context.propsValue.attendeeId ?? null,
optionName: context.propsValue.optionName ?? null,
enrollmentDate: context.propsValue.enrollmentDate
? dayjs(context.propsValue.enrollmentDate).format('YYYY-MM-DD')
: null,
dataProvider: context.propsValue.dataProvider ?? null,
type: context.propsValue.type ?? null,
accesModality: context.propsValue.accesModality ?? null,
accesModalityVae: context.propsValue.accesModalityVae ?? null,
tags: context.propsValue.tags ?? [],
metadata: context.propsValue.metadata ?? []
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +'/certificationFolders',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,52 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const declareCertificationFolderFailed = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderFailed',
displayName: 'Passer un dossier de certification à létat : Échoué',
description: "Change l'état d'un dossier de certification vers : Échoué",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
detailedResult: Property.ShortText({
displayName: "Détail du résultat de l'examen",
required: false,
}),
europeanLanguageLevel: wedofCommon.europeanLanguageLevel,
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
detailedResult: context.propsValue.detailedResult,
europeanLanguageLevel: context.propsValue.europeanLanguageLevel,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/fail',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,75 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareCertificationFolderRegistred = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderRegistred',
displayName: "Passer un dossier de certification à l'état : Enregistré",
description: "Change l'état d'un dossier de certification vers : Enregistré",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
enrollmentDate: Property.DateTime({
displayName: "Date d'inscription à la certification",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationDate: Property.DateTime({
displayName: "Date de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationEndDate: Property.DateTime({
displayName: "Date de fin de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationType: wedofCommon.examinationType,
examinationPlace: Property.ShortText({
displayName: "Lieu de passage de l'examen",
required: false,
}),
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
enrollmentDate: context.propsValue.enrollmentDate
? dayjs(context.propsValue.enrollmentDate).format('YYYY-MM-DD')
: null,
examinationDate: context.propsValue.examinationDate
? dayjs(context.propsValue.examinationDate).format('YYYY-MM-DD')
: null,
examinationEndDate: context.propsValue.examinationEndDate
? dayjs(context.propsValue.examinationEndDate).format('YYYY-MM-DD')
: null,
examinationType: context.propsValue.examinationType,
examinationPlace: context.propsValue.examinationPlace,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/register',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,67 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareCertificationFolderSuccess = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderSuccess',
displayName: "Passer un dossier de certification à l'état : Réussi",
description: "Change l'état d'un dossier de certification vers : Réussi",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
detailedResult: Property.ShortText({
displayName: "Détail du résultat de l'examen",
required: false,
}),
europeanLanguageLevel: wedofCommon.europeanLanguageLevel,
issueDate: Property.DateTime({
displayName: "Date d'obtention de la certification",
description: 'Date au format YYYY-MM-DD.',
required: true,
}),
digitalProofLink: Property.ShortText({
displayName:
"Lien vers la preuve numérique de l'obtention de la certification",
required: false,
}),
gradePass: wedofCommon.gradePass,
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
detailedResult: context.propsValue.detailedResult,
issueDate: context.propsValue.issueDate
? dayjs(context.propsValue.issueDate).format('YYYY-MM-DD')
: null,
digitalProofLink: context.propsValue.digitalProofLink,
europeanLanguageLevel: context.propsValue.europeanLanguageLevel,
gradePass: context.propsValue.gradePass,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/success',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,100 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareCertificationFolderToControl = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderToControl',
displayName: "Passer un dossier de certification à l'état : À contrôler",
description: "Change l'état d'un dossier de certification vers : À contrôler",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
enrollmentDate: Property.DateTime({
displayName: "Date d'inscription à la certification",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationDate: Property.DateTime({
displayName: "Date de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: true,
}),
examinationEndDate: Property.DateTime({
displayName: "Date de fin de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationType: Property.StaticDropdown({
displayName: "Type de passage de l'examen",
required: true,
defaultValue: {
value: 'A_DISTANCE',
label: 'À distance',
},
options: {
options: [
{
value: 'A_DISTANCE',
label: 'À distance',
},
{
value: 'EN_PRESENTIEL',
label: 'En présentiel',
},
{
value: 'MIXTE',
label: 'Mixte',
},
],
disabled: false,
},
}),
examinationPlace: Property.ShortText({
displayName: "Lieu de passage de l'examen",
required: false,
}),
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
enrollmentDate: context.propsValue.enrollmentDate
? dayjs(context.propsValue.enrollmentDate).format('YYYY-MM-DD')
: null,
examinationDate: context.propsValue.examinationDate
? dayjs(context.propsValue.examinationDate).format('YYYY-MM-DD')
: null,
examinationEndDate: context.propsValue.examinationEndDate
? dayjs(context.propsValue.examinationEndDate).format('YYYY-MM-DD')
: null,
examinationType: context.propsValue.examinationType,
examinationPlace: context.propsValue.examinationPlace,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/control',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,76 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareCertificationFolderToRetake = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderToRetake',
displayName: 'Passer un dossier de certification à létat : à repasser',
description: "Change l'état d'un dossier de certification vers : à repasser",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
detailedResult: Property.ShortText({
displayName: "Détail du résultat de l'examen",
required: false,
}),
europeanLanguageLevel: wedofCommon.europeanLanguageLevel,
examinationDate: Property.DateTime({
displayName: "Date de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationEndDate: Property.DateTime({
displayName: "Date de fin de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationPlace: Property.ShortText({
displayName: "Lieu de passage de l'examen",
required: false,
}),
examinationType: wedofCommon.examinationType,
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
detailedResult: context.propsValue.detailedResult,
europeanLanguageLevel: context.propsValue.europeanLanguageLevel,
examinationDate: context.propsValue.examinationDate
? dayjs(context.propsValue.examinationDate).format('YYYY-MM-DD')
: null,
examinationEndDate: context.propsValue.examinationEndDate
? dayjs(context.propsValue.examinationEndDate).format('YYYY-MM-DD')
: null,
examinationPlace: context.propsValue.examinationPlace,
examinationType: context.propsValue.examinationType,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/retake',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,95 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareCertificationFolderToTake = createAction({
auth: wedofAuth,
name: 'declareCertificationFolderToTake',
displayName: "Passer un dossier de certification à l'état : Prêt à passer",
description:
"Change l'état d'un dossier de certification vers : Prêt à passer",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
enrollmentDate: Property.DateTime({
displayName: "Date d'inscription à la certification",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationDate: Property.DateTime({
displayName: "Date de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationEndDate: Property.DateTime({
displayName: "Date de fin de passage de l'examen",
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
examinationType: wedofCommon.examinationType,
examinationPlace: Property.ShortText({
displayName: "Lieu de passage de l'examen",
required: false,
}),
tiersTemps: Property.StaticDropdown({
displayName: "Tiers temps",
description: "Indique si le candidat a besoin d'un tiers temps",
required: true,
options: {
disabled: false,
options: [
{
label: "Non",
value: false,
},
{
label: 'Oui',
value: true,
},
],
},
}),
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
enrollmentDate: context.propsValue.enrollmentDate
? dayjs(context.propsValue.enrollmentDate).format('YYYY-MM-DD')
: null,
examinationDate: context.propsValue.examinationDate
? dayjs(context.propsValue.examinationDate).format('YYYY-MM-DD')
: null,
examinationEndDate: context.propsValue.examinationEndDate
? dayjs(context.propsValue.examinationEndDate).format('YYYY-MM-DD')
: null,
examinationType: context.propsValue.examinationType,
examinationPlace: context.propsValue.examinationPlace,
tiersTemps: context.propsValue.tiersTemps,
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/take',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,35 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getCertificationFolder = createAction({
auth: wedofAuth,
name: 'getCertificationFolder',
displayName: 'Récupérer un dossier de certification',
description:
'Récupérer un dossier de certification à partir de son n° de dossier',
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,36 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getCertificationFolderDocuments = createAction({
auth: wedofAuth,
name: 'getCertificationFolderDocuments',
displayName: "Liste des documents d'un dossier de certification",
description:
"Récupérer la liste de documents d'un dossier de certification à partir de son n° de dossier",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/files',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,43 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const refuseCertificationFolder = createAction({
auth: wedofAuth,
name: 'refuseCertificationFolder',
displayName: 'Passer un dossier de certification à létat : Refuser',
description: "Change l'état d'un dossier de certification vers : Refuser",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
comment: Property.LongText({
displayName: 'Commentaire',
required: false,
}),
},
async run(context) {
const message = {
comment: context.propsValue.comment,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue.externalId +
'/refuse',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,360 @@
import { HttpMethod, QueryParams, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const searchCertificationFolder = createAction({
auth: wedofAuth,
name: 'searchCertificationFolder',
displayName: 'Rechercher un ou plusieurs dossiers de certifications',
description: 'Liste les dossiers de certifications en fonction des critères sélectionnés',
props: {
query: Property.ShortText({
displayName: 'Recherche',
description: 'Permet d\'effectuer une recherche libre sur les champs nom du candidat, prénom du candidat, email du candidat, tags, commentaire, id du dossier de certification et phoneNumber',
required: false
}),
period: wedofCommon.period,
periodForm: Property.DynamicProperties({
auth: wedofAuth,
description: '',
displayName: 'ez',
required: true,
refreshers: ['period'],
props: async ({ period }) => {
const _period = period as unknown as string;
const props: DynamicPropsValue = {};
if (_period === 'custom') {
props['since'] = Property.DateTime({
displayName: '(Période) Entre le',
description: 'Date au format YYYY-MM-DD',
required: true,
});
props['until'] = Property.DateTime({
displayName: "(Période) et jusqu'au",
description: 'Date au format YYYY-MM-DD',
required: true,
});
} else if (
['next', 'future', 'tomorrow'].some((v) =>_period.toLowerCase().includes(v)
)) {
props['filterOnStateDate'] = wedofCommon.filterOnStateDateFutureCf;
} else if (_period) {
props['filterOnStateDate'] = wedofCommon.filterOnStateDateCf;
}
return props;
},
}),
state: Property.StaticMultiSelectDropdown({
displayName: 'Etat du dossier de certification',
description: 'Permet de n\'obtenir que les dossiers dans l\'état d\'obtention de la certification considéré. Plusieurs états peuvent être sélectionnés.',
required: false,
options: {
options: [
{ value: 'all', label: 'Tous' },
{ value: 'toRegister', label: 'À inscrire' },
{ value: 'refused', label: 'Refusé' },
{ value: 'registered', label: 'Inscrit' },
{ value: 'toTake', label: 'À passer' },
{ value: 'toControl', label: 'À contrôler' },
{ value: 'toRetake', label: 'À repasser' },
{ value: 'failed', label: 'Échoué' },
{ value: 'aborted', label: 'Abandonné' },
{ value: 'success', label: 'Réussi' }
]
}
}),
registrationFolderState: Property.StaticMultiSelectDropdown({
displayName: 'État du dossier de formation',
description: 'Permet de n\'obtenir que les dossiers dans l\'état considéré. Plusieurs états peuvent être sélectionnés.',
required: false,
options: {
options: [
{ value: 'notProcessed', label: 'Non traité' },
{ value: 'validated', label: 'Validé' },
{ value: 'waitingAcceptation', label: 'En attente d\'acceptation' },
{ value: 'rejectedWithoutTitulaireSuite', label: 'Rejeté sans suite titulaire' },
{ value: 'rejected', label: 'Rejeté' },
{ value: 'rejectedWithoutCdcSuite', label: 'Rejeté sans suite CDC' },
{ value: 'accepted', label: 'Accepté' },
{ value: 'inTraining', label: 'En formation' },
{ value: 'terminated', label: 'Terminé' },
{ value: 'serviceDoneDeclared', label: 'Service déclaré fait' },
{ value: 'serviceDoneValidated', label: 'Service validé fait' },
{ value: 'canceledByAttendee', label: 'Annulé par le candidat' },
{ value: 'canceledByAttendeeNotRealized', label: 'Annulé par candidat non réalisé' },
{ value: 'canceledByOrganism', label: 'Annulé par l\'organisme' },
{ value: 'refusedByAttendee', label: 'Refusé par le candidat' },
{ value: 'refusedByOrganism', label: 'Refusé par l\'organisme' }
]
}
}),
sort: Property.StaticDropdown({
displayName: 'Tri sur critère',
description: 'Trie les résultats sur un critère',
required: false,
options: {
options: [
{ value: 'stateLastUpdate', label: "Date du dernier changement d'état" },
{ value: 'id', label: 'ID de base de données' },
{ value: 'successDate', label: 'Date de réussite' }
]
}
}),
order: Property.StaticDropdown({
displayName: 'Ordre',
description: 'Tri les résultats par ordre ascendant ou descendant',
required: false,
options: {
options: [
{ value: 'asc', label: 'Ascendant' },
{ value: 'desc', label: 'Descendant' }
]
}
}),
cdcState: Property.StaticDropdown({
displayName: 'État CDC',
description: 'Permet de n\'obtenir que les dossiers dans l\'état considéré lié à l\'export des dossiers',
required: false,
options: {
options: [
{ value: 'all', label: 'Tous' },
{ value: 'notExported', label: 'Jamais accroché' },
{ value: 'exported', label: "Envoyé et en attente de l'accusé" },
{ value: 'processedOk', label: 'Accrochage réussi' },
{ value: 'processedKo', label: 'Accrochage en erreur' }
]
}
}),
cdcExcluded: Property.StaticDropdown({
displayName: "Exclus de l'accrochage",
description: "Permet de filtrer les dossiers de certification qui sont exclus de l'accrochage",
required: false,
options: {
options: [
{ value: true, label: 'Oui' },
{ value: false, label: 'Non' }
]
}
}),
cdcCompliant: Property.StaticDropdown({
displayName: 'Données apprenant complètes',
description: "Permet de filtrer les dossiers de certification selon le fait qu'ils contiennent les données de l'apprenant obligatoires pour l'accrochage en cas d'obtention de la certification",
required: false,
options: {
options: [
{ value: true, label: 'Oui' },
{ value: false, label: 'Non' }
]
}
}),
cdcToExport: Property.StaticDropdown({
displayName: 'Inclus dans les prochains accrochages',
description: "Permet de filtrer les dossiers de certification qui devront être inclus dans les prochains exports pour l'accrochage",
required: false,
options: {
options: [
{ value: true, label: 'Oui' },
{ value: false, label: 'Non' }
]
}
}),
certifInfo: Property.Array({
displayName: 'ID certification',
description: 'Permet de n\'obtenir que les dossiers liés à la certification considérée',
required: false
}),
dataProvider: Property.StaticMultiSelectDropdown({
displayName: 'Type de financement',
description: 'Permet de n\'obtenir que les dossiers dans le type considéré. Plusieurs types peuvent être sélectionnés.',
required: false,
options: {
options: [
{ value: 'cpf', label: 'CPF' },
{ value: 'individual', label: 'Individuel' },
{ value: 'poleEmploi', label: 'Pôle Emploi' },
{ value: 'company', label: 'Entreprise' },
{ value: 'opco', label: 'OPCO' },
{ value: 'opcoCfa', label: 'OPCO CFA' },
{ value: 'kairosAif', label: 'Kairos AIF' },
{ value: 'none', label: 'Aucun' }
]
}
}),
siret: Property.Array({
displayName: 'SIRET',
description: 'Permet de n\'obtenir que les dossiers issus de l\'organisme de formation de siret considéré. Utilisez "all" pour récupérer tous les dossiers de tous les organismes.',
required: false,
defaultValue:['all']
}),
tags: Property.Array({
displayName: 'Tags',
description: "Recherche libre sur les tags",
required: false
}),
format: Property.StaticDropdown({
displayName: 'Format de sortie',
description: 'Permet d\'obtenir une liste des dossiers de certification au format json ou csv',
required: false,
defaultValue: 'json',
options: {
options: [
{ value: 'json', label: 'JSON' },
{ value: 'csv', label: 'CSV' }
]
}
}),
limit: Property.Number({
displayName: 'Limite',
description: 'Nombre de dossiers de certification',
defaultValue: 100,
required: false
}),
page: Property.Number({
displayName: 'Page',
description: 'Numéro de page de la requête',
defaultValue: 1,
required: false
}),
cdcFile: Property.ShortText({
displayName: 'Fichier CDC',
description: 'Permet de filtrer les dossiers de certification exportés sur un fichier XML lié à l\'accrochage',
required: false
}),
certificatePrintData: Property.StaticDropdown({
displayName: 'Données d\'impression de certificat',
description: 'Permet de n\'obtenir que les dossiers pour lesquels un parchemin est en cours d\'impression ou a été imprimé',
required: false,
options: {
options: [
{ value: true, label: 'Oui' },
{ value: false, label: 'Non' }
]
}
}),
columnId: Property.ShortText({
displayName: 'ID de colonne',
description: 'Identifiant pour affichage personnalisé',
required: false
}),
registrationFolderCompletionRate: Property.StaticDropdown({
displayName: "Taux d'avancement",
description: "Permet de n'obtenir que les dossiers dont le taux d'avancement choisi",
required: false,
options: {
options: [
{ value: '>80', label: 'Supérieur à 80%' },
{ value: '<80', label: 'Inférieur à 80%' }
]
}
}),
skillSets: Property.ShortText({
displayName: 'Blocs de compétences',
description: 'Permet de n\'obtenir que les dossiers liés à une certification RNCP pour les blocs de compétences considérés',
required: false
}),
survey: Property.StaticDropdown({
displayName: "Questionnaire de suivi d'insertion professionnelle",
description: 'Permet de n\'obtenir que les dossiers pour lesquels un questionnaire doit être répondu ou a été répondu',
required: false,
options: {
options: [
{ label: 'Questionnaire "Situation professionnelle en début de cursus" est accessible (Enquête créée)', value: 'initialExperienceStartDate',},
{ label: 'Questionnaire "Situation professionnelle de 6 mois" est accessible', value: 'sixMonthExperienceStartDate',},
{ label: 'Questionnaire "Situation professionnelle au moins un an" est accessible', value: 'longTermExperienceStartDate',},
{ label: 'Questionnaire "Situation professionnelle en début de cursus" répondu', value: 'initialExperienceAnsweredDate',},
{ label: 'Questionnaire "Situation professionnelle de 6 mois" répondu', value: 'sixMonthExperienceAnsweredDate',},
{ label: 'Questionnaire "Situation professionnelle au moins un an" répondu', value: 'longTermExperienceAnsweredDate',},
]
}
}),
metadata: Property.Array({
displayName: 'Données personnalisées',
description: 'tableau associatif clé - valeur, disponible uniquement pour le certificateur',
required: false,
}),
messageState: Property.StaticDropdown({
displayName: 'État du message',
description: 'Permet de n\'obtenir que les dossiers liés à l\'état d\'envoi d\'un message considéré',
required: false,
options: {
options: [
{ value: 'sent', label: 'Message envoyé' },
{ value: 'notSent', label: 'Message non envoyé' },
{ value: 'notSentUnauthorized', label: 'Message non envoyé (non autorisé)' },
{ value: 'notSentEnforcedConditions', label: 'Message non envoyé (conditions renforcées)' },
{ value: 'failed', label: "Échec de l'envoi" },
{ value: 'scheduled', label: 'Envoi programmé' }
]
}
}),
messageTemplate: Property.ShortText({
displayName: 'Modèle de message',
description: "Permet de n'obtenir que les dossiers pour lequels un message issue du modèle considéré a été créé - par défaut aucun filtre",
required: false
})
},
async run(context) {
const props = context.propsValue;
const params = {
query: props.query ?? null,
limit: props.limit ?? null,
page: props.page ?? null,
period: props.period ?? null,
state: props.state && props.state.length > 0 ? props.state.join(',') : null,
registrationFolderState: props.registrationFolderState && props.registrationFolderState.length > 0 ? props.registrationFolderState.join(',') : null,
sort: props.sort ?? null,
order: props.order ?? null,
cdcState: props.cdcState ?? null,
cdcExcluded: props.cdcExcluded ?? null,
cdcCompliant: props.cdcCompliant ?? null,
cdcToExport: props.cdcToExport ?? null,
certifInfo: props.certifInfo && props.certifInfo.length > 0 ? props.certifInfo.join(',') : null,
dataProvider: props.dataProvider && props.dataProvider.length > 0 ? props.dataProvider.join(',') : null,
siret: props.siret && props.siret.length > 0 ? props.siret.join(',') : null,
tags: props.tags && props.tags.length > 0 ? props.tags.join(',') : null,
format: props.format ?? null,
since: props.periodForm?.['since']
? dayjs(props.periodForm['since'])
.startOf('day')
.format('YYYY-MM-DDTHH:mm:ssZ')
: null,
until: props.periodForm?.['until']
? dayjs(props.periodForm['until'])
.endOf('day')
.format('YYYY-MM-DDTHH:mm:ssZ')
: null,
filterOnStateDate: props.periodForm?.['filterOnStateDate'] ?? null,
cdcFile: props.cdcFile ?? null,
certificatePrintData: props.certificatePrintData ?? null,
columnId: props.columnId ?? null,
registrationFolderCompletionRate: props.registrationFolderCompletionRate ?? null,
skillSets: props.skillSets ?? null,
survey: props.survey ?? null,
metadata: context.propsValue.metadata ?? [],
messageState: props.messageState ?? null,
messageTemplate: props.messageTemplate ?? null,
};
const queryParams: QueryParams = {};
Object.keys(params).forEach((value) => {
const key = value as keyof typeof params;
if (params[key] != null && params[key] != undefined) {
queryParams[value] = params[key] as string;
}
});
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
queryParams: queryParams,
url: wedofCommon.baseUrl + '/certificationFolders',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
}
});

View File

@@ -0,0 +1,477 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
DynamicPropsValue,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const updateCertificationFolder = createAction({
auth: wedofAuth,
name: 'updateCertificationFolder',
displayName: 'Mettre à jour un dossier de certification',
description:
"Met à jour certaines informations modifiables d'un dossier de certification",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de certification',
description:
'Sélectionner la propriété {externalId} du dossier de certification',
required: true,
}),
fieldsToUpdate: Property.StaticMultiSelectDropdown({
displayName: 'Champs à mettre à jour',
description: 'Sélectionner les champs que vous souhaitez mettre à jour',
required: true,
options: {
disabled: false,
options: [
{
label: "Date d'inscription à la certification",
value: 'enrollmentDate',
},
{
label: "Date de début de l'examen",
value: 'examinationDate',
},
{
label: "Date de fin de l'examen",
value: 'examinationEndDate',
},
{
label: "Lieu de l'examen",
value: 'examinationPlace',
},
{
label: "Code postal du centre d'examen",
value: 'examinationCenterZipCode',
},
{
label: 'Type de financement',
value: 'dataProvider',
},
{
label: "Type de passage de l'examen",
value: 'examinationType',
},
{
label: 'Verbatim',
value: 'verbatim',
},
{
label: 'Option',
value: 'optionName',
},
{
label: "Modalité d'accès",
value: 'accessModality',
},
{
label: 'Modalité VAE',
value: 'accessModalityVae',
},
{
label: 'Commentaire',
value: 'comment',
},
{
label: "Initiative de l'inscription",
value: 'type',
},
{
label: 'Tags',
value: 'tags',
},
{
label: "Exclus de l'accrochage",
value: 'cdcExcluded',
},
{
label: 'Prix du passage (HT)',
value: 'amountHt',
},
{
label: 'Fichier du parchemin',
value: 'certificate',
},
{
label: 'Identifiant du parchemin',
value: 'certificateId',
},
{
label: 'Tiers temps',
value: 'tiersTemps',
},
{
label: 'Identifiant technique CDC',
value: 'cdcTechnicalId',
},
{
label: 'Badge de certification',
value: 'badgeAssertion',
},
],
},
}),
dynamicFields: Property.DynamicProperties({
auth: wedofAuth,
displayName: 'Champs sélectionnés',
refreshers: ['fieldsToUpdate'],
required: false,
props: async ({ fieldsToUpdate }) => {
const fields: DynamicPropsValue = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
if (selectedFields.includes('enrollmentDate')) {
fields['enrollmentDate'] = Property.DateTime({
displayName: "Date d'inscription à la certification",
description: 'Date au format YYYY-MM-DD - peut être modifié dans les états toRegister, registered, toTake, toControl',
required: false,
});
}
if (selectedFields.includes('examinationDate')) {
fields['examinationDate'] = Property.DateTime({
displayName: "Date de début de l'examen de certification",
description: 'Date au format YYYY-MM-DD - peut être modifié dans les états registered, toTake, toRetake, toControl',
required: false,
});
}
if (selectedFields.includes('examinationEndDate')) {
fields['examinationEndDate'] = Property.DateTime({
displayName: "Date de fin de l'examen de certification",
description: 'Date au format YYYY-MM-DD - peut être modifié dans les états registered, toTake, toRetake, toControl',
required: false,
});
}
if (selectedFields.includes('examinationPlace')) {
fields['examinationPlace'] = Property.ShortText({
displayName: "Lieu de l'examen",
description: "Lieu de l'examen de certification - peut être modifié dans les états registered, toTake, toControl, toRetake",
required: false,
});
}
if (selectedFields.includes('examinationCenterZipCode')) {
fields['examinationCenterZipCode'] = Property.ShortText({
displayName: "Code postal du centre d'examen",
description: "Code postal du centre d'examen principal - peut être modifié dans tous les états sauf success",
required: false,
});
}
if (selectedFields.includes('dataProvider')) {
fields['dataProvider'] = Property.StaticDropdown({
displayName: 'Type de financement',
description: 'Type de financement du dossier de certification',
required: false,
options: {
disabled: false,
options: [
{ label: 'Individuel', value: 'individual' },
{ label: 'OPCO', value: 'opco' },
{ label: 'Pôle Emploi', value: 'poleEmploi' },
{ label: 'Entreprise', value: 'company' },
],
},
});
}
if (selectedFields.includes('examinationType')) {
fields['examinationType'] = Property.StaticDropdown({
displayName: "Type de passage de l'examen",
description: "Type de passage de l'examen - peut être modifié dans les états registered, toTake, toControl, toRetake",
required: false,
options: {
disabled: false,
options: [
{ label: 'À distance', value: 'A_DISTANCE' },
{ label: 'En présentiel', value: 'EN_PRESENTIEL' },
{ label: 'Mixte', value: 'MIXTE' },
],
},
});
}
if (selectedFields.includes('verbatim')) {
fields['verbatim'] = Property.ShortText({
displayName: 'Verbatim',
description: 'Information complémentaire sur la certification - peut être modifié dans tous les états sauf success',
required: false,
});
}
if (selectedFields.includes('optionName')) {
fields['optionName'] = Property.ShortText({
displayName: 'Option',
description: 'Option si appliquée - peut être modifié dans tous les états sauf success',
required: false,
});
}
if (selectedFields.includes('accessModality')) {
fields['accessModality'] = Property.StaticDropdown({
displayName: "Modalité d'accès",
description: "Modalité d'accès - peut être modifié dans tous les états sauf success",
required: false,
options: {
disabled: false,
options: [
{ label: 'Formation initiale hors apprentissage', value: 'FORMATION_INITIALE_HORS_APPRENTISSAGE' },
{ label: 'Formation initiale apprentissage', value: 'FORMATION_INITIALE_APPRENTISSAGE' },
{ label: 'Formation continue hors contrat de professionnalisation', value: 'FORMATION_CONTINUE_HORS_CONTRAT_DE_PROFESSIONNALISATION' },
{ label: 'Formation continue contrat de professionnalisation', value: 'FORMATION_CONTINUE_CONTRAT_DE_PROFESSIONNALISATION' },
{ label: 'VAE', value: 'VAE' },
{ label: 'Équivalence (diplôme étranger)', value: 'EQUIVALENCE_(DIPLOME_ETRANGER)' },
{ label: 'Candidat libre', value: 'CANDIDAT_LIBRE' },
],
},
});
}
if (selectedFields.includes('accessModalityVae')) {
fields['accessModalityVae'] = Property.StaticDropdown({
displayName: 'Modalité VAE',
description: "Requis si la valeur accessModality est 'VAE'",
required: false,
options: {
disabled: false,
options: [
{ label: 'Congés VAE', value: 'CONGES_VAE' },
{ label: 'VAE classique', value: 'VAE_CLASSIQUE' },
],
},
});
}
if (selectedFields.includes('comment')) {
fields['comment'] = Property.LongText({
displayName: 'Commentaire',
description: 'Commentaires - peut être modifié dans tous les états de certification',
required: false,
});
}
if (selectedFields.includes('type')) {
fields['type'] = Property.StaticDropdown({
displayName: "Initiative de l'inscription",
description: "Initiative à laquelle l'inscription a été réalisée - peut être modifié dans tous les états sauf success",
required: false,
options: {
disabled: false,
options: [
{ label: 'Certifié(e)', value: 'CERTIFIE' },
{ label: 'Organisme de formation', value: 'OF' },
{ label: 'Pôle Emploi', value: 'POLE_EMPLOI' },
{ label: 'Employeur', value: 'EMPLOYEUR' },
{ label: 'Autre', value: 'AUTRE' },
],
},
});
}
if (selectedFields.includes('tags')) {
fields['tags'] = Property.Array({
displayName: 'Tags',
description: 'Liste de tags associée au dossier de certification, uniquement pour le certificateur',
required: false,
});
}
if (selectedFields.includes('cdcExcluded')) {
fields['cdcExcluded'] = Property.StaticDropdown({
displayName: "Exclus de l'accrochage",
description: "Indique si le dossier de certification doit être exclu de l'accrochage",
required: false,
options: {
disabled: false,
options: [
{ label: 'Non', value: 'false' },
{ label: 'Oui', value: 'true' },
],
},
});
}
if (selectedFields.includes('amountHt')) {
fields['amountHt'] = Property.Number({
displayName: 'Prix du passage de la certification (HT)',
description: 'Prix de vente du passage de la certification (Hors Taxe)',
required: false,
});
}
if (selectedFields.includes('certificate')) {
fields['certificate'] = Property.ShortText({
displayName: 'Fichier du parchemin',
description: 'Fichier du parchemin de la certification',
required: false,
});
}
if (selectedFields.includes('certificateId')) {
fields['certificateId'] = Property.ShortText({
displayName: 'Identifiant du parchemin',
description: 'Identifiant du parchemin de la certification (unique pour la certification)',
required: false,
});
}
if (selectedFields.includes('tiersTemps')) {
fields['tiersTemps'] = Property.StaticDropdown({
displayName: 'Tiers temps',
description: "Indique si le candidat a besoin d'un tiers temps",
required: false,
options: {
disabled: false,
options: [
{ label: 'Non', value: false },
{ label: 'Oui', value: true },
],
},
});
}
if (selectedFields.includes('cdcTechnicalId')) {
fields['cdcTechnicalId'] = Property.ShortText({
displayName: 'Identifiant technique CDC',
description: "Identifiant technique du passage de la certification pour l'accrochage",
required: false,
});
}
if (selectedFields.includes('badgeAssertion')) {
fields['badgeAssertion'] = Property.ShortText({
displayName: 'Badge de certification',
description: "Lien vers le badge de la certification - peut être mis à jour par le certificateur et à l'état success",
required: false,
});
}
return fields;
},
}),
},
async run(context) {
const { fieldsToUpdate, dynamicFields } = context.propsValue;
const {
enrollmentDate,
examinationDate,
examinationEndDate,
examinationPlace,
examinationCenterZipCode,
dataProvider,
examinationType,
verbatim,
optionName,
accessModality,
accessModalityVae,
comment,
type,
tags,
cdcExcluded,
amountHt,
certificate,
certificateId,
tiersTemps,
cdcTechnicalId,
badgeAssertion,
} = dynamicFields || {};
const message: Record<string, unknown> = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
selectedFields.forEach((fieldName) => {
switch (fieldName) {
case 'enrollmentDate':
message['enrollmentDate'] = enrollmentDate
? dayjs(enrollmentDate).format('YYYY-MM-DD')
: null;
break;
case 'examinationDate':
message['examinationDate'] = examinationDate
? dayjs(examinationDate).format('YYYY-MM-DD')
: null;
break;
case 'examinationEndDate':
message['examinationEndDate'] = examinationEndDate
? dayjs(examinationEndDate).format('YYYY-MM-DD')
: null;
break;
case 'examinationPlace':
message['examinationPlace'] = examinationPlace || null;
break;
case 'examinationCenterZipCode':
message['examinationCenterZipCode'] = examinationCenterZipCode || null;
break;
case 'dataProvider':
message['dataProvider'] = dataProvider || null;
break;
case 'examinationType':
message['examinationType'] = examinationType || null;
break;
case 'verbatim':
message['verbatim'] = verbatim || null;
break;
case 'optionName':
message['optionName'] = optionName || null;
break;
case 'accessModality':
message['accessModality'] = accessModality || null;
break;
case 'accessModalityVae':
message['accessModalityVae'] = accessModalityVae || null;
break;
case 'comment':
message['comment'] = comment || null;
break;
case 'type':
message['type'] = type || null;
break;
case 'tags':
message['tags'] = tags && tags.length > 0 ? (tags as string[]) : null;
break;
case 'cdcExcluded':
message['cdcExcluded'] = cdcExcluded || null;
break;
case 'amountHt':
message['amountHt'] = amountHt !== undefined ? amountHt : null;
break;
case 'certificate':
message['certificate'] = certificate || null;
break;
case 'certificateId':
message['certificateId'] = certificateId || null;
break;
case 'tiersTemps':
message['tiersTemps'] = tiersTemps !== undefined ? tiersTemps : null;
break;
case 'cdcTechnicalId':
message['cdcTechnicalId'] = cdcTechnicalId || null;
break;
case 'badgeAssertion':
message['badgeAssertion'] = badgeAssertion || null;
break;
}
});
return (
await httpClient.sendRequest({
method: HttpMethod.PUT,
body: message,
url:
wedofCommon.baseUrl +
'/certificationFolders/' +
context.propsValue['externalId'],
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,86 @@
import { wedofAuth } from '../../../index';
import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../../common/wedof';
export const createCertificationPartnerAudit = createAction({
auth: wedofAuth,
name: 'createCertificationPartnerAudit',
displayName: "Créer un audit sur un partenariat de certification",
description: "Permet de créer un audit sur un partenariat de certification",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: "Permet de n'obtenir que les modèles liés à la certification considérée",
required: true,
}),
siret: Property.ShortText({
displayName: 'N° de siret',
description:
'Sélectionner le SIRET du partenaire',
required: true,
}),
templateId: Property.DynamicProperties({
auth: wedofAuth,
displayName: "Type du modèle d'audit",
refreshers: ['certifInfo'],
required: true,
props: async ({ auth, certifInfo }) => {
if (!certifInfo) {
console.error('certifInfo is undefined');
return {};
}
try {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${wedofCommon.baseUrl}/certificationPartnerAuditTemplates`,
queryParams: { certifInfo: certifInfo as unknown as string },
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth as unknown as string,
},
});
const options = response.body.map((template: { id: string; name: string }) => ({
label: template.name,
value: template.id,
}));
return {
templateId: Property.StaticDropdown({
displayName: "Modèle d'audit",
required: true,
options: {
options: options,
},
}),
} as DynamicPropsValue;
} catch (error) {
console.error('Error fetching templates:', error);
return {};
}
},
}),
},
async run(context) {
const message = {
templateId: context.propsValue.templateId['templateId'] ?? null,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certifications/' +
context.propsValue.certifInfo +
'/partners/'+ context.propsValue.siret + '/audits',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,140 @@
import { wedofAuth } from '../../../index';
import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../../common/wedof';
export const createGeneralAudit = createAction({
auth: wedofAuth,
name: 'createGeneralAudit',
displayName: "Générer un audit général sur les partenaires d'une certification",
description: "Permet de générer et clôturer un audit pour chacun des partenariats (actifs) de certification",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: "Permet de n'obtenir que les partenariats liés à la certification considérée",
required: true,
}),
templateId: Property.DynamicProperties({
auth: wedofAuth,
displayName: "Type du modèle d'audit",
refreshers: ['certifInfo'],
required: true,
props: async ({ auth, certifInfo }) => {
if (!certifInfo) {
console.error('certifInfo is undefined');
return {};
}
try {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${wedofCommon.baseUrl}/certificationPartnerAuditTemplates`,
queryParams: { certifInfo: certifInfo as unknown as string },
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth as unknown as string,
},
});
const options = response.body.map((template: { id: string; name: string }) => ({
label: template.name,
value: template.id,
}));
return {
templateId: Property.StaticDropdown({
displayName: "Modèle d'audit",
required: true,
options: {
options: options,
},
}),
} as DynamicPropsValue;
} catch (error) {
console.error('Error fetching templates:', error);
return {};
}
},
}),
complete: Property.StaticDropdown({
displayName: "Clôturer les audits automatiquement",
description: "Indique si l'audit doit être clôturer",
required: false,
defaultValue : true,
options: {
disabled: false,
options: [
{
label: "Non",
value: false,
},
{
label: 'Oui',
value: true,
},
],
},
}),
updateCompliance: Property.StaticDropdown({
displayName: "Mettre à jour la conformité du partenariat",
description: "Indique si il faut mettre à jour la conformité du partenariat",
required: false,
defaultValue : true,
options: {
disabled: false,
options: [
{
label: "Non",
value: false,
},
{
label: 'Oui',
value: true,
},
],
},
}),
suspend: Property.StaticDropdown({
displayName: "Suspendre automatiquement le partenariat en cas de non-conformité",
description: "Indique si le partenariat doit être suspendu en cas de non-conformité (ne s'applique que pour les certifications actives)",
required: false,
defaultValue : true,
options: {
disabled: false,
options: [
{
label: "Non",
value: false,
},
{
label: 'Oui',
value: true,
},
],
},
}),
},
async run(context) {
const message = {
templateId: context.propsValue.templateId['templateId'] ?? null,
complete: context.propsValue.complete,
updateCompliance: context.propsValue.updateCompliance,
suspend: context.propsValue.suspend,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/certifications/' +
context.propsValue.certifInfo + '/partners/audits',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,42 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const createPartnership = createAction({
auth: wedofAuth,
name: 'createPartnership',
displayName: "Créer un partenariat",
description: "Permet de créer un nouveau partenariat avec le SIRET fourni",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description:
'Sélectionner le {certifInfo} de la certification considérée',
required: true,
}),
siret: Property.ShortText({
displayName: 'N° siret',
description: 'Le numéro SIRET du partenaire',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url: wedofCommon.baseUrl + '/certifications/partners/' + context.propsValue.siret,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
body:{
'certifInfo': context.propsValue.certifInfo,
}
})
).body;
},
});

View File

@@ -0,0 +1,40 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const deletePartnership = createAction({
auth: wedofAuth,
name: 'deletePartnership',
displayName: "Supprimer un partenariat",
description: "Supprime un partenariat à l'état Demande à compléter",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: 'Sélectionner le {certifInfo} de la certification considérée',
required: true,
}),
siret: Property.ShortText({
displayName: 'N° Siret',
description: 'Sélectionner le {siret} du partenaire',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.DELETE,
url:
wedofCommon.baseUrl +
'/certifications/' +
context.propsValue.certifInfo +
'/partners/' +
context.propsValue.siret,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,43 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getPartnership = createAction({
auth: wedofAuth,
name: 'getPartnership',
displayName: "Récupération d'un partenariat",
description:
"Récupération d'un partenariat par le certifInfo de la certification et du siret du partenaire",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description:
'Sélectionner le {certifInfo} de la certification considérée',
required: true,
}),
siret: Property.ShortText({
displayName: 'N° Siret',
description:
'Sélectionner le {siret} du partenaire',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/certifications/' +
context.propsValue.certifInfo +
'/partners/' +
context.propsValue.siret,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,147 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const listPartnerships = createAction({
auth: wedofAuth,
name: 'listPartnerships',
displayName: "Lister les partenariats",
description: "Récupère l'ensemble des partenariats d'une certification",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: 'Identifiant de la certification',
required: true,
}),
certifier: Property.ShortText({
displayName: 'N° Siret Certificateur',
required: false,
}),
certifierAccessState: Property.StaticDropdown({
displayName: 'État d\'accès du certificateur',
required: false,
options: {
options: [
{ label: 'Tous', value: 'all' },
{ label: 'En attente', value: 'waiting' },
{ label: 'Accepté', value: 'accepted' },
{ label: 'Refusé', value: 'refused' },
{ label: 'Terminé', value: 'terminated' },
{ label: 'Aucun', value: 'none' },
]
}
}),
compliance: Property.StaticDropdown({
displayName: 'Conformité',
required: false,
options: {
options: [
{ label: 'Tous', value: 'all' },
{ label: 'Conforme', value: 'compliant' },
{ label: 'Partiellement conforme', value: 'partiallyCompliant' },
{ label: 'Non conforme', value: 'nonCompliant' },
{ label: 'En cours', value: 'inProgress' },
]
}
}),
connectionIssue: Property.Checkbox({
displayName: 'Problème de connexion',
required: false,
}),
limit: Property.Number({
displayName: 'Limite',
defaultValue: 100,
description: 'Nombre maximal de résultats à retourner - 100 par défault',
required: false,
}),
order: Property.StaticDropdown({
displayName: 'Ordre',
required: false,
options: {
options: [
{ label: 'Ascendant', value: 'asc' },
{ label: 'Descendant', value: 'desc' },
]
}
}),
page: Property.Number({
displayName: 'Page',
defaultValue: 1,
description: 'Numéro de la page de résultats - 1 par défault',
required: false,
}),
query: Property.ShortText({
displayName: 'Requête de recherche',
required: false,
}),
sort: Property.StaticDropdown({
displayName: 'Trier par',
required: false,
defaultValue:'name',
options: {
options: [
{ label: "Nom de l'organisme", value: 'name' },
{ label: 'État', value: 'state' },
]
}
}),
state: Property.StaticDropdown({
displayName: 'État',
required: false,
defaultValue: 'all',
options: {
options: [
{
value: 'processing',
label: 'Demande en traitement',
},
{
value: 'active',
label: 'Partenariat actif',
},
{
value: 'aborted',
label: 'Demande abondonnée',
},
{
value: 'refused',
label: 'Demande refusée',
},
{
value: 'suspended',
label: 'Partenariat suspendu',
},
{
value: 'revoked',
label: 'Partenariat révoqué',
},
{
value: 'all',
label: 'Tous',
},
],
}
}),
},
async run(context) {
const queryParams = new URLSearchParams();
for (const [key, value] of Object.entries(context.propsValue)) {
if (value !== undefined) {
queryParams.append(key, String(value));
}
}
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url: wedofCommon.baseUrl +'/certifications/'+ context.propsValue.certifInfo +`/partners?${queryParams.toString()}`,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,37 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const resetPartnership = createAction({
auth: wedofAuth,
name: 'resetPartnership',
displayName: "Réinitialiser un partenariat",
description: "Permet de réinitialiser les données du partenariat en état 'Demande en traitement'",
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description: 'Identifiant de la certification',
required: true,
}),
siret: Property.ShortText({
displayName: 'N° siret',
description: 'Numéro SIRET du partenaire à réinitialiser',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url: wedofCommon.baseUrl + '/certifications/'+ context.propsValue.certifInfo +'/partners/'+ context.propsValue.siret +'/reinitialize',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,264 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
DynamicPropsValue,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const updatePartnership = createAction({
auth: wedofAuth,
name: 'updatePartnership',
displayName: 'Mettre à jour le partenariat',
description: 'Permet de mettre à jour le partenariat',
props: {
certifInfo: Property.ShortText({
displayName: 'N° certifInfo',
description:
'Sélectionner le {certifInfo} de la certification considérée',
required: true,
}),
siret: Property.ShortText({
displayName: 'N° Siret',
description: 'Sélectionner le {siret} du partenaire',
required: true,
}),
fieldsToUpdate: Property.StaticMultiSelectDropdown({
displayName: 'Champs à mettre à jour',
description: 'Sélectionner les champs que vous souhaitez mettre à jour',
required: true,
options: {
disabled: false,
options: [
{
label: 'État du partenariat',
value: 'state',
},
{
label: 'Habilitation',
value: 'habilitation',
},
{
label: 'Commentaire',
value: 'comment',
},
{
label: "En attente d'activation",
value: 'pendingActivation',
},
{
label: 'En attente de révocation',
value: 'pendingRevocation',
},
{
label: 'En attente de suspension',
value: 'pendingSuspension',
},
{
label: 'Montant HT',
value: 'amountHt',
},
{
label: 'Conformité',
value: 'compliance',
},
{
label: 'Tags',
value: 'tags',
},
{
label: 'Méta-données',
value: 'metadata',
},
{
label: 'Zone de formation',
value: 'trainingsZone',
},
{
label: 'Blocs de compétences',
value: 'skillSets',
},
],
},
}),
dynamicFields: Property.DynamicProperties({
auth: wedofAuth,
displayName: 'Champs sélectionnés',
refreshers: ['fieldsToUpdate'],
required: false,
props: async ({ fieldsToUpdate }) => {
const fields: DynamicPropsValue = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
if (selectedFields.includes('state')) {
fields['state'] = wedofCommon.partnershipState;
}
if (selectedFields.includes('habilitation')) {
fields['habilitation'] = wedofCommon.habilitation;
}
if (selectedFields.includes('comment')) {
fields['comment'] = Property.LongText({
displayName: 'Commentaire',
description: 'Informations complémentaires sur le partenariat',
required: false,
});
}
if (selectedFields.includes('pendingActivation')) {
fields['pendingActivation'] = Property.Checkbox({
displayName: "En attente d'activation",
required: false,
});
}
if (selectedFields.includes('pendingRevocation')) {
fields['pendingRevocation'] = Property.Checkbox({
displayName: 'En attente de révocation',
required: false,
});
}
if (selectedFields.includes('pendingSuspension')) {
fields['pendingSuspension'] = Property.Checkbox({
displayName: 'En attente de suspension',
required: false,
});
}
if (selectedFields.includes('amountHt')) {
fields['amountHt'] = Property.Number({
displayName: 'Montant HT',
description:
'Prix de vente du passage de certification (Hors Taxe)',
required: false,
});
}
if (selectedFields.includes('compliance')) {
fields['compliance'] = wedofCommon.compliance;
}
if (selectedFields.includes('tags')) {
fields['tags'] = Property.Array({
displayName: 'Tags',
description:
'Liste de tags associés au partenariat, si vous souhaitez garder vos précédents tags, il faut les réécrire dans le champ',
required: false,
});
}
if (selectedFields.includes('metadata')) {
fields['metadata'] = Property.Array({
displayName: 'Méta-données',
description: 'Données supplémentaires liées au partenariat',
required: false,
});
}
if (selectedFields.includes('trainingsZone')) {
fields['trainingsZone'] = Property.Array({
displayName: 'Zone de formation',
required: false,
});
}
if (selectedFields.includes('skillSets')) {
fields['skillSets'] = Property.Array({
displayName: 'Blocs de compétences',
required: false,
});
}
return fields;
},
}),
},
async run(context) {
const { fieldsToUpdate, dynamicFields } = context.propsValue;
const {
state,
habilitation,
comment,
pendingActivation,
pendingRevocation,
pendingSuspension,
amountHt,
compliance,
tags,
metadata,
trainingsZone,
skillSets,
} = dynamicFields || {};
const message: Record<string, any> = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
selectedFields.forEach((fieldName) => {
switch (fieldName) {
case 'state':
message['state'] = state || null;
break;
case 'habilitation':
message['habilitation'] = habilitation || null;
break;
case 'comment':
message['comment'] = comment || null;
break;
case 'pendingActivation':
message['pendingActivation'] =
pendingActivation !== undefined ? pendingActivation : null;
break;
case 'pendingRevocation':
message['pendingRevocation'] =
pendingRevocation !== undefined ? pendingRevocation : null;
break;
case 'pendingSuspension':
message['pendingSuspension'] =
pendingSuspension !== undefined ? pendingSuspension : null;
break;
case 'amountHt':
message['amountHt'] = amountHt !== undefined ? amountHt : null;
break;
case 'compliance':
message['compliance'] = compliance || null;
break;
case 'tags':
message['tags'] = tags && tags.length > 0 ? (tags as string[]) : null;
break;
case 'metadata':
message['metadata'] =
metadata && metadata.length > 0 ? (metadata as string[]) : null;
break;
case 'trainingsZone':
message['trainingsZone'] =
trainingsZone && trainingsZone.length > 0
? (trainingsZone as string[])
: null;
break;
case 'skillSets':
message['skillSets'] =
skillSets && skillSets.length > 0 ? (skillSets as string[]) : null;
break;
}
});
return (
await httpClient.sendRequest({
method: HttpMethod.PUT,
url:
wedofCommon.baseUrl +
'/certifications/' +
context.propsValue.certifInfo +
'/partners/' +
context.propsValue.siret,
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,167 @@
import {
httpClient,
HttpMethod,
QueryParams,
} from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const listPartnerStats = createAction({
auth: wedofAuth,
name: 'listPartnerStats',
displayName: 'Lister les statistiques des partenaires',
description: 'Récupère les statistiques des partenaires de certification',
props: {
certifInfo: Property.ShortText({
displayName: 'Identifiant de certification',
required: true,
}),
certifierAccessState: Property.StaticDropdown({
displayName: 'État de synchronisation du partenariat',
required: false,
options: {
options: [
{ label: 'En attente', value: 'waiting' },
{ label: 'Accepté', value: 'accepted' },
{ label: 'Refusé', value: 'refused' },
{ label: 'Terminé', value: 'terminated' },
{ label: 'Aucun', value: 'none' },
{ label: 'Tous les états', value: 'all' },
],
},
defaultValue : 'all',
}),
compliance: Property.StaticDropdown({
displayName: 'État de conformité',
required: false,
options: {
options: [
{ label: 'Tous', value: 'all' },
{ label: 'Aucun', value: 'none' },
{ label: 'Conforme', value: 'compliant' },
{ label: 'Partiellement conforme', value: 'partiallyCompliant' },
{ label: 'Non conforme', value: 'nonCompliant' },
{ label: 'En cours', value: 'inProgress' },
],
},
defaultValue : 'all',
}),
connectionIssue: Property.StaticDropdown({
displayName: 'Présence de problème de connexion',
required: false,
options: {
options: [
{ label: 'Oui', value: 'true' },
{ label: 'Non', value: 'false' },
],
},
}),
format: Property.StaticDropdown({
displayName: 'Format de la réponse',
required: false,
defaultValue: 'json',
options: {
options: [
{ label: 'JSON', value: 'json' },
{ label: 'CSV', value: 'csv' },
],
},
}),
limit: Property.Number({
displayName: 'Nombre de résultats',
required: false,
defaultValue: 100,
}),
order: Property.StaticDropdown({
displayName: 'Ordre de tri',
required: false,
defaultValue: 'desc',
options: {
options: [
{ label: 'Ascendant', value: 'asc' },
{ label: 'Descendant', value: 'desc' },
],
},
}),
page: Property.Number({
displayName: 'Numéro de page',
required: false,
defaultValue: 1,
}),
sort: Property.StaticDropdown({
displayName: 'Trier par',
required: false,
defaultValue: 'stateLastUpdate',
options: {
options: [
{ label: 'Dernier changement détat', value: 'stateLastUpdate' },
{ label: 'Nom', value: 'name' },
{ label: 'État', value: 'state' },
],
},
}),
state: Property.StaticDropdown({
displayName: 'État du partenariat',
required: false,
defaultValue: 'all',
options: {
options: [
{ label: 'Tous les états', value: 'all' },
{ label: 'Brouillon', value: 'draft' },
{ label: 'En cours de traitement', value: 'processing' },
{ label: 'Actif', value: 'active ' },
{ label: 'Annulé', value: 'aborted' },
{ label: 'Refusé', value: 'refused' },
{ label: 'Révoqué', value: 'revoked' },
{ label: 'Suspendu', value: 'suspended' },
],
},
}),
},
async run(context) {
const {
certifInfo,
certifierAccessState,
compliance,
connectionIssue,
format,
limit,
order,
page,
sort,
state,
} = context.propsValue;
const queryParams: QueryParams = {};
if (certifierAccessState) queryParams['certifierAccessState'] = certifierAccessState;
if (compliance) queryParams['compliance'] = compliance;
if (connectionIssue) queryParams['connectionIssue'] = connectionIssue;
if (format) queryParams['format'] = format;
if (limit !== undefined) queryParams['limit'] = limit.toString();
if (order) queryParams['order'] = order;
if (page !== undefined) queryParams['page'] = page.toString();
if (sort) queryParams['sort'] = sort;
if (state) queryParams['state'] = state;
const url = `${wedofCommon.baseUrl}/certifications/${certifInfo}/partners/details`;
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url,
queryParams,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,90 @@
import { wedofAuth } from '../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../common/wedof';
import dayjs from 'dayjs';
export const createActivitie = createAction({
auth: wedofAuth,
name: 'createActivitie',
displayName: "Créer une activité",
description: "Permet de créer une activité d'un dossier (Dossier de formation / Dossier de certification)",
props: {
entityClass: Property.StaticDropdown({
displayName: "Choisir le type de dossier",
description: "Permet de n'obtenir que les dossiers dans le type considéré - par défaut tous les types sont retournés",
required: true,
options: {
options: [
{label: "Dossier de certification", value: "CertificationFolder"},
{label: "Dossier de formation", value: "RegistrationFolder"},
{label: "Proposition commerciale", value: "Proposal"}
],
disabled: false,
},
}),
externalId: Property.ShortText({
displayName: 'N° du dossier',
description:
'Sélectionner la propriété {externalId} du dossier',
required: true,
}),
title: Property.ShortText({
displayName: "Titre de l'activité",
required: true,
}),
type:wedofCommon.tasks,
qualiopiIndicators:wedofCommon.qualiopiIndicators,
description: Property.ShortText({
displayName: 'Description',
required: false,
}),
userEmail: Property.ShortText({
displayName: "Responsable (email de l'utilisateur)",
required: true,
}),
eventTime: Property.DateTime({
displayName: "Date de début",
description: 'Date au format YYYY-MM-DDTHH:mm:ssZ.',
required: true,
}),
eventEndTime: Property.DateTime({
displayName: "Date d'échéance",
description: 'Date au format YYYY-MM-DDTHH:mm:ssZ.',
required: false,
}),
link: Property.ShortText({
displayName: "Lien (url) vers la tâche",
required: false,
}),
},
async run(context) {
const message = {
title: context.propsValue.title ?? null,
eventEndTime: context.propsValue.eventEndTime ? dayjs(context.propsValue.eventEndTime) : null,
type: context.propsValue.type,
qualiopiIndicators: context.propsValue.qualiopiIndicators,
description: context.propsValue.description ?? null,
userEmail: context.propsValue.userEmail ?? null,
link: context.propsValue.link ?? null,
eventTime: context.propsValue.eventTime ? dayjs(context.propsValue.eventTime) : null,
origin: "manual",
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/activities/' +
context.propsValue.entityClass +
'/'+ context.propsValue.externalId,
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,86 @@
import { wedofAuth } from '../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../common/wedof';
import dayjs from 'dayjs';
export const createTask = createAction({
auth: wedofAuth,
name: 'createTask',
displayName: "Créer une tâche",
description: "Permet de créer une tâche d'un dossier (Dossier de formation / Dossier de certification)",
props: {
entityClass: Property.StaticDropdown({
displayName: "Choisir le type de dossier",
description: "Permet de n'obtenir que les dossiers dans le type considéré - par défaut tous les types sont retournés",
required: true,
options: {
options: [
{label: "Dossier de certification", value: "CertificationFolder"},
{label: "Dossier de formation", value: "RegistrationFolder"},
{label: "Proposition commerciale", value: "Proposal"}
],
disabled: false,
},
}),
externalId: Property.ShortText({
displayName: 'N° du dossier',
description:
'Sélectionner la propriété {externalId} du dossier',
required: true,
}),
title: Property.ShortText({
displayName: 'Titre de la tâche',
required: true,
}),
dueDate: Property.DateTime({
displayName: "Date d'échéance",
description: 'Date au format YYYY-MM-DDTHH:mm:ssZ.',
required: false,
}),
type:wedofCommon.tasks,
qualiopiIndicators:wedofCommon.qualiopiIndicators,
description: Property.ShortText({
displayName: 'Description',
required: false,
}),
userEmail: Property.ShortText({
displayName: "Responsable (email de l'utilisateur)",
required: true,
}),
link: Property.ShortText({
displayName: "Lien (url) vers la tâche",
required: false,
}),
},
async run(context) {
const message = {
title: context.propsValue.title ?? null,
dueDate: context.propsValue.dueDate ? dayjs(context.propsValue.dueDate) : null,
eventEndTime: null,
type: context.propsValue.type,
qualiopiIndicators: context.propsValue.qualiopiIndicators,
description: context.propsValue.description ?? null,
userEmail: context.propsValue.userEmail ?? null,
link: context.propsValue.link ?? null,
eventTime: null,
origin: "manual",
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/activities/' +
context.propsValue.entityClass +
'/'+ context.propsValue.externalId,
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,52 @@
import { wedofAuth } from '../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../common/wedof';
export const listActivitiesAndTasks = createAction({
auth: wedofAuth,
name: 'listActivitiesAndTasks',
displayName: "Liste de toutes les activités et tâches d'un dossier",
description: "Liste de toutes les activités et tâches d'un dossier (Dossier de formation / Dossier de certification)",
props: {
entityClass: Property.StaticDropdown({
displayName: "Choisir le type de dossier",
description: "Permet de n'obtenir que les dossiers dans le type considéré - par défaut tous les types sont retournés",
required: true,
options: {
options: [
{
value: "certificationFolders",
label: 'Dossier de certification',
},
{
value: "registrationFolders",
label: 'Dossier de formation',
},
],
disabled: false,
},
}),
externalId: Property.ShortText({
displayName: 'N° du dossier',
description:
'Sélectionner la propriété {externalId} du dossier',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/activities/' +context.propsValue.entityClass+'/'+
context.propsValue.externalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,25 @@
import {wedofAuth} from '../../index';
import {createAction} from '@activepieces/pieces-framework';
import {HttpMethod, httpClient} from '@activepieces/pieces-common';
import {wedofCommon} from '../common/wedof';
export const me = createAction({
auth: wedofAuth,
name: 'me',
displayName: "Récupérer mes informations",
description: "Récupérer mes informations et mes détails",
props: {},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl + '/users/me',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,25 @@
import {wedofAuth} from '../../index';
import {createAction} from '@activepieces/pieces-framework';
import {HttpMethod, httpClient} from '@activepieces/pieces-common';
import {wedofCommon} from '../common/wedof';
export const myOrganism = createAction({
auth: wedofAuth,
name: 'myOrganism',
displayName: "Récupérer mon organisme",
description: "Récupérer mon organisme et afficher ses détails",
props: {},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl + '/organisms/me',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,53 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const billRegistrationFolder = createAction({
auth: wedofAuth,
name: 'billRegistrationFolder',
displayName: 'Facturer le dossier de formation',
description:
'Associe le dossier de formation à un n° de facture et transmets les informations de facturation au financeur (EDOF par exemple)',
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
billNumber: Property.ShortText({
displayName: 'N° de facture',
description: 'N° de la facture à associer',
required: true,
}),
vatRate: Property.Number({
displayName: 'TVA',
description:
'Permet de forcer un Taux de TVA en %. Par défaut la TVA est calculée à partir des données du dossier de formation',
required: false,
}),
},
async run(context) {
const message = {
billNumber: context.propsValue.billNumber,
vatRate: context.propsValue.vatRate,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/billing',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,82 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const cancelRegistrationFolder = createAction({
auth: wedofAuth,
name: 'cancelRegistrationFolder',
displayName: 'Annuler le dossier de formation',
description: 'Annuler le dossier de formation',
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
code: Property.Dropdown({
auth: wedofAuth,
displayName: "Raison de l'annulation du dossier de formation",
description: "Sélectionner la raison de l'annulation",
required: true,
refreshers: ['auth'],
refreshOnSearch: false,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
};
}
const response = (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl + '/registrationFoldersReasons?type=canceled',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth.secret_text,
},
})
).body;
const reasons = response.map(
(reason: { label: string; code: string }) => {
return { label: reason.label, value: reason.code };
}
);
return {
disabled: false,
options: reasons,
};
},
}),
description: Property.LongText({
displayName: 'Description',
description: " Texte expliquant les raisons de l'annulation",
required: false,
}),
},
async run(context) {
const message = {
code: context.propsValue.code,
description: context.propsValue.description,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/cancel',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,123 @@
import { wedofAuth } from '../../../index';
import { createAction, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../../common/wedof';
export const createRegistrationFolder = createAction({
auth: wedofAuth,
name: 'createRegistrationFolder',
displayName: "Créer un dossier de formation hors CPF",
description: "Permet de créer un nouveau dossier de formation",
props: {
sessionId: Property.Number({
displayName: 'ID de session',
description: "ID technique de la session choisie (pas l'externalId)",
required: true,
}),
attendeeId: Property.Number({
displayName: "L'ID de l'apprenant",
description:"ID de l'apprenant sélectionné",
required: true,
}),
totalTTC: Property.Number({
displayName: "Le prix de la formation TTC",
required: true,
}),
type: Property.StaticDropdown({
displayName: "Type de financement",
description: "Type de financement du dossier créer",
required: true,
options: {
options: [
{ label: 'Individuel', value: 'individual' },
{ label: 'OPCO', value: 'opco' },
{ label: 'Pôle Emploi', value: 'poleEmploi' },
{ label: 'Entreprise', value: 'company' }
],
disabled: true,
},
}),
poleEmploiId: Property.ShortText({
displayName: "L'ID Pole Emploi de l'apprenant",
description:"UNIQUEMENT requis si le type du dossier est poleEmploi",
required: false,
}),
poleEmploiRegionCode: Property.StaticDropdown({
displayName: "Le département de l'apprenant",
description: "UNIQUEMENT requis si le type du dossier est poleEmploi",
required: false,
options: {
options: [
{ label: '024 - Alpes', value: '024' },
{ label: '034 - Alpes Provence', value: '034' },
{ label: '017 - Alsace', value: '017' },
{ label: '001 - Aquitaine', value: '001' },
{ label: '044 - Auvergne', value: '044' },
{ label: '040 - Basse Normandie', value: '040' },
{ label: '050 - Bourgogne', value: '050' },
{ label: '027 - Bretagne', value: '027' },
{ label: '035 - Centre', value: '035' },
{ label: '051 - Champagne Ardennes', value: '051' },
{ label: '065 - Corse', value: '065' },
{ label: "032 - Cote d'Azur", value: '032' },
{ label: '061 - Est Francilien', value: '061' },
{ label: '020 - Franche Comte', value: '020' },
{ label: '066 - Guadeloupe', value: '066' },
{ label: '069 - Guyane', value: '069' },
{ label: '041 - Haute Normandie', value: '041' },
{ label: '068 - La Reunion', value: '068' },
{ label: '046 - Languedoc Roussillon', value: '046' },
{ label: '012 - Limousin', value: '012' },
{ label: '063 - Lorraine', value: '063' },
{ label: '067 - Martinique', value: '067' },
{ label: '071 - Mayotte', value: '071' },
{ label: '048 - Midi Pyrenees', value: '048' },
{ label: '057 - Ouest Francilien', value: '057' },
{ label: '056 - Paris', value: '056' },
{ label: '026 - Pas de Calais', value: '026' },
{ label: '013 - Pays de la Loire', value: '013' },
{ label: '049 - Pays du Nord', value: '049' },
{ label: '025 - Picardie', value: '025' },
{ label: '039 - Poitou Charentes', value: '039' },
{ label: '070 - Saint Pierre et Miquelon', value: '070' },
{ label: '016 - Sud Est Francilien', value: '016' },
{ label: '031 - Vallees Rhone Loire', value: '031' }
],
disabled: false,
},
}),
poleEmploiDevis: Property.ShortText({
displayName: "Le numéro de devis Pole Emploi de l'apprenant",
description: "UNIQUEMENT requis si le type du dossier est poleEmploi",
required: false,
}),
inPartnershipWith: Property.ShortText({
displayName: "SIRET du partenaire",
required: false,
})
},
async run(context) {
const message = {
sessionId: context.propsValue.sessionId ?? null,
attendeeId: context.propsValue.attendeeId ?? null,
totalTTC: context.propsValue.totalTTC ?? null,
type: context.propsValue.type ?? null,
poleEmploiId: context.propsValue.poleEmploiId ?? null,
poleEmploiRegionCode: context.propsValue.poleEmploiRegionCode ?? null,
poleEmploiDevis: context.propsValue.poleEmploiDevis ?? null,
inPartnershipWith: context.propsValue.inPartnershipWith ?? null
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +'/registrationFolders',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,49 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareRegistrationFolderIntraining = createAction({
auth: wedofAuth,
name: 'declareRegistrationFolderIntraining',
displayName: "Passer un dossier de formation à l'état : En formation",
description: "Change l'état d'un dossier de formation vers : En formation",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
date: Property.DateTime({
displayName: 'Entrée en formation le',
description: 'Date au format YYYY-MM-DD.',
required: false,
}),
},
async run(context) {
const message = {
date: context.propsValue.date
? dayjs(context.propsValue.date).format('YYYY-MM-DD')
: null,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/inTraining',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,105 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareRegistrationFolderServicedone = createAction({
auth: wedofAuth,
name: 'declareRegistrationFolderServicedone',
displayName: "Passer un dossier de formation à l'état : Service fait déclaré",
description:
"Passe le dossier dans l'état 'service fait déclaré' s'il est dans l'état 'sortie de formation' ou dans l'état 'en formation'. Si depuis l'état 'en formation', le passage à l'état intermédiaire 'sortie de formation' se fera automatiquement.",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
absenceDuration: Property.Number({
displayName: "durée d'absence",
description:
"La durée d'une éventuelle absence en heures. 0 si aucune absence.",
required: false,
defaultValue: 0,
}),
forceMajeureAbsence: wedofCommon.forceMajeureAbsence,
trainingDuration: Property.Number({
displayName: 'Durée totale de la formation',
description:
"Précise la durée totale de la formation afin de calculer le % d'absence. Si rien n'est précisé, récupère la durée dans le trainingActionInfo/duration",
required: false,
defaultValue: 0,
}),
code: Property.Dropdown({
auth: wedofAuth,
displayName: 'Raison de la sortie de formation',
description: 'Sélectionner la raison de sortie de formation',
required: true,
refreshers: ['auth'],
refreshOnSearch: false,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
};
}
const response = (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/registrationFoldersReasons?type=terminated',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth.secret_text,
},
})
).body;
const reasons = response.map(
(reason: { label: string; code: string }) => {
return { label: reason.label, value: reason.code };
}
);
return {
disabled: false,
options: reasons,
};
},
}),
date: Property.DateTime({
displayName: 'Sortie de formation le',
description: "Date du sortie de formation au format YYYY-MM-DD. Par défaut, date du jour. Si la date a déjà été indiquée au moment du terminate, il n'est pas nécessaire de la repréciser",
required: false,
defaultValue: dayjs(new Date()).format('YYYY-MM-DD'),
}),
},
async run(context) {
const message = {
absenceDuration: context.propsValue.absenceDuration ?? null,
forceMajeureAbsence: context.propsValue.forceMajeureAbsence ?? null,
trainingDuration: context.propsValue.trainingDuration ?? null,
code: context.propsValue.code ?? null,
date: context.propsValue.date ? dayjs(context.propsValue.date).format('YYYY-MM-DD') : null,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/serviceDone',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,96 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const declareRegistrationFolderTerminated = createAction({
auth: wedofAuth,
name: 'declareRegistrationFolderTerminated',
displayName: "Passer un dossier de formation à l'état : sortie de formation",
description:
"Change l'état d'un dossier de formation vers : sortie de formation",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
date: Property.DateTime({
displayName: 'Sortie de formation le',
description: 'Date au format YYYY-MM-DD.',
required: false,
defaultValue: dayjs(new Date()).format('YYYY-MM-DD'),
}),
code: Property.Dropdown({
auth: wedofAuth,
displayName: 'Raison de la sortie de formation',
description: 'Sélectionner la raison de sortie de formation',
required: true,
refreshers: ['auth'],
refreshOnSearch: false,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
};
}
const response = (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/registrationFoldersReasons?type=terminated',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth.secret_text,
},
})
).body;
const reasons = response.map(
(reason: { label: string; code: string }) => {
return { label: reason.label, value: reason.code };
}
);
return {
disabled: false,
options: reasons,
};
},
}),
absenceDuration: Property.Number({
displayName: "durée d'absence",
description:
"La durée d'une éventuelle absence en heures. 0 si aucune absence.",
required: false,
defaultValue: 0,
}),
},
async run(context) {
const message = {
date: context.propsValue.date
? dayjs(context.propsValue.date).format('YYYY-MM-DD')
: null,
code: context.propsValue.code,
absenceDuration: context.propsValue.absenceDuration,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/terminate',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,26 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getMinimalSessionDates = createAction({
auth: wedofAuth,
name: 'getMinimalSessionsDates',
displayName: 'Date minimale de début de session de formation',
description:
'Récupération des dates minimales de début de session de formation',
props: {},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url: wedofCommon.baseUrl + '/registrationFolders/utils/sessionMinDates',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,36 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getRegistrationFolder = createAction({
auth: wedofAuth,
name: 'getRegistrationFolder',
displayName: 'Récupérer un dossier de formation',
description:
'Récupérer un dossier de formation à partir de son n° de dossier',
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,35 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const getRegistrationFolderDocuments = createAction({
auth: wedofAuth,
name: 'getRegistrationFolderDocuments',
displayName: "Liste des documents d'un dossier de formation",
description: "Récupérer la liste de documents d'un dossier de formation à partir de son n° de dossier",
props: {
Id: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {Id} du dossier de formation',
required: true,
}),
},
async run(context) {
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.Id +'/files',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,82 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const refuseRegistrationFolder = createAction({
auth: wedofAuth,
name: 'refuseRegistrationFolder',
displayName: 'Refuser le dossier de formation',
description: 'Refuser le dossier de formation',
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
code: Property.Dropdown({
auth: wedofAuth,
displayName: 'Raison du refus du dossier de formation',
description: 'Sélectionner la raison du refus',
required: true,
refreshers: ['auth'],
refreshOnSearch: false,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
options: [],
};
}
const response = (
await httpClient.sendRequest({
method: HttpMethod.GET,
url:
wedofCommon.baseUrl + '/registrationFoldersReasons?type=refused',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth.secret_text,
},
})
).body;
const reasons = response.map(
(reason: { label: string; code: string }) => {
return { label: reason.label, value: reason.code };
}
);
return {
disabled: false,
options: reasons,
};
},
}),
description: Property.LongText({
displayName: 'Description',
description: ' Texte expliquant les raisons du refus',
required: false,
}),
},
async run(context) {
const message = {
code: context.propsValue.code,
description: context.propsValue.description,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/refuse',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,277 @@
import {
httpClient,
HttpMethod,
QueryParams,
} from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
DynamicPropsValue,
Property,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const searchRegistrationFolder = createAction({
auth: wedofAuth,
name: 'listRegistrationFolders',
displayName: 'Rechercher un ou plusieurs dossiers de formation',
description:
'Liste les dossiers de formation en fonction des critères sélectionnés',
props: {
query: Property.ShortText({
displayName: 'Recherche',
description: 'Nom, prénom, N° de dossier, N° de certification etc..',
required: false,
}),
period: wedofCommon.period,
periodForm: Property.DynamicProperties( {
auth: wedofAuth,
description: '',
displayName: 'ez',
required: true,
refreshers: ['period'],
props: async ({ period }) => {
const _period = period as unknown as string;
const props: DynamicPropsValue = {};
if (_period === 'custom') {
props['since'] = Property.DateTime({
displayName: '(Période) Entre le',
description: 'Date au format YYYY-MM-DD',
required: true,
});
props['until'] = Property.DateTime({
displayName: "(Période) et jusqu'au",
description: 'Date au format YYYY-MM-DD',
required: true,
});
} else if (
['next', 'future', 'tomorrow'].some((v) =>
_period.toLowerCase().includes(v)
)
) {
props['filterOnStateDate'] = wedofCommon.filterOnStateDateFuture;
} else if (_period) {
props['filterOnStateDate'] = wedofCommon.filterOnStateDate;
}
return props;
},
}),
type: wedofCommon.type,
state: wedofCommon.state,
billingState: wedofCommon.billingState,
controlState: wedofCommon.controlState,
certificationFolderState: wedofCommon.certificationFolderState,
proposalCode: Property.ShortText({
displayName: 'Code de proposition commercial',
description: 'Code de la proposition commercial Wedof associé',
required: false,
}),
siret: Property.ShortText({
displayName: 'Siret',
description:
"Permet de n'obtenir que les dossiers appartenant à l'organisme de siret considéré - par défaut l'organisme de l'utilisateur courant",
required: false,
}),
certifInfo: Property.ShortText({
displayName: 'Certification',
description: 'Filtrer par certification',
required: false,
}),
columnId: Property.ShortText({
displayName: 'ID de colonne',
description: 'Identifiant pour affichage personnalisé',
required: false,
}),
completionRate: Property.StaticDropdown({
displayName: 'Taux dassiduité',
description:
"Permet de n'obtenir que les dossiers dont le taux d'assiduité choisi",
required: false,
options: {
options: [
{ label: '0%', value: '0' },
{ label: '< 25%', value: '25<' },
{ label: '25% <> 80%', value: '25<>80' },
{ label: '> 80%', value: '>80' },
{ label: '100%', value: '100' },
],
},
}),
daysSinceLastUpdatedCompletionRate: Property.ShortText({
displayName: "Jours sans mise à jour d'assiduité",
description:
"Permet de n'obtenir que les dossiers pour lesquels le taux d'avancement n'a pas été mis à jour depuis plus de X jours",
required: false,
}),
format: Property.StaticDropdown({
displayName: 'Format de sortie',
required: false,
defaultValue: 'json',
options: {
options: [
{ label: 'JSON', value: 'json' },
{ label: 'CSV', value: 'csv' },
],
},
}),
messageState: Property.StaticDropdown({
displayName: 'État du message',
description:
"Permet de n'obtenir que les dossiers liés à l'état d'envoi d'un message considéré - par défaut tous les dossiers sont retournés",
required: false,
options: {
options: [
{ label: 'Message envoyé', value: 'sent' },
{ label: 'Message non envoyé', value: 'notSent' },
{
label: 'Message non envoyé (non autorisé)',
value: 'notSentUnauthorized',
},
{
label: 'Message non envoyé (conditions renforcées)',
value: 'notSentEnforcedConditions',
},
{ label: "Echec de l'envoi", value: 'failed' },
{ label: 'Envoi programmé', value: 'scheduled' },
],
},
}),
messageTemplate: Property.ShortText({
displayName: 'Modèle de message',
description:
"Permet de n'obtenir que les dossiers pour lequels un message issue du modèle considéré a été créé - par défaut aucun filtre",
required: false,
}),
order: Property.StaticDropdown({
displayName: 'Ordre de tri',
required: false,
options: {
options: [
{ label: 'Ascendant', value: 'asc' },
{ label: 'Descendant', value: 'desc' },
],
},
}),
organismType: Property.StaticDropdown({
displayName: 'Type dorganisme',
required: false,
options: {
options: [
{ label: 'Moi', value: 'self' },
{ label: 'Partenaires', value: 'partners' },
],
},
}),
sort: Property.StaticDropdown({
displayName: 'Critère de tri',
description: 'Tri les résultats sur un critère',
required: false,
options: {
options: [
{ label: 'Prénom', value: 'firstName' },
{ label: 'Nom', value: 'lastName' },
{ label: 'Dernière mise à jour', value: 'lastUpdate' },
{ label: 'ID', value: 'id' },
],
},
}),
tags: Property.Array({
displayName: 'Tags',
description: 'Recherche libre sur les tags',
required: false,
}),
trainingActionId: Property.ShortText({
displayName: "ID de l'action de formation",
description:
"Permet de n'obtenir que les dossiers liés à l'action de formation considérée",
required: false,
}),
trainingId: Property.ShortText({
displayName: 'ID de la formation',
description:
"Permet de n'obtenir que les dossiers liés à la formation considérée",
required: false,
}),
sessionId: Property.ShortText({
displayName: 'ID de la session',
description:
"Permet de n'obtenir que les dossiers liés à la session considérée",
required: false,
}),
limit: Property.Number({
displayName: 'Nombre de dossiers de formation',
description:
'Nombre de dossiers de formation maximum qui seront retournés par requête',
defaultValue: 100,
required: false,
}),
page: Property.Number({
displayName: 'N° de page de la requête',
description: 'Par défaut : 1',
defaultValue: 1,
required: false,
}),
},
async run(context) {
const props = context.propsValue;
const params = {
query: props.query ?? null,
limit: props.limit ?? null,
page: props.page ?? null,
controlState: props.controlState ?? null,
state: props.state ?? null,
certificationFolderState: props.certificationFolderState ?? null,
billingState: props.billingState ?? null,
type: props.type ?? null,
period: props.period ?? null,
proposalCode: props.proposalCode ?? null,
siret: props.siret ?? null,
certifInfo: props.certifInfo ?? null,
columnId: props.columnId ?? null,
completionRate: props.completionRate ?? null,
daysSinceLastUpdatedCompletionRate:
props.daysSinceLastUpdatedCompletionRate ?? null,
format: props.format ?? null,
messageState: props.messageState ?? null,
messageTemplate: props.messageTemplate ?? null,
order: props.order ?? null,
organismType: props.organismType ?? null,
sort: props.sort ?? null,
tags: props.tags ?? null,
trainingActionId: props.trainingActionId ?? null,
trainingId: props.trainingId ?? null,
sessionId: props.sessionId ?? null,
since: props.periodForm['since']
? dayjs(props.periodForm['since'])
.startOf('day')
.format('YYYY-MM-DDTHH:mm:ssZ')
: null,
until: props.periodForm['until']
? dayjs(props.periodForm['until'])
.endOf('day')
.format('YYYY-MM-DDTHH:mm:ssZ')
: null,
filterOnStateDate: props.periodForm['filterOnStateDate'] ?? null,
};
const queryParams: QueryParams = {};
Object.keys(params).forEach((value) => {
const key = value as keyof typeof params;
if (params[key] != null && params[key] != undefined) {
queryParams[value] = params[key] as string;
}
});
return (
await httpClient.sendRequest({
method: HttpMethod.GET,
queryParams: queryParams,
url: wedofCommon.baseUrl + '/registrationFolders',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,44 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const updateCompletionRate = createAction({
auth: wedofAuth,
name: 'updateCompletionRate',
displayName: "Mettre à jour l'assiduité d'un apprenant",
description:
"Mettre à jour le taux d'avancement en % d'assiduité d'un apprenant pour un Dossier de formation donné.",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
completionRate: Property.Number({
displayName: "Taux d'avancement",
description: "Taux d'avancement en % compris entre 0% et 100%. Uniquement sous format d'un entier. Uniquement possible à l'état En formation et Sortie de formation",
required: true,
}),
},
async run(context) {
const message = {
completionRate: context.propsValue.completionRate,
};
return (
await httpClient.sendRequest({
method: HttpMethod.PUT,
body: message,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,243 @@
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import {
createAction,
Property,
DynamicPropsValue,
} from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
import dayjs from 'dayjs';
export const updateRegistrationFolder = createAction({
auth: wedofAuth,
name: 'updateRegistrationFolder',
displayName: 'Mettre à jour un dossier de formation',
description:
"Met à jour certaines informations modifiables d'un dossier de formation",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
fieldsToUpdate: Property.StaticMultiSelectDropdown({
displayName: 'Champs à mettre à jour',
description: 'Sélectionner les champs que vous souhaitez mettre à jour',
required: true,
options: {
disabled: false,
options: [
{
label: 'Prix de la formation',
value: 'price',
},
{
label: 'Date de début de la session de formation',
value: 'sessionStartDate',
},
{
label: 'Date de fin de la session de formation',
value: 'sessionEndDate',
},
{
label: 'Notes privées',
value: 'notes',
},
{
label: 'Description publique',
value: 'description',
},
{
label: "Taux d'avancement",
value: 'completionRate',
},
{
label: 'Durée moyenne de la formation',
value: 'indicativeDuration',
},
{
label: 'Temps de formation par semaine',
value: 'weeklyDuration',
},
{
label: 'Tags',
value: 'tags',
},
],
},
}),
dynamicFields: Property.DynamicProperties( {
auth: wedofAuth,
displayName: 'Champs sélectionnés',
refreshers: ['fieldsToUpdate'],
required: false,
props: async ({ fieldsToUpdate }) => {
const fields: DynamicPropsValue = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
if (selectedFields.includes('price')) {
fields['price'] = Property.Number({
displayName: 'Prix de la formation',
description: 'Nouveau tarif en €',
required: false,
});
}
if (selectedFields.includes('sessionStartDate')) {
fields['sessionStartDate'] = Property.DateTime({
displayName: 'Date de début de la session de formation',
description: 'Date au format YYYY-MM-DD',
required: false,
});
}
if (selectedFields.includes('sessionEndDate')) {
fields['sessionEndDate'] = Property.DateTime({
displayName: 'Date de fin de la session de formation',
description: 'Date au format YYYY-MM-DD',
required: false,
});
}
if (selectedFields.includes('notes')) {
fields['notes'] = Property.LongText({
displayName: 'Notes',
description: "Notes privées (non-visible par l'apprenant)",
required: false,
});
}
if (selectedFields.includes('description')) {
fields['description'] = Property.LongText({
displayName: 'Description',
description: "Note publique visible de l'apprenant",
required: false,
});
}
if (selectedFields.includes('completionRate')) {
fields['completionRate'] = Property.Number({
displayName: "Taux d'avancement",
description:
"Taux d'avancement en % compris entre 0% et 100%. Uniquement sous format d'un entier. Uniquement possible à l'état En formation et Sortie de formation",
required: false,
});
}
if (selectedFields.includes('indicativeDuration')) {
fields['indicativeDuration'] = Property.Number({
displayName: 'Durée moyenne de la formation',
description: 'En heures, durée moyenne de la formation',
required: false,
});
}
if (selectedFields.includes('weeklyDuration')) {
fields['weeklyDuration'] = Property.Number({
displayName: 'Temps de formation par semaine',
description: 'En heures, ne peut pas être supérieur à 99',
required: false,
});
}
if (selectedFields.includes('tags')) {
fields['tags'] = Property.Array({
displayName: 'Tags',
description:
'Liste de tags associée au dossier de formation, si vous souhaitez garder vos précédents tags, il faut les réécrire dans le champ',
required: false,
});
}
return fields;
},
}),
},
async run(context) {
const { fieldsToUpdate, dynamicFields } = context.propsValue;
const {
price,
sessionStartDate,
sessionEndDate,
notes,
description,
completionRate,
indicativeDuration,
weeklyDuration,
tags,
} = dynamicFields || {};
const message: Record<string, unknown> = {};
const selectedFields = (fieldsToUpdate as string[]) || [];
let priceChange: Record<string, unknown> | null = null;
let trainingActionInfo: Record<string, unknown> | null = null;
selectedFields.forEach((fieldName) => {
switch (fieldName) {
case 'price':
if (!priceChange) priceChange = {};
priceChange['price'] = price !== undefined ? price : null;
break;
case 'sessionStartDate':
if (!trainingActionInfo) trainingActionInfo = {};
trainingActionInfo['sessionStartDate'] = sessionStartDate
? dayjs(sessionStartDate).format('YYYY-MM-DD')
: null;
break;
case 'sessionEndDate':
if (!trainingActionInfo) trainingActionInfo = {};
trainingActionInfo['sessionEndDate'] = sessionEndDate
? dayjs(sessionEndDate).format('YYYY-MM-DD')
: null;
break;
case 'completionRate':
if (!trainingActionInfo) trainingActionInfo = {};
trainingActionInfo['completionRate'] =
completionRate !== undefined ? completionRate : null;
break;
case 'indicativeDuration':
if (!trainingActionInfo) trainingActionInfo = {};
trainingActionInfo['indicativeDuration'] =
indicativeDuration !== undefined ? indicativeDuration : null;
break;
case 'weeklyDuration':
if (!trainingActionInfo) trainingActionInfo = {};
trainingActionInfo['weeklyDuration'] =
weeklyDuration !== undefined ? weeklyDuration : null;
break;
case 'notes':
message['notes'] = notes || null;
break;
case 'description':
message['description'] = description || null;
break;
case 'tags':
message['tags'] = tags && tags.length > 0 ? (tags as string[]) : null;
break;
}
});
if (priceChange) {
message['priceChange'] = priceChange;
}
if (trainingActionInfo) {
message['trainingActionInfo'] = trainingActionInfo;
}
return (
await httpClient.sendRequest({
method: HttpMethod.PUT,
body: message,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,53 @@
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { wedofAuth } from '../../..';
import { createAction, Property } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const validateRegistrationFolder = createAction({
auth: wedofAuth,
name: 'validateRegistrationFolder',
displayName: 'Valider le dossier de formation',
description: "Passer l'état du dossier de formation à l'état validé",
props: {
externalId: Property.ShortText({
displayName: 'N° du dossier de formation',
description:
'Sélectionner la propriété {externalId} du dossier de formation',
required: true,
}),
indicativeDuration: Property.Number({
displayName: 'Durée totale de la formation',
description:
"Obligatoire dans le cas d'un dossier de formation avec financement France Travail",
required: false,
}),
weeklyDuration: Property.Number({
displayName: 'Intensité hebdomadaire',
description:
'Intensité hebdomadaire de la formation, en heures par semaine',
required: false,
}),
},
async run(context) {
const message = {
indicativeDuration: context.propsValue.indicativeDuration,
weeklyDuration: context.propsValue.weeklyDuration,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/registrationFolders/' +
context.propsValue.externalId +
'/validate',
body: message,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

View File

@@ -0,0 +1,164 @@
import { wedofAuth } from '../../index';
import { createAction, DynamicPropsValue, Property } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
import { wedofCommon } from '../common/wedof';
export const sendFile = createAction({
auth: wedofAuth,
name: 'sendFile',
displayName: "Envoyer un fichier",
description: "Permet d'envoyer un fichier pour un dossier (Dossier de formation / Dossier de certification)",
props: {
entityClass: Property.StaticDropdown({
displayName: "Choisir le type de dossier",
description: "Permet de n'obtenir que les dossiers dans le type considéré - par défaut tous les types sont retournés",
required: true,
options: {
options: [
{
value: "certificationFolders",
label: 'Dossier de certification',
},
{
value: "registrationFolders",
label: 'Dossier de formation',
},
],
disabled: false,
},
}),
externalId: Property.ShortText({
displayName: 'N° du dossier',
description:
'Sélectionner la propriété {externalId} du dossier',
required: true,
}),
title: Property.ShortText({
displayName: 'Titre du fichier',
required: false,
}),
typeId: Property.DynamicProperties({
auth: wedofAuth,
displayName: 'Type du fichier',
refreshers: ['entityClass', 'externalId'],
required: true,
props: async ({ auth, entityClass, externalId }) => {
const fields: DynamicPropsValue = {};
if (!entityClass) {
console.error('entityClass is undefined');
return {};
}
if (!externalId) {
console.error('externalId is undefined');
return {};
}
try {
const res = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${wedofCommon.baseUrl}/${entityClass}/${externalId}/files`,
headers: {
'Content-Type': 'application/json',
'X-Api-Key': auth as unknown as string,
},
});
const data = res.body;
if (Array.isArray(data)) {
data.forEach((field: { id: string | number; name: string; }) => {
fields[field.id] = Property.StaticDropdown({
displayName: field.name,
options: {
options: data.map((option: { typeId: string; name: string; }) => ({
value: option.typeId,
label: option.name,
})),
disabled: false,
},
required: false,
});
});
}
} catch (error) {
console.error('Error fetching data:', error);
}
return fields;
},
}),
typeFile: Property.StaticDropdown({
displayName: "Choisir le format d'envoi du fichier",
description: "Permet de choisir la méthode d'envoi du fichier",
required: false,
defaultValue: "file",
options: {
options: [
{
value: "file",
label: 'Attacher un document',
},
{
value: "fileUrl",
label: 'Ajouter un lien',
},
{
value: "url",
label: "Ajouter à partir d'un lien",
},
],
disabled : false,
},
}),
files: Property.DynamicProperties({
auth: wedofAuth,
description: '',
displayName: 'ez',
required: true,
refreshers: ['typeFile'],
props: async ({ typeFile }) => {
const _type = typeFile as unknown as string;
const props: DynamicPropsValue = {};
if (_type === "url") {
props['fileToDownload'] = Property.LongText({
displayName: "Lien vers le document",
description: 'URL du fichier à télécharger',
required: true,
});
} else if (_type === "fileUrl") {
props['file'] = Property.LongText({
displayName: "Lien a envoyer",
description: 'URL du fichier',
required: true,
});
} else if (_type === "file") {
props['file'] = Property.File({
displayName: "Fichier a envoyer",
required: true,
});
}
return props;
},
}),
},
async run(context) {
const message = {
title: context.propsValue.title ?? null,
typeId: String(context.propsValue.typeId['undefined'])?? null,
file:context.propsValue.files['file'] ?? null,
fileToDownload: context.propsValue.files['fileToDownload'] ?? null,
};
return (
await httpClient.sendRequest({
method: HttpMethod.POST,
url:
wedofCommon.baseUrl +
'/' +
context.propsValue.entityClass +
'/'+ context.propsValue.externalId + '/files',
body: message,
headers: {
'Content-Type': 'multipart/form-data',
'X-Api-Key': context.auth.secret_text,
},
})
).body;
},
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,104 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveyInitialExperienceAnswered = createTrigger(
{
auth: wedofAuth,
name: 'certificationFolderSurveyInitialExperienceAnswered',
displayName:
'Enquête "Situation professionnelle en début de cursus" répondue',
description:
"Se déclenche lorsqu'un une enquête de début de cursus est répondue",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.initialExperienceAnswered'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
}
);

View File

@@ -0,0 +1,103 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveyInitialExperienceAvailable =
createTrigger({
auth: wedofAuth,
name: 'certificationFolderSurveyInitialExperienceAvailable',
displayName:
'Enquête "Situation professionnelle en début de cursus" disponible',
description:
"Se déclenche lorsqu'un une enquête de début de cursus est disponible",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.created'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,102 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveyLongTermExperienceAnswered =
createTrigger({
auth: wedofAuth,
name: 'certificationFolderSurveyLongTermExperienceAnswered',
displayName: 'Enquête "Situation professionnelle au moins un an" répondue',
description:
"Se déclenche lorsqu'un une enquête de au moins un an de cursus est répondue",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.longTermExperienceAnswered'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,103 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveyLongTermExperienceAvailable =
createTrigger({
auth: wedofAuth,
name: 'certificationFolderSurveyLongTermExperienceAvailable',
displayName:
'Enquête "Situation professionnelle au moins un an" disponible',
description:
"Se déclenche lorsqu'un une enquête de au moins un an de cursus est disponible",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.longTermExperienceAvailable'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,102 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveySixMonthExperienceAnswered =
createTrigger({
auth: wedofAuth,
name: 'certificationFolderSurveySixMonthExperienceAnswered',
displayName: 'Enquête "Situation professionnelle de 6 mois" répondue',
description:
"Se déclenche lorsqu'un une enquête de 6 mois de cursus est répondue",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.sixMonthExperienceAnswered'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,102 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSurveySixMonthExperienceAvailable =
createTrigger({
auth: wedofAuth,
name: 'certificationFolderSurveySixMonthExperienceAvailable',
displayName: 'Enquête "Situation professionnelle de 6 mois" disponible',
description:
"Se déclenche lorsqu'un une enquête de 6 mois de cursus est disponible",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
id: 0,
initialExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
initialExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
sixMonthExperienceAnsweredDate: '2019-08-24T14:15:22Z',
sixMonthExperienceStartDate: '2019-08-24T14:15:22Z',
longTermExperience: {
id: 0,
qualification: 0,
certificationName: 'string',
job: 'string',
companyName: 'string',
salaryYearly: 0,
situation: 'string',
contractType: 'string',
executiveStatus: true,
startDate: '2019-08-24T14:15:22Z',
endDate: '2019-08-24T14:15:22Z',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
},
longTermExperienceAnsweredDate: '2019-08-24T14:15:22Z',
longTermExperienceStartDate: '2019-08-24T14:15:22Z',
state: 'created',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolderSurvey.sixMonthExperienceAvailable'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,224 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderRegistred = createTrigger({
auth: wedofAuth,
name: 'certificationFolderRegistred',
displayName: 'Dossier de certification enregistré',
description: "Se déclenche lorsqu'un dossier de certification est enregistré",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.registered'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,227 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSelected = createTrigger({
auth: wedofAuth,
name: 'certificationFolderSelected',
displayName: 'Événement sur le dossier de certification',
description:
"Se déclenche lorsque l'événement choisi se produit sur un dossier de certification",
props: {
scope: wedofCommon.certificationEvents,
},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
context.propsValue.scope,
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,225 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderSuccess = createTrigger({
auth: wedofAuth,
name: 'certificationfolderSuccess',
displayName: 'Dossier de certification réussi',
description:
"Se déclenche lorsqu'un dossier de formation passe à l'état réussi",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.success'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,225 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderToControl = createTrigger({
auth: wedofAuth,
name: 'certificationFolderToControl',
displayName: 'Dossier de certification à contrôler',
description:
"Se déclenche lorsqu'un dossier de certification passe à controler",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.toControl'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,225 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderToretake = createTrigger({
auth: wedofAuth,
name: 'certificationFolderToretake',
displayName: 'Dossier de certification à repasser',
description:
"Se déclanche lorsqu'un dossier de certification est prét à repasser",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.toRetake'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,225 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderTotake = createTrigger({
auth: wedofAuth,
name: 'certificationFolderTotake',
displayName: 'Dossier de certification prêt à passer',
description:
"Se déclenche lorsqu'un dossier de certification est prét à passer",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.toTake'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,224 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationFolderUpdated = createTrigger({
auth: wedofAuth,
name: 'certificationFolderUpdated',
displayName: 'Dossier de certification mis à jour',
description: "Se déclenche lorsqu'un dossier de certification est mis à jour",
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.updated'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
}
});

View File

@@ -0,0 +1,225 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const newCertificationFolderCreated = createTrigger({
auth: wedofAuth,
name: 'newCertificationFolderCreated',
displayName: 'Nouveau dossier de certification',
description:
"Se déclenche lorsqu'un nouveau dossier de certification est créé",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
attendeeLink: 'https://test.wedof.fr/candidat-1234-123456789',
permalink: 'https://test.wedof.fr/dossier-certification-1234',
addToPassportLink:
'https://test.wedof.fr/candidat-1234-123456789-passeport',
id: 2024,
examinationDate: null,
examinationEndDate: null,
examinationPlace: null,
issueDate: null,
expirationDate: null,
detailedResult: null,
digitalProofLink: null,
state: 'registered',
files: [
{
permalink: 'https://test.wedof.fr/candidat-1234-123456789-document-4',
id: 40,
typeId: 4,
fileName: 'OUHAHAH',
link: 'https://community.n8n.io/t/declarative-style-nodes-how-to-send-multipart-form-data/26416',
fileType: 'link',
state: 'valid',
comment: null,
generationState: 'notGenerated',
createdOn: '2024-06-20T13:48:12.000Z',
updatedOn: '2024-06-26T14:05:12.123Z',
_links: {
certificationFolder: {
href: '/api/certificationFolders/1234',
},
},
},
],
comment: '',
history: {
toTakeDate: null,
failedDate: null,
successDate: null,
toRegisterDate: '2024-06-18T12:31:12.000Z',
registeredDate: '2024-06-18T12:31:12.000Z',
abortedDate: null,
toControlDate: null,
refusedDate: null,
toRetakeDate: null,
inTrainingStartedDate: null,
inTrainingEndedDate: null,
},
stateLastUpdate: '2024-06-18T12:31:12.000Z',
attendee: {
id: 2024,
lastName: 'doe',
firstName: 'john',
email: 'john.doe@gmail.com',
phoneNumber: '+1.112.666.0606',
phoneFixed: null,
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '9',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'ALL',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
employmentStatus: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
readOnly: false,
externalId: null,
lastLogin: null,
cdcCompliant: false,
},
certifiedData: true,
examinationType: 'A_DISTANCE',
type: 'OF',
gradePass: null,
examinationCenterZipCode: null,
europeanLanguageLevel: null,
accessModality: null,
verbatim: null,
optionName: null,
accessModalityVae: null,
cdcState: 'notExported',
cdcToExport: true,
cdcCompliant: false,
enrollmentDate: null,
amountHt: null,
cdcTechnicalId: null,
inTraining: false,
cdcExcluded: false,
externalId: '1234-1234567890',
certificateId: null,
createdOn: '2024-06-18T12:31:12.000Z',
updatedOn: '2024-06-26T14:05:12.121Z',
_links: {
self: {
href: '/api/certificationFolders/1234-1234567890',
},
register: {
href: '/api/certificationFolders/1234-1234567890/register',
},
refuse: {
href: '/api/certificationFolders/1234-1234567890/refuse',
},
take: {
href: '/api/certificationFolders/1234-1234567890/take',
},
control: {
href: '/api/certificationFolders/1234-1234567890/control',
},
retake: {
href: '/api/certificationFolders/1234-1234567890/retake',
},
fail: {
href: '/api/certificationFolders/1234-1234567890/fail',
},
success: {
href: '/api/certificationFolders/1234-1234567890/success',
},
abort: {
href: '/api/certificationFolders/1234-1234567890/abort',
},
certification: {
href: '/api/certifications/123456',
name: 'titre certification',
certifInfo: '123456',
externalId: 'RS12345',
id: 2,
enabled: true,
},
registrationFolder: {
href: '/api/registrationFolders/1234567890',
externalId: '1234567890',
type: 'individual',
state: 'accepted',
},
partner: {
href: '/api/organisms/123456789',
name: 'organism',
siret: '1234567890',
},
certifier: {
href: '/api/organisms/1234567890',
name: 'organism',
siret: '1234567890',
},
activities: {
href: '/api/activities/CertificationFolder/1234',
},
},
tags: [],
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationFolder.created'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerAborted = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerAborted',
displayName: 'Demande de partenariat abandonnée',
description: "Se déclenche Lorsqu'une demande de partenariat estabandonnée",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.aborted'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerActive = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerActive',
displayName: 'Partenariat actif',
description: "Se déclenche Lorsqu'une demande de partenariat est actif",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.active'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerProcessing = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerProcessing',
displayName: 'Demande de partenariat en traitement',
description:
"Se déclenche Lorsqu'une demande de partenariat est en traitement",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.processing'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerRefused = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerRefused',
displayName: 'Demande de partenariat refusée',
description: "Se déclenche Lorsqu'une demande de partenariat est refusée",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.refused'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerRevoked = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerRevoked',
displayName: 'Partenariat révoqué',
description: "Se déclenche Lorsqu'un partenariat est révoqué",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.revoked'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,68 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const certificationPartnerSuspended = createTrigger({
auth: wedofAuth,
name: 'certificationPartnerSuspended',
displayName: 'Partenariat suspendu',
description: "Se déclenche Lorsqu'un partenariat est suspendu",
props: {},
sampleData: {
id: 0,
url: 'string',
secret: 'string',
type: 'string',
events: {},
enabled: true,
ignoreSsl: true,
name: 'string',
createdOn: '2019-08-24T14:15:22Z',
updatedOn: '2019-08-24T14:15:22Z',
_links: {
self: {
href: 'string',
},
organism: {
href: 'string',
name: null,
siret: null,
},
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['certificationPartner.suspended'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,232 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const newRegistrationFolderNotProcessed = createTrigger({
auth: wedofAuth,
name: 'newRegistrationFolderNotProcessed',
displayName: 'Nouveau dossier de formation',
description:
"Se déclenche lorsqu'un nouveau dossier de formation est créé (non traité)",
type: TriggerStrategy.WEBHOOK,
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'notProcessed',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: null,
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolder.notProcessed'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,232 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderAccepted = createTrigger({
auth: wedofAuth,
name: 'registrationFolderAccepted',
displayName: 'Dossier de formation accepté',
description:
"Se déclenche lorsqu'un dossier de formation passe à l'état accepté",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolder.accepted'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,232 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderInTraining = createTrigger({
auth: wedofAuth,
name: 'registrationFolderInTraining',
displayName: 'Dossier de formation entre en formation',
description:
"Se déclenche lorsqu'un dossier de formation passe à l'état en formation",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolder.inTraining'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,231 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderPaid = createTrigger({
auth: wedofAuth,
name: 'registrationFolderPaid',
displayName: 'Dossier de formation payé (acompte ou payé totalement)',
description: "Se déclenche lorsqu'un dossier de formation est payé",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolderBilling.paid'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,234 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderSelected = createTrigger({
auth: wedofAuth,
name: 'registrationFolderSelected',
displayName: 'Événement sur le dossier de formation',
description:
"Se déclenche lorsque l'événement choisi se produit sur un dossier de formation",
props: {
scope: wedofCommon.events,
},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
context.propsValue.scope,
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,232 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderTerminated = createTrigger({
auth: wedofAuth,
name: 'registrationFolderTerminated',
displayName: 'Dossier de formation sort de formation',
description:
"Se déclenche lorsqu'un dossier de formation passe à l'état sorti de formation",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolder.terminated'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,232 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderTobill = createTrigger({
auth: wedofAuth,
name: 'registrationFolderTobill',
displayName: 'Dossier de formation à facturer',
description:
"Se déclenche lorsqu'un dossier de formation est prêt à être facturé (service fait validé)",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolderBilling.toBill'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});

View File

@@ -0,0 +1,231 @@
import { wedofAuth } from '../../..';
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
import { wedofCommon } from '../../common/wedof';
export const registrationFolderUpdated = createTrigger({
auth: wedofAuth,
name: 'registrationFolderUpdated',
displayName: 'Dossier de formation mis à jour',
description: "Se déclenche lorsqu'un dossier de formation est mis à jour",
props: {},
sampleData: {
withPoleEmploi: false,
attendeeLink: 'https://test.wedof.fr/apprenant-12345678901234',
dataProviderId: null,
permalink: 'https://test.wedof.fr/dossier-formation-12345678901234',
isAllowActions: true,
type: 'individual',
lastUpdate: '2024-03-15T14:26:51.842Z',
attendee: {
id: 2024,
lastName: 'john',
firstName: 'Doe',
email: 'john.doe@gmail.com',
phoneNumber: '(323) 853-2456',
phoneFixed: '0666666666',
degree: 7,
degreeTitle: 'BAC+5 : grade master, DEA, DESS, ingénieur... (NIVEAU 7)',
address: {
id: null,
city: 'string',
line4: null,
number: '01',
country: null,
postBox: null,
zipCode: 'string',
roadName: 'string',
roadType: 'string',
idAddress: null,
residence: null,
countryCode: null,
fullAddress: null,
trainingSite: null,
corporateName: 'M JOHN DOE',
roadTypeLabel: 'string',
informationSite: null,
repetitionIndex: null,
subscriptionSite: null,
additionalAddress: null,
repetitionIndexLabel: null,
reducedMobilityAccessCompliant: null,
reducedMobilityAccessModalities: null,
},
dateOfBirth: null,
nameCityOfBirth: null,
gender: null,
birthName: null,
codeCountryOfBirth: null,
poleEmploiId: null,
poleEmploiDpt: null,
codeCityOfBirth: null,
firstName2: null,
firstName3: null,
nameCountryOfBirth: null,
poleEmploiRegionCode: null,
readOnly: false,
cdcCompliant: false,
},
state: 'accepted',
attendeeState: 'serviceDoneNotDeclared',
billingState: 'notBillable',
externalId: '12345678901234',
billId: null,
billNumber: null,
amountHtNet: null,
amountToInvoice: null,
amountCGU: null,
amountTtc: null,
amountHt: null,
vatHtAmount5: null,
vatAmount5: null,
vatHtAmount20: null,
vatAmount20: null,
history: {
serviceDoneDeclaredAttendeeDate: null,
billedDate: null,
paidDate: null,
acceptedDate: '2024-06-16T14:26:51.000Z',
rejectedWithoutTitulaireSuiteDate: null,
validatedDate: null,
inTrainingDate: null,
terminatedDate: null,
notProcessedDate: '2024-06-16T14:26:51.000Z',
refusedByAttendeeDate: null,
refusedByOrganismDate: null,
refusedByFinancerDate: null,
canceledByAttendeeDate: null,
canceledByOrganismDate: null,
serviceDoneDeclaredDate: null,
serviceDoneValidatedDate: null,
canceledByAttendeeNotRealizedDate: null,
canceledByFinancerDate: null,
inControlDate: null,
releasedDate: null,
completionRateLastUpdate: null,
},
files: [],
notes: '',
description: '',
completionRate: null,
controlState: 'notInControl',
createdOn: '2024-03-15T14:26:51.000Z',
updatedOn: '2024-06-26T09:42:40.642Z',
_links: {
self: {
href: '/api/registrationFolders/12345678901234',
},
validate: {
href: '/api/registrationFolders/12345678901234/validate',
},
inTraining: {
href: '/api/registrationFolders/12345678901234/inTraining',
},
terminate: {
href: '/api/registrationFolders/12345678901234/terminate',
},
serviceDone: {
href: '/api/registrationFolders/12345678901234/serviceDone',
},
refuse: {
href: '/api/registrationFolders/12345678901234/refuse',
},
cancel: {
href: '/api/registrationFolders/12345678901234/cancel',
},
billing: {
href: '/api/registrationFolders/12345678901234/billing',
},
session: {
href: '/api/sessions/titre_action',
},
organism: {
href: '/api/organisms/12345678901234',
name: 'Organism',
siret: '12345678901234',
},
payments: {
href: '/api/payments?registrationFolderId=12345678901234',
},
trainingAction: {
href: '/api/trainingActions/titre_action',
},
certification: {
href: '/api/certifications/112713',
name: 'Gérer des projets avec la méthode Agile',
certifInfo: '112713',
externalId: 'RS5695',
id: 2,
enabled: true,
},
activities: {
href: '/api/activities/RegistrationFolder/12345678901234',
},
},
tags: [],
trainingActionInfo: {
vat: null,
title: 'Titre formation',
address: {
id: null,
},
content: 'string',
sessionId: 'Titre session',
totalExcl: 1075,
totalIncl: 1290,
quitReason: null,
vatExclTax5: null,
vatInclTax5: null,
externalLink: '',
trainingGoal: 'string',
vatExclTax20: 1075,
vatInclTax20: 1290,
trainingPaces: ['3', '1', '5'],
additionalFees: 0,
expectedResult: 'string',
sessionEndDate: '2024-03-29T00:00:00.000Z',
weeklyDuration: 14,
sessionStartDate: '2024-03-28T00:00:00.000Z',
indicativeDuration: 14,
teachingModalities: '2',
trainingCompletionRate: null,
externalId: '53222292400039_scrum-online-action-v2',
trainingActionId: '53222292400039_scrum-online-v2/titre_action',
},
externalLink: '',
},
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
const flows = await context.flows.list();
const flow = flows.data.find(
(flow) => flow.id === context.flows.current.id
);
const name = `<a href="${context.webhookUrl
.split('/')
.slice(0, 3)
.join('/')}/projects/${context.project.id}/flows/${
context.flows.current.id
}">${flow?.version.displayName}</a>`;
await wedofCommon.handleWebhookSubscription(
['registrationFolder.updated'],
context,
name
);
},
async onDisable(context) {
const id = await context.store.get('_webhookId');
if (id !== null && id !== undefined) {
await wedofCommon.unsubscribeWebhook(
id as string,
context.auth.secret_text
);
await context.store.delete('_webhookId');
}
},
async run(context) {
return [context.payload.body];
},
});