@merchi/sdk 1.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +43 -0
- package/.turbo/turbo-build.log +1 -0
- package/.turbo/turbo-test.log +849 -0
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/coverage/clover.xml +5057 -0
- package/coverage/coverage-final.json +133 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +103 -0
- package/coverage/lcov-report/src/constants/call_to_actions.ts.html +127 -0
- package/coverage/lcov-report/src/constants/discount_types.ts.html +100 -0
- package/coverage/lcov-report/src/constants/domain_types.ts.html +121 -0
- package/coverage/lcov-report/src/constants/errors.ts.html +181 -0
- package/coverage/lcov-report/src/constants/event_types.ts.html +100 -0
- package/coverage/lcov-report/src/constants/field_types.ts.html +133 -0
- package/coverage/lcov-report/src/constants/index.html +551 -0
- package/coverage/lcov-report/src/constants/index.ts.html +238 -0
- package/coverage/lcov-report/src/constants/input_types.ts.html +124 -0
- package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +103 -0
- package/coverage/lcov-report/src/constants/invoice_types.ts.html +100 -0
- package/coverage/lcov-report/src/constants/item_types.ts.html +100 -0
- package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +106 -0
- package/coverage/lcov-report/src/constants/job/index.html +176 -0
- package/coverage/lcov-report/src/constants/job/payment_status.ts.html +106 -0
- package/coverage/lcov-report/src/constants/job/production_status.ts.html +121 -0
- package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +118 -0
- package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +103 -0
- package/coverage/lcov-report/src/constants/job_priorities.ts.html +103 -0
- package/coverage/lcov-report/src/constants/job_status.ts.html +232 -0
- package/coverage/lcov-report/src/constants/job_types.ts.html +133 -0
- package/coverage/lcov-report/src/constants/notification_sections.ts.html +124 -0
- package/coverage/lcov-report/src/constants/notification_types.ts.html +385 -0
- package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +106 -0
- package/coverage/lcov-report/src/constants/payment_types.ts.html +115 -0
- package/coverage/lcov-report/src/constants/platform.ts.html +103 -0
- package/coverage/lcov-report/src/constants/product_types.ts.html +163 -0
- package/coverage/lcov-report/src/constants/rights.ts.html +100 -0
- package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +118 -0
- package/coverage/lcov-report/src/constants/roles.ts.html +223 -0
- package/coverage/lcov-report/src/constants/shipment_companies.ts.html +142 -0
- package/coverage/lcov-report/src/constants/shipment_services.ts.html +94 -0
- package/coverage/lcov-report/src/constants/system_roles.ts.html +94 -0
- package/coverage/lcov-report/src/constants/theme_status.ts.html +100 -0
- package/coverage/lcov-report/src/constants/user_types.ts.html +136 -0
- package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +103 -0
- package/coverage/lcov-report/src/cookie.ts.html +133 -0
- package/coverage/lcov-report/src/entities/address.ts.html +280 -0
- package/coverage/lcov-report/src/entities/agent_conversation.ts.html +202 -0
- package/coverage/lcov-report/src/entities/agent_skill.ts.html +382 -0
- package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +163 -0
- package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +277 -0
- package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +349 -0
- package/coverage/lcov-report/src/entities/assignment.ts.html +382 -0
- package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +172 -0
- package/coverage/lcov-report/src/entities/bank.ts.html +220 -0
- package/coverage/lcov-report/src/entities/cart.ts.html +391 -0
- package/coverage/lcov-report/src/entities/cart_item.ts.html +340 -0
- package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +148 -0
- package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +184 -0
- package/coverage/lcov-report/src/entities/category.ts.html +262 -0
- package/coverage/lcov-report/src/entities/company.ts.html +1276 -0
- package/coverage/lcov-report/src/entities/company_invitation.ts.html +184 -0
- package/coverage/lcov-report/src/entities/country_tax.ts.html +223 -0
- package/coverage/lcov-report/src/entities/discount.ts.html +235 -0
- package/coverage/lcov-report/src/entities/discount_group.ts.html +214 -0
- package/coverage/lcov-report/src/entities/domain.ts.html +3349 -0
- package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +331 -0
- package/coverage/lcov-report/src/entities/domain_invitation.ts.html +193 -0
- package/coverage/lcov-report/src/entities/domain_tag.ts.html +211 -0
- package/coverage/lcov-report/src/entities/draft.ts.html +322 -0
- package/coverage/lcov-report/src/entities/draft_comment.ts.html +274 -0
- package/coverage/lcov-report/src/entities/draft_preview.ts.html +196 -0
- package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +148 -0
- package/coverage/lcov-report/src/entities/draft_template.ts.html +328 -0
- package/coverage/lcov-report/src/entities/email_address.ts.html +157 -0
- package/coverage/lcov-report/src/entities/email_counter.ts.html +145 -0
- package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +205 -0
- package/coverage/lcov-report/src/entities/exchange_rate.ts.html +151 -0
- package/coverage/lcov-report/src/entities/file.ts.html +580 -0
- package/coverage/lcov-report/src/entities/index.html +1271 -0
- package/coverage/lcov-report/src/entities/internal_tag.ts.html +238 -0
- package/coverage/lcov-report/src/entities/inventory.ts.html +274 -0
- package/coverage/lcov-report/src/entities/inventory_group.ts.html +193 -0
- package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +172 -0
- package/coverage/lcov-report/src/entities/invoice.ts.html +661 -0
- package/coverage/lcov-report/src/entities/item.ts.html +262 -0
- package/coverage/lcov-report/src/entities/job.ts.html +1288 -0
- package/coverage/lcov-report/src/entities/job_comment.ts.html +244 -0
- package/coverage/lcov-report/src/entities/job_note.ts.html +205 -0
- package/coverage/lcov-report/src/entities/job_operation_log.ts.html +208 -0
- package/coverage/lcov-report/src/entities/matching_inventory.ts.html +172 -0
- package/coverage/lcov-report/src/entities/notification.ts.html +403 -0
- package/coverage/lcov-report/src/entities/payment.ts.html +316 -0
- package/coverage/lcov-report/src/entities/payment_device.ts.html +175 -0
- package/coverage/lcov-report/src/entities/phone_number.ts.html +193 -0
- package/coverage/lcov-report/src/entities/product.ts.html +1543 -0
- package/coverage/lcov-report/src/entities/product_form.ts.html +238 -0
- package/coverage/lcov-report/src/entities/product_form_version.ts.html +238 -0
- package/coverage/lcov-report/src/entities/product_review.ts.html +748 -0
- package/coverage/lcov-report/src/entities/production_comment.ts.html +244 -0
- package/coverage/lcov-report/src/entities/quote.ts.html +505 -0
- package/coverage/lcov-report/src/entities/quote_item.ts.html +298 -0
- package/coverage/lcov-report/src/entities/reminder.ts.html +307 -0
- package/coverage/lcov-report/src/entities/session.ts.html +169 -0
- package/coverage/lcov-report/src/entities/shipment.ts.html +673 -0
- package/coverage/lcov-report/src/entities/shipment_item.ts.html +130 -0
- package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +130 -0
- package/coverage/lcov-report/src/entities/shipment_log.ts.html +196 -0
- package/coverage/lcov-report/src/entities/shipment_method.ts.html +268 -0
- package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +202 -0
- package/coverage/lcov-report/src/entities/short_url.ts.html +193 -0
- package/coverage/lcov-report/src/entities/subscription_plan.ts.html +304 -0
- package/coverage/lcov-report/src/entities/supply_domain.ts.html +166 -0
- package/coverage/lcov-report/src/entities/support_conversation.ts.html +280 -0
- package/coverage/lcov-report/src/entities/support_message.ts.html +175 -0
- package/coverage/lcov-report/src/entities/system_role.ts.html +136 -0
- package/coverage/lcov-report/src/entities/theme.ts.html +331 -0
- package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +154 -0
- package/coverage/lcov-report/src/entities/user.ts.html +1369 -0
- package/coverage/lcov-report/src/entities/user_company.ts.html +166 -0
- package/coverage/lcov-report/src/entities/variation.ts.html +277 -0
- package/coverage/lcov-report/src/entities/variation_field.ts.html +889 -0
- package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +406 -0
- package/coverage/lcov-report/src/entities/variation_option.ts.html +259 -0
- package/coverage/lcov-report/src/entities/variations_group.ts.html +208 -0
- package/coverage/lcov-report/src/entity.ts.html +3379 -0
- package/coverage/lcov-report/src/index.html +221 -0
- package/coverage/lcov-report/src/index.ts.html +652 -0
- package/coverage/lcov-report/src/merchi.ts.html +1420 -0
- package/coverage/lcov-report/src/pricing/discount.ts.html +136 -0
- package/coverage/lcov-report/src/pricing/estimate.ts.html +1015 -0
- package/coverage/lcov-report/src/pricing/index.html +206 -0
- package/coverage/lcov-report/src/pricing/index.ts.html +106 -0
- package/coverage/lcov-report/src/pricing/inventory.ts.html +352 -0
- package/coverage/lcov-report/src/pricing/matrix.ts.html +736 -0
- package/coverage/lcov-report/src/pricing/round.ts.html +166 -0
- package/coverage/lcov-report/src/pricing/visibility.ts.html +418 -0
- package/coverage/lcov-report/src/request.ts.html +673 -0
- package/coverage/lcov-report/src/test_util.ts.html +139 -0
- package/coverage/lcov-report/src/toasts.ts.html +187 -0
- package/coverage/lcov-report/src/util/float.ts.html +121 -0
- package/coverage/lcov-report/src/util/index.html +161 -0
- package/coverage/lcov-report/src/util/index.ts.html +106 -0
- package/coverage/lcov-report/src/util/query_string.ts.html +124 -0
- package/coverage/lcov-report/src/util/validation.ts.html +91 -0
- package/coverage/lcov-report/src/uuid.ts.html +109 -0
- package/coverage/lcov.info +7758 -0
- package/dist/constants/auto_assign_production_on_actions.js +7 -0
- package/dist/constants/call_to_actions.js +15 -0
- package/dist/constants/call_to_actions.test.js +4 -0
- package/dist/constants/discount_types.js +6 -0
- package/dist/constants/discount_types.test.js +4 -0
- package/dist/constants/domain_types.js +13 -0
- package/dist/constants/domain_types.test.js +4 -0
- package/dist/constants/errors.js +32 -0
- package/dist/constants/event_types.js +6 -0
- package/dist/constants/event_types.test.js +4 -0
- package/dist/constants/field_types.js +17 -0
- package/dist/constants/field_types.test.js +4 -0
- package/dist/constants/index.js +25 -0
- package/dist/constants/input_types.js +14 -0
- package/dist/constants/input_types.test.js +4 -0
- package/dist/constants/inventory_status.test.js +4 -0
- package/dist/constants/inventory_statuses.js +7 -0
- package/dist/constants/invoice_types.js +6 -0
- package/dist/constants/invoice_types.test.js +4 -0
- package/dist/constants/item_types.js +6 -0
- package/dist/constants/item_types.test.js +4 -0
- package/dist/constants/job/drafting_status.js +8 -0
- package/dist/constants/job/drafting_status.test.js +4 -0
- package/dist/constants/job/payment_status.js +8 -0
- package/dist/constants/job/payment_status.test.js +4 -0
- package/dist/constants/job/production_status.js +13 -0
- package/dist/constants/job/production_status.test.js +4 -0
- package/dist/constants/job/shipment_status.js +12 -0
- package/dist/constants/job/shipment_status.test.js +4 -0
- package/dist/constants/job/supply_chain_request_status.js +7 -0
- package/dist/constants/job/supply_chain_request_status.test.js +4 -0
- package/dist/constants/job_priorities.js +7 -0
- package/dist/constants/job_priorities.test.js +4 -0
- package/dist/constants/job_status.js +50 -0
- package/dist/constants/job_status.test.js +4 -0
- package/dist/constants/job_types.js +17 -0
- package/dist/constants/job_types.test.js +4 -0
- package/dist/constants/notification_sections.js +14 -0
- package/dist/constants/notification_sections.test.js +4 -0
- package/dist/constants/notification_types.js +101 -0
- package/dist/constants/notification_types.test.js +4 -0
- package/dist/constants/notification_urgencies.js +7 -0
- package/dist/constants/notification_urgencies.test.js +4 -0
- package/dist/constants/payment_types.js +11 -0
- package/dist/constants/payment_types.test.js +4 -0
- package/dist/constants/platform.js +5 -0
- package/dist/constants/platform.test.js +8 -0
- package/dist/constants/product_types.js +27 -0
- package/dist/constants/product_types.test.js +4 -0
- package/dist/constants/rights.js +6 -0
- package/dist/constants/rights.test.js +4 -0
- package/dist/constants/robots_meta_directives.js +11 -0
- package/dist/constants/robots_meta_directives.test.js +4 -0
- package/dist/constants/roles.js +64 -0
- package/dist/constants/roles.test.js +4 -0
- package/dist/constants/shipment_companies.js +20 -0
- package/dist/constants/shipment_companies.test.js +4 -0
- package/dist/constants/shipment_services.js +4 -0
- package/dist/constants/shipment_services.test.js +4 -0
- package/dist/constants/system_roles.js +4 -0
- package/dist/constants/system_roles.test.js +4 -0
- package/dist/constants/theme_status.js +6 -0
- package/dist/constants/theme_status.test.js +4 -0
- package/dist/constants/user_types.js +18 -0
- package/dist/constants/user_types.test.js +4 -0
- package/dist/constants/white_label_accessibilities.js +6 -0
- package/dist/constants/white_label_accessibilities.test.js +4 -0
- package/dist/cookie.js +15 -0
- package/dist/cookie.test.js +10 -0
- package/dist/entities/address.js +104 -0
- package/dist/entities/address.test.js +6 -0
- package/dist/entities/agent_conversation.js +78 -0
- package/dist/entities/agent_conversation.test.js +6 -0
- package/dist/entities/agent_skill.js +133 -0
- package/dist/entities/agent_skill.test.js +11 -0
- package/dist/entities/agent_skill_approval.js +61 -0
- package/dist/entities/agent_skill_version.js +99 -0
- package/dist/entities/agent_token_analytics.js +1 -0
- package/dist/entities/agent_token_usage.js +127 -0
- package/dist/entities/agent_token_usage.test.js +6 -0
- package/dist/entities/assignment.js +135 -0
- package/dist/entities/assignment.test.js +30 -0
- package/dist/entities/automatic_payment_relationship.js +65 -0
- package/dist/entities/automatic_payment_relationship.test.js +6 -0
- package/dist/entities/bank.js +85 -0
- package/dist/entities/bank.test.js +6 -0
- package/dist/entities/cart.js +173 -0
- package/dist/entities/cart.test.js +51 -0
- package/dist/entities/cart_item.js +125 -0
- package/dist/entities/cart_item.test.js +28 -0
- package/dist/entities/cart_shipment_group.js +53 -0
- package/dist/entities/cart_shipment_quote.js +70 -0
- package/dist/entities/category.js +101 -0
- package/dist/entities/category.test.js +52 -0
- package/dist/entities/company.js +509 -0
- package/dist/entities/company.test.js +6 -0
- package/dist/entities/company_invitation.js +70 -0
- package/dist/entities/company_invitation.test.js +6 -0
- package/dist/entities/country_tax.js +80 -0
- package/dist/entities/country_tax.test.js +11 -0
- package/dist/entities/discount.js +89 -0
- package/dist/entities/discount.test.js +34 -0
- package/dist/entities/discount_group.js +80 -0
- package/dist/entities/discount_group.test.js +6 -0
- package/dist/entities/domain.js +567 -0
- package/dist/entities/domain.test.js +356 -0
- package/dist/entities/domain_chat_settings.js +134 -0
- package/dist/entities/domain_chat_settings.test.js +15 -0
- package/dist/entities/domain_invitation.js +74 -0
- package/dist/entities/domain_invitation.test.js +6 -0
- package/dist/entities/domain_tag.js +77 -0
- package/dist/entities/domain_tag.test.js +6 -0
- package/dist/entities/draft.js +122 -0
- package/dist/entities/draft.test.js +26 -0
- package/dist/entities/draft_comment.js +107 -0
- package/dist/entities/draft_comment.test.js +6 -0
- package/dist/entities/draft_preview.js +74 -0
- package/dist/entities/draft_preview.test.js +36 -0
- package/dist/entities/draft_preview_layer.js +54 -0
- package/dist/entities/draft_preview_layer.test.js +6 -0
- package/dist/entities/draft_template.js +119 -0
- package/dist/entities/draft_template.test.js +12 -0
- package/dist/entities/email_address.js +56 -0
- package/dist/entities/email_address.test.js +6 -0
- package/dist/entities/email_counter.js +53 -0
- package/dist/entities/email_counter.test.js +6 -0
- package/dist/entities/enrolled_domain.js +74 -0
- package/dist/entities/enrolled_domain.test.js +6 -0
- package/dist/entities/exchange_rate.js +56 -0
- package/dist/entities/exchange_rate.test.js +6 -0
- package/dist/entities/file.js +218 -0
- package/dist/entities/file.test.js +38 -0
- package/dist/entities/internal_tag.js +84 -0
- package/dist/entities/internal_tag.test.js +6 -0
- package/dist/entities/inventory.js +97 -0
- package/dist/entities/inventory.test.js +22 -0
- package/dist/entities/inventory_group.js +69 -0
- package/dist/entities/inventory_group.test.js +6 -0
- package/dist/entities/inventory_unit_variation.js +61 -0
- package/dist/entities/inventory_unit_variation.test.js +6 -0
- package/dist/entities/invoice.js +268 -0
- package/dist/entities/invoice.test.js +45 -0
- package/dist/entities/item.js +96 -0
- package/dist/entities/item.test.js +17 -0
- package/dist/entities/job.js +519 -0
- package/dist/entities/job.test.js +83 -0
- package/dist/entities/job_comment.js +94 -0
- package/dist/entities/job_comment.test.js +6 -0
- package/dist/entities/job_note.js +78 -0
- package/dist/entities/job_operation_log.js +82 -0
- package/dist/entities/job_operation_log.test.js +6 -0
- package/dist/entities/matching_inventory.js +63 -0
- package/dist/entities/notification.js +163 -0
- package/dist/entities/notification.test.js +51 -0
- package/dist/entities/payment.js +122 -0
- package/dist/entities/payment.test.js +22 -0
- package/dist/entities/payment_device.js +65 -0
- package/dist/entities/payment_device.test.js +6 -0
- package/dist/entities/phone_number.js +72 -0
- package/dist/entities/phone_number.test.js +6 -0
- package/dist/entities/product.js +619 -0
- package/dist/entities/product.test.js +720 -0
- package/dist/entities/product_form.js +92 -0
- package/dist/entities/product_form_version.js +95 -0
- package/dist/entities/product_review.js +234 -0
- package/dist/entities/production_comment.js +94 -0
- package/dist/entities/production_comment.test.js +6 -0
- package/dist/entities/quote.js +168 -0
- package/dist/entities/quote.test.js +86 -0
- package/dist/entities/quote_item.js +99 -0
- package/dist/entities/quote_item.test.js +40 -0
- package/dist/entities/reminder.js +120 -0
- package/dist/entities/reminder.test.js +14 -0
- package/dist/entities/session.js +63 -0
- package/dist/entities/session.test.js +6 -0
- package/dist/entities/shipment.js +256 -0
- package/dist/entities/shipment.test.js +20 -0
- package/dist/entities/shipment_item.js +45 -0
- package/dist/entities/shipment_item.test.js +6 -0
- package/dist/entities/shipment_item_fulfillment.js +46 -0
- package/dist/entities/shipment_item_fulfillment.test.js +6 -0
- package/dist/entities/shipment_log.js +75 -0
- package/dist/entities/shipment_method.js +104 -0
- package/dist/entities/shipment_method.test.js +6 -0
- package/dist/entities/shipment_method_variation.js +77 -0
- package/dist/entities/shipment_method_variation.test.js +6 -0
- package/dist/entities/short_url.js +73 -0
- package/dist/entities/short_url.test.js +6 -0
- package/dist/entities/subscription_plan.js +122 -0
- package/dist/entities/subscription_plan.test.js +6 -0
- package/dist/entities/supply_domain.js +62 -0
- package/dist/entities/supply_domain.test.js +6 -0
- package/dist/entities/support_conversation.js +106 -0
- package/dist/entities/support_conversation.test.js +6 -0
- package/dist/entities/support_message.js +66 -0
- package/dist/entities/support_message.test.js +6 -0
- package/dist/entities/system_role.js +49 -0
- package/dist/entities/system_role.test.js +6 -0
- package/dist/entities/theme.js +125 -0
- package/dist/entities/theme.test.js +35 -0
- package/dist/entities/theme_css_setting.js +57 -0
- package/dist/entities/theme_css_setting.test.js +6 -0
- package/dist/entities/user.js +508 -0
- package/dist/entities/user.test.js +134 -0
- package/dist/entities/user_company.js +62 -0
- package/dist/entities/user_company.test.js +6 -0
- package/dist/entities/variation.js +108 -0
- package/dist/entities/variation.test.js +6 -0
- package/dist/entities/variation_field.js +381 -0
- package/dist/entities/variation_field.test.js +69 -0
- package/dist/entities/variation_fields_option.js +153 -0
- package/dist/entities/variation_fields_option.test.js +43 -0
- package/dist/entities/variation_option.js +104 -0
- package/dist/entities/variation_option.test.js +6 -0
- package/dist/entities/variations_group.js +79 -0
- package/dist/entities/variations_group.test.js +6 -0
- package/dist/entity.js +950 -0
- package/dist/index.js +86 -0
- package/dist/merchi.js +296 -0
- package/dist/merchi.test.js +21 -0
- package/dist/pricing/discount.js +11 -0
- package/dist/pricing/discount.test.js +35 -0
- package/dist/pricing/estimate.js +335 -0
- package/dist/pricing/estimate.test.js +403 -0
- package/dist/pricing/golden.test.js +61 -0
- package/dist/pricing/index.js +7 -0
- package/dist/pricing/index.test.js +8 -0
- package/dist/pricing/inventory.js +238 -0
- package/dist/pricing/inventory.test.js +188 -0
- package/dist/pricing/matrix.js +245 -0
- package/dist/pricing/matrix.test.js +437 -0
- package/dist/pricing/round.js +29 -0
- package/dist/pricing/round.test.js +27 -0
- package/dist/pricing/types.js +1 -0
- package/dist/pricing/visibility.js +227 -0
- package/dist/pricing/visibility.test.js +210 -0
- package/dist/request.js +169 -0
- package/dist/request.test.js +70 -0
- package/dist/test_util.js +17 -0
- package/dist/toasts.js +14 -0
- package/dist/toasts.test.js +28 -0
- package/dist/util/float.js +34 -0
- package/dist/util/index.js +3 -0
- package/dist/util/query_string.js +13 -0
- package/dist/util/query_string.test.js +6 -0
- package/dist/util/validation.js +3 -0
- package/dist/util/validation.test.js +12 -0
- package/dist/uuid.js +8 -0
- package/dist/uuid.test.js +11 -0
- package/jest.config.js +23 -0
- package/merchi_sdk_ts-1.13.1.tgz +0 -0
- package/package.json +41 -0
- package/src/constants/auto_assign_production_on_actions.ts +6 -0
- package/src/constants/call_to_actions.test.ts +5 -0
- package/src/constants/call_to_actions.ts +14 -0
- package/src/constants/discount_types.test.ts +5 -0
- package/src/constants/discount_types.ts +5 -0
- package/src/constants/domain_types.test.ts +5 -0
- package/src/constants/domain_types.ts +12 -0
- package/src/constants/errors.ts +32 -0
- package/src/constants/event_types.test.ts +5 -0
- package/src/constants/event_types.ts +5 -0
- package/src/constants/field_types.test.ts +5 -0
- package/src/constants/field_types.ts +16 -0
- package/src/constants/index.ts +51 -0
- package/src/constants/input_types.test.ts +5 -0
- package/src/constants/input_types.ts +13 -0
- package/src/constants/inventory_status.test.ts +5 -0
- package/src/constants/inventory_statuses.ts +6 -0
- package/src/constants/invoice_types.test.ts +5 -0
- package/src/constants/invoice_types.ts +5 -0
- package/src/constants/item_types.test.ts +5 -0
- package/src/constants/item_types.ts +5 -0
- package/src/constants/job/drafting_status.test.ts +5 -0
- package/src/constants/job/drafting_status.ts +7 -0
- package/src/constants/job/payment_status.test.ts +5 -0
- package/src/constants/job/payment_status.ts +7 -0
- package/src/constants/job/production_status.test.ts +5 -0
- package/src/constants/job/production_status.ts +12 -0
- package/src/constants/job/shipment_status.test.ts +5 -0
- package/src/constants/job/shipment_status.ts +11 -0
- package/src/constants/job/supply_chain_request_status.test.ts +5 -0
- package/src/constants/job/supply_chain_request_status.ts +6 -0
- package/src/constants/job_priorities.test.ts +5 -0
- package/src/constants/job_priorities.ts +6 -0
- package/src/constants/job_status.test.ts +5 -0
- package/src/constants/job_status.ts +49 -0
- package/src/constants/job_types.test.ts +5 -0
- package/src/constants/job_types.ts +16 -0
- package/src/constants/notification_sections.test.ts +5 -0
- package/src/constants/notification_sections.ts +13 -0
- package/src/constants/notification_types.test.ts +5 -0
- package/src/constants/notification_types.ts +100 -0
- package/src/constants/notification_urgencies.test.ts +5 -0
- package/src/constants/notification_urgencies.ts +7 -0
- package/src/constants/payment_types.test.ts +5 -0
- package/src/constants/payment_types.ts +10 -0
- package/src/constants/platform.test.ts +15 -0
- package/src/constants/platform.ts +6 -0
- package/src/constants/product_types.test.ts +6 -0
- package/src/constants/product_types.ts +26 -0
- package/src/constants/rights.test.ts +5 -0
- package/src/constants/rights.ts +5 -0
- package/src/constants/robots_meta_directives.test.ts +5 -0
- package/src/constants/robots_meta_directives.ts +11 -0
- package/src/constants/roles.test.ts +5 -0
- package/src/constants/roles.ts +46 -0
- package/src/constants/shipment_companies.test.ts +5 -0
- package/src/constants/shipment_companies.ts +19 -0
- package/src/constants/shipment_services.test.ts +5 -0
- package/src/constants/shipment_services.ts +3 -0
- package/src/constants/system_roles.test.ts +5 -0
- package/src/constants/system_roles.ts +3 -0
- package/src/constants/theme_status.test.ts +5 -0
- package/src/constants/theme_status.ts +5 -0
- package/src/constants/user_types.test.ts +5 -0
- package/src/constants/user_types.ts +17 -0
- package/src/constants/white_label_accessibilities.test.ts +5 -0
- package/src/constants/white_label_accessibilities.ts +6 -0
- package/src/cookie.test.ts +11 -0
- package/src/cookie.ts +16 -0
- package/src/entities/address.test.ts +7 -0
- package/src/entities/address.ts +65 -0
- package/src/entities/agent_conversation.test.ts +7 -0
- package/src/entities/agent_conversation.ts +39 -0
- package/src/entities/agent_skill.test.ts +13 -0
- package/src/entities/agent_skill.ts +99 -0
- package/src/entities/agent_skill_approval.ts +26 -0
- package/src/entities/agent_skill_version.ts +64 -0
- package/src/entities/agent_token_analytics.ts +49 -0
- package/src/entities/agent_token_usage.test.ts +7 -0
- package/src/entities/agent_token_usage.ts +88 -0
- package/src/entities/assignment.test.ts +39 -0
- package/src/entities/assignment.ts +99 -0
- package/src/entities/automatic_payment_relationship.test.ts +8 -0
- package/src/entities/automatic_payment_relationship.ts +29 -0
- package/src/entities/bank.test.ts +7 -0
- package/src/entities/bank.ts +45 -0
- package/src/entities/cart.test.ts +57 -0
- package/src/entities/cart.ts +102 -0
- package/src/entities/cart_item.test.ts +33 -0
- package/src/entities/cart_item.ts +85 -0
- package/src/entities/cart_shipment_group.ts +21 -0
- package/src/entities/cart_shipment_quote.ts +33 -0
- package/src/entities/category.test.ts +57 -0
- package/src/entities/category.ts +59 -0
- package/src/entities/company.test.ts +7 -0
- package/src/entities/company.ts +397 -0
- package/src/entities/company_invitation.test.ts +7 -0
- package/src/entities/company_invitation.ts +33 -0
- package/src/entities/country_tax.test.ts +13 -0
- package/src/entities/country_tax.ts +46 -0
- package/src/entities/discount.test.ts +36 -0
- package/src/entities/discount.ts +50 -0
- package/src/entities/discount_group.test.ts +7 -0
- package/src/entities/discount_group.ts +43 -0
- package/src/entities/domain.test.ts +393 -0
- package/src/entities/domain.ts +1088 -0
- package/src/entities/domain_chat_settings.test.ts +16 -0
- package/src/entities/domain_chat_settings.ts +82 -0
- package/src/entities/domain_invitation.test.ts +7 -0
- package/src/entities/domain_invitation.ts +36 -0
- package/src/entities/domain_tag.test.ts +7 -0
- package/src/entities/domain_tag.ts +42 -0
- package/src/entities/draft.test.ts +29 -0
- package/src/entities/draft.ts +79 -0
- package/src/entities/draft_comment.test.ts +7 -0
- package/src/entities/draft_comment.ts +63 -0
- package/src/entities/draft_preview.test.ts +42 -0
- package/src/entities/draft_preview.ts +37 -0
- package/src/entities/draft_preview_layer.test.ts +7 -0
- package/src/entities/draft_preview_layer.ts +21 -0
- package/src/entities/draft_template.test.ts +14 -0
- package/src/entities/draft_template.ts +81 -0
- package/src/entities/email_address.test.ts +7 -0
- package/src/entities/email_address.ts +24 -0
- package/src/entities/email_counter.test.ts +7 -0
- package/src/entities/email_counter.ts +20 -0
- package/src/entities/enrolled_domain.test.ts +7 -0
- package/src/entities/enrolled_domain.ts +40 -0
- package/src/entities/exchange_rate.test.ts +7 -0
- package/src/entities/exchange_rate.ts +22 -0
- package/src/entities/file.test.ts +43 -0
- package/src/entities/file.ts +165 -0
- package/src/entities/internal_tag.test.ts +7 -0
- package/src/entities/internal_tag.ts +51 -0
- package/src/entities/inventory.test.ts +28 -0
- package/src/entities/inventory.ts +63 -0
- package/src/entities/inventory_group.test.ts +7 -0
- package/src/entities/inventory_group.ts +36 -0
- package/src/entities/inventory_unit_variation.test.ts +7 -0
- package/src/entities/inventory_unit_variation.ts +29 -0
- package/src/entities/invoice.test.ts +50 -0
- package/src/entities/invoice.ts +192 -0
- package/src/entities/item.test.ts +19 -0
- package/src/entities/item.ts +59 -0
- package/src/entities/job.test.ts +95 -0
- package/src/entities/job.ts +401 -0
- package/src/entities/job_comment.test.ts +7 -0
- package/src/entities/job_comment.ts +53 -0
- package/src/entities/job_note.ts +40 -0
- package/src/entities/job_operation_log.test.ts +7 -0
- package/src/entities/job_operation_log.ts +41 -0
- package/src/entities/matching_inventory.ts +29 -0
- package/src/entities/notification.test.ts +58 -0
- package/src/entities/notification.ts +106 -0
- package/src/entities/payment.test.ts +27 -0
- package/src/entities/payment.ts +77 -0
- package/src/entities/payment_device.test.ts +7 -0
- package/src/entities/payment_device.ts +30 -0
- package/src/entities/phone_number.test.ts +7 -0
- package/src/entities/phone_number.ts +36 -0
- package/src/entities/product.test.ts +776 -0
- package/src/entities/product.ts +486 -0
- package/src/entities/product_form.ts +51 -0
- package/src/entities/product_form_version.ts +51 -0
- package/src/entities/product_review.ts +221 -0
- package/src/entities/production_comment.test.ts +7 -0
- package/src/entities/production_comment.ts +53 -0
- package/src/entities/quote.test.ts +98 -0
- package/src/entities/quote.ts +140 -0
- package/src/entities/quote_item.test.ts +50 -0
- package/src/entities/quote_item.ts +71 -0
- package/src/entities/reminder.test.ts +16 -0
- package/src/entities/reminder.ts +74 -0
- package/src/entities/session.test.ts +7 -0
- package/src/entities/session.ts +28 -0
- package/src/entities/shipment.test.ts +24 -0
- package/src/entities/shipment.ts +196 -0
- package/src/entities/shipment_item.test.ts +7 -0
- package/src/entities/shipment_item.ts +15 -0
- package/src/entities/shipment_item_fulfillment.test.ts +8 -0
- package/src/entities/shipment_item_fulfillment.ts +15 -0
- package/src/entities/shipment_log.ts +37 -0
- package/src/entities/shipment_method.test.ts +7 -0
- package/src/entities/shipment_method.ts +61 -0
- package/src/entities/shipment_method_variation.test.ts +7 -0
- package/src/entities/shipment_method_variation.ts +39 -0
- package/src/entities/short_url.test.ts +7 -0
- package/src/entities/short_url.ts +36 -0
- package/src/entities/subscription_plan.test.ts +7 -0
- package/src/entities/subscription_plan.ts +73 -0
- package/src/entities/supply_domain.test.ts +7 -0
- package/src/entities/supply_domain.ts +27 -0
- package/src/entities/support_conversation.test.ts +7 -0
- package/src/entities/support_conversation.ts +65 -0
- package/src/entities/support_message.test.ts +7 -0
- package/src/entities/support_message.ts +30 -0
- package/src/entities/system_role.test.ts +7 -0
- package/src/entities/system_role.ts +17 -0
- package/src/entities/theme.test.ts +38 -0
- package/src/entities/theme.ts +82 -0
- package/src/entities/theme_css_setting.test.ts +7 -0
- package/src/entities/theme_css_setting.ts +23 -0
- package/src/entities/user.test.ts +154 -0
- package/src/entities/user.ts +428 -0
- package/src/entities/user_company.test.ts +7 -0
- package/src/entities/user_company.ts +27 -0
- package/src/entities/variation.test.ts +7 -0
- package/src/entities/variation.ts +64 -0
- package/src/entities/variation_field.test.ts +76 -0
- package/src/entities/variation_field.ts +268 -0
- package/src/entities/variation_fields_option.test.ts +46 -0
- package/src/entities/variation_fields_option.ts +107 -0
- package/src/entities/variation_option.test.ts +7 -0
- package/src/entities/variation_option.ts +58 -0
- package/src/entities/variations_group.test.ts +7 -0
- package/src/entities/variations_group.ts +41 -0
- package/src/entity.ts +1098 -0
- package/src/index.ts +189 -0
- package/src/merchi.test.ts +25 -0
- package/src/merchi.ts +445 -0
- package/src/pricing/__fixtures__/conditional_field_hidden.json +112 -0
- package/src/pricing/__fixtures__/conditional_field_visible.json +113 -0
- package/src/pricing/__fixtures__/group_product.json +130 -0
- package/src/pricing/__fixtures__/non_selectable_number_field.json +108 -0
- package/src/pricing/__fixtures__/quantity_break_discount.json +104 -0
- package/src/pricing/__fixtures__/simple_selectable_field.json +110 -0
- package/src/pricing/discount.test.ts +47 -0
- package/src/pricing/discount.ts +17 -0
- package/src/pricing/estimate.test.ts +486 -0
- package/src/pricing/estimate.ts +310 -0
- package/src/pricing/golden.test.ts +51 -0
- package/src/pricing/index.test.ts +9 -0
- package/src/pricing/index.ts +7 -0
- package/src/pricing/inventory.test.ts +197 -0
- package/src/pricing/inventory.ts +89 -0
- package/src/pricing/matrix.test.ts +553 -0
- package/src/pricing/matrix.ts +217 -0
- package/src/pricing/round.test.ts +31 -0
- package/src/pricing/round.ts +27 -0
- package/src/pricing/types.ts +140 -0
- package/src/pricing/visibility.test.ts +223 -0
- package/src/pricing/visibility.ts +111 -0
- package/src/request.test.ts +79 -0
- package/src/request.ts +196 -0
- package/src/test_util.ts +18 -0
- package/src/toasts.test.ts +38 -0
- package/src/toasts.ts +34 -0
- package/src/util/float.ts +12 -0
- package/src/util/index.ts +7 -0
- package/src/util/query_string.test.ts +7 -0
- package/src/util/query_string.ts +13 -0
- package/src/util/validation.test.ts +16 -0
- package/src/util/validation.ts +2 -0
- package/src/uuid.test.ts +15 -0
- package/src/uuid.ts +8 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { Merchi } from '../merchi.js';
|
|
2
|
+
import { setup, mockFetch } from '../test_util.js';
|
|
3
|
+
setup();
|
|
4
|
+
test('can make domain', function () {
|
|
5
|
+
var merchi = new Merchi();
|
|
6
|
+
var domain = new merchi.Domain();
|
|
7
|
+
expect(domain).toBeTruthy();
|
|
8
|
+
});
|
|
9
|
+
test('can get and set id', function () {
|
|
10
|
+
var merchi = new Merchi();
|
|
11
|
+
var domain = new merchi.Domain();
|
|
12
|
+
domain.id = 2;
|
|
13
|
+
expect(domain.id).toBe(2);
|
|
14
|
+
});
|
|
15
|
+
test('can get and set domain', function () {
|
|
16
|
+
var merchi = new Merchi();
|
|
17
|
+
var domain = new merchi.Domain();
|
|
18
|
+
domain.domain = 'example.com';
|
|
19
|
+
expect(domain.domain).toBe('example.com');
|
|
20
|
+
});
|
|
21
|
+
test('can create domain on server', function () {
|
|
22
|
+
var merchi = new Merchi();
|
|
23
|
+
var domain = new merchi.Domain();
|
|
24
|
+
domain.domain = 'example.com';
|
|
25
|
+
var data = Array.from(domain.toFormData().entries());
|
|
26
|
+
var fetch = mockFetch(true, {}, 201);
|
|
27
|
+
domain.create();
|
|
28
|
+
var sentToServer = Array.from(fetch.mock.calls[0][1]['body'].entries());
|
|
29
|
+
expect(sentToServer).toEqual(data);
|
|
30
|
+
});
|
|
31
|
+
test('serialises jobAgentPolicy JSON for form data', function () {
|
|
32
|
+
var merchi = new Merchi();
|
|
33
|
+
var domain = new merchi.Domain();
|
|
34
|
+
domain.id = 7;
|
|
35
|
+
domain.jobAgentPolicy = {
|
|
36
|
+
playbooks: { drafting: false, invoice: true },
|
|
37
|
+
outreach: { sendEmail: true },
|
|
38
|
+
};
|
|
39
|
+
var entries = Array.from(domain.toFormData().entries());
|
|
40
|
+
var data = Object.fromEntries(entries);
|
|
41
|
+
expect(data.jobAgentPolicy).toBe(JSON.stringify({
|
|
42
|
+
playbooks: { drafting: false, invoice: true },
|
|
43
|
+
outreach: { sendEmail: true },
|
|
44
|
+
}));
|
|
45
|
+
expect(data.jobAgentPolicy).not.toBe('[object Object]');
|
|
46
|
+
});
|
|
47
|
+
test('can delete domain', function () {
|
|
48
|
+
var merchi = new Merchi();
|
|
49
|
+
var domain = new merchi.Domain();
|
|
50
|
+
domain.id = 1;
|
|
51
|
+
var fetch = mockFetch(true, {}, 204);
|
|
52
|
+
domain.delete();
|
|
53
|
+
expect(fetch.mock.calls[0][1].method).toBe('DELETE');
|
|
54
|
+
});
|
|
55
|
+
test('taxType', function () {
|
|
56
|
+
var merchi = new Merchi();
|
|
57
|
+
var domain = new merchi.Domain();
|
|
58
|
+
expect(domain.defaultTaxType).toThrow();
|
|
59
|
+
domain.company = new merchi.Company();
|
|
60
|
+
expect(domain.defaultTaxType).toThrow();
|
|
61
|
+
var tax = new merchi.CountryTax();
|
|
62
|
+
domain.company.defaultTaxType = tax;
|
|
63
|
+
expect(domain.defaultTaxType()).toBe(tax);
|
|
64
|
+
domain.company.defaultTaxType = null;
|
|
65
|
+
expect(domain.defaultTaxType()).toBe(null);
|
|
66
|
+
});
|
|
67
|
+
test('can get domain active theme', function () {
|
|
68
|
+
var merchi = new Merchi();
|
|
69
|
+
var domain = new merchi.Domain();
|
|
70
|
+
// throw error if active theme is undefined which seems to be an embed issue
|
|
71
|
+
expect(function () { domain.getActiveTheme(); }).toThrow(Error);
|
|
72
|
+
var theme = new merchi.Theme();
|
|
73
|
+
domain.activeTheme = theme;
|
|
74
|
+
expect(domain.getActiveTheme()).toEqual(theme);
|
|
75
|
+
});
|
|
76
|
+
test('fail to delete non-existant domain', function () {
|
|
77
|
+
var merchi = new Merchi('YrDwzmh8&QGtAfg9quh(4QfSlE^RPXWl');
|
|
78
|
+
var domain = new merchi.Domain();
|
|
79
|
+
domain.id = -1;
|
|
80
|
+
var fetch = mockFetch(true, { statusCode: 404 }, 404);
|
|
81
|
+
var invocation = domain.delete();
|
|
82
|
+
expect(fetch.mock.calls[0][1].method).toBe('DELETE');
|
|
83
|
+
return invocation.catch(function (e) { return expect(e.statusCode).toEqual(404); });
|
|
84
|
+
});
|
|
85
|
+
test('can get storefront v2 config', function () {
|
|
86
|
+
var merchi = new Merchi();
|
|
87
|
+
var domain = new merchi.Domain();
|
|
88
|
+
domain.id = 42;
|
|
89
|
+
var fetch = mockFetch(true, {}, 200);
|
|
90
|
+
domain.getStorefrontV2();
|
|
91
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
92
|
+
var query = fetch.mock.calls[0][1].query;
|
|
93
|
+
expect(fetch.mock.calls[0][1].method).toBe('GET');
|
|
94
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/');
|
|
95
|
+
expect(query).toContainEqual(['skip_rights', 'y']);
|
|
96
|
+
});
|
|
97
|
+
test('can provision storefront v2', function () {
|
|
98
|
+
var merchi = new Merchi();
|
|
99
|
+
var domain = new merchi.Domain();
|
|
100
|
+
domain.id = 42;
|
|
101
|
+
var fetch = mockFetch(true, {}, 200);
|
|
102
|
+
domain.provisionStorefrontV2({
|
|
103
|
+
starterTemplate: 'merchi/storefront-v2-starter',
|
|
104
|
+
urlStructure: '/products/:product',
|
|
105
|
+
});
|
|
106
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
107
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
108
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
109
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/provision/');
|
|
110
|
+
expect(body).toEqual({
|
|
111
|
+
starterTemplate: 'merchi/storefront-v2-starter',
|
|
112
|
+
urlStructure: '/products/:product',
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
test('can extract storefront v2 site context', function () {
|
|
116
|
+
var merchi = new Merchi();
|
|
117
|
+
var domain = new merchi.Domain();
|
|
118
|
+
domain.id = 42;
|
|
119
|
+
var fetch = mockFetch(true, {}, 200);
|
|
120
|
+
domain.extractStorefrontV2SiteContext({ url: 'https://example.com' });
|
|
121
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
122
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
123
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
124
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/site_context/extract/');
|
|
125
|
+
expect(body).toEqual({ url: 'https://example.com' });
|
|
126
|
+
});
|
|
127
|
+
test('can create storefront v2 change request', function () {
|
|
128
|
+
var merchi = new Merchi();
|
|
129
|
+
var domain = new merchi.Domain();
|
|
130
|
+
domain.id = 42;
|
|
131
|
+
var fetch = mockFetch(true, {}, 200);
|
|
132
|
+
domain.createStorefrontChangeRequest({ prompt: 'update hero' });
|
|
133
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
134
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
135
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
136
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/requests/');
|
|
137
|
+
expect(body).toEqual({ prompt: 'update hero' });
|
|
138
|
+
});
|
|
139
|
+
test('can create storefront v2 change request with context payload', function () {
|
|
140
|
+
var merchi = new Merchi();
|
|
141
|
+
var domain = new merchi.Domain();
|
|
142
|
+
domain.id = 42;
|
|
143
|
+
var fetch = mockFetch(true, {}, 200);
|
|
144
|
+
domain.createStorefrontChangeRequest({
|
|
145
|
+
prompt: 'update hero',
|
|
146
|
+
contextFilePaths: ['src/app/page.tsx', 'components/hero.tsx'],
|
|
147
|
+
contextImages: [
|
|
148
|
+
{
|
|
149
|
+
name: 'hero-ref.png',
|
|
150
|
+
mimeType: 'image/png',
|
|
151
|
+
dataUrl: 'data:image/png;base64,abc123',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
156
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
157
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
158
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/requests/');
|
|
159
|
+
expect(body).toEqual({
|
|
160
|
+
prompt: 'update hero',
|
|
161
|
+
contextFilePaths: ['src/app/page.tsx', 'components/hero.tsx'],
|
|
162
|
+
contextImages: [
|
|
163
|
+
{
|
|
164
|
+
name: 'hero-ref.png',
|
|
165
|
+
mimeType: 'image/png',
|
|
166
|
+
dataUrl: 'data:image/png;base64,abc123',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
test('can create storefront v2 change request with clarification payload', function () {
|
|
172
|
+
var merchi = new Merchi();
|
|
173
|
+
var domain = new merchi.Domain();
|
|
174
|
+
domain.id = 42;
|
|
175
|
+
var fetch = mockFetch(true, {}, 200);
|
|
176
|
+
domain.createStorefrontChangeRequest({
|
|
177
|
+
prompt: 'generate storefront',
|
|
178
|
+
startNewBranch: true,
|
|
179
|
+
clarificationAnswers: { 'nav-style': 'simplify-to-starter-header' },
|
|
180
|
+
generationBriefSummary: 'Refresh homepage hero.',
|
|
181
|
+
generationBoilerplateFit: 'Starter header maps to source nav.',
|
|
182
|
+
clarificationSkipped: false,
|
|
183
|
+
});
|
|
184
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
185
|
+
expect(body).toEqual({
|
|
186
|
+
prompt: 'generate storefront',
|
|
187
|
+
startNewBranch: true,
|
|
188
|
+
clarificationAnswers: { 'nav-style': 'simplify-to-starter-header' },
|
|
189
|
+
generationBriefSummary: 'Refresh homepage hero.',
|
|
190
|
+
generationBoilerplateFit: 'Starter header maps to source nav.',
|
|
191
|
+
clarificationSkipped: false,
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
test('can create storefront v2 generation brief', function () {
|
|
195
|
+
var merchi = new Merchi();
|
|
196
|
+
var domain = new merchi.Domain();
|
|
197
|
+
domain.id = 42;
|
|
198
|
+
var fetch = mockFetch(true, {}, 200);
|
|
199
|
+
domain.createStorefrontV2GenerationBrief({
|
|
200
|
+
siteContext: { sourceUrl: 'https://example.com' },
|
|
201
|
+
urlStructure: '/:category/:product',
|
|
202
|
+
});
|
|
203
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
204
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
205
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/generation_brief/');
|
|
206
|
+
expect(body.siteContext.sourceUrl).toBe('https://example.com');
|
|
207
|
+
expect(body.urlStructure).toBe('/:category/:product');
|
|
208
|
+
});
|
|
209
|
+
test('can resolve starter template url structure', function () {
|
|
210
|
+
var merchi = new Merchi();
|
|
211
|
+
var domain = new merchi.Domain();
|
|
212
|
+
domain.id = 42;
|
|
213
|
+
var fetch = mockFetch(true, {}, 200);
|
|
214
|
+
domain.resolveStarterTemplateUrlStructure({
|
|
215
|
+
starterTemplate: 'merchi/storefront-v2-starter',
|
|
216
|
+
});
|
|
217
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
218
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
219
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/starter_template/url_structure/');
|
|
220
|
+
expect(body.starterTemplate).toBe('merchi/storefront-v2-starter');
|
|
221
|
+
});
|
|
222
|
+
test('can reset storefront v2', function () {
|
|
223
|
+
var merchi = new Merchi();
|
|
224
|
+
var domain = new merchi.Domain();
|
|
225
|
+
domain.id = 42;
|
|
226
|
+
var fetch = mockFetch(true, {}, 200);
|
|
227
|
+
domain.resetStorefrontV2();
|
|
228
|
+
expect(fetch.mock.calls[0][0]).toContain('/domains/42/storefront_v2/reset/');
|
|
229
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
230
|
+
});
|
|
231
|
+
test('can get storefront v2 repository tree with query params', function () {
|
|
232
|
+
var merchi = new Merchi();
|
|
233
|
+
var domain = new merchi.Domain();
|
|
234
|
+
domain.id = 42;
|
|
235
|
+
var fetch = mockFetch(true, {}, 200);
|
|
236
|
+
domain.getStorefrontV2RepositoryTree({ path: 'src', ref: 'main' });
|
|
237
|
+
expect(fetch.mock.calls[0][0]).toContain('/domains/42/storefront_v2/repository_tree/');
|
|
238
|
+
expect(fetch.mock.calls[0][1].query).toContainEqual(['path', 'src']);
|
|
239
|
+
expect(fetch.mock.calls[0][1].query).toContainEqual(['ref', 'main']);
|
|
240
|
+
});
|
|
241
|
+
test('can publish storefront v2 product', function () {
|
|
242
|
+
var merchi = new Merchi();
|
|
243
|
+
var domain = new merchi.Domain();
|
|
244
|
+
domain.id = 42;
|
|
245
|
+
var fetch = mockFetch(true, {}, 200);
|
|
246
|
+
domain.publishStorefrontV2Product({ productName: 'Wristband' });
|
|
247
|
+
expect(fetch.mock.calls[0][0]).toContain('/domains/42/storefront_v2/products/publish/');
|
|
248
|
+
expect(JSON.parse(fetch.mock.calls[0][1].body)).toEqual({
|
|
249
|
+
productName: 'Wristband',
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
test('can get storefront v2 product status', function () {
|
|
253
|
+
var merchi = new Merchi();
|
|
254
|
+
var domain = new merchi.Domain();
|
|
255
|
+
domain.id = 42;
|
|
256
|
+
var fetch = mockFetch(true, {}, 200);
|
|
257
|
+
domain.getStorefrontV2ProductStatus(88);
|
|
258
|
+
expect(fetch.mock.calls[0][0]).toContain('/domains/42/storefront_v2/products/88/status/');
|
|
259
|
+
});
|
|
260
|
+
test('can get storefront v2 change request by id', function () {
|
|
261
|
+
var merchi = new Merchi();
|
|
262
|
+
var domain = new merchi.Domain();
|
|
263
|
+
var fetch = mockFetch(true, {}, 200);
|
|
264
|
+
domain.getStorefrontChangeRequest(9);
|
|
265
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
266
|
+
expect(fetch.mock.calls[0][1].method).toBe('GET');
|
|
267
|
+
expect(fetchUrl).toContain('/storefront_change_requests/9/');
|
|
268
|
+
});
|
|
269
|
+
test('can get storefront v2 change request events by id', function () {
|
|
270
|
+
var merchi = new Merchi();
|
|
271
|
+
var domain = new merchi.Domain();
|
|
272
|
+
var fetch = mockFetch(true, {}, 200);
|
|
273
|
+
domain.getStorefrontChangeRequestEvents(9);
|
|
274
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
275
|
+
expect(fetch.mock.calls[0][1].method).toBe('GET');
|
|
276
|
+
expect(fetchUrl).toContain('/storefront_change_requests/9/events/');
|
|
277
|
+
});
|
|
278
|
+
test('can run storefront v2 change request', function () {
|
|
279
|
+
var merchi = new Merchi();
|
|
280
|
+
var domain = new merchi.Domain();
|
|
281
|
+
var fetch = mockFetch(true, {}, 200);
|
|
282
|
+
domain.runStorefrontChangeRequest(9, {
|
|
283
|
+
status: 'running',
|
|
284
|
+
pullRequestNumber: 42,
|
|
285
|
+
checksSummary: {
|
|
286
|
+
overall: 'passing',
|
|
287
|
+
counts: { total: 4, passed: 4, failed: 0, pending: 0, neutral: 0 },
|
|
288
|
+
},
|
|
289
|
+
checksUpdatedAt: '2026-05-15T00:00:00Z',
|
|
290
|
+
});
|
|
291
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
292
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
293
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
294
|
+
expect(fetchUrl).toContain('/storefront_change_requests/9/run/');
|
|
295
|
+
expect(body).toEqual({
|
|
296
|
+
status: 'running',
|
|
297
|
+
pullRequestNumber: 42,
|
|
298
|
+
checksSummary: {
|
|
299
|
+
overall: 'passing',
|
|
300
|
+
counts: { total: 4, passed: 4, failed: 0, pending: 0, neutral: 0 },
|
|
301
|
+
},
|
|
302
|
+
checksUpdatedAt: '2026-05-15T00:00:00Z',
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
test('can approve storefront v2 change request', function () {
|
|
306
|
+
var merchi = new Merchi();
|
|
307
|
+
var domain = new merchi.Domain();
|
|
308
|
+
var fetch = mockFetch(true, {}, 200);
|
|
309
|
+
domain.approveStorefrontChangeRequest(9, { comment: 'looks good' });
|
|
310
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
311
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
312
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
313
|
+
expect(fetchUrl).toContain('/storefront_change_requests/9/approve/');
|
|
314
|
+
expect(body).toEqual({ comment: 'looks good' });
|
|
315
|
+
});
|
|
316
|
+
test('can reject storefront v2 change request', function () {
|
|
317
|
+
var merchi = new Merchi();
|
|
318
|
+
var domain = new merchi.Domain();
|
|
319
|
+
var fetch = mockFetch(true, {}, 200);
|
|
320
|
+
domain.rejectStorefrontChangeRequest(9, { errorDetails: 'needs edits' });
|
|
321
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
322
|
+
var body = JSON.parse(fetch.mock.calls[0][1].body);
|
|
323
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
324
|
+
expect(fetchUrl).toContain('/storefront_change_requests/9/reject/');
|
|
325
|
+
expect(body).toEqual({ errorDetails: 'needs edits' });
|
|
326
|
+
});
|
|
327
|
+
test('can get storefront v2 deployments', function () {
|
|
328
|
+
var merchi = new Merchi();
|
|
329
|
+
var domain = new merchi.Domain();
|
|
330
|
+
domain.id = 42;
|
|
331
|
+
var fetch = mockFetch(true, {}, 200);
|
|
332
|
+
domain.getStorefrontV2Deployments();
|
|
333
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
334
|
+
expect(fetch.mock.calls[0][1].method).toBe('GET');
|
|
335
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/deployments/');
|
|
336
|
+
});
|
|
337
|
+
test('can get storefront v2 deployment logs', function () {
|
|
338
|
+
var merchi = new Merchi();
|
|
339
|
+
var domain = new merchi.Domain();
|
|
340
|
+
domain.id = 42;
|
|
341
|
+
var fetch = mockFetch(true, {}, 200);
|
|
342
|
+
domain.getStorefrontV2DeploymentLogs('dep_123');
|
|
343
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
344
|
+
expect(fetch.mock.calls[0][1].method).toBe('GET');
|
|
345
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/deployments/dep_123/logs/');
|
|
346
|
+
});
|
|
347
|
+
test('can rollback storefront v2 deployment', function () {
|
|
348
|
+
var merchi = new Merchi();
|
|
349
|
+
var domain = new merchi.Domain();
|
|
350
|
+
domain.id = 42;
|
|
351
|
+
var fetch = mockFetch(true, {}, 200);
|
|
352
|
+
domain.rollbackStorefrontV2();
|
|
353
|
+
var fetchUrl = fetch.mock.calls[0][0];
|
|
354
|
+
expect(fetch.mock.calls[0][1].method).toBe('POST');
|
|
355
|
+
expect(fetchUrl).toContain('/domains/42/storefront_v2/rollback/');
|
|
356
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { Domain } from './domain.js';
|
|
26
|
+
import { Entity } from '../entity.js';
|
|
27
|
+
import { MerchiFile } from './file.js';
|
|
28
|
+
var DomainChatSettings = /** @class */ (function (_super) {
|
|
29
|
+
__extends(DomainChatSettings, _super);
|
|
30
|
+
function DomainChatSettings() {
|
|
31
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
+
}
|
|
33
|
+
DomainChatSettings.resourceName = 'domain_chat_settings';
|
|
34
|
+
DomainChatSettings.singularName = 'domainChatSettings';
|
|
35
|
+
DomainChatSettings.pluralName = 'domainChatSettingsList';
|
|
36
|
+
__decorate([
|
|
37
|
+
DomainChatSettings.property(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], DomainChatSettings.prototype, "id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
DomainChatSettings.property(),
|
|
42
|
+
__metadata("design:type", Domain)
|
|
43
|
+
], DomainChatSettings.prototype, "domain", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
DomainChatSettings.property(),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], DomainChatSettings.prototype, "enabled", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
DomainChatSettings.property(),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], DomainChatSettings.prototype, "displayName", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
DomainChatSettings.property({ type: MerchiFile }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], DomainChatSettings.prototype, "avatar", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
DomainChatSettings.property(),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], DomainChatSettings.prototype, "welcomeMessage", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
DomainChatSettings.property(),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], DomainChatSettings.prototype, "privacyPolicyUrl", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
DomainChatSettings.property(),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], DomainChatSettings.prototype, "workingHours", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
DomainChatSettings.property(),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], DomainChatSettings.prototype, "awayMessage", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
DomainChatSettings.property(),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], DomainChatSettings.prototype, "notifyEmailNewConversation", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
DomainChatSettings.property(),
|
|
78
|
+
__metadata("design:type", Boolean)
|
|
79
|
+
], DomainChatSettings.prototype, "notifyEmailNewMessage", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
DomainChatSettings.property(),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], DomainChatSettings.prototype, "telegramChatId", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
DomainChatSettings.property({ arrayType: 'User' }),
|
|
86
|
+
__metadata("design:type", Array)
|
|
87
|
+
], DomainChatSettings.prototype, "assignedUsers", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
DomainChatSettings.property(),
|
|
90
|
+
__metadata("design:type", Boolean)
|
|
91
|
+
], DomainChatSettings.prototype, "requireGuestContact", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
DomainChatSettings.property(),
|
|
94
|
+
__metadata("design:type", Boolean)
|
|
95
|
+
], DomainChatSettings.prototype, "embedTestMode", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
DomainChatSettings.property(),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], DomainChatSettings.prototype, "autoOpenDelay", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
DomainChatSettings.property(),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], DomainChatSettings.prototype, "autoOpenMessage", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
DomainChatSettings.property(),
|
|
106
|
+
__metadata("design:type", Object)
|
|
107
|
+
], DomainChatSettings.prototype, "autoOpenMode", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
DomainChatSettings.property(),
|
|
110
|
+
__metadata("design:type", Boolean)
|
|
111
|
+
], DomainChatSettings.prototype, "aiFallbackEnabled", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
DomainChatSettings.property(),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], DomainChatSettings.prototype, "aiFallbackScope", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
DomainChatSettings.property(),
|
|
118
|
+
__metadata("design:type", Object)
|
|
119
|
+
], DomainChatSettings.prototype, "aiDisclosureMode", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
DomainChatSettings.property(),
|
|
122
|
+
__metadata("design:type", Object)
|
|
123
|
+
], DomainChatSettings.prototype, "aiMaxRepliesPerConversation", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
DomainChatSettings.property(),
|
|
126
|
+
__metadata("design:type", Number)
|
|
127
|
+
], DomainChatSettings.prototype, "aiCooldownSeconds", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
DomainChatSettings.property(),
|
|
130
|
+
__metadata("design:type", Object)
|
|
131
|
+
], DomainChatSettings.prototype, "aiEscalationMessage", void 0);
|
|
132
|
+
return DomainChatSettings;
|
|
133
|
+
}(Entity));
|
|
134
|
+
export { DomainChatSettings };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Merchi } from '../merchi.js';
|
|
2
|
+
test('can make DomainChatSettings', function () {
|
|
3
|
+
var merchi = new Merchi();
|
|
4
|
+
var settings = new merchi.DomainChatSettings();
|
|
5
|
+
expect(settings).toBeTruthy();
|
|
6
|
+
});
|
|
7
|
+
test('can set assignedUsers', function () {
|
|
8
|
+
var _a;
|
|
9
|
+
var merchi = new Merchi();
|
|
10
|
+
var settings = new merchi.DomainChatSettings();
|
|
11
|
+
var user = new merchi.User();
|
|
12
|
+
user.id = 11;
|
|
13
|
+
settings.assignedUsers = [user];
|
|
14
|
+
expect((_a = settings.assignedUsers) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; })).toEqual([11]);
|
|
15
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { Domain } from './domain.js';
|
|
26
|
+
import { Entity } from '../entity.js';
|
|
27
|
+
import { User } from './user.js';
|
|
28
|
+
var DomainInvitation = /** @class */ (function (_super) {
|
|
29
|
+
__extends(DomainInvitation, _super);
|
|
30
|
+
function DomainInvitation() {
|
|
31
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
+
}
|
|
33
|
+
DomainInvitation.resourceName = 'domain_invitations';
|
|
34
|
+
DomainInvitation.singularName = 'domainInvitation';
|
|
35
|
+
DomainInvitation.pluralName = 'domainInvitations';
|
|
36
|
+
__decorate([
|
|
37
|
+
DomainInvitation.property({ type: Date }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], DomainInvitation.prototype, "archived", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
DomainInvitation.property(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], DomainInvitation.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
DomainInvitation.property(),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], DomainInvitation.prototype, "userName", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
DomainInvitation.property(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], DomainInvitation.prototype, "userEmail", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
DomainInvitation.property(),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], DomainInvitation.prototype, "role", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
DomainInvitation.property(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], DomainInvitation.prototype, "token", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
DomainInvitation.property(),
|
|
62
|
+
__metadata("design:type", Domain)
|
|
63
|
+
], DomainInvitation.prototype, "domain", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
DomainInvitation.property(),
|
|
66
|
+
__metadata("design:type", User)
|
|
67
|
+
], DomainInvitation.prototype, "sender", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
DomainInvitation.property({ type: Date }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], DomainInvitation.prototype, "user", void 0);
|
|
72
|
+
return DomainInvitation;
|
|
73
|
+
}(Entity));
|
|
74
|
+
export { DomainInvitation };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { Domain } from './domain.js';
|
|
26
|
+
import { Entity } from '../entity.js';
|
|
27
|
+
var DomainTag = /** @class */ (function (_super) {
|
|
28
|
+
__extends(DomainTag, _super);
|
|
29
|
+
function DomainTag() {
|
|
30
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
31
|
+
}
|
|
32
|
+
DomainTag.resourceName = 'domain_tags';
|
|
33
|
+
DomainTag.singularName = 'domainTag';
|
|
34
|
+
DomainTag.pluralName = 'domainTags';
|
|
35
|
+
__decorate([
|
|
36
|
+
DomainTag.property(),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], DomainTag.prototype, "id", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
DomainTag.property(),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], DomainTag.prototype, "colour", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
DomainTag.property(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], DomainTag.prototype, "name", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
DomainTag.property(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], DomainTag.prototype, "description", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
DomainTag.property(),
|
|
53
|
+
__metadata("design:type", Boolean)
|
|
54
|
+
], DomainTag.prototype, "showPublic", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
DomainTag.property(),
|
|
57
|
+
__metadata("design:type", Domain)
|
|
58
|
+
], DomainTag.prototype, "domain", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
DomainTag.property({ arrayType: 'Job' }),
|
|
61
|
+
__metadata("design:type", Array)
|
|
62
|
+
], DomainTag.prototype, "jobs", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
DomainTag.property({ arrayType: 'Product' }),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], DomainTag.prototype, "products", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
DomainTag.property({ arrayType: 'Invoice' }),
|
|
69
|
+
__metadata("design:type", Array)
|
|
70
|
+
], DomainTag.prototype, "invoices", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
DomainTag.property({ arrayType: 'Shipment' }),
|
|
73
|
+
__metadata("design:type", Array)
|
|
74
|
+
], DomainTag.prototype, "shipments", void 0);
|
|
75
|
+
return DomainTag;
|
|
76
|
+
}(Entity));
|
|
77
|
+
export { DomainTag };
|