signUp
Inscription de l'utilisateur (❗️Pour les fournisseurs avec activation de l'utilisateur, un code d'activation est envoyé par le biais de la méthode de notification utilisateur correspondante)
Description
La méthode accepte le corps comme paramètre. Elle renvoie une promesse qui se résout en un objet ISignUpEntity.
AuthProvider.signUp(
marker*,
body*,
formIdentifier*,
langCode,
formData
);
Schéma des paramètres
Schéma
marker(required): string
L'identifiant textuel du fournisseur d'autorisation
exemple: "email"
body(required): ISignUpData
Corps de la requête
exemple:
{
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Nom"
}
],
"notificationData": {
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
}
body.formIdentifier(required): string
L'identifiant du formulaire d'inscription.
exemple: "reg"
body.langCode: string
Code de langue. Par défaut "en_US".
body.formData(required): IAuthFormData | IAuthFormData[]
Les données du formulaire pour l'inscription, qui peuvent être un seul objet ou un tableau d'objets.
exemple:
{
"marker": "last_name",
"type": "string",
"value": "Nom"
}
formData.marker(required): string
Un identifiant unique pour le champ du formulaire.
exemple: "email"
formData.type(required): string
Le type du champ du formulaire, tel que 'string', 'email', etc.
exemple: "string"
formData.value(required): string
La valeur saisie dans le champ du formulaire.
exemple: "example@oneentry.cloud"
body.notificationData(required): Object
Un objet contenant les données de notification, y compris email, phonePush et phoneSMS.
exemple:
{
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
langCode: string
Code de langue. Par défaut : "en_US"
exemple: "en_US"
Exemples
Exemple minimal
const body = {
"formIdentifier": "reg","authData": [{
"marker": "login","value": "example@oneentry.cloud"},{
"marker": "password","value":"12345"}],"formData": [{
"marker": "last_name","type": "string","value": "Nom"}],"notificationData": {
"email": "example@oneentry.cloud","phonePush": ["+99999999999"],"phoneSMS": "+99999999999"}};
const response = await AuthProvider.signUp('email', body)
Exemple avec des attributs de types simples formData "string", "integer", "float".
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Fyodor Ivanov"
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec des attributs de types "date", "dateTime", "time"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "birthday",
"type": "date",
"value": {
"fullDate": "2024-05-07T21:02:00.000Z",
"formattedValue": "08-05-2024 00:02",
"formatString": "DD-MM-YYYY HH:mm"
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec un attribut de type "text"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "text",
"value": {
"htmlValue": "<p>C'est moi</p>",
"plainValue": "",
"params": {
"isEditorDisabled": false,
"isImageCompressed": true
}
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec un attribut de type "textWithHeader"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "textWithHeader",
"value": {
"header": "En-tête",
"htmlValue": "<p>C'est moi</p>",
"plainValue": "",
"params": {
"isEditorDisabled": false,
"isImageCompressed": true
}
}
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec des attributs de type "image" et "groupOfImages"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "avatar",
"type": "image",
"value": [
{
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"downloadLink": "http://my-site.zone/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"size": 392585,
"previewLink": "",
"params": {
"isImageCompressed": true
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec un attribut de type "file"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "picture",
"type": "file",
"value": [
{
"filename": "files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"downloadLink": "http://my-site.zone/cloud-static/files/project/page/10/image/Screenshot-from-2024-05-02-15-23-14.png",
"size": 392585
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec des attributs de type "radioButton" et "list"
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "rouge",
"value": "1",
"extended": {
"value": "rouge",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec un attribut de type "entity" (liste imbriquée)
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "entity-selector",
"type": "entity",
"value": [
{
"id": "1",
"title": "rouge",
"value": "1",
"parentId": "null"
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
}
Exemple avec un identifiant push
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "rouge",
"value": "1",
"extended": {
"value": "rouge",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [
"7DD987F846400079F4B03C058365A4869047B4A0."
],
"phoneSMS": "+19991234567"
}
}
Exemple avec plusieurs identifiants push
{
"formIdentifier": "reg",
"langCode": "en_US",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "selector",
"type": "list",
"value": [
{
"title": "rouge",
"value": "1",
"extended": {
"value": "rouge",
"type": "string"
}
}
]
}
],
"notificationData": {
"email": "test@test.zone",
"phonePush": [
"7DD987F846400079F4B03C058365A4869047B4A0",
"7DD987F846400079F4B03C058365A4869047B4A0",
"7DD987F846400079F4B03C058365A4869047B4A0."
],
"phoneSMS": "+19991234567"
}
}
Schéma
formIdentifier: string
identifiant textuel du formulaire du fournisseur d'autorisation
exemple: reg_form
formData:
données du formulaire attachées au fournisseur d'autorisation
authData:
données d'autorisation prises dans le formulaire attaché au fournisseur d'autorisation
exemple:
[
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]
notificationData:
données de notification utilisateur
attributeSetId: number
identifiant pour l'ensemble d'attributs utilisé
exemple: 7
formData: FormDataLangType
Données soumises par le formulaire
exemple:
{
"en_US": [
{
"marker": "marker_1",
"value": "Nom"
}
]
}
notificationData: UserNotificationDataType
données pour notifier l'utilisateur
exemple:
{
"email": "test@test.zone",
"phonePush": "", "phoneSMS": "+19991234567"
}
systemCode: string
code système pour effectuer des actions officielles (réinitialisation de mot de passe, activation)
exemple:
{
"value": "90BDCX",
"expiredDate": "2024-05-07T21:02:00.000Z"
}
formIdentifier: string
l'identifiant textuel du formulaire du fournisseur d'autorisation
exemple: reg_form
authData: FormAuthDataType
données d'autorisation prises dans le formulaire lié au fournisseur d'autorisation
exemple:
[
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
]
authProviderId: number
ID du fournisseur d'autorisation
exemple: 1
Cette méthode enregistrera un nouvel utilisateur. Renvoie l'objet de l'utilisateur enregistré.
Exemple de réponse
{
"id": 1764,
"updatedDate": "2024-05-23T12:43:00.169Z",
"version": 10,
"identifier": "catalog",
"isActive": false,
"authProviderId": 1,
"formData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "f-name",
"value": "Nom de famille"
}
],
"notificationData": {
"email": "test@test.com",
"phonePush": ["+999999999"],
"phoneSMS": "+9999999999"
},
"systemCode": {
"value": "90BDCX",
"expiredDate": "2024-05-07T21:02:00.000Z"
}
}
Schéma de réponse
Schéma: ISignUpEntity
id: number
L'identifiant unique de l'entité d'inscription.
exemple: 12345
updatedDate: string
La date à laquelle l'entité d'inscription a été mise à jour pour la dernière fois.
exemple: "2023-10-01T12:00:00Z"
version: number
Le numéro de version de l'entité d'inscription.
exemple: 1
identifier: string
Une chaîne unique qui identifie l'entité d'inscription.
exemple: "signup_12345"
isActive: boolean
Indique si l'entité d'inscription est active.
exemple: true
notificationData: Object
Un objet contenant les données de notification, y compris email, phonePush et phoneSMS.
exemple:
{
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
locale: string
Le code de langue ou la locale associée à l'entité d'inscription.
exemple: "en_US"