diff --git a/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid b/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid index 530c33a..b8dc19c 100644 --- a/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid +++ b/pos-module-chat/modules/chat/public/views/pages/inbox.html.liquid @@ -33,7 +33,7 @@ slug: inbox if conversations.total_entries > 0 if current_conversation and current_conversation.participants == blank graphql participants = 'modules/user/profiles/search', ids: current_conversation.participant_ids - hash_assign current_conversation['participants'] = participants.records.results + assign current_conversation.participants = participants.records.results endif render 'modules/chat/inbox', current_conversation: current_conversation, conversations: conversations, current_profile: current_profile diff --git a/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid b/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid index ae49cbc..eb364f4 100644 --- a/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/channels/conversate/receive.liquid @@ -21,10 +21,7 @@ function conversation = 'modules/chat/lib/queries/conversations/find_by_participant', id: room_id, participant_id: current_profile.id, include_messages: null if conversation assign message_safe = context.params.message | raw_escape_string - assign object = '{}' | parse_json - hash_assign object['conversation_id'] = conversation.id - hash_assign object['autor_id'] = current_profile.id - hash_assign object['message'] = message_safe + assign object = { "conversation_id": conversation.id, "autor_id": current_profile.id, "message": message_safe } function message = 'modules/chat/lib/commands/messages/create', object: object if message.valid != true log message, 'ERROR receive message' diff --git a/pos-module-chat/modules/chat/public/views/partials/inbox.liquid b/pos-module-chat/modules/chat/public/views/partials/inbox.liquid index 807bb5c..2f3601c 100644 --- a/pos-module-chat/modules/chat/public/views/partials/inbox.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/inbox.liquid @@ -41,7 +41,7 @@ -{% assign dummy_message = '{ "message": "", "created_at": null }' | parse_json %} +{% assign dummy_message = { "message": "", "created_at": null } %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid index bb3b199..2f469c6 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/build.liquid @@ -1,7 +1,5 @@ {% liquid - assign data = '{}' | parse_json - hash_assign data['participant_ids'] = object.participant_ids - hash_assign data['participant_read_ids'] = current_profile.id + assign data = { "participant_ids": object.participant_ids, "participant_read_ids": current_profile.id } return data -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid index 00c229f..005ff93 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/create/check.liquid @@ -1,12 +1,12 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_ids' function c = 'modules/core/validations/length', c: c, object: object, field_name: 'participant_ids', minimum: 2, allow_blank: null function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_read_ids' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid index 6dbbb52..ac83518 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create.liquid @@ -7,7 +7,7 @@ function conversation = 'modules/chat/lib/queries/conversations/find_by_participants', participant_ids: object.participant_ids, include_messages: true unless conversation function conversation = 'modules/chat/lib/commands/conversations/create', object: object, current_profile: current_profile - hash_assign conversation['created'] = true + assign conversation.created = true endunless endif diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid index 5716d07..a35f400 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/build.liquid @@ -1,8 +1,6 @@ {% liquid - assign participants = '[]' | parse_json | add_to_array: current_profile.id | add_to_array: object['to_id'] | uniq | compact | sort - assign data = '{}' | parse_json - hash_assign data['participant_ids'] = participants - hash_assign data['conversation_id'] = object.conversation_id + assign participants = [current_profile.id, object.to_id] | uniq | compact | sort + assign data = { "participant_ids": participants, "conversation_id": object.conversation_id } return data -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid index 6391f18..e606409 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/find_or_create/check.liquid @@ -4,9 +4,9 @@ assign types = object.participants | map: 'type' | uniq if types.size == 1 and types.first == 'profile' - hash_assign object['valid'] = false + assign object.valid = false endif endcomment return object -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid index edb2233..1723801 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/build.liquid @@ -1,8 +1,5 @@ {% liquid - assign data = '{}' | parse_json - hash_assign data['id'] = conversation.id - hash_assign data['participant_read_ids'] = conversation.participant_read_ids - hash_assign data['participant_id'] = participant_id + assign data = { "id": conversation.id, "participant_read_ids": conversation.participant_read_ids, "participant_id": participant_id } return data -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid index f043e84..11c6623 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_read/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid index 96eb24c..2150034 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/build.liquid @@ -1,7 +1,5 @@ {% liquid - assign data = '{}' | parse_json - hash_assign data['id'] = conversation.id - hash_assign data['participant_read_ids'] = current_profile.id + assign data = { "id": conversation.id, "participant_read_ids": current_profile.id } return data -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid index a74aa70..df21af9 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/conversations/mark_unread/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'participant_read_ids' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid index 5c12d58..00baae5 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/build.liquid @@ -1,8 +1,5 @@ {% liquid - assign data = '{}' | parse_json - hash_assign data['conversation_id'] = object.conversation_id - hash_assign data['autor_id'] = object.autor_id - hash_assign data['message'] = object.message + assign data = { "conversation_id": object.conversation_id, "autor_id": object.autor_id, "message": object.message } return data -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid index b464e90..f8f3e3e 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/commands/messages/create/check.liquid @@ -1,12 +1,12 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'conversation_id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'autor_id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'message' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid index 7d922a3..0177666 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find.liquid @@ -8,17 +8,14 @@ assign conversation = r.conversations.results.first - assign participants = '[]' | parse_json + assign participants = [] - - # platformos-check-disable GraphqlInForLoop for participant_id in conversation.participant_ids function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null - assign participants = participants | add_to_array: profile + assign participants << profile endfor - # platformos-check-enable GraphqlInForLoop - hash_assign conversation['participants'] = participants + assign conversation.participants = participants return conversation -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid index a80d216..81fd303 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participant.liquid @@ -14,15 +14,15 @@ assign conversation = r.conversations.results.first if conversation - assign participants = '[]' | parse_json + assign participants = [] for participant_id in conversation.participant_ids function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null - assign participants = participants | add_to_array: profile + assign participants << profile endfor - hash_assign conversation['participants'] = participants + assign conversation.participants = participants endif return conversation -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid index 3624d77..c7ecc72 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/find_by_participants.liquid @@ -9,15 +9,15 @@ assign conversation = r.conversations.results.first if conversation - assign participants = '[]' | parse_json + assign participants = [] for participant_id in conversation.participant_ids function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null - assign participants = participants | add_to_array: profile + assign participants << profile endfor - hash_assign conversation['participants'] = participants + assign conversation.participants = participants endif return conversation -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid index 132d680..e775b30 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search.liquid @@ -3,21 +3,21 @@ graphql r = 'modules/chat/conversations/search_by_message', limit: limit, page: page, participant_id: participant_id, message: message assign result = r.conversations - assign conversations = '[]' | parse_json + assign conversations = [] for conversation in result.results - assign participants = '[]' | parse_json + assign participants = [] for participant_id in conversation.participant_ids function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null - assign participants = participants | add_to_array: profile + assign participants << profile endfor - hash_assign conversation['participants'] = participants - assign conversations = conversations | add_to_array: conversation + assign conversation.participants = participants + assign conversations << conversation endfor - hash_assign result['results'] = conversations + assign result.results = conversations return result -%} + %} diff --git a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid index 4632f13..4b54064 100644 --- a/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid +++ b/pos-module-chat/modules/chat/public/views/partials/lib/queries/conversations/search_by_participant.liquid @@ -9,21 +9,21 @@ graphql r = 'modules/chat/conversations/search', limit: limit, page: page, participant_id: participant_id assign result = r.conversations - assign conversations = '[]' | parse_json + assign conversations = [] for conversation in result.results - assign participants = '[]' | parse_json + assign participants = [] for participant_id in conversation.participant_ids function profile = 'modules/user/queries/profiles/find', id: participant_id, user_id: null, uuid: null, first_name: null, last_name: null - assign participants = participants | add_to_array: profile + assign participants << profile endfor - hash_assign conversation['participants'] = participants - assign conversations = conversations | add_to_array: conversation + assign conversation.participants = participants + assign conversations << conversation endfor - hash_assign result['results'] = conversations + assign result.results = conversations return result -%} + %} diff --git a/pos-module-chat/modules/chat/template-values.json b/pos-module-chat/modules/chat/template-values.json index ca5c942..f9c5f3a 100644 --- a/pos-module-chat/modules/chat/template-values.json +++ b/pos-module-chat/modules/chat/template-values.json @@ -2,11 +2,11 @@ "name": "Pos Module Chat", "machine_name": "chat", "type": "module", - "version": "1.1.1", + "version": "1.2.0", "dependencies": { - "core": "^2.0.6", + "core": "^2.1.0", "profile": "^1.1.1", - "user": "^5.0.4", + "user": "^5.2.0", "common-styling": "1.11.0" } } diff --git a/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid b/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid index 4af2559..1bc8167 100644 --- a/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid +++ b/pos-module-chat/modules/common-styling/public/views/pages/style-guide.liquid @@ -1139,9 +1139,9 @@ layout: 'modules/common-styling/style-guide' for i in (i..10) assign value = 'value' | append: i assign label = 'Label for value ' | append: i - assign example_item = '{}' | parse_json | hash_merge: value: value, label: label + assign example_item = { "value": value, "label": label } assign example_list = example_list | add_to_array: example_item - assign selected = '["value0", "value5", "value6"]' | parse_json + assign selected = ["value0", "value5", "value6"] endfor %} {% render 'modules/common-styling/forms/multiselect', name: 'styleguide-form-multiselect-test-1', id: 'styleguide-form-multiselect-test-1', list: example_list, showFilter: true, combine_selected: true %} diff --git a/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid b/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid index cb0e37a..43c1b24 100644 --- a/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid +++ b/pos-module-chat/modules/core/generators/crud/templates/views/pages/model/new.liquid @@ -1,4 +1,4 @@ {% liquid - assign object = '{}' | parse_json + assign object = {} render 'theme/simple/<%= modelNamePlural %>/new', object: object -%} + %} diff --git a/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid b/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid index 64e2245..670f254 100644 --- a/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid +++ b/pos-module-chat/modules/core/public/lib/commands/hook/alter.liquid @@ -16,6 +16,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid b/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid index c4956c8..d2872ca 100644 --- a/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid +++ b/pos-module-chat/modules/core/public/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid index 3418a8a..118bc47 100644 --- a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid +++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/alter.liquid @@ -17,6 +17,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid index 5af969b..ec71ae5 100644 --- a/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid +++ b/pos-module-chat/modules/core/public/views/partials/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid b/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid index 2f252ef..a449ea4 100644 --- a/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid +++ b/pos-module-chat/modules/core/public/views/partials/lib/helpers/register_error.liquid @@ -17,7 +17,7 @@ assign errors = contract.errors - assign field_errors = errors[field_name] | default: '[]' | parse_json + assign field_errors = errors[field_name] | default: [] assign field_errors = field_errors | add_to_array: msg hash_assign errors[field_name] = field_errors diff --git a/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid b/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid index 9c2cb22..7d9294a 100644 --- a/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid +++ b/pos-module-chat/modules/core/public/views/partials/lib/queries/registry/search.liquid @@ -8,18 +8,18 @@ case type when 'module' - assign modules = '[]' | parse_json + assign modules = [] for module in registry if module.type == 'module' - assign modules = modules | add_to_array: module + assign modules << module endif endfor return modules when 'theme' - assign themes = '[]' | parse_json + assign themes = [] for module in registry if module.type == 'theme' - assign themes = themes | add_to_array: module + assign themes << module endif endfor return themes diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid index ff6f895..3c60414 100644 --- a/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/profiles/create/build.liquid @@ -6,9 +6,9 @@ assign data = null | hash_merge: first_name: object.first_name, last_name: object.last_name, user_id: object.user_id, email: object.email, uuid: uuid, name: name, c__names: tokenized_names if object.roles == null - assign roles = '[]' | parse_json + assign roles = [] if context.constants.USER_DEFAULT_ROLE != blank - assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE + assign roles << context.constants.USER_DEFAULT_ROLE endif else assign roles_type = object.roles | type_of @@ -17,16 +17,15 @@ elsif roles_type == 'Array' assign roles = object.roles else - # accepts only String and Array log object.roles, type: 'ERROR: roles must be an array or a coma separated string' - assign roles = '[]' | parse_json + assign roles = [] if context.constants.USER_DEFAULT_ROLE != blank - assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE + assign roles << context.constants.USER_DEFAULT_ROLE endif endif endif hash_assign data['roles'] = roles return data -%} + %} diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid index aabfc15..c6052e7 100644 --- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/append.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role: role + assign object = { "valid": true, "id": id, "role": role } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/append' if object.errors == blank diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid index 2f6a6da..45ef598 100644 --- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/remove.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role : role + assign object = { "valid": true, "id": id, "role": role } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/remove' if object.errors == blank diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid index c1a0f39..b912b18 100644 --- a/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/profiles/roles/set.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, roles: roles + assign object = { "valid": true, "id": id, "roles": roles } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/set' if object.errors == blank diff --git a/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid b/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid index f4b04c8..7155bdc 100644 --- a/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/profiles/tokenize_names.liquid @@ -1,4 +1,4 @@ {% liquid - assign tokenized_names = '[]' | parse_json | array_add: object.email | array_add: object.first_name | array_add: object.last_name | compact | uniq | join: ' ' | downcase + assign tokenized_names = [] | push: object.email | push: object.first_name | push: object.last_name | compact | uniq | join: ' ' | downcase return tokenized_names -%} + %} diff --git a/pos-module-chat/modules/user/public/lib/commands/session/create.liquid b/pos-module-chat/modules/user/public/lib/commands/session/create.liquid index 5cffc62..1af717e 100644 --- a/pos-module-chat/modules/user/public/lib/commands/session/create.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/session/create.liquid @@ -30,7 +30,7 @@ function user = 'modules/user/queries/user/load', id: object.id if user.id sign_in user_id: user.id - assign params = '{}' | parse_json | hash_merge: user: user, hook_params: hook_params + assign params = { "user": user, "hook_params": hook_params } function results = 'modules/core/commands/hook/fire', hook: 'user_login', params: params, merge_to_object: true hash_assign user['hook_results'] = results endif diff --git a/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid b/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid index 1ad11d0..3a26f10 100644 --- a/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/session/destroy.liquid @@ -8,7 +8,7 @@ hash_assign destroy['user'] = current_profile.user unless destroy.errors - assign params = '{}' | parse_json | hash_merge: destroy: destroy + assign params = { "destroy": destroy } function results = 'modules/core/commands/hook/fire', hook: 'user_logout', params: params, merge_to_object: null hash_assign destroy['hook_results'] = results assign event_payload = null | hash_merge: user_id: current_profile.user.id diff --git a/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid b/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid index 31ba099..c220cfd 100644 --- a/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/user/delete.liquid @@ -8,7 +8,7 @@ graphql user = 'modules/user/user/delete', id: id unless user.errors - assign params = '{}' | parse_json | hash_merge: user: user.user + assign params = { "user": user.user } function results = 'modules/core/commands/hook/fire', hook: 'user_delete', params: params, merge_to_object: null hash_assign user['hook_results'] = results diff --git a/pos-module-chat/modules/user/public/lib/commands/user/update.liquid b/pos-module-chat/modules/user/public/lib/commands/user/update.liquid index d2502fa..c28a241 100644 --- a/pos-module-chat/modules/user/public/lib/commands/user/update.liquid +++ b/pos-module-chat/modules/user/public/lib/commands/user/update.liquid @@ -17,7 +17,7 @@ graphql user = 'modules/user/user/update', args: object hash_assign object['update_result'] = user unless user.errors - assign params = '{}' | parse_json | hash_merge: updated_user: user.user, hook_params: hook_params + assign params = { "updated_user": user.user, "hook_params": hook_params } # todo: merge_to_object for hooks with the same name will overwrite the validity of previous results function results = 'modules/core/commands/hook/fire', hook: 'user_update', params: params, merge_to_object: true for result in results diff --git a/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid b/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid index 460352f..b56072e 100644 --- a/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid +++ b/pos-module-chat/modules/user/public/lib/helpers/current_profile.liquid @@ -1,17 +1,17 @@ {% liquid function user = 'modules/user/queries/user/current' if user.id == null - assign current_profile = '{ "user": null, "roles": ["anonymous"] }' | parse_json + assign current_profile = { "user": null, "roles": ["anonymous"] } else function current_profile = 'modules/user/queries/profiles/find', user_id: user.id, id: null, uuid: null, first_name: null, last_name: null assign current_profile = current_profile | hash_merge: user: user if current_profile.roles != null - hash_assign current_profile['roles'] = current_profile.roles | array_add: 'authenticated' + hash_assign current_profile['roles'] = current_profile.roles << 'authenticated' else - hash_assign current_profile['roles'] = '["authenticated"]' | parse_json + hash_assign current_profile['roles'] = ["authenticated"] endif endif export current_profile return current_profile -%} + %} diff --git a/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid b/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid index 0e490b4..85da299 100644 --- a/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid +++ b/pos-module-chat/modules/user/public/lib/queries/profiles/filters.liquid @@ -1,15 +1,13 @@ -{% parse_json sort_options %} -{ - "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }}, - "first_name_desc": { "properties": { "name": "first_name", "order": "ASC" }} -} -{% endparse_json %} {% liquid - assign filters = '{}' | parse_json + assign sort_options = { + "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }}, + "first_name_asc": { "properties": { "name": "first_name", "order": "ASC" }} + } + assign filters = {} hash_assign filters['page'] = params.page | to_positive_integer: 1 hash_assign filters['keyword'] = params.keyword | default: '' hash_assign filters['sort_by'] = params.sort_by | default: 'first_name_desc' hash_assign filters['sort'] = sort_options[filters.sort_by] return filters -%} + %} diff --git a/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid b/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid index ec4ed53..dab15bc 100644 --- a/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid +++ b/pos-module-chat/modules/user/public/lib/queries/profiles/search.liquid @@ -7,16 +7,16 @@ graphql r = 'modules/user/profiles/search', limit: limit, uuid: uuid, id: id, ids: ids, first_name: first_name , last_name: last_name , user_id: user_id, not_ids: not_ids, query: query, emails: emails, sort: sort, page: page assign records = r.records - assign profiles = '[]' | parse_json + assign profiles = [] for profile in records.results function slug = 'modules/user/helpers/profiles/slugs/build' , current_profile: profile hash_assign profile['slug'] = slug assign p = profile - assign profiles = profiles | array_add: p + assign profiles << p endfor hash_assign records['results'] = profiles return records -%} + %} diff --git a/pos-module-core/modules/core/generators/crud/templates/views/pages/model/new.liquid b/pos-module-core/modules/core/generators/crud/templates/views/pages/model/new.liquid index cb0e37a..43c1b24 100644 --- a/pos-module-core/modules/core/generators/crud/templates/views/pages/model/new.liquid +++ b/pos-module-core/modules/core/generators/crud/templates/views/pages/model/new.liquid @@ -1,4 +1,4 @@ {% liquid - assign object = '{}' | parse_json + assign object = {} render 'theme/simple/<%= modelNamePlural %>/new', object: object -%} + %} diff --git a/pos-module-core/modules/core/public/lib/commands/email/send.liquid b/pos-module-core/modules/core/public/lib/commands/email/send.liquid index bd0a46e..08b61e8 100644 --- a/pos-module-core/modules/core/public/lib/commands/email/send.liquid +++ b/pos-module-core/modules/core/public/lib/commands/email/send.liquid @@ -7,8 +7,8 @@ if r.errors log r.errors, type: 'errors.graphql.invalid' - hash_assign object['valid'] = false - hash_assign object['errors'] = r.errors + assign object.valid = false + assign object.errors = r.errors endif else log object.errors, type: 'payload validation error in core: commands/email' diff --git a/pos-module-core/modules/core/public/lib/commands/email/send/check.liquid b/pos-module-core/modules/core/public/lib/commands/email/send/check.liquid index 83f4269..ace1577 100644 --- a/pos-module-core/modules/core/public/lib/commands/email/send/check.liquid +++ b/pos-module-core/modules/core/public/lib/commands/email/send/check.liquid @@ -1,13 +1,13 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'from' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'to' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'layout' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'partial' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-core/modules/core/public/lib/commands/events/broadcast.liquid b/pos-module-core/modules/core/public/lib/commands/events/broadcast.liquid index 5cf9440..6558c07 100644 --- a/pos-module-core/modules/core/public/lib/commands/events/broadcast.liquid +++ b/pos-module-core/modules/core/public/lib/commands/events/broadcast.liquid @@ -8,7 +8,7 @@ assign name = 'consumers/' | append: object.type | append: '/' graphql consumers = 'modules/core/events/consumers', name: name | fetch: "admin_liquid_partials" | fetch: "results" - hash_assign object['consumers'] = consumers + assign object.consumers = consumers for consumer in consumers assign priority = 'default' if priorities contains consumer.metadata.priority diff --git a/pos-module-core/modules/core/public/lib/commands/events/create/check.liquid b/pos-module-core/modules/core/public/lib/commands/events/create/check.liquid index b4f2878..e931a31 100644 --- a/pos-module-core/modules/core/public/lib/commands/events/create/check.liquid +++ b/pos-module-core/modules/core/public/lib/commands/events/create/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'type' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'date' @@ -17,8 +17,8 @@ if event_check_partial function event_result = event_check_partial.path, event: object if event_result.valid != true - hash_assign c['errors']['object'] = event_result.errors - hash_assign c['valid'] = false + assign c.errors.object = event_result.errors + assign c.valid = false endif else assign message = 'There is no such event: ' | append: object.type | append: '. Please add event check in events/' | append: object.type @@ -27,4 +27,4 @@ assign object = object | hash_merge: c return object -%} + %} diff --git a/pos-module-core/modules/core/public/lib/commands/events/create/execute.liquid b/pos-module-core/modules/core/public/lib/commands/events/create/execute.liquid index bff75bf..326537b 100644 --- a/pos-module-core/modules/core/public/lib/commands/events/create/execute.liquid +++ b/pos-module-core/modules/core/public/lib/commands/events/create/execute.liquid @@ -2,7 +2,7 @@ graphql r = 'modules/core/events/create', payload: object assign object = r.activity_create.payload - hash_assign object['valid'] = true + assign object.valid = true return object %} diff --git a/pos-module-core/modules/core/public/lib/commands/execute.liquid b/pos-module-core/modules/core/public/lib/commands/execute.liquid index 0c9e1cd..e68f82d 100644 --- a/pos-module-core/modules/core/public/lib/commands/execute.liquid +++ b/pos-module-core/modules/core/public/lib/commands/execute.liquid @@ -7,6 +7,6 @@ endif assign object = r[selection] - hash_assign object['valid'] = true + assign object.valid = true return object %} diff --git a/pos-module-core/modules/core/public/lib/commands/hook/alter.liquid b/pos-module-core/modules/core/public/lib/commands/hook/alter.liquid index 64e2245..670f254 100644 --- a/pos-module-core/modules/core/public/lib/commands/hook/alter.liquid +++ b/pos-module-core/modules/core/public/lib/commands/hook/alter.liquid @@ -16,6 +16,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-core/modules/core/public/lib/commands/hook/fire.liquid b/pos-module-core/modules/core/public/lib/commands/hook/fire.liquid index c4956c8..d2872ca 100644 --- a/pos-module-core/modules/core/public/lib/commands/hook/fire.liquid +++ b/pos-module-core/modules/core/public/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-core/modules/core/public/lib/commands/statuses/create/check.liquid b/pos-module-core/modules/core/public/lib/commands/statuses/create/check.liquid index acbcb25..db690e5 100644 --- a/pos-module-core/modules/core/public/lib/commands/statuses/create/check.liquid +++ b/pos-module-core/modules/core/public/lib/commands/statuses/create/check.liquid @@ -1,13 +1,13 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'name' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'timestamp' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'reference_id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'requester_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-core/modules/core/public/lib/commands/statuses/delete/check.liquid b/pos-module-core/modules/core/public/lib/commands/statuses/delete/check.liquid index 51f8988..225a9ed 100644 --- a/pos-module-core/modules/core/public/lib/commands/statuses/delete/check.liquid +++ b/pos-module-core/modules/core/public/lib/commands/statuses/delete/check.liquid @@ -1,10 +1,10 @@ {% liquid - assign c = '{ "valid": true, "errors": {} }' | parse_json + assign c = { "valid": true, "errors": {} } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-core/modules/core/public/lib/helpers/redirect_to.liquid b/pos-module-core/modules/core/public/lib/helpers/redirect_to.liquid index 3d430eb..2a109e0 100644 --- a/pos-module-core/modules/core/public/lib/helpers/redirect_to.liquid +++ b/pos-module-core/modules/core/public/lib/helpers/redirect_to.liquid @@ -28,8 +28,8 @@ echo response_json else response_status 422 - assign res = '{ "errors": {} }' | parse_json - hash_assign res['errors'] = response_json.errors + assign res = { "errors": {} } + assign res.errors = response_json.errors echo res endif diff --git a/pos-module-core/modules/core/public/lib/helpers/register_error.liquid b/pos-module-core/modules/core/public/lib/helpers/register_error.liquid index 2f252ef..e04d750 100644 --- a/pos-module-core/modules/core/public/lib/helpers/register_error.liquid +++ b/pos-module-core/modules/core/public/lib/helpers/register_error.liquid @@ -17,11 +17,11 @@ assign errors = contract.errors - assign field_errors = errors[field_name] | default: '[]' | parse_json + assign field_errors = errors[field_name] | default: [] assign field_errors = field_errors | add_to_array: msg - hash_assign errors[field_name] = field_errors - hash_assign contract['valid'] = false + assign errors[field_name] = field_errors + assign contract.valid = false return contract %} diff --git a/pos-module-core/modules/core/public/lib/queries/registry/search.liquid b/pos-module-core/modules/core/public/lib/queries/registry/search.liquid index 60e1126..f0564d4 100644 --- a/pos-module-core/modules/core/public/lib/queries/registry/search.liquid +++ b/pos-module-core/modules/core/public/lib/queries/registry/search.liquid @@ -8,7 +8,7 @@ case type when 'module' - assign modules = '[]' | parse_json + assign modules = [] for module in registry if module.type == 'module' assign modules = modules | add_to_array: module @@ -16,7 +16,7 @@ endfor return modules when 'theme' - assign themes = '[]' | parse_json + assign themes = [] for module in registry if module.type == 'theme' assign themes = themes | add_to_array: module diff --git a/pos-module-core/modules/core/public/lib/validations/valid_object.liquid b/pos-module-core/modules/core/public/lib/validations/valid_object.liquid index b29a9b1..41f9359 100644 --- a/pos-module-core/modules/core/public/lib/validations/valid_object.liquid +++ b/pos-module-core/modules/core/public/lib/validations/valid_object.liquid @@ -12,7 +12,7 @@ if check_object.valid != true function c = 'modules/core/helpers/register_error', contract: c, field_name: field_name, key: 'modules/core/validation.invalid' assign errors_key = field_name | append: '_errors' - hash_assign c['errors'][errors_key] = check_object.errors + assign c.errors[errors_key] = check_object.errors endif endif diff --git a/pos-module-core/modules/core/public/views/pages/_events/trigger.liquid b/pos-module-core/modules/core/public/views/pages/_events/trigger.liquid index 9ac9edd..c062670 100644 --- a/pos-module-core/modules/core/public/views/pages/_events/trigger.liquid +++ b/pos-module-core/modules/core/public/views/pages/_events/trigger.liquid @@ -12,7 +12,7 @@ slug: _events/:uuid/trigger else assign name = 'consumers/' | append: event.type | append: '/' graphql consumers = 'modules/core/events/consumers', name: name | fetch: "admin_liquid_partials" | fetch: "results" - hash_assign event['consumers'] = consumers + assign event.consumers = consumers endif render 'modules/core/events/show', event: event diff --git a/pos-module-core/modules/core/public/views/partials/lib/commands/email/send.liquid b/pos-module-core/modules/core/public/views/partials/lib/commands/email/send.liquid index e6ad1be..1818aa7 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/commands/email/send.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/commands/email/send.liquid @@ -8,8 +8,8 @@ if r.errors log r.errors, type: 'errors.graphql.invalid' - hash_assign object['valid'] = false - hash_assign object['errors'] = r.errors + assign object.valid = false + assign object.errors = r.errors endif else log object.errors, type: 'payload validation error in core: lib/commands/email' diff --git a/pos-module-core/modules/core/public/views/partials/lib/commands/email/send/check.liquid b/pos-module-core/modules/core/public/views/partials/lib/commands/email/send/check.liquid index 83f4269..ace1577 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/commands/email/send/check.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/commands/email/send/check.liquid @@ -1,13 +1,13 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'from' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'to' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'layout' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'partial' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-core/modules/core/public/views/partials/lib/commands/hook/alter.liquid b/pos-module-core/modules/core/public/views/partials/lib/commands/hook/alter.liquid index 3418a8a..118bc47 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/commands/hook/alter.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/commands/hook/alter.liquid @@ -17,6 +17,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-core/modules/core/public/views/partials/lib/commands/hook/fire.liquid b/pos-module-core/modules/core/public/views/partials/lib/commands/hook/fire.liquid index 5af969b..ec71ae5 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/commands/hook/fire.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-core/modules/core/public/views/partials/lib/helpers/register_error.liquid b/pos-module-core/modules/core/public/views/partials/lib/helpers/register_error.liquid index 2f252ef..e04d750 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/helpers/register_error.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/helpers/register_error.liquid @@ -17,11 +17,11 @@ assign errors = contract.errors - assign field_errors = errors[field_name] | default: '[]' | parse_json + assign field_errors = errors[field_name] | default: [] assign field_errors = field_errors | add_to_array: msg - hash_assign errors[field_name] = field_errors - hash_assign contract['valid'] = false + assign errors[field_name] = field_errors + assign contract.valid = false return contract %} diff --git a/pos-module-core/modules/core/public/views/partials/lib/queries/registry/search.liquid b/pos-module-core/modules/core/public/views/partials/lib/queries/registry/search.liquid index 9c2cb22..c417f51 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/queries/registry/search.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/queries/registry/search.liquid @@ -8,7 +8,7 @@ case type when 'module' - assign modules = '[]' | parse_json + assign modules = [] for module in registry if module.type == 'module' assign modules = modules | add_to_array: module @@ -16,7 +16,7 @@ endfor return modules when 'theme' - assign themes = '[]' | parse_json + assign themes = [] for module in registry if module.type == 'theme' assign themes = themes | add_to_array: module diff --git a/pos-module-core/modules/core/public/views/partials/lib/validations/valid_object.liquid b/pos-module-core/modules/core/public/views/partials/lib/validations/valid_object.liquid index 7b1b317..f0adacc 100644 --- a/pos-module-core/modules/core/public/views/partials/lib/validations/valid_object.liquid +++ b/pos-module-core/modules/core/public/views/partials/lib/validations/valid_object.liquid @@ -13,7 +13,7 @@ if check_object.valid != true function c = 'modules/core/lib/helpers/register_error', contract: c, field_name: field_name, key: 'modules/core/validation.invalid' assign errors_key = field_name | append: '_errors' - hash_assign c['errors'][errors_key] = check_object.errors + assign c.errors[errors_key] = check_object.errors endif endif diff --git a/pos-module-core/modules/core/template-values.json b/pos-module-core/modules/core/template-values.json index 87ab94b..8a2520a 100644 --- a/pos-module-core/modules/core/template-values.json +++ b/pos-module-core/modules/core/template-values.json @@ -2,6 +2,6 @@ "name": "Pos Module Core", "machine_name": "core", "type": "module", - "version": "2.0.7", + "version": "2.1.0", "dependencies": {} } diff --git a/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/create/build.liquid b/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/create/build.liquid index 44ec47d..81e6a33 100644 --- a/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/create/build.liquid +++ b/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/create/build.liquid @@ -1,14 +1,14 @@ {%- liquid - assign result = '{}' | parse_json + assign result = {} if object.records_filter - hash_assign result['records_filter'] = null | hash_merge: filter: object.records_filter + assign result.records_filter = null | hash_merge: filter: object.records_filter endif if object.users_filter - hash_assign result['users_filter'] = null | hash_merge: filter: object.users_filter + assign result.users_filter = null | hash_merge: filter: object.users_filter endif if object.encryption - hash_assign result['encryption'] = object.encryption + assign result.encryption = object.encryption endif return result -%} + %} diff --git a/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/delete/build.liquid b/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/delete/build.liquid index 7527759..e27c6b3 100644 --- a/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/delete/build.liquid +++ b/pos-module-data-export-api/modules/data_export_api/public/lib/commands/data_exports/delete/build.liquid @@ -1,6 +1,5 @@ {%- liquid - assign result = '{}' | parse_json - hash_assign result['id'] = object.id + assign result = { "id": object.id } return result -%} + %} diff --git a/pos-module-data-export-api/modules/data_export_api/template-values.json b/pos-module-data-export-api/modules/data_export_api/template-values.json index 250e6d2..1b744f6 100644 --- a/pos-module-data-export-api/modules/data_export_api/template-values.json +++ b/pos-module-data-export-api/modules/data_export_api/template-values.json @@ -2,7 +2,7 @@ "name": "pos-module-data-export-api", "machine_name": "data_export_api", "type": "module", - "version": "0.1.1", + "version": "0.2.0", "dependencies": { "core": "^1.5.0" } diff --git a/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/build.liquid index 44f6bf5..19489c9 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/build.liquid @@ -1,10 +1,5 @@ {% liquid - assign embedding = '{}' | parse_json - - hash_assign embedding['embedding'] = object.embedding - hash_assign embedding['content'] = object.content - hash_assign embedding['metadata'] = object.metadata - hash_assign embedding['token_count'] = object.token_count + assign embedding = { "embedding": object.embedding, "content": object.content, "metadata": object.metadata, "token_count": object.token_count } return embedding -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/execute.liquid b/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/execute.liquid index 7674aec..0ea5325 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/execute.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/embeddings/create/execute.liquid @@ -2,8 +2,8 @@ graphql r = 'modules/openai/embeddings/create', args: object assign object = r.embedding_create - hash_assign object['valid'] = true + assign object.valid = true return object -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/embeddings/delete/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/embeddings/delete/build.liquid index 5315d48..eebc3bb 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/embeddings/delete/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/embeddings/delete/build.liquid @@ -1,7 +1,6 @@ {% liquid assign id = id | default: object.id - assign embedding = '{}' | parse_json - hash_assign embedding['id'] = id + assign embedding = { "id": id } return embedding -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/build.liquid index 3d57b43..1707969 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/build.liquid @@ -1,13 +1,7 @@ {% liquid assign id = id | default: object.id - assign embedding = '{}' | parse_json - hash_assign embedding['id'] = id - - hash_assign embedding['embedding'] = object.embedding - hash_assign embedding['content'] = object.content - hash_assign embedding['metadata'] = object.metadata - hash_assign embedding['token_count'] = object.token_count + assign embedding = { "id": id, "embedding": object.embedding, "content": object.content, "metadata": object.metadata, "token_count": object.token_count } return embedding -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/execute.liquid b/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/execute.liquid index 3909418..e6b6a60 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/execute.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/embeddings/update/execute.liquid @@ -2,8 +2,8 @@ graphql r = 'modules/openai/embeddings/update', args: object assign object = r.embedding_update - hash_assign object['valid'] = true + assign object.valid = true return object -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/openai/chat/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/openai/chat/build.liquid index aed1ea7..0813677 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/openai/chat/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/openai/chat/build.liquid @@ -74,31 +74,30 @@ See also: https://platform.openai.com/docs/api-reference/chat {%- liquid - hash_assign data_frame['model'] = object['model'] | default: "gpt-4o-mini" - hash_assign data_frame['temperature'] = object['temperature'] | default: 1 - hash_assign data_frame['messages'][0]['content'] = object['system_message'] | default: "" - hash_assign data_frame['messages'][1]['content'][0]['text'] = object['user_message'] | default: "" + assign data_frame.model = object['model'] | default: "gpt-4o-mini" + assign data_frame.temperature = object['temperature'] | default: 1 + assign data_frame.messages[0].content = object['system_message'] | default: "" + assign data_frame.messages[1].content[0].text = object['user_message'] | default: "" - assign user_images = object['user_images'] | default: '[]' | parse_json + assign user_images = object['user_images'] | default: [] if user_images.size > 0 - assign user_content = data_frame['messages'][1]['content'] + assign user_content = data_frame.messages[1].content for item in user_images - assign img_object = null | hash_merge: type: "image_url" | hash_merge: image_url: null - hash_assign img_object['image_url'] = null | hash_merge: url: item - assign user_content = user_content | array_add: img_object + assign img_object = { "type": "image_url", "image_url": { "url": item } } + assign user_content = user_content << img_object endfor - hash_assign data_frame['messages'][1]['content'] = user_content + assign data_frame.messages[1].content = user_content endif assign response_format_schema_json = object['response_format_schema_json'] | default: null if response_format_schema_json != blank - hash_assign data_frame['response_format']['json_schema']['schema']['properties'] = response_format_schema_json + assign data_frame.response_format.json_schema.schema.properties = response_format_schema_json else - hash_assign data_frame['response_format'] = null + assign data_frame.response_format = null endif return data_frame diff --git a/pos-module-openai/modules/openai/public/lib/commands/openai/fetch_embeddings/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/openai/fetch_embeddings/build.liquid index 8d263ff..7cacd27 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/openai/fetch_embeddings/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/openai/fetch_embeddings/build.liquid @@ -21,14 +21,14 @@ assign arr = object assign obj_type = object | type_of if obj_type != 'Array' - assign arr = '[]' | parse_json | add_to_array: object + assign arr = [object] endif assign arr = arr - hash_assign request_object['data']['payload']['input'] = arr | compact + assign request_object.data.payload.input = arr | compact else log "modules/openai/fetch_embeddings - object is null, should be an array of strings that will be transformed to embeddings", type: 'ERROR' endif return request_object -%} + %} diff --git a/pos-module-openai/modules/openai/public/lib/commands/openai/responses/build.liquid b/pos-module-openai/modules/openai/public/lib/commands/openai/responses/build.liquid index c4be056..e657109 100644 --- a/pos-module-openai/modules/openai/public/lib/commands/openai/responses/build.liquid +++ b/pos-module-openai/modules/openai/public/lib/commands/openai/responses/build.liquid @@ -77,38 +77,38 @@ See also: https://platform.openai.com/docs/api-reference/responses/create {%- liquid - hash_assign data_frame['model'] = object['model'] | default: "gpt-4o-mini" - hash_assign data_frame['temperature'] = object['temperature'] | default: 1 - hash_assign data_frame['input'][0]['content'] = object['system_message'] | default: "" - hash_assign data_frame['input'][1]['content'][0]['text'] = object['user_message'] | default: "" + assign data_frame.model = object['model'] | default: "gpt-4o-mini" + assign data_frame.temperature = object['temperature'] | default: 1 + assign data_frame.input[0].content = object['system_message'] | default: "" + assign data_frame.input[1].content[0].text = object['user_message'] | default: "" - assign user_images = object['user_images'] | default: '[]' | parse_json + assign user_images = object['user_images'] | default: [] if user_images.size > 0 - assign user_content = data_frame['input'][1]['content'] + assign user_content = data_frame.input[1].content for item in user_images - assign img_object = null | hash_merge: type: "input_image" | hash_merge: image_url: item - assign user_content = user_content | array_add: img_object + assign img_object = { "type": "input_image", "image_url": item } + assign user_content << img_object endfor - hash_assign data_frame['input'][1]['content'] = user_content + assign data_frame.input[1].content = user_content endif assign response_format_schema_json = object['response_format_schema_json'] | default: null assign response_format_required_fields = object['response_format_required_fields'] | default: null if response_format_schema_json != blank - hash_assign data_frame['text']['format']['schema']['properties'] = response_format_schema_json + assign data_frame.text.format.schema.properties = response_format_schema_json if response_format_required_fields == blank - assign required = data_frame['text']['format']['schema']['properties'] | hash_keys - hash_assign data_frame['text']['format']['schema']['required'] = required + assign required = data_frame.text.format.schema.properties | hash_keys + assign data_frame.text.format.schema.required = required else - hash_assign data_frame['text']['format']['schema']['required'] = response_format_required_fields + assign data_frame.text.format.schema.required = response_format_required_fields endif else - hash_assign data_frame['text'] = null + assign data_frame.text = null endif return data_frame diff --git a/pos-module-openai/template-values.json b/pos-module-openai/template-values.json index de6d548..2475366 100644 --- a/pos-module-openai/template-values.json +++ b/pos-module-openai/template-values.json @@ -2,7 +2,7 @@ "name": "pos-module-openai", "machine_name": "openai", "type": "module", - "version": "1.1.0", + "version": "1.2.0", "dependencies": { "core": "^2.0.0" } diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/connected_accounts/create.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/connected_accounts/create.liquid index 8a7589d..ca81eaa 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/connected_accounts/create.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/connected_accounts/create.liquid @@ -6,7 +6,7 @@ if object.account_id == blank function account = 'modules/payments_stripe/commands/stripe_connected_accounts/create', reference_id: object.reference_id, metadata: object - hash_assign object['account_id'] = account.id + assign object.account_id = account.id endif function object = 'modules/payments_stripe/commands/connected_accounts/create/build', object: object function object = 'modules/payments_stripe/commands/connected_accounts/create/check', object: object diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/customers/create.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/customers/create.liquid index 148994f..b8ea1eb 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/customers/create.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/customers/create.liquid @@ -1,7 +1,7 @@ {% liquid function customer = 'modules/payments_stripe/queries/customers/find_by_customer_id', customer_id: object.customer_id if customer - hash_assign customer['valid'] = true + assign customer.valid = true return customer endif diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/payouts/handle_webhook/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/payouts/handle_webhook/check.liquid index 401f7a1..a47d533 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/payouts/handle_webhook/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/payouts/handle_webhook/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'payout_id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'gateway_connected_account_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/setup_intents/update_status/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/setup_intents/update_status/check.liquid index 63323dc..88397ca 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/setup_intents/update_status/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/setup_intents/update_status/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'c__status' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_balance_history/retrieve/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_balance_history/retrieve/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_balance_history/retrieve/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_balance_history/retrieve/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/create/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/create/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/create/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/create/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/handle_webhook/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/handle_webhook/check.liquid index 384b5fa..a9ebc98 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/handle_webhook/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_charge/handle_webhook/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'status' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/build.liquid index 73f6210..80a7c9c 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/build.liquid @@ -1,3 +1,3 @@ {% liquid - return object | default: '{}' | parse_json -%} + return object | default: {} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/check.liquid index 06145c0..c6273d9 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/check.liquid @@ -1,13 +1,13 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object.data.object, field_name: 'client_reference_id' assign ids = object.data.object['client_reference_id'] | split: ',' function c = 'modules/core/validations/exist_in_db', c: c, field_name: 'transaction_id', table: 'modules/payments/transaction', ids: ids - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/map_request.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/map_request.liquid index 55e2652..2de5ec0 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/map_request.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/complete/map_request.liquid @@ -1,33 +1,33 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.request_data assign response = object.request_data | parse_json - hash_assign data['valid'] = true - hash_assign data['external_id'] = response.client_reference_id + assign data.valid = true + assign data.external_id = response.client_reference_id function transaction = 'modules/payments/queries/transactions/find', id: data.external_id - hash_assign data['transaction'] = transaction + assign data.transaction = transaction assign customer = nil | hash_merge: customer_id: response.customer, email: response.customer_details.email, name: response.customer_details.name, reference_id: transaction.payer_id - hash_assign data['customer'] = customer + assign data.customer = customer case object.name when 'checkout.session.completed' - hash_assign data['status'] = 'pending' + assign data.status = 'pending' if response.payment_status == 'paid' - hash_assign data['status'] = 'succeeded' + assign data.status = 'succeeded' endif when 'checkout.session.async_payment_succeeded' - hash_assign data['status'] = 'succeeded' + assign data.status = 'succeeded' when 'checkout.session.async_payment_failed' - hash_assign data['status'] = 'failed' + assign data.status = 'failed' endcase else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/create/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/create/map_response.liquid index f905911..502f634 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/create/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/create/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = data | hash_merge: id: response.id, url: response.url, payment_intent: response.payment_intent - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/expire/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/expire/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/expire/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/expire/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/build.liquid index a49a1aa..446e562 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/build.liquid @@ -3,9 +3,9 @@ if object.customer assign customer = nil | hash_merge: customer_id: object.customer, email: object.customer_details.email, name: object.customer_details.name, reference_id: transaction.payer_id - hash_assign data['customer'] = customer + assign data.customer = customer endif - hash_assign data['status'] = object.status + assign data.status = object.status return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/check.liquid index 34348e0..b203354 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/handle_webhook/check.liquid @@ -1,8 +1,8 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/build.liquid index bd7d71f..6e2c7d5 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/build.liquid @@ -2,12 +2,12 @@ assign url = 'https://api.stripe.com/v1/checkout/sessions' assign url = url | append: '/' | append: transaction.gateway_transaction_id - assign payload = '{}' | parse_json + assign payload = {} if with_payment_intent - assign expand = '[]' | parse_json | array_add: 'payment_intent' + assign expand = ["payment_intent"] assign payload = payload | hash_merge: expand: expand endif assign data = null | hash_merge: payload: payload, request_type: 'GET', to: url return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/retrieve/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/setup_intent/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/setup_intent/map_response.liquid index 2d31acd..2d0cff5 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/setup_intent/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_checkout/setup_intent/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = data | hash_merge: id: response.id, url: response.url, setup_intent: response.setup_intent - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/create/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/create/map_response.liquid index cdaed6e..1f2d438 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/create/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/create/map_response.liquid @@ -1,19 +1,19 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = data | hash_merge: id: response.id - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif - hash_assign data['stripe_account_name'] = stripe_account_name + assign data.stripe_account_name = stripe_account_name return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/delete/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/delete/map_response.liquid index a2cb0de..af2a3fd 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/delete/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/delete/map_response.liquid @@ -1,18 +1,18 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = data | hash_merge: id: response.id - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_dashboard_link/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_dashboard_link/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_dashboard_link/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_dashboard_link/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_onboarding_link/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_onboarding_link/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_onboarding_link/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/get_onboarding_link/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/build.liquid index e46aebc..4c9b92d 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/build.liquid @@ -1,10 +1,10 @@ {% liquid assign account_data = object.data.object - hash_assign account_data['state'] = 'pending' + assign account_data.state = 'pending' if account_data.payouts_enabled == true and account_data.charges_enabled == true - hash_assign account_data['state'] = 'verified' + assign account_data.state = 'verified' endif return account_data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/check.liquid index 07a5d00..dd50ad5 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_connected_accounts/handle_webhook/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'state' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_customer/retrieve/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_customer/retrieve/map_response.liquid index a1754d6..fcaa275 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_customer/retrieve/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_customer/retrieve/map_response.liquid @@ -1,20 +1,20 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true - hash_assign data['customer_id'] = response.id - hash_assign data['reference_id'] = payer_id - hash_assign data['stripe_account_name'] = stripe_account_name + assign data.valid = true + assign data.customer_id = response.id + assign data.reference_id = payer_id + assign data.stripe_account_name = stripe_account_name endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_intent/create/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_intent/create/map_response.liquid index 6c84bc9..4b21687 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_intent/create/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_intent/create/map_response.liquid @@ -1,17 +1,17 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign data = response - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_method/retrieve/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_method/retrieve/map_response.liquid index e3d9ff3..3d44c2c 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_method/retrieve/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_payment_method/retrieve/map_response.liquid @@ -1,18 +1,18 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.valid = false else assign payment_method = response[response.type] | hash_merge: payment_method_id: response.id, type: response.type, stripe_account_name: stripe_account_name assign data = payment_method - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false + assign data.valid = false endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/build.liquid index f968d4b..470bb77 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/build.liquid @@ -1,6 +1,6 @@ {%- liquid assign payable_ids = transaction.payable_ids | join: ',' - hash_assign object['metadata'] = object.metadata | hash_merge: transaction_id: transaction.id, payable_ids: payable_ids, payer_id: transaction.payer_id + assign object.metadata = object.metadata | hash_merge: transaction_id: transaction.id, payable_ids: payable_ids, payer_id: transaction.payer_id -%} {%- parse_json data -%} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/map_response.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/map_response.liquid index c0afda1..4b1ef47 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/map_response.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_refund/create/map_response.liquid @@ -1,19 +1,19 @@ {% liquid - assign data = '{}' | parse_json + assign data = {} if object.response_body assign response = object.response_body | parse_json if response.error - hash_assign data['errors'] = response.error - hash_assign data['status'] = 'failed' - hash_assign data['valid'] = false + assign data.errors = response.error + assign data.status = 'failed' + assign data.valid = false else assign data = response | hash_merge: refund_id: response.id - hash_assign data['valid'] = true + assign data.valid = true endif else - hash_assign data['valid'] = false - hash_assign data['status'] = 'failed' + assign data.valid = false + assign data.status = 'failed' endif return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/build.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/build.liquid index 9653133..dd28ea0 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/build.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/build.liquid @@ -2,13 +2,13 @@ assign data = null | hash_merge: setup_intent: setup_intent, id: object.id if object.customer function customer = 'modules/payments_stripe/commands/stripe_customer/retrieve', customer_id: object.customer, payer_id: setup_intent.reference_id, stripe_account_name: setup_intent.stripe_account_name - hash_assign data['customer'] = customer + assign data.customer = customer if object.payment_method function payment_method = 'modules/payments_stripe/commands/stripe_payment_method/retrieve', payment_method_id: object.payment_method, customer_id: customer.customer_id, stripe_account_name: setup_intent.stripe_account_name - hash_assign data['payment_method'] = payment_method + assign data.payment_method = payment_method endif endif - hash_assign data['status'] = object.status + assign data.status = object.status return data -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/check.liquid index a97c3fe..41ee7a8 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_setup_intent/handle_webhook/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'customer' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'payment_method' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_webhook/delete/check.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_webhook/delete/check.liquid index e535b50..7423300 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_webhook/delete/check.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/stripe_webhook/delete/check.liquid @@ -1,13 +1,13 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'to' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'request_type' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'idempotency_key' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'gateway_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhook_endpoints/create.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhook_endpoints/create.liquid index 582749c..426b14b 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhook_endpoints/create.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhook_endpoints/create.liquid @@ -4,10 +4,10 @@ if object.valid graphql r = 'modules/payments_stripe/webhook_endpoints/create', args: object assign object = r['record'] - hash_assign object['valid'] = true + assign object.valid = true else log object, type: 'ERROR: modules/payments_stripe webhook_endpoints/create' endif return object -%} + %} diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/charge.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/charge.liquid index 64cfdec..0aa7884 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/charge.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/charge.liquid @@ -1,7 +1,7 @@ {%- liquid assign requester_id = 'stripe_webhook_request' assign response = null | hash_merge: status: 200 - assign gateway_transaction_ids = params.data.object.id | split: '!!' | array_add: params.data.object.payment_intent | array_compact + assign gateway_transaction_ids = params.data.object.id | split: '!!' | push: params.data.object.payment_intent | compact if params.data.object.metadata.transaction_id function transaction = 'modules/payments/queries/transactions/find', id: params.data.object.metadata.transaction_id elsif gateway_transaction_ids.size > 0 @@ -11,18 +11,18 @@ function payment_status = 'modules/payments/commands/transactions/map_status', payment_status: params.data.object.status if transaction == blank and params.data.object.metadata.host contains host - hash_assign response['status'] = 500 - hash_assign response['body'] = "Transaction not found" + assign response.status = 500 + assign response.body = "Transaction not found" log params, type: 'ERROR: modules/payments_stripe/commands/webhooks/charge object' elsif transaction == blank - hash_assign response['status'] = 202 - hash_assign response['body'] = "Transaction is from a different host" + assign response.status = 202 + assign response.body = "Transaction is from a different host" elsif transaction and transaction.c__status == payment_status - hash_assign response['status'] = 202 - hash_assign response['body'] = "Transaction already completed" + assign response.status = 202 + assign response.body = "Transaction already completed" elsif transaction and params.data.object.metadata.host contains host or params.data.object.metadata.host == blank function object = 'modules/payments_stripe/commands/stripe_charge/handle_webhook', params: params, requester_id: requester_id, request_url: request_url, transaction: transaction - hash_assign response['body'] = object + assign response.body = object endif return response diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/connected_account.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/connected_account.liquid index 8362cd7..fd7bc5e 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/connected_account.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/connected_account.liquid @@ -4,11 +4,11 @@ function connected_account = 'modules/payments_stripe/queries/connected_accounts/find_by_account_id', account_id: params.account if connected_account == blank - hash_assign response['status'] = 202 - hash_assign response['body'] = "Account is from a different host" + assign response.status = 202 + assign response.body = "Account is from a different host" else function object = 'modules/payments_stripe/commands/stripe_connected_accounts/handle_webhook', params: params, connected_account: connected_account - hash_assign response['body'] = object + assign response.body = object endif return response diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/payout.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/payout.liquid index c0c77de..5ee5ddd 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/payout.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/payout.liquid @@ -4,11 +4,11 @@ function connected_account = 'modules/payments_stripe/queries/connected_accounts/find_by_account_id', account_id: params.account if connected_account == blank - hash_assign response['status'] = 202 - hash_assign response['body'] = "Payout is from a different host" + assign response.status = 202 + assign response.body = "Payout is from a different host" else function object = 'modules/payments_stripe/commands/payouts/handle_webhook', params: params, request_url: request_url, connected_account: connected_account - hash_assign response['body'] = object + assign response.body = object endif return response diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/session_expired.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/session_expired.liquid index 7919639..79f8494 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/session_expired.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/session_expired.liquid @@ -2,21 +2,21 @@ assign requester_id = 'stripe_webhook_request' assign response = null | hash_merge: status: 200 - assign gateway_transaction_ids = params.data.object.id | split: '!!' | array_add: params.data.object.payment_intent + assign gateway_transaction_ids = params.data.object.id | split: '!!' | push: params.data.object.payment_intent function transactions = 'modules/payments/queries/transactions/search', gateway_transaction_ids: gateway_transaction_ids, limit: 1 assign transaction = transactions.results[0] if transaction == blank and params.data.object.success_url contains host - hash_assign response['status'] = 500 - hash_assign response['body'] = "Transaction not found" + assign response.status = 500 + assign response.body = "Transaction not found" log params, type: 'ERROR: modules/payments_stripe/commands/webhooks/session_expired object' elsif transaction == blank - hash_assign response['status'] = 202 - hash_assign response['body'] = "Transaction is from a different host" + assign response.status = 202 + assign response.body = "Transaction is from a different host" else function object = 'modules/payments_stripe/commands/stripe_checkout/handle_webhook', params: params, transaction: transaction, requester_id: requester_id, request_url: request_url - hash_assign response['body'] = object + assign response.body = object endif return response diff --git a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/setup_intent.liquid b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/setup_intent.liquid index 5dfaa4e..272910c 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/setup_intent.liquid +++ b/pos-module-payments-stripe/modules/payments_stripe/public/lib/commands/webhooks/setup_intent.liquid @@ -6,15 +6,15 @@ assign setup_intent = setup_intents.results[0] if setup_intent == blank and params.data.object.metadata.host contains host - hash_assign response['status'] = 500 - hash_assign response['body'] = "Setup Intent not found" + assign response.status = 500 + assign response.body = "Setup Intent not found" log params, type: 'ERROR: modules/payments_stripe/commands/webhooks/setup_intent object' elsif setup_intent == blank - hash_assign response['status'] = 202 - hash_assign response['body'] = "Setup Intent is from a different host" + assign response.status = 202 + assign response.body = "Setup Intent is from a different host" else function object = 'modules/payments_stripe/commands/stripe_setup_intent/handle_webhook', params: params, requester_id: requester_id, request_url: request_url, setup_intent: setup_intent - hash_assign response['body'] = object + assign response.body = object endif return response diff --git a/pos-module-payments-stripe/modules/payments_stripe/template-values.json b/pos-module-payments-stripe/modules/payments_stripe/template-values.json index 24ade2d..95bcef8 100644 --- a/pos-module-payments-stripe/modules/payments_stripe/template-values.json +++ b/pos-module-payments-stripe/modules/payments_stripe/template-values.json @@ -2,9 +2,9 @@ "name": "pOS Payments Stripe", "machine_name": "payments_stripe", "type": "module", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { - "core": "^1.3.0", + "core": "^2.1.0", "payments": "0.2.6" } } diff --git a/pos-module-reports/modules/core/public/lib/commands/hook/alter.liquid b/pos-module-reports/modules/core/public/lib/commands/hook/alter.liquid index 64e2245..670f254 100644 --- a/pos-module-reports/modules/core/public/lib/commands/hook/alter.liquid +++ b/pos-module-reports/modules/core/public/lib/commands/hook/alter.liquid @@ -16,6 +16,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-reports/modules/core/public/views/partials/lib/commands/hook/alter.liquid b/pos-module-reports/modules/core/public/views/partials/lib/commands/hook/alter.liquid index 3418a8a..118bc47 100644 --- a/pos-module-reports/modules/core/public/views/partials/lib/commands/hook/alter.liquid +++ b/pos-module-reports/modules/core/public/views/partials/lib/commands/hook/alter.liquid @@ -17,6 +17,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/build.liquid b/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/build.liquid index 1ab15e9..a38e48c 100644 --- a/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/build.liquid +++ b/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/build.liquid @@ -1,12 +1,5 @@ {% liquid - assign output = '{}' | parse_json - - hash_assign output['content'] = object.content - hash_assign output['document_type'] = object.document_type - hash_assign output['object_uuid'] = object.object_uuid - hash_assign output['content_type'] = object.content_type - hash_assign output['content_disposition'] = object.content_disposition - hash_assign output['creator_id'] = creator_id + assign output = { "content": object.content, "document_type": object.document_type, "object_uuid": object.object_uuid, "content_type": object.content_type, "content_disposition": object.content_disposition, "creator_id": creator_id } return output -%} + %} diff --git a/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/check.liquid b/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/check.liquid index 0adf4aa..237a26f 100644 --- a/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/check.liquid +++ b/pos-module-reports/modules/reports/public/lib/commands/documents/create_with_content/check.liquid @@ -1,12 +1,12 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'content' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'object_uuid' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'document_type' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'creator_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-reports/modules/reports/public/lib/commands/reports/create/check.liquid b/pos-module-reports/modules/reports/public/lib/commands/reports/create/check.liquid index fbf8255..8585a88 100644 --- a/pos-module-reports/modules/reports/public/lib/commands/reports/create/check.liquid +++ b/pos-module-reports/modules/reports/public/lib/commands/reports/create/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'uuid' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'operation_type' @@ -11,13 +11,13 @@ if object.options try - hash_assign object['options'] = object.options | parse_json | json + assign object.options = object.options | parse_json | json catch err - hash_assign object['options'] = null + assign object.options = null endtry endif assign object = object | hash_merge: c return object -%} + %} diff --git a/pos-module-reports/modules/reports/public/lib/consumers/report_requested/trigger_export.liquid b/pos-module-reports/modules/reports/public/lib/consumers/report_requested/trigger_export.liquid index 4064b8c..c80361d 100644 --- a/pos-module-reports/modules/reports/public/lib/consumers/report_requested/trigger_export.liquid +++ b/pos-module-reports/modules/reports/public/lib/consumers/report_requested/trigger_export.liquid @@ -11,11 +11,11 @@ endif assign content_disposition = "attachment; filename=" | append: file_name | append: ";" - assign object_payload = '{}' | parse_json | hash_merge: content: results, object_uuid: operation.uuid, document_type: 'file', content_type: "text/csv; charset=UTF-8", content_disposition: content_disposition + assign object_payload = { "content": results, "object_uuid": operation.uuid, "document_type": "file", "content_type": "text/csv; charset=UTF-8", "content_disposition": content_disposition } function document = 'modules/reports/commands/documents/create_with_content', object: object_payload, creator_id: operation.creator_id if document.valid function res = 'modules/core/commands/statuses/create', name: 'modules/reports/statuses.report.done', reference_id: operation.id, requester_id: 'report' - assign object_payload = '{}' | parse_json | hash_merge: creator_id: operation.creator_id, user_id: operation.user_id, object_id: operation.id, document_id: document.id, app_host: event.app_host + assign object_payload = { "creator_id": operation.creator_id, "user_id": operation.user_id, "object_id": operation.id, "document_id": document.id, "app_host": event.app_host } function _event = 'modules/core/commands/events/publish', type: 'report_completed', object: object_payload else log document, type: 'ERROR: trigger_export document' diff --git a/pos-module-reports/modules/reports/public/lib/consumers/status_created/update_report_status.liquid b/pos-module-reports/modules/reports/public/lib/consumers/status_created/update_report_status.liquid index 532767b..a977aea 100644 --- a/pos-module-reports/modules/reports/public/lib/consumers/status_created/update_report_status.liquid +++ b/pos-module-reports/modules/reports/public/lib/consumers/status_created/update_report_status.liquid @@ -1,11 +1,11 @@ {% liquid - assign object = '{}' | parse_json + assign object = {} if event.name contains 'modules/reports/statuses.report' - hash_assign object['id'] = event.reference_id + assign object.id = event.reference_id assign short_name = event.name | replace: 'modules/reports/statuses.report.', '' - hash_assign object['status'] = short_name + assign object.status = short_name function object = 'modules/core/commands/execute', mutation_name: 'modules/reports/reports/update_status' object: object endif -%} + %} diff --git a/pos-module-reports/modules/reports/template-values.json b/pos-module-reports/modules/reports/template-values.json index b9909a9..edd7fc1 100644 --- a/pos-module-reports/modules/reports/template-values.json +++ b/pos-module-reports/modules/reports/template-values.json @@ -2,10 +2,10 @@ "name": "Pos Module Reports", "machine_name": "reports", "type": "module", - "version": "1.0.4", + "version": "1.1.0", "dependencies": { - "core": "^2.0.0", - "tests": "^1.0.0", - "user": "^5.0.0" + "core": "^2.1.0", + "tests": "^1.3.0", + "user": "^5.2.0" } } diff --git a/pos-module-tests/modules/tests/public/lib/commands/run.liquid b/pos-module-tests/modules/tests/public/lib/commands/run.liquid index 87930c7..7789099 100644 --- a/pos-module-tests/modules/tests/public/lib/commands/run.liquid +++ b/pos-module-tests/modules/tests/public/lib/commands/run.liquid @@ -31,10 +31,7 @@ assign __stop = "now" | to_time assign total_duration = __start | time_diff: __stop, 'ms' | round - assign data = '{}' | parse_json - hash_assign data['contracts'] = contracts - hash_assign data['total_errors'] = total_errors - hash_assign data['total_duration'] = total_duration + assign data = { "contracts": contracts, "total_errors": total_errors, "total_duration": total_duration } assign test_formatter = format | default: 'html' | prepend: 'modules/tests/tests/show_' # platformos-check-disable ConvertIncludeToRender diff --git a/pos-module-tests/modules/tests/public/views/pages/_tests/index.js.liquid b/pos-module-tests/modules/tests/public/views/pages/_tests/index.js.liquid index 0725673..46be7ea 100644 --- a/pos-module-tests/modules/tests/public/views/pages/_tests/index.js.liquid +++ b/pos-module-tests/modules/tests/public/views/pages/_tests/index.js.liquid @@ -6,7 +6,7 @@ layout: '' assign per_page = 100 graphql total_pages = 'modules/tests/test_files/count', per_page: per_page, path: context.params.name | dig: "admin_liquid_partials" | dig: "total_pages" - assign result = '[]' | parse_json + assign result = [] for page in (1..total_pages) graphql tests = 'modules/tests/test_files/search', path: context.params.name, page: page, per_page: per_page | dig: "admin_liquid_partials" | dig: "results" @@ -14,10 +14,8 @@ layout: '' for test in tests assign test_name = test.path | remove_first: 'lib/test/' | remove_first: '_test' assign test_url = '/_tests/run.js?test_name=' | append: test_name - assign test_object = '{}' | parse_json - hash_assign test_object['name'] = test_name - hash_assign test_object['url'] = test_url - assign result = result | add_to_array: test_object + assign test_object = { "name": test_name, "url": test_url } + assign result << test_object endfor endfor @@ -25,4 +23,4 @@ layout: '' else echo '{"error":"Tests can only be accessed in staging or development environment"}' endif -%} + %} diff --git a/pos-module-tests/modules/tests/public/views/pages/_tests/run_async.js.liquid b/pos-module-tests/modules/tests/public/views/pages/_tests/run_async.js.liquid index 79956bd..481743c 100644 --- a/pos-module-tests/modules/tests/public/views/pages/_tests/run_async.js.liquid +++ b/pos-module-tests/modules/tests/public/views/pages/_tests/run_async.js.liquid @@ -6,7 +6,7 @@ layout: '' {% background source_name: "liquid_tests", test_name: test_name %} {% include 'modules/tests/commands/run', format: 'log_js', test_name: test_name %} {% endbackground %} - {% assign result = '{}' | parse_json | hash_merge: test_name: test_name %} + {% assign result = { "test_name": test_name } %} {{ result }} {% else %} {"success":false,"error":"Tests can only be run in staging or development environment"} diff --git a/pos-module-tests/modules/tests/public/views/partials/tests/show_js.liquid b/pos-module-tests/modules/tests/public/views/partials/tests/show_js.liquid index f9e4d75..76eb411 100644 --- a/pos-module-tests/modules/tests/public/views/partials/tests/show_js.liquid +++ b/pos-module-tests/modules/tests/public/views/partials/tests/show_js.liquid @@ -1,18 +1,14 @@ {% liquid - assign result = '{}' | parse_json + assign result = {} assign total_assertions = 0 - assign tests_array = '[]' | parse_json - for contract in contracts + assign tests_array = [] + for contract in tests_array assign total_assertions = total_assertions | plus: contract.total - assign test_result = '{}' | parse_json - hash_assign test_result['name'] = contract.test_path - hash_assign test_result['success'] = contract.success - hash_assign test_result['assertions'] = contract.total - hash_assign test_result['errors'] = contract.errors + assign test_result = { "name": contract.test_path, "success": contract.success, "assertions": contract.total, "errors": contract.errors } - assign tests_array = tests_array | add_to_array: test_result + assign tests_array << test_result endfor if total_errors > 0 @@ -26,5 +22,5 @@ hash_assign result['total_errors'] = total_errors hash_assign result['duration_ms'] = total_duration hash_assign result['tests'] = tests_array -%} + %} {{ result | json }} diff --git a/pos-module-tests/modules/tests/template-values.json b/pos-module-tests/modules/tests/template-values.json index 59e310f..9f70878 100644 --- a/pos-module-tests/modules/tests/template-values.json +++ b/pos-module-tests/modules/tests/template-values.json @@ -2,6 +2,6 @@ "name": "Pos Module Tests", "machine_name": "tests", "type": "module", - "version": "1.2.0", + "version": "1.3.0", "dependencies": {} } diff --git a/pos-module-user/modules/core/public/lib/commands/hook/alter.liquid b/pos-module-user/modules/core/public/lib/commands/hook/alter.liquid index 64e2245..670f254 100644 --- a/pos-module-user/modules/core/public/lib/commands/hook/alter.liquid +++ b/pos-module-user/modules/core/public/lib/commands/hook/alter.liquid @@ -16,6 +16,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-user/modules/core/public/lib/commands/hook/fire.liquid b/pos-module-user/modules/core/public/lib/commands/hook/fire.liquid index c4956c8..d2872ca 100644 --- a/pos-module-user/modules/core/public/lib/commands/hook/fire.liquid +++ b/pos-module-user/modules/core/public/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-user/modules/core/public/lib/helpers/register_error.liquid b/pos-module-user/modules/core/public/lib/helpers/register_error.liquid index 2f252ef..a449ea4 100644 --- a/pos-module-user/modules/core/public/lib/helpers/register_error.liquid +++ b/pos-module-user/modules/core/public/lib/helpers/register_error.liquid @@ -17,7 +17,7 @@ assign errors = contract.errors - assign field_errors = errors[field_name] | default: '[]' | parse_json + assign field_errors = errors[field_name] | default: [] assign field_errors = field_errors | add_to_array: msg hash_assign errors[field_name] = field_errors diff --git a/pos-module-user/modules/core/public/views/partials/lib/commands/hook/alter.liquid b/pos-module-user/modules/core/public/views/partials/lib/commands/hook/alter.liquid index 3418a8a..118bc47 100644 --- a/pos-module-user/modules/core/public/views/partials/lib/commands/hook/alter.liquid +++ b/pos-module-user/modules/core/public/views/partials/lib/commands/hook/alter.liquid @@ -17,6 +17,6 @@ function _ = implementation.path, params_to_modify: params_to_modify, params: params endfor - assign result = '{}' | parse_json | hash_merge: original_params: original_params + assign result = { "original_params": original_params } return result %} diff --git a/pos-module-user/modules/core/public/views/partials/lib/commands/hook/fire.liquid b/pos-module-user/modules/core/public/views/partials/lib/commands/hook/fire.liquid index 5af969b..ec71ae5 100644 --- a/pos-module-user/modules/core/public/views/partials/lib/commands/hook/fire.liquid +++ b/pos-module-user/modules/core/public/views/partials/lib/commands/hook/fire.liquid @@ -8,9 +8,9 @@ {% endcomment %} {% liquid if merge_to_object - assign results = '{}' | parse_json + assign results = {} else - assign results = '[]' | parse_json + assign results = [] endif assign hook = '/hook_' | append: hook diff --git a/pos-module-user/modules/user/public/lib/commands/authentication_links/create/check.liquid b/pos-module-user/modules/user/public/lib/commands/authentication_links/create/check.liquid index cdd52a2..b942cbd 100644 --- a/pos-module-user/modules/user/public/lib/commands/authentication_links/create/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/authentication_links/create/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'email' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'host' @@ -9,8 +9,8 @@ function c = 'modules/core/validations/hcaptcha', c: c, hcaptcha_params: hcaptcha_params endif - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/authentication_links/create/execute.liquid b/pos-module-user/modules/user/public/lib/commands/authentication_links/create/execute.liquid index 2b5ea1e..b3e2207 100644 --- a/pos-module-user/modules/user/public/lib/commands/authentication_links/create/execute.liquid +++ b/pos-module-user/modules/user/public/lib/commands/authentication_links/create/execute.liquid @@ -1,7 +1,7 @@ {% liquid if object.valid - hash_assign object['url'] = 'https://{host}/passwords/new?token={token}&email={email}' | expand_url_template: object + assign object.url = 'https://{host}/passwords/new?token={token}&email={email}' | expand_url_template: object endif return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/passwords/create/check.liquid b/pos-module-user/modules/user/public/lib/commands/passwords/create/check.liquid index 877fbe9..c1aeed8 100644 --- a/pos-module-user/modules/user/public/lib/commands/passwords/create/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/passwords/create/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'password' @@ -7,8 +7,8 @@ function c = 'modules/core/validations/equal', c: c, given: object.password, expected: object.password_confirmation, field_name: 'password_confirmation', key: 'modules/user/validation.password.do_not_match', not_verbose: true, message: null function c = 'modules/core/validations/password_complexity', c: c, object: object, field_name: 'password', key: null - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/passwords/create/execute.liquid b/pos-module-user/modules/user/public/lib/commands/passwords/create/execute.liquid index 4c0a7fd..4d9e84b 100644 --- a/pos-module-user/modules/user/public/lib/commands/passwords/create/execute.liquid +++ b/pos-module-user/modules/user/public/lib/commands/passwords/create/execute.liquid @@ -4,9 +4,9 @@ if r.errors log r.errors, type: 'errors.graphql.invalid' - hash_assign object['valid'] = false - hash_assign object['errors'] = r.errors + assign object.valid = false + assign object.errors = r.errors endif return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/create/build.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/create/build.liquid index ff6f895..11e00d2 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/create/build.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/create/build.liquid @@ -6,9 +6,9 @@ assign data = null | hash_merge: first_name: object.first_name, last_name: object.last_name, user_id: object.user_id, email: object.email, uuid: uuid, name: name, c__names: tokenized_names if object.roles == null - assign roles = '[]' | parse_json + assign roles = [] if context.constants.USER_DEFAULT_ROLE != blank - assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE + assign roles << context.constants.USER_DEFAULT_ROLE endif else assign roles_type = object.roles | type_of @@ -17,16 +17,15 @@ elsif roles_type == 'Array' assign roles = object.roles else - # accepts only String and Array log object.roles, type: 'ERROR: roles must be an array or a coma separated string' - assign roles = '[]' | parse_json + assign roles = [] if context.constants.USER_DEFAULT_ROLE != blank - assign roles = roles | array_add: context.constants.USER_DEFAULT_ROLE + assign roles << context.constants.USER_DEFAULT_ROLE endif endif endif - hash_assign data['roles'] = roles + assign data.roles = roles return data %} diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/build.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/build.liquid index 87e9177..ede59fc 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/build.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/build.liquid @@ -1,10 +1,10 @@ {% liquid - assign data = '{}' | parse_json | hash_merge: id: object.id + assign data = { "id": object.id } if object.otp_configured == null - hash_assign data['otp_configured'] = true + assign data.otp_configured = true else - hash_assign data['otp_configured'] = object.otp_configured + assign data.otp_configured = object.otp_configured endif return data -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/check.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/check.liquid index 9c54ed4..a56c28c 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/mark_otp/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/not_null', c: c, object: object, field_name: 'otp_configured' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/roles/append.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/roles/append.liquid index aabfc15..c6052e7 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/roles/append.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/roles/append.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role: role + assign object = { "valid": true, "id": id, "role": role } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/append' if object.errors == blank diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/roles/remove.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/roles/remove.liquid index 2f6a6da..45ef598 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/roles/remove.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/roles/remove.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, role : role + assign object = { "valid": true, "id": id, "role": role } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/remove' if object.errors == blank diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/roles/set.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/roles/set.liquid index c1a0f39..b912b18 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/roles/set.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/roles/set.liquid @@ -1,5 +1,5 @@ {% liquid - assign object = '{}' | parse_json | hash_merge: valid: true, id: id, roles: roles + assign object = { "valid": true, "id": id, "roles": roles } function object = 'modules/core/commands/execute', object: object, mutation_name: 'modules/user/profiles/roles/set' if object.errors == blank diff --git a/pos-module-user/modules/user/public/lib/commands/profiles/tokenize_names.liquid b/pos-module-user/modules/user/public/lib/commands/profiles/tokenize_names.liquid index f4b04c8..7155bdc 100644 --- a/pos-module-user/modules/user/public/lib/commands/profiles/tokenize_names.liquid +++ b/pos-module-user/modules/user/public/lib/commands/profiles/tokenize_names.liquid @@ -1,4 +1,4 @@ {% liquid - assign tokenized_names = '[]' | parse_json | array_add: object.email | array_add: object.first_name | array_add: object.last_name | compact | uniq | join: ' ' | downcase + assign tokenized_names = [] | push: object.email | push: object.first_name | push: object.last_name | compact | uniq | join: ' ' | downcase return tokenized_names -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/session/create.liquid b/pos-module-user/modules/user/public/lib/commands/session/create.liquid index 4d99513..0e93581 100644 --- a/pos-module-user/modules/user/public/lib/commands/session/create.liquid +++ b/pos-module-user/modules/user/public/lib/commands/session/create.liquid @@ -36,15 +36,15 @@ function user = 'modules/user/queries/user/load', id: object.id function profile = 'modules/user/queries/profiles/find', user_id: user.id, id: null, uuid: null, first_name: null, last_name: null if profile.otp_configured and skip_otp == false - hash_assign object['otp_required'] = true + assign object.otp_required = true else if user.id sign_in user_id: user.id - assign params = '{}' | parse_json | hash_merge: user: user, hook_params: hook_params + assign params = { "user": user, "hook_params": hook_params } function results = 'modules/core/commands/hook/fire', hook: 'user_login', params: params, merge_to_object: true - hash_assign user['hook_results'] = results + assign user.hook_results = results endif - hash_assign object['user'] = user + assign object.user = user assign event_payload = null | hash_merge: user_id: object.id function _ = 'modules/core/commands/events/publish', type: 'user_signed_in', object: event_payload, delay: null, max_attempts: null diff --git a/pos-module-user/modules/user/public/lib/commands/session/create/check.liquid b/pos-module-user/modules/user/public/lib/commands/session/create/check.liquid index a8e6310..9370ce1 100644 --- a/pos-module-user/modules/user/public/lib/commands/session/create/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/session/create/check.liquid @@ -1,10 +1,10 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/session/destroy.liquid b/pos-module-user/modules/user/public/lib/commands/session/destroy.liquid index 1ad11d0..a997205 100644 --- a/pos-module-user/modules/user/public/lib/commands/session/destroy.liquid +++ b/pos-module-user/modules/user/public/lib/commands/session/destroy.liquid @@ -5,12 +5,12 @@ function current_profile = 'modules/user/helpers/current_profile' graphql destroy = 'modules/user/session/destroy' - hash_assign destroy['user'] = current_profile.user + assign destroy.user = current_profile.user unless destroy.errors - assign params = '{}' | parse_json | hash_merge: destroy: destroy + assign params = { "destroy": destroy } function results = 'modules/core/commands/hook/fire', hook: 'user_logout', params: params, merge_to_object: null - hash_assign destroy['hook_results'] = results + assign destroy.hook_results = results assign event_payload = null | hash_merge: user_id: current_profile.user.id function _ = 'modules/core/commands/events/publish', type: 'user_logout', object: event_payload, delay: null, max_attempts: null session original_user_id = null diff --git a/pos-module-user/modules/user/public/lib/commands/session/impersonation/create/check.liquid b/pos-module-user/modules/user/public/lib/commands/session/impersonation/create/check.liquid index 3298544..49d3fc9 100644 --- a/pos-module-user/modules/user/public/lib/commands/session/impersonation/create/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/session/impersonation/create/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'current_user_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid b/pos-module-user/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid index 3298544..49d3fc9 100644 --- a/pos-module-user/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/session/impersonation/destroy/check.liquid @@ -1,11 +1,11 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'id' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'current_user_id' - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/user/create.liquid b/pos-module-user/modules/user/public/lib/commands/user/create.liquid index 29331b6..8a2207b 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/create.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/create.liquid @@ -17,7 +17,7 @@ function object = 'modules/user/commands/user/create/check', object: object if object.valid function user = 'modules/core/commands/execute', mutation_name: 'modules/user/user/create', object: object, selection: 'user' - hash_assign object['user_id'] = user.id + assign object.user_id = user.id function profile = 'modules/user/commands/profiles/create', object: object if profile.valid != true diff --git a/pos-module-user/modules/user/public/lib/commands/user/create/build.liquid b/pos-module-user/modules/user/public/lib/commands/user/create/build.liquid index 361605f..29e474d 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/create/build.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/create/build.liquid @@ -8,6 +8,6 @@ } {% endparse_json %} -{% hash_assign object['roles'] = roles %} +{% assign object.roles = roles %} {% return object %} diff --git a/pos-module-user/modules/user/public/lib/commands/user/create/check.liquid b/pos-module-user/modules/user/public/lib/commands/user/create/check.liquid index ca33f4e..8e37d48 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/create/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/create/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'first_name' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'last_name' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'password' @@ -16,8 +16,8 @@ endif endif - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/user/delete.liquid b/pos-module-user/modules/user/public/lib/commands/user/delete.liquid index 31ba099..0ed2286 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/delete.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/delete.liquid @@ -8,9 +8,9 @@ graphql user = 'modules/user/user/delete', id: id unless user.errors - assign params = '{}' | parse_json | hash_merge: user: user.user + assign params = { "user": user.user } function results = 'modules/core/commands/hook/fire', hook: 'user_delete', params: params, merge_to_object: null - hash_assign user['hook_results'] = results + assign user.hook_results = results assign event_payload = null | hash_merge: user_id: id function _ = 'modules/core/commands/events/publish', type: 'user_deleted', object: event_payload, delay: null, max_attempts: null diff --git a/pos-module-user/modules/user/public/lib/commands/user/update.liquid b/pos-module-user/modules/user/public/lib/commands/user/update.liquid index d2502fa..0812589 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/update.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/update.liquid @@ -15,20 +15,18 @@ if object.valid graphql user = 'modules/user/user/update', args: object - hash_assign object['update_result'] = user + assign object.update_result = user unless user.errors - assign params = '{}' | parse_json | hash_merge: updated_user: user.user, hook_params: hook_params - # todo: merge_to_object for hooks with the same name will overwrite the validity of previous results + assign params = { "updated_user": user.user, "hook_params": hook_params } function results = 'modules/core/commands/hook/fire', hook: 'user_update', params: params, merge_to_object: true for result in results - # using the errors key for a quick workaround for now if result[1].valid == false or result[1].errors != blank - hash_assign object['valid'] = false - hash_assign object['errors'] = result[1].errors + assign object.valid = false + assign object.errors = result[1].errors break endif endfor - hash_assign object['hook_results'] = results + assign object.hook_results = results endunless assign event_payload = null | hash_merge: user_id: object.id diff --git a/pos-module-user/modules/user/public/lib/commands/user/update/check.liquid b/pos-module-user/modules/user/public/lib/commands/user/update/check.liquid index 3719f9e..4b848dc 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/update/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/update/check.liquid @@ -1,12 +1,12 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } if object['email'] function c = 'modules/core/validations/email', c: c, object: object, field_name: 'email' endif - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/user/verify_otp/check.liquid b/pos-module-user/modules/user/public/lib/commands/user/verify_otp/check.liquid index 37151c6..54477b0 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/verify_otp/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/verify_otp/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'email' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'password' @@ -11,11 +11,11 @@ function c = 'modules/core/validations/truthy', c: c, field_name: 'otp_code', object: user.authenticate, key: 'modules/user/2fa.errors.otp_code' function c = 'modules/core/validations/truthy', c: c, field_name: 'password', object: user.authenticate, key: 'modules/user/2fa.errors.password' - hash_assign object['id'] = user.id + assign object.id = user.id endif - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/commands/user/verify_password/check.liquid b/pos-module-user/modules/user/public/lib/commands/user/verify_password/check.liquid index 19a55b6..85b247c 100644 --- a/pos-module-user/modules/user/public/lib/commands/user/verify_password/check.liquid +++ b/pos-module-user/modules/user/public/lib/commands/user/verify_password/check.liquid @@ -1,5 +1,5 @@ {% liquid - assign c = '{ "errors": {}, "valid": true }' | parse_json + assign c = { "errors": {}, "valid": true } function c = 'modules/core/validations/email', c: c, object: object, field_name: 'email' function c = 'modules/core/validations/presence', c: c, object: object, field_name: 'email' @@ -10,11 +10,11 @@ assign user = user.users.results.first function c = 'modules/core/validations/truthy', c: c, field_name: 'password', object: user.authenticate, key: 'modules/user/validation.invalid_email_or_password' - hash_assign object['id'] = user.id + assign object.id = user.id endif - hash_assign object['valid'] = c.valid - hash_assign object['errors'] = c.errors + assign object.valid = c.valid + assign object.errors = c.errors return object -%} + %} diff --git a/pos-module-user/modules/user/public/lib/helpers/current_profile.liquid b/pos-module-user/modules/user/public/lib/helpers/current_profile.liquid index 460352f..3cd6a6f 100644 --- a/pos-module-user/modules/user/public/lib/helpers/current_profile.liquid +++ b/pos-module-user/modules/user/public/lib/helpers/current_profile.liquid @@ -1,17 +1,17 @@ {% liquid function user = 'modules/user/queries/user/current' if user.id == null - assign current_profile = '{ "user": null, "roles": ["anonymous"] }' | parse_json + assign current_profile = { "user": null, "roles": ["anonymous"] } else function current_profile = 'modules/user/queries/profiles/find', user_id: user.id, id: null, uuid: null, first_name: null, last_name: null assign current_profile = current_profile | hash_merge: user: user if current_profile.roles != null - hash_assign current_profile['roles'] = current_profile.roles | array_add: 'authenticated' + assign current_profile.roles = current_profile.roles << 'authenticated' else - hash_assign current_profile['roles'] = '["authenticated"]' | parse_json + assign current_profile.roles = ["authenticated"] endif endif export current_profile return current_profile -%} + %} diff --git a/pos-module-user/modules/user/public/lib/helpers/get_available_oauth_providers.liquid b/pos-module-user/modules/user/public/lib/helpers/get_available_oauth_providers.liquid index 86ceef8..7153b6c 100644 --- a/pos-module-user/modules/user/public/lib/helpers/get_available_oauth_providers.liquid +++ b/pos-module-user/modules/user/public/lib/helpers/get_available_oauth_providers.liquid @@ -1,5 +1,5 @@ {% liquid - assign available_providers = "{}" | parse_json + assign available_providers = {} assign keys = context.constants | hash_keys for item in keys assign starts_with = item | start_with: "OAUTH2_" @@ -12,13 +12,9 @@ assign client_id_key = "OAUTH2_" | append: provider_id | append: "_CLIENT_ID" assign secret_value_key = "OAUTH2_" | append: provider_id | append: "_SECRET_VALUE" - assign provider_data = "{}" | parse_json - hash_assign provider_data['key'] = context.constants[provider_key] - hash_assign provider_data['name'] = context.constants[name_key] - hash_assign provider_data['client_id'] = context.constants[client_id_key] - hash_assign provider_data['secret_value'] = context.constants[secret_value_key] + assign provider_data = { "key": context.constants[provider_key], "name": context.constants[name_key], "client_id": context.constants[client_id_key], "secret_value": context.constants[secret_value_key] } - hash_assign available_providers[provider_id] = provider_data + assign available_providers[provider_id] = provider_data endif endfor diff --git a/pos-module-user/modules/user/public/lib/queries/profiles/filters.liquid b/pos-module-user/modules/user/public/lib/queries/profiles/filters.liquid index 0e490b4..85b367f 100644 --- a/pos-module-user/modules/user/public/lib/queries/profiles/filters.liquid +++ b/pos-module-user/modules/user/public/lib/queries/profiles/filters.liquid @@ -1,15 +1,13 @@ -{% parse_json sort_options %} -{ - "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }}, - "first_name_desc": { "properties": { "name": "first_name", "order": "ASC" }} -} -{% endparse_json %} {% liquid - assign filters = '{}' | parse_json - hash_assign filters['page'] = params.page | to_positive_integer: 1 - hash_assign filters['keyword'] = params.keyword | default: '' - hash_assign filters['sort_by'] = params.sort_by | default: 'first_name_desc' - hash_assign filters['sort'] = sort_options[filters.sort_by] + assign sort_options = { + "first_name_desc": { "properties": { "name": "first_name", "order": "DESC" }}, + "first_name_asc": { "properties": { "name": "first_name", "order": "ASC" }} + } + assign filters = {} + assign filters.page = params.page | to_positive_integer: 1 + assign filters.keyword = params.keyword | default: '' + assign filters.sort_by = params.sort_by | default: 'first_name_desc' + assign filters.sort = sort_options[filters.sort_by] return filters -%} + %} diff --git a/pos-module-user/modules/user/public/lib/queries/profiles/find.liquid b/pos-module-user/modules/user/public/lib/queries/profiles/find.liquid index 9c64092..aceb24e 100644 --- a/pos-module-user/modules/user/public/lib/queries/profiles/find.liquid +++ b/pos-module-user/modules/user/public/lib/queries/profiles/find.liquid @@ -9,7 +9,7 @@ if profile function slug = 'modules/user/helpers/profiles/slugs/build', current_profile: profile - hash_assign profile['slug'] = slug + assign profile.slug = slug endif return profile diff --git a/pos-module-user/modules/user/public/lib/queries/profiles/search.liquid b/pos-module-user/modules/user/public/lib/queries/profiles/search.liquid index ec4ed53..ee683d8 100644 --- a/pos-module-user/modules/user/public/lib/queries/profiles/search.liquid +++ b/pos-module-user/modules/user/public/lib/queries/profiles/search.liquid @@ -7,15 +7,15 @@ graphql r = 'modules/user/profiles/search', limit: limit, uuid: uuid, id: id, ids: ids, first_name: first_name , last_name: last_name , user_id: user_id, not_ids: not_ids, query: query, emails: emails, sort: sort, page: page assign records = r.records - assign profiles = '[]' | parse_json + assign profiles = [] for profile in records.results function slug = 'modules/user/helpers/profiles/slugs/build' , current_profile: profile - hash_assign profile['slug'] = slug + assign profile.slug = slug assign p = profile - assign profiles = profiles | array_add: p + assign profiles << p endfor - hash_assign records['results'] = profiles + assign records.results = profiles return records %} diff --git a/pos-module-user/modules/user/public/views/pages/passwords/create.liquid b/pos-module-user/modules/user/public/views/pages/passwords/create.liquid index 4a641f8..58c23b8 100644 --- a/pos-module-user/modules/user/public/views/pages/passwords/create.liquid +++ b/pos-module-user/modules/user/public/views/pages/passwords/create.liquid @@ -5,7 +5,7 @@ method: post {% liquid assign input = context.params.password assign redirect_url = context.params.redirect_to | default: '/' - hash_assign input['user_id'] = context.session.reset_password_session_user_id + assign input.user_id = context.session.reset_password_session_user_id function object = 'modules/user/commands/passwords/create', object: input if object.valid diff --git a/pos-module-user/modules/user/public/views/pages/profiles/2fa/create.liquid b/pos-module-user/modules/user/public/views/pages/profiles/2fa/create.liquid index e97d6a7..c35ad40 100644 --- a/pos-module-user/modules/user/public/views/pages/profiles/2fa/create.liquid +++ b/pos-module-user/modules/user/public/views/pages/profiles/2fa/create.liquid @@ -10,7 +10,7 @@ method: post function object = 'modules/user/commands/user/verify_otp', object: context.params.2fa, email: current_profile.user.email if object.valid - hash_assign current_profile['otp_configured'] = true + assign current_profile.otp_configured = true function object = 'modules/user/commands/profiles/mark_otp', object: current_profile if object.valid != true log object, 'ERROR: modules/user/profiles/mark_otp' diff --git a/pos-module-user/modules/user/public/views/pages/profiles/2fa/delete.liquid b/pos-module-user/modules/user/public/views/pages/profiles/2fa/delete.liquid index 970c0f9..d932282 100644 --- a/pos-module-user/modules/user/public/views/pages/profiles/2fa/delete.liquid +++ b/pos-module-user/modules/user/public/views/pages/profiles/2fa/delete.liquid @@ -10,7 +10,7 @@ method: post function object = 'modules/user/commands/user/verify_otp', object: context.params.2fa, email: current_profile.user.email if object.valid - hash_assign current_profile['otp_configured'] = false + assign current_profile.otp_configured = false function object = 'modules/user/commands/profiles/mark_otp', object: current_profile if object.valid != true log object, 'ERROR: modules/user/profiles/mark_otp' diff --git a/pos-module-user/modules/user/public/views/pages/users/email/update.liquid b/pos-module-user/modules/user/public/views/pages/users/email/update.liquid index b82cb1e..2afe6b9 100644 --- a/pos-module-user/modules/user/public/views/pages/users/email/update.liquid +++ b/pos-module-user/modules/user/public/views/pages/users/email/update.liquid @@ -19,7 +19,7 @@ method: put function object = 'modules/user/commands/user/email_update', object: context.params.user, current_user: current_profile.user, c: null if object.valid - hash_assign current_profile['email'] = context.params.user.email + assign current_profile.email = context.params.user.email function _ = 'modules/user/commands/profiles/update', object: current_profile, profile: current_profile assign event_payload = null | hash_merge: actor_id: object.id, object: object, actor: object, target: null, object_id: null, target_id: null function _event = 'modules/core/commands/events/publish', type: 'email_updated', object: event_payload, delay: null, max_attempts: null diff --git a/pos-module-user/modules/user/template-values.json b/pos-module-user/modules/user/template-values.json index 76ac117..bcc95c2 100644 --- a/pos-module-user/modules/user/template-values.json +++ b/pos-module-user/modules/user/template-values.json @@ -2,9 +2,9 @@ "name": "User", "machine_name": "user", "type": "module", - "version": "5.1.2", + "version": "5.2.0", "dependencies": { - "core": "^1.5.0", + "core": "^2.1.0", "common-styling": "^1.11.0" } }