diff --git a/apps/rd-station-252023.v1.zip b/apps/rd-station-252023.v1.zip deleted file mode 100644 index 24aed58..0000000 Binary files a/apps/rd-station-252023.v1.zip and /dev/null differ diff --git a/apps/rd-station-252023/connections/rd-station-2520232/metadata.json b/apps/rd-station-252023/connections/rd-station-2520232/metadata.json index bd31f70..cdd9486 100644 --- a/apps/rd-station-252023/connections/rd-station-2520232/metadata.json +++ b/apps/rd-station-252023/connections/rd-station-2520232/metadata.json @@ -1,5 +1,5 @@ { "name": "rd-station-2520232", - "label": "RD Station - API Key", + "label": "RD Station - API Key (Not Tested / Not Used in Any Module)", "type": "basic" } \ No newline at end of file diff --git a/apps/rd-station-252023/functions/getExpectContact/code.js b/apps/rd-station-252023/functions/getExpectContact/code.js index 5f0457a..e7d4bcd 100644 --- a/apps/rd-station-252023/functions/getExpectContact/code.js +++ b/apps/rd-station-252023/functions/getExpectContact/code.js @@ -1,14 +1,16 @@ -function getExpectContact(fields, type) { +function getExpectContact(fields, type, origin) { - function getExpect(input, typ) { + function getExpect(input, typ, ori) { var results = [] if (typ == 'interface') {results.push({"name": "uuid","label": "UUID","type": "text"})} - if (typ == 'expect') {} + if (typ == 'expect' || typ == 'expect-with-email') {} + input //.filter(f => {return true}) - .sort(function (a, b) { return a.uuid < b.uuid ? -1 : a.uuid > b.uuid ? 1 : 0 }) + .sort(function(a,b) { if (a.label.default > b.label.default) { return 1 } if (a.label.default < b.label.default) { return -1 } return 0 }) + //.sort(function (a, b) { return a.custom_field = false ? 1 : b.custom_field == false ? 1 : 0 }) .forEach(f => { const data = { name: f.api_identifier, label: f.label.default, type: 'text'} switch (f.data_type) { @@ -27,16 +29,13 @@ function getExpectContact(fields, type) { case 'TEXT_INPUT': { break } - case 'EMAIL_INPUT': { - data.type = 'email' + case 'EMAIL_INPUT': { data.type = 'email' break } - case 'PHONE_INPUT': { - data.type = 'text' + case 'PHONE_INPUT': { data.type = 'text' break } - case 'URL_INPUT': { - data.type = 'url' + case 'URL_INPUT': { data.type = 'url' break } case 'RADIO_BUTTON': { @@ -83,7 +82,14 @@ function getExpectContact(fields, type) { } case 'INTEGER': { // presentation_type: 'NUMBER_INPUT' - data.type = 'number' + switch (ori) { + /** /platform/contacts Expect the value to be integer (outside double quotes) + /platform/events Expect the value inside double quotes (string) */ + case 'contacts': data.type = 'integer' + break + case 'events': data.type = 'text' + break + } } } results.push(data) @@ -95,9 +101,9 @@ function getExpectContact(fields, type) { {"name": "status","label": "Status","type": "text","help": "Can be empty when `Category` is `data_processing` or pay attention to the fact that when `Category` is `data_processing` the only accepted value for `Status` is `granted`."}]} } ) - if (typ == 'expect') { results = results.filter(function(el) {return (el.name !== 'email')}) } + if (typ == 'expect') { results = results.filter(function(el) {return (el.name !== 'email') }) } return results } - if (Array.isArray(fields) && fields.length) { return getExpect(fields, type) } else { return {} } + if (Array.isArray(fields) && fields.length) { return getExpect(fields, type, origin) } else { return {} } } \ No newline at end of file diff --git a/apps/rd-station-252023/functions/getExpectContact/test.js b/apps/rd-station-252023/functions/getExpectContact/test.js index 871cf5d..86fdb89 100644 --- a/apps/rd-station-252023/functions/getExpectContact/test.js +++ b/apps/rd-station-252023/functions/getExpectContact/test.js @@ -1,1058 +1,13 @@ -it('1 ', () => { - let result = getExpectContact([ - - { - "uuid": "fdeba6ec-f1cf-4b13-b2ea-e93d47c0d828", - "label": { - "en-UD": "crwdns1510942:0crwdne1510942:0", - "en-US": "Name", - "es-ES": "Nombre", - "pt-BR": "Nome", - "default": "Nome" - }, - "name": { - "en-UD": "crwdns1510944:0crwdne1510944:0", - "en-US": "name", - "es-ES": "nombre", - "pt-BR": "nome", - "default": "nome" - }, - "api_identifier": "name", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "f0a3dd8a-f044-432c-a1ce-1bb559d6edf4", - "label": { - "en-UD": "crwdns1510946:0crwdne1510946:0", - "en-US": "Email", - "es-ES": "Email", - "pt-BR": "Email", - "default": "Email" - }, - "name": { - "en-UD": "crwdns1510948:0crwdne1510948:0", - "en-US": "email", - "es-ES": "email", - "pt-BR": "email", - "default": "email" - }, - "api_identifier": "email", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - } - ] - , 'expect'); - assert.deepEqual(result, {}); +it('first ', () => { + let result = getExpectContact( + [{"uuid":"fdeba6ec-f1cf-4b13-b2ea-e93d47c0d828","label":{"en-UD":"crwdns1510942:0crwdne1510942:0","en-US":"Name","es-ES":"Nombre","pt-BR":"Nome","default":"Nome"},"name":{"en-UD":"crwdns1510944:0crwdne1510944:0","en-US":"name","es-ES":"nombre","pt-BR":"nome","default":"nome"},"api_identifier":"name","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"f0a3dd8a-f044-432c-a1ce-1bb559d6edf4","label":{"en-UD":"crwdns1510946:0crwdne1510946:0","en-US":"Email","es-ES":"Email","pt-BR":"Email","default":"Email"},"name":{"en-UD":"crwdns1510948:0crwdne1510948:0","en-US":"email","es-ES":"email","pt-BR":"email","default":"email"},"api_identifier":"email","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"}] + , 'expect', 'contacts'); + assert.deepEqual(result, [{ "name": "name", "label": "Nome", "type": "text" }, { "name": "extra_emails", "label": "Extra Emails", "type": "array", "spec": { "type": "text" } }, { "name": "legal_bases", "label": "Legal Bases", "type": "array", "spec": { "type": "collection", "spec": [{ "name": "category", "label": "Category", "type": "select", "options": [{ "label": "data_processing", "value": "data_processing" }, { "label": "communications", "value": "communications" }] }, { "name": "type", "label": "Type", "type": "select", "options": [{ "label": "pre_existent_contract", "value": "pre_existent_contract" }, { "label": "consent", "value": "consent" }, { "label": "legitimate_interest", "value": "legitimate_interest" }, { "label": "judicial_process", "value": "judicial_process" }, { "label": "vital_interest", "value": "vital_interest" }, { "label": "public_interest", "value": "public_interest" }] }, { "name": "status", "label": "Status", "type": "text", "help": "Can be empty when `Category` is `data_processing` or pay attention to the fact that when `Category` is `data_processing` the only accepted value for `Status` is `granted`." }] } }]); }); -it('1 ', () => { - let result = getExpectContact([ - { - "uuid": "059ea2d6-39bc-4557-93e4-f393a23f4b96", - "label": { - "en-UD": "crwdns1510954:0crwdne1510954:0", - "en-US": "Mobile", - "es-ES": "Teléfono Celular", - "pt-BR": "Celular", - "default": "Celular" - }, - "name": { - "en-UD": "crwdns1510956:0crwdne1510956:0", - "en-US": "mobile", - "es-ES": "teléfono celular", - "pt-BR": "celular", - "default": "celular" - }, - "api_identifier": "mobile_phone", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "cdf28cd9-e387-4e42-84e6-e33e87d0c581", - "label": { - "en-UD": "crwdns1545676:0crwdne1545676:0", - "en-US": "Country", - "es-ES": "País", - "pt-BR": "País", - "default": "País" - }, - "name": { - "en-UD": "crwdns1545678:0crwdne1545678:0", - "en-US": "country", - "es-ES": "país", - "pt-BR": "país", - "default": "país" - }, - "api_identifier": "country", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "e978fe0a-50ed-4384-aa71-5bbf52f20485", - "label": { - "en-UD": "crwdns1510950:0crwdne1510950:0", - "en-US": "Job title", - "es-ES": "Cargo", - "pt-BR": "Cargo", - "default": "Cargo" - }, - "name": { - "en-UD": "crwdns1510952:0crwdne1510952:0", - "en-US": "job title", - "es-ES": "cargo", - "pt-BR": "cargo", - "default": "cargo" - }, - "api_identifier": "job_title", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "592ffdf6-4a4a-4b9f-9539-f88e9f832203", - "label": { - "en-UD": "crwdns1545664:0crwdne1545664:0", - "en-US": "LinkedIn", - "es-ES": "Linkedin", - "pt-BR": "Linkedin", - "default": "Linkedin" - }, - "name": { - "en-UD": "crwdns1545666:0crwdne1545666:0", - "en-US": "linkedin", - "es-ES": "Linkedin", - "pt-BR": "linkedin", - "default": "linkedin" - }, - "api_identifier": "linkedin", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "f3f2f760-535b-44d4-97ad-9fcc924bfa77", - "label": { - "en-UD": "crwdns1545644:0crwdne1545644:0", - "en-US": "Phone", - "es-ES": "Teléfono", - "pt-BR": "Telefone", - "default": "Telefone" - }, - "name": { - "en-UD": "crwdns1545646:0crwdne1545646:0", - "en-US": "phone", - "es-ES": "teléfono", - "pt-BR": "telefone", - "default": "telefone" - }, - "api_identifier": "personal_phone", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "290e963c-389f-4368-91c8-e3c1d71b8764", - "label": { - "en-UD": "crwdns1545660:0crwdne1545660:0", - "en-US": "Facebook", - "es-ES": "Facebook", - "pt-BR": "Facebook", - "default": "Facebook" - }, - "name": { - "en-UD": "crwdns1545662:0crwdne1545662:0", - "en-US": "facebook", - "es-ES": "facebook", - "pt-BR": "facebook", - "default": "facebook" - }, - "api_identifier": "facebook", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "fdeba6ec-f1cf-4b13-b2ea-e93d47c0d828", - "label": { - "en-UD": "crwdns1510942:0crwdne1510942:0", - "en-US": "Name", - "es-ES": "Nombre", - "pt-BR": "Nome", - "default": "Nome" - }, - "name": { - "en-UD": "crwdns1510944:0crwdne1510944:0", - "en-US": "name", - "es-ES": "nombre", - "pt-BR": "nome", - "default": "nome" - }, - "api_identifier": "name", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "f0a3dd8a-f044-432c-a1ce-1bb559d6edf4", - "label": { - "en-UD": "crwdns1510946:0crwdne1510946:0", - "en-US": "Email", - "es-ES": "Email", - "pt-BR": "Email", - "default": "Email" - }, - "name": { - "en-UD": "crwdns1510948:0crwdne1510948:0", - "en-US": "email", - "es-ES": "email", - "pt-BR": "email", - "default": "email" - }, - "api_identifier": "email", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "ff720b63-8f20-42a5-aa00-bb0ce50388be", - "label": { - "en-UD": "crwdns1545700:0crwdne1545700:0", - "en-US": "Tags", - "es-ES": "Tags", - "pt-BR": "Tags", - "default": "Tags" - }, - "name": { - "en-UD": "crwdns1545702:0crwdne1545702:0", - "en-US": "Tags", - "es-ES": "Tags", - "pt-BR": "Tags", - "default": "Tags" - }, - "api_identifier": "tags", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "SET" - }, - { - "uuid": "55ac8223-9c31-4db1-98f8-9879c44efb2e", - "label": { - "en-UD": "crwdns1545652:0crwdne1545652:0", - "en-US": "Bio", - "es-ES": "Biografía", - "pt-BR": "Biografia", - "default": "Biografia" - }, - "name": { - "en-UD": "crwdns1545654:0crwdne1545654:0", - "en-US": "bio", - "es-ES": "biografía", - "pt-BR": "biografia", - "default": "biografia" - }, - "api_identifier": "bio", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "9bfa0d04-ede1-4f6b-8f66-f4aa7ccda1ec", - "label": { - "en-UD": "crwdns1545672:0crwdne1545672:0", - "en-US": "State", - "es-ES": "Estado", - "pt-BR": "Estado", - "default": "Estado" - }, - "name": { - "en-UD": "crwdns1545674:0crwdne1545674:0", - "en-US": "state", - "es-ES": "estado", - "pt-BR": "estado", - "default": "estado" - }, - "api_identifier": "state", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "9aad7414-b90a-48e3-9d20-90fd33820dbf", - "label": { - "en-UD": "crwdns1545668:0crwdne1545668:0", - "en-US": "Website", - "es-ES": "Website", - "pt-BR": "Website", - "default": "Website" - }, - "name": { - "en-UD": "crwdns1545670:0crwdne1545670:0", - "en-US": "website", - "es-ES": "website", - "pt-BR": "website", - "default": "website" - }, - "api_identifier": "website", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "29a2f7d0-5dc6-4466-9af7-bd9bf4244d84", - "label": { - "en-UD": "crwdns1545656:0crwdne1545656:0", - "en-US": "Twitter", - "es-ES": "Twitter", - "pt-BR": "Twitter", - "default": "Twitter" - }, - "name": { - "en-UD": "crwdns1545658:0crwdne1545658:0", - "en-US": "twitter", - "es-ES": "twitter", - "pt-BR": "twitter", - "default": "twitter" - }, - "api_identifier": "twitter", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "25ebfce7-8ecd-4847-8057-9ac21d20b784", - "label": { - "en-UD": "crwdns1545648:0crwdne1545648:0", - "en-US": "City", - "es-ES": "Ciudad", - "pt-BR": "Cidade", - "default": "Cidade" - }, - "name": { - "en-UD": "crwdns1545650:0crwdne1545650:0", - "en-US": "city", - "es-ES": "ciudad", - "pt-BR": "cidade", - "default": "cidade" - }, - "api_identifier": "city", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "1644ad41-71be-4ccd-a861-0d957b66c298", - "label": { - "pt-BR": "Checkbox", - "default": "Checkbox" - }, - "name": { - "pt-BR": "checkbox", - "default": "checkbox" - }, - "api_identifier": "cf_checkbox", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "CHECK_BOX", - "data_type": "BOOLEAN" - }, - { - "uuid": "6c0d1a6c-b5ec-4c02-8a11-d60e3e770285", - "label": { - "pt-BR": "CRN (Registro do Conselho Regional de Nutricionistas)", - "default": "CRN (Registro do Conselho Regional de Nutricionistas)" - }, - "name": { - "pt-BR": "crn", - "default": "crn" - }, - "api_identifier": "cf_crn", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "84d057b1-d83d-414e-b146-00f95fe2ef20", - "label": { - "pt-BR": "Large Text", - "default": "Large Text" - }, - "name": { - "pt-BR": "large_text", - "default": "large_text" - }, - "api_identifier": "cf_large_text", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "TEXT_AREA", - "data_type": "STRING" - }, - { - "uuid": "f9cd83e0-8bad-460f-90b2-82e0912d465c", - "label": { - "pt-BR": "url", - "default": "url" - }, - "name": { - "pt-BR": "url_f", - "default": "url_f" - }, - "api_identifier": "cf_url_f", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "URL_INPUT", - "data_type": "STRING" - }, - { - "uuid": "d2f67454-c194-4681-94d7-7c1ec855ada2", - "label": { - "pt-BR": "phone", - "default": "phone" - }, - "name": { - "pt-BR": "phone_X", - "default": "phone_X" - }, - "api_identifier": "cf_phone_x", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "PHONE_INPUT", - "data_type": "STRING" - }, - { - "uuid": "2cf7269d-cca6-4bdd-b65f-ba29b0209f23", - "label": { - "pt-BR": "email", - "default": "email" - }, - "name": { - "pt-BR": "email_nf", - "default": "email_nf" - }, - "api_identifier": "cf_email_nf", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "EMAIL_INPUT", - "data_type": "STRING" - }, - { - "uuid": "06464336-24af-4b39-8bea-0240e3ef223b", - "label": { - "pt-BR": "Number", - "default": "Number" - }, - "name": { - "pt-BR": "number", - "default": "number" - }, - "api_identifier": "cf_number", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "NUMBER_INPUT", - "data_type": "INTEGER" - }, - { - "uuid": "9c7076e7-a137-4a90-929c-cea5c1cf5ef8", - "label": { - "pt-BR": "Single Choice", - "default": "Single Choice" - }, - "name": { - "pt-BR": "single_choice", - "default": "single_choice" - }, - "api_identifier": "cf_single_choice", - "custom_field": true, - "validation_rules": { - "valid_options": [ - { - "value": "1", - "label": { - "pt-BR": "1", - "default": "1" - } - }, - { - "value": "2", - "label": { - "pt-BR": "2", - "default": "2" - } - }, - { - "value": "3", - "label": { - "pt-BR": "3", - "default": "3" - } - } - ] - }, - "presentation_type": "RADIO_BUTTON", - "data_type": "STRING" - }, - { - "uuid": "30096c4e-6a98-4f50-b4ff-20a53c4841a5", - "label": { - "pt-BR": "Birthday", - "default": "Birthday" - }, - "name": { - "pt-BR": "birthday", - "default": "birthday" - }, - "api_identifier": "cf_birthday", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "e5913955-5895-4d10-b28d-12e2e343e4c0", - "label": { - "pt-BR": "Multichoice", - "default": "Multichoice" - }, - "name": { - "pt-BR": "multiple_choice_test", - "default": "multiple_choice_test" - }, - "api_identifier": "cf_cf_multiple_choice_test", - "custom_field": true, - "validation_rules": { - "valid_options": [ - { - "value": "1", - "label": { - "pt-BR": "1", - "default": "1" - } - }, - { - "value": "2", - "label": { - "pt-BR": "2", - "default": "2" - } - }, - { - "value": "3", - "label": { - "pt-BR": "3", - "default": "3" - } - } - ] - }, - "presentation_type": "MULTIPLE_CHOICE", - "data_type": "STRING[]" - }, - { - "uuid": "dde0cb2d-f34b-42d7-9e4e-3bee78600187", - "label": { - "pt-BR": "Combobox", - "default": "Combobox" - }, - "name": { - "pt-BR": "comboxbox_test", - "default": "comboxbox_test" - }, - "api_identifier": "cf_cf_comboxbox_test", - "custom_field": true, - "validation_rules": { - "valid_options": [ - { - "value": "1", - "label": { - "pt-BR": "1", - "default": "1" - } - }, - { - "value": "2", - "label": { - "pt-BR": "2", - "default": "2" - } - }, - { - "value": "3", - "label": { - "pt-BR": "3", - "default": "3" - } - } - ] - }, - "presentation_type": "COMBO_BOX", - "data_type": "STRING" - } - ] - , 'expect'); - assert.deepEqual(result, {}); -}); -/** - -{ - "fields": [ - { - "uuid": "fdeba6ec-f1cf-4b13-b2ea-e93d47c0d828", - "label": { - "en-UD": "crwdns1510942:0crwdne1510942:0", - "en-US": "Name", - "es-ES": "Nombre", - "pt-BR": "Nome", - "default": "Nome" - }, - "name": { - "en-UD": "crwdns1510944:0crwdne1510944:0", - "en-US": "name", - "es-ES": "nombre", - "pt-BR": "nome", - "default": "nome" - }, - "api_identifier": "name", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "55ac8223-9c31-4db1-98f8-9879c44efb2e", - "label": { - "en-UD": "crwdns1545652:0crwdne1545652:0", - "en-US": "Bio", - "es-ES": "Biografía", - "pt-BR": "Biografia", - "default": "Biografia" - }, - "name": { - "en-UD": "crwdns1545654:0crwdne1545654:0", - "en-US": "bio", - "es-ES": "biografía", - "pt-BR": "biografia", - "default": "biografia" - }, - "api_identifier": "bio", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "f3f2f760-535b-44d4-97ad-9fcc924bfa77", - "label": { - "en-UD": "crwdns1545644:0crwdne1545644:0", - "en-US": "Phone", - "es-ES": "Teléfono", - "pt-BR": "Telefone", - "default": "Telefone" - }, - "name": { - "en-UD": "crwdns1545646:0crwdne1545646:0", - "en-US": "phone", - "es-ES": "teléfono", - "pt-BR": "telefone", - "default": "telefone" - }, - "api_identifier": "personal_phone", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "29a2f7d0-5dc6-4466-9af7-bd9bf4244d84", - "label": { - "en-UD": "crwdns1545656:0crwdne1545656:0", - "en-US": "Twitter", - "es-ES": "Twitter", - "pt-BR": "Twitter", - "default": "Twitter" - }, - "name": { - "en-UD": "crwdns1545658:0crwdne1545658:0", - "en-US": "twitter", - "es-ES": "twitter", - "pt-BR": "twitter", - "default": "twitter" - }, - "api_identifier": "twitter", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "9bfa0d04-ede1-4f6b-8f66-f4aa7ccda1ec", - "label": { - "en-UD": "crwdns1545672:0crwdne1545672:0", - "en-US": "State", - "es-ES": "Estado", - "pt-BR": "Estado", - "default": "Estado" - }, - "name": { - "en-UD": "crwdns1545674:0crwdne1545674:0", - "en-US": "state", - "es-ES": "estado", - "pt-BR": "estado", - "default": "estado" - }, - "api_identifier": "state", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "f0a3dd8a-f044-432c-a1ce-1bb559d6edf4", - "label": { - "en-UD": "crwdns1510946:0crwdne1510946:0", - "en-US": "Email", - "es-ES": "Email", - "pt-BR": "Email", - "default": "Email" - }, - "name": { - "en-UD": "crwdns1510948:0crwdne1510948:0", - "en-US": "email", - "es-ES": "email", - "pt-BR": "email", - "default": "email" - }, - "api_identifier": "email", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "25ebfce7-8ecd-4847-8057-9ac21d20b784", - "label": { - "en-UD": "crwdns1545648:0crwdne1545648:0", - "en-US": "City", - "es-ES": "Ciudad", - "pt-BR": "Cidade", - "default": "Cidade" - }, - "name": { - "en-UD": "crwdns1545650:0crwdne1545650:0", - "en-US": "city", - "es-ES": "ciudad", - "pt-BR": "cidade", - "default": "cidade" - }, - "api_identifier": "city", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "ff720b63-8f20-42a5-aa00-bb0ce50388be", - "label": { - "en-UD": "crwdns1545700:0crwdne1545700:0", - "en-US": "Tags", - "es-ES": "Tags", - "pt-BR": "Tags", - "default": "Tags" - }, - "name": { - "en-UD": "crwdns1545702:0crwdne1545702:0", - "en-US": "Tags", - "es-ES": "Tags", - "pt-BR": "Tags", - "default": "Tags" - }, - "api_identifier": "tags", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "SET" - }, - { - "uuid": "cdf28cd9-e387-4e42-84e6-e33e87d0c581", - "label": { - "en-UD": "crwdns1545676:0crwdne1545676:0", - "en-US": "Country", - "es-ES": "País", - "pt-BR": "País", - "default": "País" - }, - "name": { - "en-UD": "crwdns1545678:0crwdne1545678:0", - "en-US": "country", - "es-ES": "país", - "pt-BR": "país", - "default": "país" - }, - "api_identifier": "country", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "059ea2d6-39bc-4557-93e4-f393a23f4b96", - "label": { - "en-UD": "crwdns1510954:0crwdne1510954:0", - "en-US": "Mobile", - "es-ES": "Teléfono Celular", - "pt-BR": "Celular", - "default": "Celular" - }, - "name": { - "en-UD": "crwdns1510956:0crwdne1510956:0", - "en-US": "mobile", - "es-ES": "teléfono celular", - "pt-BR": "celular", - "default": "celular" - }, - "api_identifier": "mobile_phone", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "e978fe0a-50ed-4384-aa71-5bbf52f20485", - "label": { - "en-UD": "crwdns1510950:0crwdne1510950:0", - "en-US": "Job title", - "es-ES": "Cargo", - "pt-BR": "Cargo", - "default": "Cargo" - }, - "name": { - "en-UD": "crwdns1510952:0crwdne1510952:0", - "en-US": "job title", - "es-ES": "cargo", - "pt-BR": "cargo", - "default": "cargo" - }, - "api_identifier": "job_title", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "9aad7414-b90a-48e3-9d20-90fd33820dbf", - "label": { - "en-UD": "crwdns1545668:0crwdne1545668:0", - "en-US": "Website", - "es-ES": "Website", - "pt-BR": "Website", - "default": "Website" - }, - "name": { - "en-UD": "crwdns1545670:0crwdne1545670:0", - "en-US": "website", - "es-ES": "website", - "pt-BR": "website", - "default": "website" - }, - "api_identifier": "website", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "290e963c-389f-4368-91c8-e3c1d71b8764", - "label": { - "en-UD": "crwdns1545660:0crwdne1545660:0", - "en-US": "Facebook", - "es-ES": "Facebook", - "pt-BR": "Facebook", - "default": "Facebook" - }, - "name": { - "en-UD": "crwdns1545662:0crwdne1545662:0", - "en-US": "facebook", - "es-ES": "facebook", - "pt-BR": "facebook", - "default": "facebook" - }, - "api_identifier": "facebook", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "592ffdf6-4a4a-4b9f-9539-f88e9f832203", - "label": { - "en-UD": "crwdns1545664:0crwdne1545664:0", - "en-US": "LinkedIn", - "es-ES": "Linkedin", - "pt-BR": "Linkedin", - "default": "Linkedin" - }, - "name": { - "en-UD": "crwdns1545666:0crwdne1545666:0", - "en-US": "linkedin", - "es-ES": "Linkedin", - "pt-BR": "linkedin", - "default": "linkedin" - }, - "api_identifier": "linkedin", - "custom_field": false, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "1644ad41-71be-4ccd-a861-0d957b66c298", - "label": { - "pt-BR": "Checkbox", - "default": "Checkbox" - }, - "name": { - "pt-BR": "checkbox", - "default": "checkbox" - }, - "api_identifier": "cf_checkbox", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "CHECK_BOX", - "data_type": "BOOLEAN" - }, - { - "uuid": "6c0d1a6c-b5ec-4c02-8a11-d60e3e770285", - "label": { - "pt-BR": "CRN (Registro do Conselho Regional de Nutricionistas)", - "default": "CRN (Registro do Conselho Regional de Nutricionistas)" - }, - "name": { - "pt-BR": "crn", - "default": "crn" - }, - "api_identifier": "cf_crn", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "dde0cb2d-f34b-42d7-9e4e-3bee78600187", - "label": { - "pt-BR": "Combobox", - "default": "Combobox" - }, - "name": { - "pt-BR": "comboxbox_test", - "default": "comboxbox_test" - }, - "api_identifier": "cf_cf_comboxbox_test", - "custom_field": true, - "validation_rules": { - "valid_options": [ - { - "value": "1", - "label": { - "pt-BR": "1", - "default": "1" - } - }, - { - "value": "2", - "label": { - "pt-BR": "2", - "default": "2" - } - }, - { - "value": "3", - "label": { - "pt-BR": "3", - "default": "3" - } - } - ] - }, - "presentation_type": "COMBO_BOX", - "data_type": "STRING" - }, - { - "uuid": "30096c4e-6a98-4f50-b4ff-20a53c4841a5", - "label": { - "pt-BR": "Birthday", - "default": "Birthday" - }, - "name": { - "pt-BR": "birthday", - "default": "birthday" - }, - "api_identifier": "cf_birthday", - "custom_field": true, - "validation_rules": {}, - "presentation_type": "TEXT_INPUT", - "data_type": "STRING" - }, - { - "uuid": "e5913955-5895-4d10-b28d-12e2e343e4c0", - "label": { - "pt-BR": "Multichoice", - "default": "Multichoice" - }, - "name": { - "pt-BR": "multiple_choice_test", - "default": "multiple_choice_test" - }, - "api_identifier": "cf_cf_multiple_choice_test", - "custom_field": true, - "validation_rules": { - "valid_options": [ - { - "value": "1", - "label": { - "pt-BR": "1", - "default": "1" - } - }, - { - "value": "2", - "label": { - "pt-BR": "2", - "default": "2" - } - }, - { - "value": "3", - "label": { - "pt-BR": "3", - "default": "3" - } - } - ] - }, - "presentation_type": "MULTIPLE_CHOICE", - "data_type": "STRING[]" - } - ] -} - - */ \ No newline at end of file +it('second ', () => { + let result = getExpectContact( + [{"uuid":"059ea2d6-39bc-4557-93e4-f393a23f4b96","label":{"en-UD":"crwdns1510954:0crwdne1510954:0","en-US":"Mobile","es-ES":"Teléfono Celular","pt-BR":"Celular","default":"Celular"},"name":{"en-UD":"crwdns1510956:0crwdne1510956:0","en-US":"mobile","es-ES":"teléfono celular","pt-BR":"celular","default":"celular"},"api_identifier":"mobile_phone","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"cdf28cd9-e387-4e42-84e6-e33e87d0c581","label":{"en-UD":"crwdns1545676:0crwdne1545676:0","en-US":"Country","es-ES":"País","pt-BR":"País","default":"País"},"name":{"en-UD":"crwdns1545678:0crwdne1545678:0","en-US":"country","es-ES":"país","pt-BR":"país","default":"país"},"api_identifier":"country","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"e978fe0a-50ed-4384-aa71-5bbf52f20485","label":{"en-UD":"crwdns1510950:0crwdne1510950:0","en-US":"Job title","es-ES":"Cargo","pt-BR":"Cargo","default":"Cargo"},"name":{"en-UD":"crwdns1510952:0crwdne1510952:0","en-US":"job title","es-ES":"cargo","pt-BR":"cargo","default":"cargo"},"api_identifier":"job_title","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"592ffdf6-4a4a-4b9f-9539-f88e9f832203","label":{"en-UD":"crwdns1545664:0crwdne1545664:0","en-US":"LinkedIn","es-ES":"Linkedin","pt-BR":"Linkedin","default":"Linkedin"},"name":{"en-UD":"crwdns1545666:0crwdne1545666:0","en-US":"linkedin","es-ES":"Linkedin","pt-BR":"linkedin","default":"linkedin"},"api_identifier":"linkedin","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"f3f2f760-535b-44d4-97ad-9fcc924bfa77","label":{"en-UD":"crwdns1545644:0crwdne1545644:0","en-US":"Phone","es-ES":"Teléfono","pt-BR":"Telefone","default":"Telefone"},"name":{"en-UD":"crwdns1545646:0crwdne1545646:0","en-US":"phone","es-ES":"teléfono","pt-BR":"telefone","default":"telefone"},"api_identifier":"personal_phone","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"290e963c-389f-4368-91c8-e3c1d71b8764","label":{"en-UD":"crwdns1545660:0crwdne1545660:0","en-US":"Facebook","es-ES":"Facebook","pt-BR":"Facebook","default":"Facebook"},"name":{"en-UD":"crwdns1545662:0crwdne1545662:0","en-US":"facebook","es-ES":"facebook","pt-BR":"facebook","default":"facebook"},"api_identifier":"facebook","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"fdeba6ec-f1cf-4b13-b2ea-e93d47c0d828","label":{"en-UD":"crwdns1510942:0crwdne1510942:0","en-US":"Name","es-ES":"Nombre","pt-BR":"Nome","default":"Nome"},"name":{"en-UD":"crwdns1510944:0crwdne1510944:0","en-US":"name","es-ES":"nombre","pt-BR":"nome","default":"nome"},"api_identifier":"name","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"f0a3dd8a-f044-432c-a1ce-1bb559d6edf4","label":{"en-UD":"crwdns1510946:0crwdne1510946:0","en-US":"Email","es-ES":"Email","pt-BR":"Email","default":"Email"},"name":{"en-UD":"crwdns1510948:0crwdne1510948:0","en-US":"email","es-ES":"email","pt-BR":"email","default":"email"},"api_identifier":"email","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"ff720b63-8f20-42a5-aa00-bb0ce50388be","label":{"en-UD":"crwdns1545700:0crwdne1545700:0","en-US":"Tags","es-ES":"Tags","pt-BR":"Tags","default":"Tags"},"name":{"en-UD":"crwdns1545702:0crwdne1545702:0","en-US":"Tags","es-ES":"Tags","pt-BR":"Tags","default":"Tags"},"api_identifier":"tags","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"SET"},{"uuid":"55ac8223-9c31-4db1-98f8-9879c44efb2e","label":{"en-UD":"crwdns1545652:0crwdne1545652:0","en-US":"Bio","es-ES":"Biografía","pt-BR":"Biografia","default":"Biografia"},"name":{"en-UD":"crwdns1545654:0crwdne1545654:0","en-US":"bio","es-ES":"biografía","pt-BR":"biografia","default":"biografia"},"api_identifier":"bio","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"9bfa0d04-ede1-4f6b-8f66-f4aa7ccda1ec","label":{"en-UD":"crwdns1545672:0crwdne1545672:0","en-US":"State","es-ES":"Estado","pt-BR":"Estado","default":"Estado"},"name":{"en-UD":"crwdns1545674:0crwdne1545674:0","en-US":"state","es-ES":"estado","pt-BR":"estado","default":"estado"},"api_identifier":"state","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"9aad7414-b90a-48e3-9d20-90fd33820dbf","label":{"en-UD":"crwdns1545668:0crwdne1545668:0","en-US":"Website","es-ES":"Website","pt-BR":"Website","default":"Website"},"name":{"en-UD":"crwdns1545670:0crwdne1545670:0","en-US":"website","es-ES":"website","pt-BR":"website","default":"website"},"api_identifier":"website","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"29a2f7d0-5dc6-4466-9af7-bd9bf4244d84","label":{"en-UD":"crwdns1545656:0crwdne1545656:0","en-US":"Twitter","es-ES":"Twitter","pt-BR":"Twitter","default":"Twitter"},"name":{"en-UD":"crwdns1545658:0crwdne1545658:0","en-US":"twitter","es-ES":"twitter","pt-BR":"twitter","default":"twitter"},"api_identifier":"twitter","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"25ebfce7-8ecd-4847-8057-9ac21d20b784","label":{"en-UD":"crwdns1545648:0crwdne1545648:0","en-US":"City","es-ES":"Ciudad","pt-BR":"Cidade","default":"Cidade"},"name":{"en-UD":"crwdns1545650:0crwdne1545650:0","en-US":"city","es-ES":"ciudad","pt-BR":"cidade","default":"cidade"},"api_identifier":"city","custom_field":false,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"1644ad41-71be-4ccd-a861-0d957b66c298","label":{"pt-BR":"Checkbox","default":"Checkbox"},"name":{"pt-BR":"checkbox","default":"checkbox"},"api_identifier":"cf_checkbox","custom_field":true,"validation_rules":{},"presentation_type":"CHECK_BOX","data_type":"BOOLEAN"},{"uuid":"6c0d1a6c-b5ec-4c02-8a11-d60e3e770285","label":{"pt-BR":"CRN (Registro do Conselho Regional de Nutricionistas)","default":"CRN (Registro do Conselho Regional de Nutricionistas)"},"name":{"pt-BR":"crn","default":"crn"},"api_identifier":"cf_crn","custom_field":true,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"84d057b1-d83d-414e-b146-00f95fe2ef20","label":{"pt-BR":"Large Text","default":"Large Text"},"name":{"pt-BR":"large_text","default":"large_text"},"api_identifier":"cf_large_text","custom_field":true,"validation_rules":{},"presentation_type":"TEXT_AREA","data_type":"STRING"},{"uuid":"f9cd83e0-8bad-460f-90b2-82e0912d465c","label":{"pt-BR":"url","default":"url"},"name":{"pt-BR":"url_f","default":"url_f"},"api_identifier":"cf_url_f","custom_field":true,"validation_rules":{},"presentation_type":"URL_INPUT","data_type":"STRING"},{"uuid":"d2f67454-c194-4681-94d7-7c1ec855ada2","label":{"pt-BR":"phone","default":"phone"},"name":{"pt-BR":"phone_X","default":"phone_X"},"api_identifier":"cf_phone_x","custom_field":true,"validation_rules":{},"presentation_type":"PHONE_INPUT","data_type":"STRING"},{"uuid":"2cf7269d-cca6-4bdd-b65f-ba29b0209f23","label":{"pt-BR":"email","default":"email"},"name":{"pt-BR":"email_nf","default":"email_nf"},"api_identifier":"cf_email_nf","custom_field":true,"validation_rules":{},"presentation_type":"EMAIL_INPUT","data_type":"STRING"},{"uuid":"06464336-24af-4b39-8bea-0240e3ef223b","label":{"pt-BR":"Number","default":"Number"},"name":{"pt-BR":"number","default":"number"},"api_identifier":"cf_number","custom_field":true,"validation_rules":{},"presentation_type":"NUMBER_INPUT","data_type":"INTEGER"},{"uuid":"9c7076e7-a137-4a90-929c-cea5c1cf5ef8","label":{"pt-BR":"Single Choice","default":"Single Choice"},"name":{"pt-BR":"single_choice","default":"single_choice"},"api_identifier":"cf_single_choice","custom_field":true,"validation_rules":{"valid_options":[{"value":"1","label":{"pt-BR":"1","default":"1"}},{"value":"2","label":{"pt-BR":"2","default":"2"}},{"value":"3","label":{"pt-BR":"3","default":"3"}}]},"presentation_type":"RADIO_BUTTON","data_type":"STRING"},{"uuid":"30096c4e-6a98-4f50-b4ff-20a53c4841a5","label":{"pt-BR":"Birthday","default":"Birthday"},"name":{"pt-BR":"birthday","default":"birthday"},"api_identifier":"cf_birthday","custom_field":true,"validation_rules":{},"presentation_type":"TEXT_INPUT","data_type":"STRING"},{"uuid":"e5913955-5895-4d10-b28d-12e2e343e4c0","label":{"pt-BR":"Multichoice","default":"Multichoice"},"name":{"pt-BR":"multiple_choice_test","default":"multiple_choice_test"},"api_identifier":"cf_cf_multiple_choice_test","custom_field":true,"validation_rules":{"valid_options":[{"value":"1","label":{"pt-BR":"1","default":"1"}},{"value":"2","label":{"pt-BR":"2","default":"2"}},{"value":"3","label":{"pt-BR":"3","default":"3"}}]},"presentation_type":"MULTIPLE_CHOICE","data_type":"STRING[]"},{"uuid":"dde0cb2d-f34b-42d7-9e4e-3bee78600187","label":{"pt-BR":"Combobox","default":"Combobox"},"name":{"pt-BR":"comboxbox_test","default":"comboxbox_test"},"api_identifier":"cf_cf_comboxbox_test","custom_field":true,"validation_rules":{"valid_options":[{"value":"1","label":{"pt-BR":"1","default":"1"}},{"value":"2","label":{"pt-BR":"2","default":"2"}},{"value":"3","label":{"pt-BR":"3","default":"3"}}]},"presentation_type":"COMBO_BOX","data_type":"STRING"}] + , 'expect', 'contacts'); + assert.deepEqual(result, [{ "name": "bio", "label": "Biografia", "type": "text" }, { "name": "cf_birthday", "label": "Birthday", "type": "text" }, { "name": "cf_crn", "label": "CRN (Registro do Conselho Regional de Nutricionistas)", "type": "text" }, { "name": "job_title", "label": "Cargo", "type": "text" }, { "name": "mobile_phone", "label": "Celular", "type": "text" }, { "name": "cf_checkbox", "label": "Checkbox", "type": "boolean", "required": true }, { "name": "city", "label": "Cidade", "type": "text" }, { "name": "cf_cf_comboxbox_test", "label": "Combobox", "type": "select", "dynamic": true, "multiple": false, "options": [{ "label": "1", "value": "1" }, { "label": "2", "value": "2" }, { "label": "3", "value": "3" }] }, { "name": "state", "label": "Estado", "type": "text" }, { "name": "facebook", "label": "Facebook", "type": "text" }, { "name": "cf_large_text", "label": "Large Text", "type": "text", "multiline": "true" }, { "name": "linkedin", "label": "Linkedin", "type": "text" }, { "name": "cf_cf_multiple_choice_test", "label": "Multichoice", "type": "select", "dynamic": true, "multiple": true, "options": [{ "label": "1", "value": "1" }, { "label": "2", "value": "2" }, { "label": "3", "value": "3" }] }, { "name": "name", "label": "Nome", "type": "text" }, { "name": "cf_number", "label": "Number", "type": "integer" }, { "name": "country", "label": "País", "type": "text" }, { "name": "cf_single_choice", "label": "Single Choice", "type": "select", "multiple": false, "options": [{ "label": "1", "value": "1" }, { "label": "2", "value": "2" }, { "label": "3", "value": "3" }] }, { "name": "tags", "label": "Tags", "type": "array", "spec": { "type": "text" } }, { "name": "personal_phone", "label": "Telefone", "type": "text" }, { "name": "twitter", "label": "Twitter", "type": "text" }, { "name": "website", "label": "Website", "type": "text" }, { "name": "cf_email_nf", "label": "email", "type": "email" }, { "name": "cf_phone_x", "label": "phone", "type": "text" }, { "name": "cf_url_f", "label": "url", "type": "url" }, { "name": "extra_emails", "label": "Extra Emails", "type": "array", "spec": { "type": "text" } }, { "name": "legal_bases", "label": "Legal Bases", "type": "array", "spec": { "type": "collection", "spec": [{ "name": "category", "label": "Category", "type": "select", "options": [{ "label": "data_processing", "value": "data_processing" }, { "label": "communications", "value": "communications" }] }, { "name": "type", "label": "Type", "type": "select", "options": [{ "label": "pre_existent_contract", "value": "pre_existent_contract" }, { "label": "consent", "value": "consent" }, { "label": "legitimate_interest", "value": "legitimate_interest" }, { "label": "judicial_process", "value": "judicial_process" }, { "label": "vital_interest", "value": "vital_interest" }, { "label": "public_interest", "value": "public_interest" }] }, { "name": "status", "label": "Status", "type": "text", "help": "Can be empty when `Category` is `data_processing` or pay attention to the fact that when `Category` is `data_processing` the only accepted value for `Status` is `granted`." }] } }]); +}); \ No newline at end of file diff --git a/apps/rd-station-252023/functions/getExpectEventInput/code.js b/apps/rd-station-252023/functions/getExpectEventInput/code.js index 1b64df7..84f665c 100644 --- a/apps/rd-station-252023/functions/getExpectEventInput/code.js +++ b/apps/rd-station-252023/functions/getExpectEventInput/code.js @@ -4,7 +4,7 @@ function getExpectEventInput(input) { const body = Object.assign({}, obj); var payload = body.payload; - function setValue(propertyPath, value, obj) { + function setValue(propertyPath, value, obj, typ) { /** * */ @@ -16,17 +16,19 @@ function getExpectEventInput(input) { if (properties.length > 1) { // The property doesn't exists OR is not an object (and so we overwritten it) so we create it if (!obj.hasOwnProperty(properties[0]) || typeof obj[properties[0]] !== "object") obj[properties[0]] = {}; - // We iterate. + return setValue(properties.slice(1), value, obj[properties[0]]); - // This is the last property - the one where to set the value } else { // We set the value to the last property - try { - obj[properties[0]] = JSON.parse(value); - } catch (e) { - obj[properties[0]] = value; - } - return true; + if (typ != 'FLOAT' && typ != 'INTEGER') { + value = JSON.stringify(value) + try { + obj[properties[0]] = JSON.parse(value) + } catch (e) { + obj[properties[0]] = value.toString() + } + } else { obj[properties[0]] = ((typ == 'FLOAT') ? parseFloat(value) : (typ == 'INTEGER') ? parseInt(value) : Number(value)) } + return true } } @@ -36,7 +38,7 @@ function getExpectEventInput(input) { if (key === 'custom_fields') { var custom_fields = payload[key]; custom_fields.forEach(item => { - setValue(('payload.' + item['name']), item['value'], body); + setValue(('payload.' + item['name']), (item['value']), body, item['type']); }); delete payload[key]; } @@ -60,5 +62,4 @@ function getExpectEventInput(input) { return getExpect(input); -} - +} \ No newline at end of file diff --git a/apps/rd-station-252023/functions/getExpectEventInput/test.js b/apps/rd-station-252023/functions/getExpectEventInput/test.js index 2f41b19..106db58 100644 --- a/apps/rd-station-252023/functions/getExpectEventInput/test.js +++ b/apps/rd-station-252023/functions/getExpectEventInput/test.js @@ -1,4 +1,4 @@ -it('Should be okay ', () => { +it('Should be okay - first ', () => { let result = getExpectEventInput({ "payload": { "custom_fields": [ @@ -14,6 +14,16 @@ it('Should be okay ', () => { "name": "job_title", "value": "job title value" }, + { + "name": "cf_order_total_items", + "value": "10.00", + "type": "INTEGER" + }, + { + "name": "cf_order_payment_amount", + "value": "10.00", + "type": "FLOAT" + }, { "name": "email", "value": "email@email.com" @@ -33,7 +43,9 @@ it('Should be okay ', () => { "name": "Nome", "job_title": "job title value", "email": "email@email.com", - "state": "state of the contact" + "state": "state of the contact", + "cf_order_payment_amount": 10.00, + "cf_order_total_items": 10 }, "event_type": "CONVERSION", "event_family": "CDP" @@ -44,7 +56,7 @@ it('Should be okay ', () => { -it('Should be okay ', () => { +it('Should be okay - second ', () => { let result = getExpectEventInput({ "payload": { "custom_fields": [ @@ -115,7 +127,7 @@ it('Should be okay ', () => { -it('Should be okay with array of objects ', () => { +it('Should be okay with array of objects ', () => { let result = getExpectEventInput([{ "payload": { "custom_fields": [ diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/api.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/api.imljson new file mode 100644 index 0000000..fb5e2ff --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/api.imljson @@ -0,0 +1,8 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": "{{parameters}}", + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/expect.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/expect.imljson new file mode 100644 index 0000000..8c7db01 --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/expect.imljson @@ -0,0 +1,173 @@ +[ + { + "name": "event_type", + "label": "Event Type", + "type": "select", + "required": true, + "help": "The event type that diferentiates the event. Could be `CHAT_STARTED`, `CHAT_FINISHED` or `CALL_FINISHED`.", + "options": { + "store": [ + { + "label": "Chat Started", + "value": "CHAT_STARTED", + "nested": [ + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + { + "name": "email", + "label": "Email", + "type": "text", + "help": "Email of the Contact" + }, + { + "name": "chat_subject", + "label": "Chat Subject", + "type": "text" + }, + { + "name": "cf_chat_status", + "label": "Chat Status", + "type": "text" + }, + { + "name": "cf_chat_type", + "label": "Chat Type", + "type": "text" + } + ] + } + ] + }, + { + "label": "Chat Finished", + "value": "CHAT_FINISHED", + "nested": [ + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + { + "name": "email", + "label": "Email", + "type": "text", + "help": "Email of the Contact" + }, + { + "name": "chat_subject", + "label": "Chat Subject", + "type": "text" + }, + { + "name": "cf_chat_status", + "label": "Chat Status", + "type": "text" + }, + { + "name": "cf_chat_type", + "label": "Chat Type", + "type": "text" + }, + { + "name": "cf_chat_transcript_message", + "label": "Chat Transcript Message", + "type": "text", + "multiline": true + } + ] + } + ] + }, + { + "label": "Call Finished", + "value": "CALL_FINISHED", + "nested": [ + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + { + "name": "email", + "label": "Email", + "type": "text", + "help": "Email of the Contact" + }, + { + "name": "call_user_email", + "label": "Call User Email", + "type": "text" + }, + { + "name": "call_from_number", + "label": "Call from Number", + "type": "text", + "required": true, + "help": "Number of Call Tracking" + }, + { + "name": "call_started_at", + "label": "Call Started at", + "type": "date", + "time": true + }, + { + "name": "call_duration", + "label": "Call Duration", + "type": "text", + "help": "Call duration, in seconds." + }, + { + "name": "call_type", + "label": "Call Type", + "type": "text", + "help": "Inbound or Outbound" + }, + { + "name": "call_status", + "label": "Call Status", + "type": "text" + }, + { + "name": "call_status_description", + "label": "Call Status Description", + "type": "text", + "help": "Call status complement. This could be the name of the recipient, a personalized message or 'Off'" + }, + { + "name": "call_phone_type", + "label": "Call Type", + "type": "text", + "help": "Phone type. Mobile or Comercial." + }, + { + "name": "call_carrier", + "label": "Call Carrier", + "type": "text", + "help": "Carrier name." + }, + { + "name": "call_record", + "label": "Call Type", + "type": "text", + "help": "Call recording URL." + } + ] + } + ] + } + ] + } + }, + { + "name": "event_family", + "label": "Event Family", + "type": "text", + "default": "CDP", + "advanced": true, + "help": "The family of the event for processing purposes. It currently accepts only `CDP` as valid option." + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/interface.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/metadata.json b/apps/rd-station-252023/modules/createCommunicationEvent/metadata.json new file mode 100644 index 0000000..ca95de2 --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createCommunicationEvent", + "label": "Create an Event of Communication", + "description": "Chat or Call event", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/parameters.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/samples.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/samples.imljson new file mode 100644 index 0000000..f09c506 --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "db414473-942d-4b46-ba27-e8604854244f" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createCommunicationEvent/scope.imljson b/apps/rd-station-252023/modules/createCommunicationEvent/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createCommunicationEvent/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/api.imljson b/apps/rd-station-252023/modules/createConversionEvent/api.imljson new file mode 100644 index 0000000..3c02623 --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/api.imljson @@ -0,0 +1,12 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": { + "event_type": "CONVERSION", + "event_family": "CDP", + "payload": "{{parameters}}" + }, + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/expect.imljson b/apps/rd-station-252023/modules/createConversionEvent/expect.imljson new file mode 100644 index 0000000..7d54f03 --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/expect.imljson @@ -0,0 +1,84 @@ +[ + /** + { + "name": "event_type", + "label": "Event Type", + "type": "hidden", + "help": "The event type that diferentiates the event. For the conversion event it should be sent as `CONVERSION`." + }, + { + "name": "event_family", + "label": "Event Family", + "type": "text", + "help": "The family of the event for processing purposes. It currently accepts only `CDP` as valid option." + }, + + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + */ + { + "name": "conversion_identifier", + "label": "Event Identifier", + "type": "text", + "help": "Name to identify the source of the conversion event. Ex: landing-page, form-site, api." + }, + { + "name": "company_name", + "label": "Company Name", + "type": "text", + "help": "Lead's company name. Ex: Resultados Digitais, Integromat." + }, + { + "name": "company_site", + "label": "Company Site", + "type": "text" + }, + { + "name": "company_address", + "label": "Company Address", + "type": "text" + }, + { + "name": "company_size", + "label": "Company Size", + "type": "text", + "help": "Number of employees of lead's company. Ex: 1-5." + }, + { + "name": "client_tracking_id", + "label": "Client Tracking ID", + "type": "text" + }, + { + "name": "traffic_source", + "label": "Traffic Source", + "type": "text", + "help": "This can either be the value of a '__trf.src' cookie (base 64 encoded or not) or an UTM source param. If passing a cookie the following fields MUST be empty: traffic_medium, traffic_campaign and traffic_value." + }, + { + "name": "traffic_medium", + "label": "Traffic Medium", + "type": "text", + "help": "UTM medium param." + }, + { + "name": "traffic_campaign", + "label": "Traffic Campaign", + "type": "text", + "help": "UTM campaign param." + }, + { + "name": "traffic_value", + "label": "Traffic Value", + "type": "text", + "help": "UTM value param (term)." + }, + "rpc://contactFieldsExpectWithEmail" + /** + ] + } + */ +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/interface.imljson b/apps/rd-station-252023/modules/createConversionEvent/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/metadata.json b/apps/rd-station-252023/modules/createConversionEvent/metadata.json new file mode 100644 index 0000000..1805833 --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createConversionEvent", + "label": "Create an Event of Conversion", + "description": "It registers a new conversion event for a contact.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/parameters.imljson b/apps/rd-station-252023/modules/createConversionEvent/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/samples.imljson b/apps/rd-station-252023/modules/createConversionEvent/samples.imljson new file mode 100644 index 0000000..5f8c97b --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "47e6e476-b438-4673-801d-150bf5a1cdb9" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createConversionEvent/scope.imljson b/apps/rd-station-252023/modules/createConversionEvent/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createConversionEvent/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEvent/expect.imljson b/apps/rd-station-252023/modules/createEvent/expect.imljson index 44bde9c..efa53cf 100644 --- a/apps/rd-station-252023/modules/createEvent/expect.imljson +++ b/apps/rd-station-252023/modules/createEvent/expect.imljson @@ -34,6 +34,30 @@ "type": "any", "multiline": true, "required": true + }, + { + "name": "type", + "label": "Type", + "type": "select", + "default": "STRING", + "options": [ + { + "label": "STRING", + "value": "STRING" + }, + { + "label": "INTEGER", + "value": "INTEGER" + }, + { + "label": "FLOAT", + "value": "FLOAT" + }, + { + "label": "JSON", + "value": "JSON" + } + ] } ] } diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/api.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/api.imljson new file mode 100644 index 0000000..fb5e2ff --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/api.imljson @@ -0,0 +1,8 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": "{{parameters}}", + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/expect.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/expect.imljson new file mode 100644 index 0000000..27c3736 --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/expect.imljson @@ -0,0 +1,127 @@ +[ + { + "name": "event_type", + "label": "Event Type", + "type": "select", + "required": true, + "help": "The event type that diferentiates the event. Could be `ORDER_PLACED` or `ORDER_PLACED_ITEM`.", + "options": { + "store": [ + { + "label": "Cart Abandoned", + "value": "ORDER_PLACED", + "nested": [ + { + "name": "payload", + "type": "collection", + "spec": [ + { + "name": "name", + "type": "text" + }, + { + "name": "email", + "type": "text" + }, + { + "name": "cf_order_id", + "type": "text" + }, + { + "name": "cf_order_total_items", + "type": "number" + }, + { + "name": "cf_order_status", + "type": "text" + }, + { + "name": "cf_order_payment_method", + "type": "text" + }, + { + "name": "cf_order_payment_amount", + "type": "number" + }, + { + "name": "legal_bases", + "type": "array", + "spec": { + "type": "collection", + "spec": [ + { + "name": "category", + "type": "text" + }, + { + "name": "type", + "type": "text" + } + ] + } + } + ] + } + ] + }, + { + "label": "Placed Order with a specific Item", + "value": "ORDER_PLACED_ITEM", + "nested": [ + { + "name": "payload", + "type": "collection", + "spec": [ + { + "name": "name", + "type": "text" + }, + { + "name": "email", + "type": "text" + }, + { + "name": "cf_order_id", + "type": "text" + }, + { + "name": "cf_order_product_id", + "type": "text" + }, + { + "name": "cf_order_product_sku", + "type": "text" + }, + { + "name": "legal_bases", + "type": "array", + "spec": { + "type": "collection", + "spec": [ + { + "name": "category", + "type": "text" + }, + { + "name": "type", + "type": "text" + } + ] + } + } + ] + } + ] + } + ] + } + }, + { + "name": "event_family", + "label": "Event Family", + "type": "text", + "default": "CDP", + "advanced": true, + "help": "The family of the event for processing purposes. It currently accepts only `CDP` as valid option." + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/interface.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/metadata.json b/apps/rd-station-252023/modules/createEventPlacedOrder/metadata.json new file mode 100644 index 0000000..d3215b4 --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createEventPlacedOrder", + "label": "Create an Event of Placed Order", + "description": "Whenever an oder is placed on an e-commerce platform.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/parameters.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/samples.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/samples.imljson new file mode 100644 index 0000000..4a3fa4b --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "f2469eb1-2e6f-4e3d-92ff-15151056538a" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventPlacedOrder/scope.imljson b/apps/rd-station-252023/modules/createEventPlacedOrder/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createEventPlacedOrder/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createEventsBatch/expect.imljson b/apps/rd-station-252023/modules/createEventsBatch/expect.imljson index ffd8e35..46197ec 100644 --- a/apps/rd-station-252023/modules/createEventsBatch/expect.imljson +++ b/apps/rd-station-252023/modules/createEventsBatch/expect.imljson @@ -39,6 +39,30 @@ "type": "any", "multiline": true, "required": true + }, + { + "name": "type", + "label": "Type", + "type": "select", + "default": "STRING", + "options": [ + { + "label": "STRING", + "value": "STRING" + }, + { + "label": "INTEGER", + "value": "INTEGER" + }, + { + "label": "FLOAT", + "value": "FLOAT" + }, + { + "label": "JSON", + "value": "JSON" + } + ] } ] } diff --git a/apps/rd-station-252023/modules/createLostDeal/api.imljson b/apps/rd-station-252023/modules/createLostDeal/api.imljson new file mode 100644 index 0000000..a009e29 --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/api.imljson @@ -0,0 +1,12 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": { + "event_type": "OPPORTUNITY_LOST", + "event_family": "CDP", + "payload": "{{parameters}}" + }, + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/expect.imljson b/apps/rd-station-252023/modules/createLostDeal/expect.imljson new file mode 100644 index 0000000..98ec68c --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/expect.imljson @@ -0,0 +1,21 @@ +[ + { + "name": "email", + "label": "Email", + "type": "email", + "help": "Email of the contact." + }, + { + "name": "reason", + "label": "Reason", + "type": "text", + "help": "Reason for why the Contact was marked as lost." + }, + { + "name": "funnel_name", + "label": "Funnel Name", + "type": "text", + "advanced": true, + "default": "default" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/interface.imljson b/apps/rd-station-252023/modules/createLostDeal/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/metadata.json b/apps/rd-station-252023/modules/createLostDeal/metadata.json new file mode 100644 index 0000000..b998a77 --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createLostDeal", + "label": "Create a Lost Deal", + "description": "Mark a deal as lost.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/parameters.imljson b/apps/rd-station-252023/modules/createLostDeal/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/samples.imljson b/apps/rd-station-252023/modules/createLostDeal/samples.imljson new file mode 100644 index 0000000..526ddf1 --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "575c47d3-273f-4124-a40f-7cb1a7481c8c" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createLostDeal/scope.imljson b/apps/rd-station-252023/modules/createLostDeal/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createLostDeal/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/api.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/api.imljson new file mode 100644 index 0000000..d258c49 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/api.imljson @@ -0,0 +1,12 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": { + "event_type": "OPPORTUNITY", + "event_family": "CDP", + "payload": "{{parameters}}" + }, + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/expect.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/expect.imljson new file mode 100644 index 0000000..e27be08 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/expect.imljson @@ -0,0 +1,15 @@ +[ + { + "name": "email", + "label": "Email", + "type": "email", + "help": "Email of the contact." + }, + { + "name": "funnel_name", + "label": "Funnel Name", + "type": "text", + "advanced": true, + "default": "default" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/interface.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/metadata.json b/apps/rd-station-252023/modules/createOpportunityEvent/metadata.json new file mode 100644 index 0000000..f815892 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createOpportunityEvent", + "label": "Create an Opportunity Event", + "description": "Record contact maked as an opportunity.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/parameters.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/samples.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/samples.imljson new file mode 100644 index 0000000..653d209 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "9ccbd952-d867-4ecd-a5b6-d3e5fcc34075" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createOpportunityEvent/scope.imljson b/apps/rd-station-252023/modules/createOpportunityEvent/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createOpportunityEvent/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/api.imljson b/apps/rd-station-252023/modules/createWonDeal/api.imljson new file mode 100644 index 0000000..88b3016 --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/api.imljson @@ -0,0 +1,12 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": { + "event_type": "SALE", + "event_family": "CDP", + "payload": "{{parameters}}" + }, + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/expect.imljson b/apps/rd-station-252023/modules/createWonDeal/expect.imljson new file mode 100644 index 0000000..820cb16 --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/expect.imljson @@ -0,0 +1,21 @@ +[ + { + "name": "email", + "label": "Email", + "type": "email", + "help": "Email of the contact." + }, + { + "name": "value", + "label": "Value", + "type": "number", + "help": "Value of the won opportunity." + }, + { + "name": "funnel_name", + "label": "Funnel Name", + "type": "text", + "advanced": true, + "default": "default" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/interface.imljson b/apps/rd-station-252023/modules/createWonDeal/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/metadata.json b/apps/rd-station-252023/modules/createWonDeal/metadata.json new file mode 100644 index 0000000..082a6bf --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "createWonDeal", + "label": "Create a Won Deal", + "description": "Mark a deal as won.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/parameters.imljson b/apps/rd-station-252023/modules/createWonDeal/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/samples.imljson b/apps/rd-station-252023/modules/createWonDeal/samples.imljson new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/samples.imljson @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/createWonDeal/scope.imljson b/apps/rd-station-252023/modules/createWonDeal/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/createWonDeal/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/api.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/api.imljson new file mode 100644 index 0000000..fb5e2ff --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/api.imljson @@ -0,0 +1,8 @@ +{ + "url": "/platform/events", + "method": "POST", + "body": "{{parameters}}", + "response": { + "output": "{{body}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/expect.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/expect.imljson new file mode 100644 index 0000000..af06b3c --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/expect.imljson @@ -0,0 +1,225 @@ +[ + { + "name": "event_type", + "label": "Event Type", + "type": "select", + "required": true, + "help": "The event type that diferentiates the event. Could be `CART_ABANDONED` or `CART_ABANDONED_ITEM`.", + "options": { + "store": [ + { + "label": "Abandoned Cart", + "value": "CART_ABANDONED", + "nested": [ + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + { + "name": "email", + "label": "email", + "type": "text", + "help": "Email of the contact." + }, + { + "name": "name", + "label": "Name", + "type": "text", + "help": "Name of the contact." + }, + { + "name": "cf_cart_id", + "label": "Cart Identifier", + "type": "text" + }, + { + "name": "cf_cart_total_items", + "label": "Total Number of Items", + "type": "text" + }, + { + "name": "cf_cart_status", + "label": "Status of Cart", + "type": "text" + }, + { + "name": "legal_bases", + "label": "Legal Bases", + "type": "array", + "spec": { + "type": "collection", + "spec": [ + { + "name": "category", + "label": "Category", + "type": "select", + "options": [ + { + "label": "data_processing", + "value": "data_processing" + }, + { + "label": "communications", + "value": "communications" + } + ] + }, + { + "name": "type", + "label": "Type", + "type": "select", + "options": [ + { + "label": "pre_existent_contract", + "value": "pre_existent_contract" + }, + { + "label": "consent", + "value": "consent" + }, + { + "label": "legitimate_interest", + "value": "legitimate_interest" + }, + { + "label": "judicial_process", + "value": "judicial_process" + }, + { + "label": "vital_interest", + "value": "vital_interest" + }, + { + "label": "public_interest", + "value": "public_interest" + } + ] + }, + { + "name": "status", + "label": "Status", + "type": "text", + "help": "Can be empty when `Category` is `data_processing` or pay attention to the fact that when `Category` is `data_processing` the only accepted value for `Status` is `granted`." + } + ] + } + } + ] + } + ] + }, + { + "label": "Abandoned Cart with a specific Item", + "value": "CART_ABANDONED_ITEM", + "nested": [ + { + "name": "payload", + "label": "Payload", + "type": "collection", + "spec": [ + { + "name": "email", + "label": "email", + "type": "text", + "help": "Email of the contact." + }, + { + "name": "name", + "label": "Name", + "type": "text", + "help": "Name of the contact." + }, + { + "name": "cf_cart_id", + "label": "Cart Identifier", + "type": "text" + }, + { + "name": "cf_cart_product_id", + "label": "Product Identifier", + "type": "text" + }, + { + "name": "cf_cart_product_sku", + "label": "SKU Identifier", + "type": "text" + }, + { + "name": "legal_bases", + "label": "Legal Bases", + "type": "array", + "spec": { + "type": "collection", + "spec": [ + { + "name": "category", + "label": "Category", + "type": "select", + "options": [ + { + "label": "data_processing", + "value": "data_processing" + }, + { + "label": "communications", + "value": "communications" + } + ] + }, + { + "name": "type", + "label": "Type", + "type": "select", + "options": [ + { + "label": "pre_existent_contract", + "value": "pre_existent_contract" + }, + { + "label": "consent", + "value": "consent" + }, + { + "label": "legitimate_interest", + "value": "legitimate_interest" + }, + { + "label": "judicial_process", + "value": "judicial_process" + }, + { + "label": "vital_interest", + "value": "vital_interest" + }, + { + "label": "public_interest", + "value": "public_interest" + } + ] + }, + { + "name": "status", + "label": "Status", + "type": "text", + "help": "Can be empty when `Category` is `data_processing` or pay attention to the fact that when `Category` is `data_processing` the only accepted value for `Status` is `granted`." + } + ] + } + } + ] + } + ] + } + ] + } + }, + { + "name": "event_family", + "label": "Event Family", + "type": "text", + "default": "CDP", + "advanced": true, + "help": "The family of the event for processing purposes. It currently accepts only `CDP` as valid option." + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/interface.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/interface.imljson new file mode 100644 index 0000000..d9b178f --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/interface.imljson @@ -0,0 +1,7 @@ +[ + { + "name": "event_uuid", + "label": "Event UUID", + "type": "text" + } +] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/metadata.json b/apps/rd-station-252023/modules/eventCartAbandoned/metadata.json new file mode 100644 index 0000000..6f2818d --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/metadata.json @@ -0,0 +1,8 @@ +{ + "name": "eventCartAbandoned", + "label": "Create an Event of Abandoned Cart", + "description": "Whenever a cart is abandoned on an e-commerce platform.", + "connection": "rd-station-2520233", + "webhook": null, + "type": "action" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/parameters.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/samples.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/samples.imljson new file mode 100644 index 0000000..70fbd05 --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/samples.imljson @@ -0,0 +1,3 @@ +{ + "event_uuid": "3e3e2dfb-a6d4-42f5-8ce5-db6bc85bf958" +} \ No newline at end of file diff --git a/apps/rd-station-252023/modules/eventCartAbandoned/scope.imljson b/apps/rd-station-252023/modules/eventCartAbandoned/scope.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/modules/eventCartAbandoned/scope.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/apps/rd-station-252023/rpcs/contactFieldsExpect/api.imljson b/apps/rd-station-252023/rpcs/contactFieldsExpect/api.imljson index 864dd99..35b5d2f 100644 --- a/apps/rd-station-252023/rpcs/contactFieldsExpect/api.imljson +++ b/apps/rd-station-252023/rpcs/contactFieldsExpect/api.imljson @@ -6,6 +6,6 @@ "type": "DataError", "message": "{{getErrors(statusCode, body)}}" }, - "output": "{{getExpectContact(body.fields, 'expect')}}" + "output": "{{getExpectContact(body.fields, 'expect', 'contacts')}}" } } \ No newline at end of file diff --git a/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/api.imljson b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/api.imljson new file mode 100644 index 0000000..a3d4a59 --- /dev/null +++ b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/api.imljson @@ -0,0 +1,11 @@ +{ + "url": "/platform/contacts/fields", + "method": "GET", + "response": { + "error": { + "type": "DataError", + "message": "{{getErrors(statusCode, body)}}" + }, + "output": "{{getExpectContact(body.fields, 'expect-with-email', 'events')}}" + } +} \ No newline at end of file diff --git a/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/metadata.json b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/metadata.json new file mode 100644 index 0000000..9b80643 --- /dev/null +++ b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/metadata.json @@ -0,0 +1,5 @@ +{ + "name": "contactFieldsExpectWithEmail", + "label": "Contact Fields Expect with Email", + "connection": "rd-station-2520233" +} \ No newline at end of file diff --git a/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/parameters.imljson b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/parameters.imljson new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/apps/rd-station-252023/rpcs/contactFieldsExpectWithEmail/parameters.imljson @@ -0,0 +1 @@ +[] \ No newline at end of file