merchi_sdk_ts 1.32.0 → 1.32.1
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 -43
- package/LICENSE +21 -21
- package/README.md +244 -244
- package/coverage/clover.xml +4870 -366
- package/coverage/coverage-final.json +131 -7
- package/coverage/lcov-report/block-navigation.js +1 -1
- package/coverage/lcov-report/index.html +76 -91
- package/coverage/lcov-report/sorter.js +21 -7
- package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +7 -7
- package/coverage/lcov-report/src/constants/call_to_actions.ts.html +37 -37
- package/coverage/lcov-report/src/constants/discount_types.ts.html +19 -19
- package/coverage/lcov-report/src/constants/domain_types.ts.html +13 -13
- package/coverage/lcov-report/src/constants/errors.ts.html +43 -43
- package/coverage/lcov-report/src/constants/event_types.ts.html +19 -19
- package/coverage/lcov-report/src/constants/field_types.ts.html +17 -23
- package/coverage/lcov-report/src/constants/index.html +221 -221
- package/coverage/lcov-report/src/constants/index.ts.html +103 -103
- package/coverage/lcov-report/src/constants/input_types.ts.html +35 -35
- package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +7 -7
- package/coverage/lcov-report/src/constants/invoice_types.ts.html +19 -19
- package/coverage/lcov-report/src/constants/item_types.ts.html +19 -19
- package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +23 -23
- package/coverage/lcov-report/src/constants/job/index.html +66 -66
- package/coverage/lcov-report/src/constants/job/payment_status.ts.html +23 -23
- package/coverage/lcov-report/src/constants/job/production_status.ts.html +33 -33
- package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +31 -31
- package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +21 -21
- package/coverage/lcov-report/src/constants/job_priorities.ts.html +21 -21
- package/coverage/lcov-report/src/constants/job_status.ts.html +91 -91
- package/coverage/lcov-report/src/constants/job_types.ts.html +41 -41
- package/coverage/lcov-report/src/constants/notification_sections.ts.html +14 -14
- package/coverage/lcov-report/src/constants/notification_types.ts.html +98 -98
- package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +21 -21
- package/coverage/lcov-report/src/constants/payment_types.ts.html +29 -29
- package/coverage/lcov-report/src/constants/platform.ts.html +17 -17
- package/coverage/lcov-report/src/constants/product_types.ts.html +61 -61
- package/coverage/lcov-report/src/constants/rights.ts.html +19 -19
- package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +9 -9
- package/coverage/lcov-report/src/constants/roles.ts.html +19 -19
- package/coverage/lcov-report/src/constants/shipment_companies.ts.html +47 -47
- package/coverage/lcov-report/src/constants/shipment_services.ts.html +4 -4
- package/coverage/lcov-report/src/constants/system_roles.ts.html +15 -15
- package/coverage/lcov-report/src/constants/theme_status.ts.html +6 -6
- package/coverage/lcov-report/src/constants/user_types.ts.html +18 -18
- package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +19 -19
- package/coverage/lcov-report/src/cookie.ts.html +4 -4
- package/coverage/lcov-report/src/entities/address.ts.html +25 -25
- package/coverage/lcov-report/src/entities/agent_conversation.ts.html +20 -20
- package/coverage/lcov-report/src/entities/agent_skill.ts.html +31 -31
- package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +15 -15
- package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +31 -31
- package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +31 -31
- package/coverage/lcov-report/src/entities/assignment.ts.html +63 -63
- package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +16 -16
- package/coverage/lcov-report/src/entities/bank.ts.html +21 -21
- package/coverage/lcov-report/src/entities/cart.ts.html +58 -58
- package/coverage/lcov-report/src/entities/cart_item.ts.html +67 -67
- package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +13 -13
- package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +18 -18
- package/coverage/lcov-report/src/entities/category.ts.html +25 -25
- package/coverage/lcov-report/src/entities/company.ts.html +129 -129
- package/coverage/lcov-report/src/entities/company_invitation.ts.html +18 -18
- package/coverage/lcov-report/src/entities/country_tax.ts.html +37 -37
- package/coverage/lcov-report/src/entities/discount.ts.html +41 -41
- package/coverage/lcov-report/src/entities/discount_group.ts.html +19 -19
- package/coverage/lcov-report/src/entities/domain.ts.html +259 -385
- package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +34 -34
- package/coverage/lcov-report/src/entities/domain_invitation.ts.html +19 -19
- package/coverage/lcov-report/src/entities/domain_tag.ts.html +19 -19
- package/coverage/lcov-report/src/entities/draft.ts.html +51 -51
- package/coverage/lcov-report/src/entities/draft_comment.ts.html +27 -27
- package/coverage/lcov-report/src/entities/draft_preview.ts.html +19 -19
- package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +14 -14
- package/coverage/lcov-report/src/entities/draft_template.ts.html +32 -50
- package/coverage/lcov-report/src/entities/email_address.ts.html +13 -13
- package/coverage/lcov-report/src/entities/email_counter.ts.html +13 -13
- package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +40 -40
- package/coverage/lcov-report/src/entities/exchange_rate.ts.html +13 -13
- package/coverage/lcov-report/src/entities/file.ts.html +84 -84
- package/coverage/lcov-report/src/entities/index.html +274 -274
- package/coverage/lcov-report/src/entities/internal_tag.ts.html +20 -20
- package/coverage/lcov-report/src/entities/inventory.ts.html +43 -43
- package/coverage/lcov-report/src/entities/inventory_group.ts.html +17 -17
- package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +32 -32
- package/coverage/lcov-report/src/entities/invoice.ts.html +70 -70
- package/coverage/lcov-report/src/entities/item.ts.html +45 -45
- package/coverage/lcov-report/src/entities/job.ts.html +188 -188
- package/coverage/lcov-report/src/entities/job_comment.ts.html +23 -23
- package/coverage/lcov-report/src/entities/job_note.ts.html +20 -20
- package/coverage/lcov-report/src/entities/job_operation_log.ts.html +20 -20
- package/coverage/lcov-report/src/entities/matching_inventory.ts.html +17 -17
- package/coverage/lcov-report/src/entities/notification.ts.html +48 -48
- package/coverage/lcov-report/src/entities/payment.ts.html +48 -48
- package/coverage/lcov-report/src/entities/payment_device.ts.html +16 -16
- package/coverage/lcov-report/src/entities/phone_number.ts.html +17 -17
- package/coverage/lcov-report/src/entities/product.ts.html +285 -276
- package/coverage/lcov-report/src/entities/product_form.ts.html +22 -22
- package/coverage/lcov-report/src/entities/product_form_version.ts.html +22 -22
- package/coverage/lcov-report/src/entities/product_review.ts.html +26 -26
- package/coverage/lcov-report/src/entities/production_comment.ts.html +23 -23
- package/coverage/lcov-report/src/entities/quote.ts.html +163 -163
- package/coverage/lcov-report/src/entities/quote_item.ts.html +61 -61
- package/coverage/lcov-report/src/entities/reminder.ts.html +35 -35
- package/coverage/lcov-report/src/entities/session.ts.html +17 -17
- package/coverage/lcov-report/src/entities/shipment.ts.html +98 -98
- package/coverage/lcov-report/src/entities/shipment_item.ts.html +11 -11
- package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +12 -12
- package/coverage/lcov-report/src/entities/shipment_log.ts.html +17 -17
- package/coverage/lcov-report/src/entities/shipment_method.ts.html +28 -28
- package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +19 -19
- package/coverage/lcov-report/src/entities/short_url.ts.html +18 -18
- package/coverage/lcov-report/src/entities/subscription_plan.ts.html +31 -31
- package/coverage/lcov-report/src/entities/supply_domain.ts.html +16 -16
- package/coverage/lcov-report/src/entities/support_conversation.ts.html +27 -27
- package/coverage/lcov-report/src/entities/support_message.ts.html +17 -17
- package/coverage/lcov-report/src/entities/system_role.ts.html +12 -12
- package/coverage/lcov-report/src/entities/theme.ts.html +66 -66
- package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +14 -14
- package/coverage/lcov-report/src/entities/user.ts.html +250 -250
- package/coverage/lcov-report/src/entities/user_company.ts.html +16 -16
- package/coverage/lcov-report/src/entities/variation.ts.html +29 -29
- package/coverage/lcov-report/src/entities/variation_field.ts.html +128 -359
- package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +86 -95
- package/coverage/lcov-report/src/entities/variation_option.ts.html +25 -25
- package/coverage/lcov-report/src/entities/variations_group.ts.html +21 -21
- package/coverage/lcov-report/src/entity.ts.html +918 -942
- package/coverage/lcov-report/src/index.html +68 -68
- package/coverage/lcov-report/src/index.ts.html +349 -349
- package/coverage/lcov-report/src/merchi.ts.html +236 -236
- package/coverage/lcov-report/src/pricing/discount.ts.html +29 -29
- package/coverage/lcov-report/src/pricing/estimate.ts.html +232 -463
- package/coverage/lcov-report/src/pricing/index.html +75 -90
- package/coverage/lcov-report/src/pricing/index.ts.html +21 -24
- package/coverage/lcov-report/src/pricing/inventory.ts.html +103 -103
- package/coverage/lcov-report/src/pricing/round.ts.html +33 -33
- package/coverage/lcov-report/src/pricing/visibility.ts.html +113 -113
- package/coverage/lcov-report/src/request.ts.html +76 -76
- package/coverage/lcov-report/src/test_util.ts.html +26 -26
- package/coverage/lcov-report/src/toasts.ts.html +30 -30
- package/coverage/lcov-report/src/util/float.ts.html +27 -27
- package/coverage/lcov-report/src/util/index.html +49 -49
- package/coverage/lcov-report/src/util/index.ts.html +15 -15
- package/coverage/lcov-report/src/util/query_string.ts.html +29 -29
- package/coverage/lcov-report/src/util/validation.ts.html +15 -15
- package/coverage/lcov-report/src/uuid.ts.html +8 -8
- package/coverage/lcov.info +7332 -722
- package/dist/constants/auto_assign_production_on_actions.js +7 -7
- package/dist/constants/call_to_actions.js +15 -15
- package/dist/constants/call_to_actions.test.js +4 -4
- package/dist/constants/discount_types.js +6 -6
- package/dist/constants/discount_types.test.js +4 -4
- package/dist/constants/domain_types.js +13 -13
- package/dist/constants/domain_types.test.js +4 -4
- package/dist/constants/errors.js +32 -32
- package/dist/constants/event_types.js +6 -6
- package/dist/constants/event_types.test.js +4 -4
- package/dist/constants/field_types.js +17 -17
- package/dist/constants/field_types.test.js +4 -4
- package/dist/constants/index.js +25 -25
- package/dist/constants/input_types.js +14 -14
- package/dist/constants/input_types.test.js +4 -4
- package/dist/constants/inventory_status.test.js +4 -4
- package/dist/constants/inventory_statuses.js +7 -7
- package/dist/constants/invoice_types.js +6 -6
- package/dist/constants/invoice_types.test.js +4 -4
- package/dist/constants/item_types.js +6 -6
- package/dist/constants/item_types.test.js +4 -4
- package/dist/constants/job/drafting_status.js +8 -8
- package/dist/constants/job/drafting_status.test.js +4 -4
- package/dist/constants/job/payment_status.js +8 -8
- package/dist/constants/job/payment_status.test.js +4 -4
- package/dist/constants/job/production_status.js +13 -13
- package/dist/constants/job/production_status.test.js +4 -4
- package/dist/constants/job/shipment_status.js +12 -12
- package/dist/constants/job/shipment_status.test.js +4 -4
- package/dist/constants/job/supply_chain_request_status.js +7 -7
- package/dist/constants/job/supply_chain_request_status.test.js +4 -4
- package/dist/constants/job_priorities.js +7 -7
- package/dist/constants/job_priorities.test.js +4 -4
- package/dist/constants/job_status.js +50 -50
- package/dist/constants/job_status.test.js +4 -4
- package/dist/constants/job_types.js +17 -17
- package/dist/constants/job_types.test.js +4 -4
- package/dist/constants/notification_sections.js +14 -14
- package/dist/constants/notification_sections.test.js +4 -4
- package/dist/constants/notification_types.js +98 -98
- package/dist/constants/notification_types.test.js +4 -4
- package/dist/constants/notification_urgencies.js +7 -7
- package/dist/constants/notification_urgencies.test.js +4 -4
- package/dist/constants/payment_types.js +11 -11
- package/dist/constants/payment_types.test.js +4 -4
- package/dist/constants/platform.js +5 -5
- package/dist/constants/platform.test.js +8 -8
- package/dist/constants/product_types.js +27 -27
- package/dist/constants/product_types.test.js +4 -4
- package/dist/constants/rights.js +6 -6
- package/dist/constants/rights.test.js +4 -4
- package/dist/constants/robots_meta_directives.js +11 -11
- package/dist/constants/robots_meta_directives.test.js +4 -4
- package/dist/constants/roles.js +57 -57
- package/dist/constants/roles.test.js +4 -4
- package/dist/constants/shipment_companies.js +20 -20
- package/dist/constants/shipment_companies.test.js +4 -4
- package/dist/constants/shipment_services.js +4 -4
- package/dist/constants/shipment_services.test.js +4 -4
- package/dist/constants/system_roles.js +4 -4
- package/dist/constants/system_roles.test.js +4 -4
- package/dist/constants/theme_status.js +6 -6
- package/dist/constants/theme_status.test.js +4 -4
- package/dist/constants/user_types.js +18 -18
- package/dist/constants/user_types.test.js +4 -4
- package/dist/constants/white_label_accessibilities.js +6 -6
- package/dist/constants/white_label_accessibilities.test.js +4 -4
- package/dist/cookie.js +15 -15
- package/dist/cookie.test.js +10 -10
- package/dist/entities/address.js +104 -104
- package/dist/entities/address.test.js +6 -6
- package/dist/entities/agent_conversation.js +78 -78
- package/dist/entities/agent_conversation.test.js +6 -6
- package/dist/entities/agent_skill.js +133 -133
- package/dist/entities/agent_skill.test.js +11 -11
- package/dist/entities/agent_skill_approval.js +61 -61
- package/dist/entities/agent_skill_version.js +99 -99
- package/dist/entities/agent_token_analytics.js +1 -1
- package/dist/entities/agent_token_usage.js +127 -127
- package/dist/entities/agent_token_usage.test.js +6 -6
- package/dist/entities/assignment.js +135 -135
- package/dist/entities/assignment.test.js +30 -30
- package/dist/entities/automatic_payment_relationship.js +65 -65
- package/dist/entities/automatic_payment_relationship.test.js +6 -6
- package/dist/entities/bank.js +85 -85
- package/dist/entities/bank.test.js +6 -6
- package/dist/entities/cart.js +169 -165
- package/dist/entities/cart.test.js +45 -45
- package/dist/entities/cart_item.js +125 -125
- package/dist/entities/cart_item.test.js +28 -28
- package/dist/entities/cart_shipment_group.js +53 -53
- package/dist/entities/cart_shipment_quote.js +70 -70
- package/dist/entities/category.js +101 -101
- package/dist/entities/category.test.js +52 -52
- package/dist/entities/company.js +509 -509
- package/dist/entities/company.test.js +6 -6
- package/dist/entities/company_invitation.js +70 -70
- package/dist/entities/company_invitation.test.js +6 -6
- package/dist/entities/country_tax.js +80 -80
- package/dist/entities/country_tax.test.js +11 -11
- package/dist/entities/discount.js +80 -80
- package/dist/entities/discount.test.js +16 -16
- package/dist/entities/discount_group.js +80 -80
- package/dist/entities/discount_group.test.js +6 -6
- package/dist/entities/domain.js +564 -556
- package/dist/entities/domain.test.js +348 -348
- package/dist/entities/domain_chat_settings.js +134 -134
- package/dist/entities/domain_chat_settings.test.js +15 -15
- package/dist/entities/domain_invitation.js +74 -74
- package/dist/entities/domain_invitation.test.js +6 -6
- package/dist/entities/domain_tag.js +77 -77
- package/dist/entities/domain_tag.test.js +6 -6
- package/dist/entities/draft.js +122 -118
- package/dist/entities/draft.test.js +26 -26
- package/dist/entities/draft_comment.js +107 -103
- package/dist/entities/draft_comment.test.js +6 -6
- package/dist/entities/draft_preview.js +74 -74
- package/dist/entities/draft_preview.test.js +36 -36
- package/dist/entities/draft_preview_layer.js +54 -54
- package/dist/entities/draft_preview_layer.test.js +6 -6
- package/dist/entities/draft_template.js +119 -119
- package/dist/entities/draft_template.test.js +12 -12
- package/dist/entities/email_address.js +56 -56
- package/dist/entities/email_address.test.js +6 -6
- package/dist/entities/email_counter.js +53 -53
- package/dist/entities/email_counter.test.js +6 -6
- package/dist/entities/enrolled_domain.js +74 -74
- package/dist/entities/enrolled_domain.test.js +6 -6
- package/dist/entities/exchange_rate.js +56 -56
- package/dist/entities/exchange_rate.test.js +6 -6
- package/dist/entities/file.js +218 -218
- package/dist/entities/file.test.js +38 -38
- package/dist/entities/internal_tag.js +84 -84
- package/dist/entities/internal_tag.test.js +6 -6
- package/dist/entities/inventory.js +97 -97
- package/dist/entities/inventory.test.js +22 -22
- package/dist/entities/inventory_group.js +69 -69
- package/dist/entities/inventory_group.test.js +6 -6
- package/dist/entities/inventory_unit_variation.js +61 -61
- package/dist/entities/inventory_unit_variation.test.js +6 -6
- package/dist/entities/invoice.js +264 -260
- package/dist/entities/invoice.test.js +39 -39
- package/dist/entities/item.js +96 -96
- package/dist/entities/item.test.js +17 -17
- package/dist/entities/job.js +515 -511
- package/dist/entities/job.test.js +83 -83
- package/dist/entities/job_comment.js +94 -90
- package/dist/entities/job_comment.test.js +6 -6
- package/dist/entities/job_note.js +78 -78
- package/dist/entities/job_operation_log.js +82 -82
- package/dist/entities/job_operation_log.test.js +6 -6
- package/dist/entities/matching_inventory.js +63 -63
- package/dist/entities/notification.js +163 -163
- package/dist/entities/notification.test.js +51 -51
- package/dist/entities/payment.js +106 -106
- package/dist/entities/payment.test.js +16 -16
- package/dist/entities/payment_device.js +65 -65
- package/dist/entities/payment_device.test.js +6 -6
- package/dist/entities/phone_number.js +72 -72
- package/dist/entities/phone_number.test.js +6 -6
- package/dist/entities/product.js +611 -611
- package/dist/entities/product.test.js +716 -716
- package/dist/entities/product_form.js +92 -92
- package/dist/entities/product_form_version.js +95 -95
- package/dist/entities/product_review.js +234 -234
- package/dist/entities/production_comment.js +94 -90
- package/dist/entities/production_comment.test.js +6 -6
- package/dist/entities/quote.js +168 -168
- package/dist/entities/quote.test.js +86 -86
- package/dist/entities/quote_item.js +99 -99
- package/dist/entities/quote_item.test.js +40 -40
- package/dist/entities/reminder.js +120 -120
- package/dist/entities/reminder.test.js +14 -14
- package/dist/entities/session.js +63 -63
- package/dist/entities/session.test.js +6 -6
- package/dist/entities/shipment.js +256 -252
- package/dist/entities/shipment.test.js +20 -20
- package/dist/entities/shipment_item.js +45 -45
- package/dist/entities/shipment_item.test.js +6 -6
- package/dist/entities/shipment_item_fulfillment.js +46 -46
- package/dist/entities/shipment_item_fulfillment.test.js +6 -6
- package/dist/entities/shipment_log.js +75 -75
- package/dist/entities/shipment_method.js +104 -104
- package/dist/entities/shipment_method.test.js +6 -6
- package/dist/entities/shipment_method_variation.js +77 -77
- package/dist/entities/shipment_method_variation.test.js +6 -6
- package/dist/entities/short_url.js +73 -73
- package/dist/entities/short_url.test.js +6 -6
- package/dist/entities/subscription_plan.js +122 -122
- package/dist/entities/subscription_plan.test.js +6 -6
- package/dist/entities/supply_domain.js +62 -62
- package/dist/entities/supply_domain.test.js +6 -6
- package/dist/entities/support_conversation.js +106 -106
- package/dist/entities/support_conversation.test.js +6 -6
- package/dist/entities/support_message.js +66 -66
- package/dist/entities/support_message.test.js +6 -6
- package/dist/entities/system_role.js +49 -49
- package/dist/entities/system_role.test.js +6 -6
- package/dist/entities/theme.js +125 -125
- package/dist/entities/theme.test.js +35 -35
- package/dist/entities/theme_css_setting.js +57 -57
- package/dist/entities/theme_css_setting.test.js +6 -6
- package/dist/entities/user.js +508 -508
- package/dist/entities/user.test.js +134 -134
- package/dist/entities/user_company.js +62 -62
- package/dist/entities/user_company.test.js +6 -6
- package/dist/entities/variation.js +108 -108
- package/dist/entities/variation.test.js +6 -6
- package/dist/entities/variation_field.js +381 -381
- package/dist/entities/variation_field.test.js +69 -69
- package/dist/entities/variation_fields_option.js +153 -153
- package/dist/entities/variation_fields_option.test.js +43 -43
- package/dist/entities/variation_option.js +104 -104
- package/dist/entities/variation_option.test.js +6 -6
- package/dist/entities/variations_group.js +79 -79
- package/dist/entities/variations_group.test.js +6 -6
- package/dist/entity.js +947 -947
- package/dist/index.js +86 -86
- package/dist/merchi.js +296 -296
- package/dist/merchi.test.js +21 -21
- package/dist/pricing/discount.js +11 -11
- package/dist/pricing/discount.test.js +35 -35
- package/dist/pricing/estimate.js +335 -335
- package/dist/pricing/estimate.test.js +403 -403
- package/dist/pricing/golden.test.js +61 -61
- package/dist/pricing/index.js +7 -7
- package/dist/pricing/index.test.js +8 -8
- package/dist/pricing/inventory.js +238 -238
- package/dist/pricing/inventory.test.js +188 -188
- package/dist/pricing/matrix.js +245 -245
- package/dist/pricing/matrix.test.js +437 -437
- package/dist/pricing/round.js +29 -29
- package/dist/pricing/round.test.js +27 -27
- package/dist/pricing/types.js +1 -1
- package/dist/pricing/visibility.js +227 -227
- package/dist/pricing/visibility.test.js +210 -210
- package/dist/request.js +169 -169
- package/dist/request.test.js +70 -70
- package/dist/test_util.js +17 -17
- package/dist/toasts.js +14 -14
- package/dist/toasts.test.js +28 -28
- package/dist/util/float.js +34 -34
- package/dist/util/index.js +3 -3
- package/dist/util/query_string.js +13 -13
- package/dist/util/query_string.test.js +6 -6
- package/dist/util/validation.js +3 -3
- package/dist/util/validation.test.js +12 -12
- package/dist/uuid.js +8 -8
- package/dist/uuid.test.js +11 -11
- package/jest.config.js +23 -23
- package/package.json +34 -34
- package/src/constants/auto_assign_production_on_actions.ts +6 -6
- package/src/constants/call_to_actions.test.ts +5 -5
- package/src/constants/call_to_actions.ts +14 -14
- package/src/constants/discount_types.test.ts +5 -5
- package/src/constants/discount_types.ts +5 -5
- package/src/constants/domain_types.test.ts +5 -5
- package/src/constants/domain_types.ts +12 -12
- package/src/constants/errors.ts +32 -32
- package/src/constants/event_types.test.ts +5 -5
- package/src/constants/event_types.ts +5 -5
- package/src/constants/field_types.test.ts +5 -5
- package/src/constants/field_types.ts +16 -16
- package/src/constants/index.ts +51 -51
- package/src/constants/input_types.test.ts +5 -5
- package/src/constants/input_types.ts +13 -13
- package/src/constants/inventory_status.test.ts +5 -5
- package/src/constants/inventory_statuses.ts +6 -6
- package/src/constants/invoice_types.test.ts +5 -5
- package/src/constants/invoice_types.ts +5 -5
- package/src/constants/item_types.test.ts +5 -5
- package/src/constants/item_types.ts +5 -5
- package/src/constants/job/drafting_status.test.ts +5 -5
- package/src/constants/job/drafting_status.ts +7 -7
- package/src/constants/job/payment_status.test.ts +5 -5
- package/src/constants/job/payment_status.ts +7 -7
- package/src/constants/job/production_status.test.ts +5 -5
- package/src/constants/job/production_status.ts +12 -12
- package/src/constants/job/shipment_status.test.ts +5 -5
- package/src/constants/job/shipment_status.ts +11 -11
- package/src/constants/job/supply_chain_request_status.test.ts +5 -5
- package/src/constants/job/supply_chain_request_status.ts +6 -6
- package/src/constants/job_priorities.test.ts +5 -5
- package/src/constants/job_priorities.ts +6 -6
- package/src/constants/job_status.test.ts +5 -5
- package/src/constants/job_status.ts +49 -49
- package/src/constants/job_types.test.ts +5 -5
- package/src/constants/job_types.ts +16 -16
- package/src/constants/notification_sections.test.ts +5 -5
- package/src/constants/notification_sections.ts +13 -13
- package/src/constants/notification_types.test.ts +5 -5
- package/src/constants/notification_types.ts +97 -97
- package/src/constants/notification_urgencies.test.ts +5 -5
- package/src/constants/notification_urgencies.ts +7 -7
- package/src/constants/payment_types.test.ts +5 -5
- package/src/constants/payment_types.ts +10 -10
- package/src/constants/platform.test.ts +15 -15
- package/src/constants/platform.ts +6 -6
- package/src/constants/product_types.test.ts +6 -6
- package/src/constants/product_types.ts +26 -26
- package/src/constants/rights.test.ts +5 -5
- package/src/constants/rights.ts +5 -5
- package/src/constants/robots_meta_directives.test.ts +5 -5
- package/src/constants/robots_meta_directives.ts +11 -11
- package/src/constants/roles.test.ts +5 -5
- package/src/constants/roles.ts +38 -38
- package/src/constants/shipment_companies.test.ts +5 -5
- package/src/constants/shipment_companies.ts +19 -19
- package/src/constants/shipment_services.test.ts +5 -5
- package/src/constants/shipment_services.ts +3 -3
- package/src/constants/system_roles.test.ts +5 -5
- package/src/constants/system_roles.ts +3 -3
- package/src/constants/theme_status.test.ts +5 -5
- package/src/constants/theme_status.ts +5 -5
- package/src/constants/user_types.test.ts +5 -5
- package/src/constants/user_types.ts +17 -17
- package/src/constants/white_label_accessibilities.test.ts +5 -5
- package/src/constants/white_label_accessibilities.ts +6 -6
- package/src/cookie.test.ts +11 -11
- package/src/cookie.ts +16 -16
- package/src/entities/address.test.ts +7 -7
- package/src/entities/address.ts +65 -65
- package/src/entities/agent_conversation.test.ts +7 -7
- package/src/entities/agent_conversation.ts +39 -39
- package/src/entities/agent_skill.test.ts +13 -13
- package/src/entities/agent_skill.ts +99 -99
- package/src/entities/agent_skill_approval.ts +26 -26
- package/src/entities/agent_skill_version.ts +64 -64
- package/src/entities/agent_token_analytics.ts +49 -49
- package/src/entities/agent_token_usage.test.ts +7 -7
- package/src/entities/agent_token_usage.ts +88 -88
- package/src/entities/assignment.test.ts +39 -39
- package/src/entities/assignment.ts +99 -99
- package/src/entities/automatic_payment_relationship.test.ts +8 -8
- package/src/entities/automatic_payment_relationship.ts +29 -29
- package/src/entities/bank.test.ts +7 -7
- package/src/entities/bank.ts +45 -45
- package/src/entities/cart.test.ts +50 -50
- package/src/entities/cart.ts +99 -96
- package/src/entities/cart_item.test.ts +33 -33
- package/src/entities/cart_item.ts +85 -85
- package/src/entities/cart_shipment_group.ts +21 -21
- package/src/entities/cart_shipment_quote.ts +33 -33
- package/src/entities/category.test.ts +57 -57
- package/src/entities/category.ts +59 -59
- package/src/entities/company.test.ts +7 -7
- package/src/entities/company.ts +397 -397
- package/src/entities/company_invitation.test.ts +7 -7
- package/src/entities/company_invitation.ts +33 -33
- package/src/entities/country_tax.test.ts +13 -13
- package/src/entities/country_tax.ts +46 -46
- package/src/entities/discount.test.ts +18 -18
- package/src/entities/discount.ts +43 -43
- package/src/entities/discount_group.test.ts +7 -7
- package/src/entities/discount_group.ts +43 -43
- package/src/entities/domain.test.ts +382 -382
- package/src/entities/domain.ts +1069 -1063
- package/src/entities/domain_chat_settings.test.ts +16 -16
- package/src/entities/domain_chat_settings.ts +82 -82
- package/src/entities/domain_invitation.test.ts +7 -7
- package/src/entities/domain_invitation.ts +36 -36
- package/src/entities/domain_tag.test.ts +7 -7
- package/src/entities/domain_tag.ts +42 -42
- package/src/entities/draft.test.ts +29 -29
- package/src/entities/draft.ts +79 -76
- package/src/entities/draft_comment.test.ts +7 -7
- package/src/entities/draft_comment.ts +63 -60
- package/src/entities/draft_preview.test.ts +42 -42
- package/src/entities/draft_preview.ts +37 -37
- package/src/entities/draft_preview_layer.test.ts +7 -7
- package/src/entities/draft_preview_layer.ts +21 -21
- package/src/entities/draft_template.test.ts +14 -14
- package/src/entities/draft_template.ts +81 -81
- package/src/entities/email_address.test.ts +7 -7
- package/src/entities/email_address.ts +24 -24
- package/src/entities/email_counter.test.ts +7 -7
- package/src/entities/email_counter.ts +20 -20
- package/src/entities/enrolled_domain.test.ts +7 -7
- package/src/entities/enrolled_domain.ts +40 -40
- package/src/entities/exchange_rate.test.ts +7 -7
- package/src/entities/exchange_rate.ts +22 -22
- package/src/entities/file.test.ts +43 -43
- package/src/entities/file.ts +165 -165
- package/src/entities/internal_tag.test.ts +7 -7
- package/src/entities/internal_tag.ts +51 -51
- package/src/entities/inventory.test.ts +28 -28
- package/src/entities/inventory.ts +63 -63
- package/src/entities/inventory_group.test.ts +7 -7
- package/src/entities/inventory_group.ts +36 -36
- package/src/entities/inventory_unit_variation.test.ts +7 -7
- package/src/entities/inventory_unit_variation.ts +29 -29
- package/src/entities/invoice.test.ts +43 -43
- package/src/entities/invoice.ts +189 -186
- package/src/entities/item.test.ts +19 -19
- package/src/entities/item.ts +59 -59
- package/src/entities/job.test.ts +95 -95
- package/src/entities/job.ts +398 -395
- package/src/entities/job_comment.test.ts +7 -7
- package/src/entities/job_comment.ts +53 -50
- package/src/entities/job_note.ts +40 -40
- package/src/entities/job_operation_log.test.ts +7 -7
- package/src/entities/job_operation_log.ts +41 -41
- package/src/entities/matching_inventory.ts +29 -29
- package/src/entities/notification.test.ts +58 -58
- package/src/entities/notification.ts +106 -106
- package/src/entities/payment.test.ts +19 -19
- package/src/entities/payment.ts +65 -65
- package/src/entities/payment_device.test.ts +7 -7
- package/src/entities/payment_device.ts +30 -30
- package/src/entities/phone_number.test.ts +7 -7
- package/src/entities/phone_number.ts +36 -36
- package/src/entities/product.test.ts +772 -772
- package/src/entities/product.ts +480 -480
- package/src/entities/product_form.ts +51 -51
- package/src/entities/product_form_version.ts +51 -51
- package/src/entities/product_review.ts +221 -221
- package/src/entities/production_comment.test.ts +7 -7
- package/src/entities/production_comment.ts +53 -50
- package/src/entities/quote.test.ts +98 -98
- package/src/entities/quote.ts +140 -140
- package/src/entities/quote_item.test.ts +50 -50
- package/src/entities/quote_item.ts +71 -71
- package/src/entities/reminder.test.ts +16 -16
- package/src/entities/reminder.ts +74 -74
- package/src/entities/session.test.ts +7 -7
- package/src/entities/session.ts +28 -28
- package/src/entities/shipment.test.ts +24 -24
- package/src/entities/shipment.ts +196 -193
- package/src/entities/shipment_item.test.ts +7 -7
- package/src/entities/shipment_item.ts +15 -15
- package/src/entities/shipment_item_fulfillment.test.ts +8 -8
- package/src/entities/shipment_item_fulfillment.ts +15 -15
- package/src/entities/shipment_log.ts +37 -37
- package/src/entities/shipment_method.test.ts +7 -7
- package/src/entities/shipment_method.ts +61 -61
- package/src/entities/shipment_method_variation.test.ts +7 -7
- package/src/entities/shipment_method_variation.ts +39 -39
- package/src/entities/short_url.test.ts +7 -7
- package/src/entities/short_url.ts +36 -36
- package/src/entities/subscription_plan.test.ts +7 -7
- package/src/entities/subscription_plan.ts +73 -73
- package/src/entities/supply_domain.test.ts +7 -7
- package/src/entities/supply_domain.ts +27 -27
- package/src/entities/support_conversation.test.ts +7 -7
- package/src/entities/support_conversation.ts +65 -65
- package/src/entities/support_message.test.ts +7 -7
- package/src/entities/support_message.ts +30 -30
- package/src/entities/system_role.test.ts +7 -7
- package/src/entities/system_role.ts +17 -17
- package/src/entities/theme.test.ts +38 -38
- package/src/entities/theme.ts +82 -82
- package/src/entities/theme_css_setting.test.ts +7 -7
- package/src/entities/theme_css_setting.ts +23 -23
- package/src/entities/user.test.ts +154 -154
- package/src/entities/user.ts +428 -428
- package/src/entities/user_company.test.ts +7 -7
- package/src/entities/user_company.ts +27 -27
- package/src/entities/variation.test.ts +7 -7
- package/src/entities/variation.ts +64 -64
- package/src/entities/variation_field.test.ts +76 -76
- package/src/entities/variation_field.ts +268 -268
- package/src/entities/variation_fields_option.test.ts +46 -46
- package/src/entities/variation_fields_option.ts +107 -107
- package/src/entities/variation_option.test.ts +7 -7
- package/src/entities/variation_option.ts +58 -58
- package/src/entities/variations_group.test.ts +7 -7
- package/src/entities/variations_group.ts +41 -41
- package/src/entity.ts +1094 -1094
- package/src/index.ts +189 -189
- package/src/merchi.test.ts +25 -25
- package/src/merchi.ts +445 -445
- package/src/pricing/__fixtures__/conditional_field_hidden.json +111 -111
- package/src/pricing/__fixtures__/conditional_field_visible.json +112 -112
- package/src/pricing/__fixtures__/group_product.json +129 -129
- package/src/pricing/__fixtures__/non_selectable_number_field.json +107 -107
- package/src/pricing/__fixtures__/quantity_break_discount.json +103 -103
- package/src/pricing/__fixtures__/simple_selectable_field.json +109 -109
- package/src/pricing/discount.test.ts +47 -47
- package/src/pricing/discount.ts +17 -17
- package/src/pricing/estimate.test.ts +486 -486
- package/src/pricing/estimate.ts +310 -310
- package/src/pricing/golden.test.ts +51 -51
- package/src/pricing/index.test.ts +9 -9
- package/src/pricing/index.ts +7 -7
- package/src/pricing/inventory.test.ts +197 -197
- package/src/pricing/inventory.ts +89 -89
- package/src/pricing/matrix.test.ts +553 -553
- package/src/pricing/matrix.ts +217 -217
- package/src/pricing/round.test.ts +31 -31
- package/src/pricing/round.ts +27 -27
- package/src/pricing/types.ts +140 -140
- package/src/pricing/visibility.test.ts +223 -223
- package/src/pricing/visibility.ts +111 -111
- package/src/request.test.ts +79 -79
- package/src/request.ts +196 -196
- package/src/test_util.ts +18 -18
- package/src/toasts.test.ts +38 -38
- package/src/toasts.ts +34 -34
- package/src/util/float.ts +12 -12
- package/src/util/index.ts +7 -7
- package/src/util/query_string.test.ts +7 -7
- package/src/util/query_string.ts +13 -13
- package/src/util/validation.test.ts +16 -16
- package/src/util/validation.ts +2 -2
- package/src/uuid.test.ts +15 -15
- package/src/uuid.ts +8 -8
- package/tsconfig.json +29 -29
- package/coverage/lcov-report/discount.ts.html +0 -136
- package/coverage/lcov-report/estimate.ts.html +0 -1015
- package/coverage/lcov-report/index.ts.html +0 -106
- package/coverage/lcov-report/inventory.ts.html +0 -352
- package/coverage/lcov-report/matrix.ts.html +0 -736
- package/coverage/lcov-report/round.ts.html +0 -166
- package/coverage/lcov-report/src/constants/theme_foundations.ts.html +0 -103
- package/coverage/lcov-report/src/entities/component.ts.html +0 -361
- package/coverage/lcov-report/src/entities/component_tag.ts.html +0 -136
- package/coverage/lcov-report/src/entities/component_version.ts.html +0 -175
- package/coverage/lcov-report/src/entities/menu.ts.html +0 -175
- package/coverage/lcov-report/src/entities/menu_item.ts.html +0 -172
- package/coverage/lcov-report/src/entities/page.ts.html +0 -181
- package/coverage/lcov-report/src/entities/seo_domain_page.ts.html +0 -184
- package/coverage/lcov-report/src/pricing/matrix.ts.html +0 -736
- package/coverage/lcov-report/visibility.ts.html +0 -418
- package/dist/constants/theme_foundations.js +0 -7
- package/dist/constants/theme_foundations.test.js +0 -4
- package/dist/entities/backup.js +0 -45
- package/dist/entities/backup.test.js +0 -6
- package/dist/entities/company_invoice_settings.js +0 -80
- package/dist/entities/company_invoice_settings_version.js +0 -64
- package/dist/entities/component.js +0 -141
- package/dist/entities/component.test.js +0 -12
- package/dist/entities/component_tag.js +0 -49
- package/dist/entities/component_tag.test.js +0 -6
- package/dist/entities/component_version.js +0 -65
- package/dist/entities/component_version.test.js +0 -6
- package/dist/entities/invoice_template.js +0 -60
- package/dist/entities/invoice_template_version.js +0 -52
- package/dist/entities/menu.js +0 -65
- package/dist/entities/menu.test.js +0 -6
- package/dist/entities/menu_item.js +0 -65
- package/dist/entities/menu_item.test.js +0 -6
- package/dist/entities/page.js +0 -69
- package/dist/entities/page.test.js +0 -6
- package/dist/entities/seo_domain_page.js +0 -70
- package/dist/entities/seo_domain_page.test.js +0 -6
- package/yarn-error.log +0 -4718
package/.eslintrc.cjs
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
'parser': '@typescript-eslint/parser',
|
|
3
|
-
'plugins': ['@typescript-eslint'],
|
|
4
|
-
'env': {
|
|
5
|
-
'browser': true,
|
|
6
|
-
'es6': true,
|
|
7
|
-
'jest': true
|
|
8
|
-
},
|
|
9
|
-
'extends': ['eslint:recommended',
|
|
10
|
-
'plugin:@typescript-eslint/eslint-recommended',
|
|
11
|
-
'plugin:@typescript-eslint/recommended'],
|
|
12
|
-
'globals': {
|
|
13
|
-
'Atomics': 'readonly',
|
|
14
|
-
'SharedArrayBuffer': 'readonly',
|
|
15
|
-
'global': 'writable'
|
|
16
|
-
},
|
|
17
|
-
'parserOptions': {
|
|
18
|
-
'ecmaVersion': 2018,
|
|
19
|
-
'sourceType': 'module'
|
|
20
|
-
},
|
|
21
|
-
'rules': {
|
|
22
|
-
'indent': 'off',
|
|
23
|
-
'@typescript-eslint/indent': ['error', 2],
|
|
24
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
25
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
26
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
27
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
28
|
-
'@typescript-eslint/no-this-alias': 'off',
|
|
29
|
-
'@typescript-eslint/ban-types': 'off',
|
|
30
|
-
'linebreak-style': [
|
|
31
|
-
'error',
|
|
32
|
-
'unix'
|
|
33
|
-
],
|
|
34
|
-
'quotes': [
|
|
35
|
-
'error',
|
|
36
|
-
'single'
|
|
37
|
-
],
|
|
38
|
-
'semi': [
|
|
39
|
-
'error',
|
|
40
|
-
'always'
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
'parser': '@typescript-eslint/parser',
|
|
3
|
+
'plugins': ['@typescript-eslint'],
|
|
4
|
+
'env': {
|
|
5
|
+
'browser': true,
|
|
6
|
+
'es6': true,
|
|
7
|
+
'jest': true
|
|
8
|
+
},
|
|
9
|
+
'extends': ['eslint:recommended',
|
|
10
|
+
'plugin:@typescript-eslint/eslint-recommended',
|
|
11
|
+
'plugin:@typescript-eslint/recommended'],
|
|
12
|
+
'globals': {
|
|
13
|
+
'Atomics': 'readonly',
|
|
14
|
+
'SharedArrayBuffer': 'readonly',
|
|
15
|
+
'global': 'writable'
|
|
16
|
+
},
|
|
17
|
+
'parserOptions': {
|
|
18
|
+
'ecmaVersion': 2018,
|
|
19
|
+
'sourceType': 'module'
|
|
20
|
+
},
|
|
21
|
+
'rules': {
|
|
22
|
+
'indent': 'off',
|
|
23
|
+
'@typescript-eslint/indent': ['error', 2],
|
|
24
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
25
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
26
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
27
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
28
|
+
'@typescript-eslint/no-this-alias': 'off',
|
|
29
|
+
'@typescript-eslint/ban-types': 'off',
|
|
30
|
+
'linebreak-style': [
|
|
31
|
+
'error',
|
|
32
|
+
'unix'
|
|
33
|
+
],
|
|
34
|
+
'quotes': [
|
|
35
|
+
'error',
|
|
36
|
+
'single'
|
|
37
|
+
],
|
|
38
|
+
'semi': [
|
|
39
|
+
'error',
|
|
40
|
+
'always'
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
};
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Merchi
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Merchi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,244 +1,244 @@
|
|
|
1
|
-
# Merchi TypeScript SDK
|
|
2
|
-
|
|
3
|
-
A TypeScript SDK for interacting with the Merchi API.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/merchi_sdk_ts)
|
|
6
|
-
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
7
|
-
|
|
8
|
-
## Table of Contents
|
|
9
|
-
|
|
10
|
-
- [Installation](#installation)
|
|
11
|
-
- [Quick Start](#quick-start)
|
|
12
|
-
- [Configuration](#configuration)
|
|
13
|
-
- [Authentication](#authentication)
|
|
14
|
-
- [Basic Usage](#basic-usage)
|
|
15
|
-
- [Entity Operations](#entity-operations)
|
|
16
|
-
- [Embedding Related Entities](#embedding-related-entities)
|
|
17
|
-
- [Available Entities](#available-entities)
|
|
18
|
-
- [Examples](#examples)
|
|
19
|
-
- [TypeScript Support](#typescript-support)
|
|
20
|
-
- [License](#license)
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Using npm
|
|
26
|
-
npm install merchi_sdk_ts
|
|
27
|
-
|
|
28
|
-
# Using yarn
|
|
29
|
-
yarn add merchi_sdk_ts
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Quick Start
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import { Merchi, Product } from 'merchi_sdk_ts';
|
|
36
|
-
|
|
37
|
-
// Initialize the SDK
|
|
38
|
-
const merchi = new Merchi();
|
|
39
|
-
|
|
40
|
-
// Fetch a product by ID
|
|
41
|
-
Product.get(123).then(product => {
|
|
42
|
-
console.log(product.name);
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Configuration
|
|
47
|
-
|
|
48
|
-
The SDK by default is set up to make requests to the Merchi production server at `https://api.merchi.co/v6/`.
|
|
49
|
-
|
|
50
|
-
You can customize the API endpoint by:
|
|
51
|
-
|
|
52
|
-
1. Setting `process.env.MERCHI_BACKEND_URI` in your Node.js environment.
|
|
53
|
-
2. Setting `window.merchiBackendUri` in the browser.
|
|
54
|
-
3. Passing the `backendUri` directly to the `Merchi` constructor (highest precedence).
|
|
55
|
-
|
|
56
|
-
The SDK will look for these in the order of 3, 2, 1, and finally use the default production URL if none are found.
|
|
57
|
-
The API version (e.g., `/v6/`) will be appended automatically if not included in your custom URI, assuming the URI ends with the base domain (e.g. `https://custom.merchi.co`). If your custom URI already includes a path (e.g., `https://custom.merchi.co/api/`), ensure it ends with a trailing slash for the version to be appended correctly (e.g., `https://custom.merchi.co/api/v6/`).
|
|
58
|
-
|
|
59
|
-
**Example: Passing `backendUri` to the constructor**
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
import { Merchi } from 'merchi_sdk_ts';
|
|
63
|
-
|
|
64
|
-
// Initialize the SDK with a custom backend URI
|
|
65
|
-
// This URI should be the base path to your Merchi backend instance.
|
|
66
|
-
// The API version (e.g., /v6/) will be appended.
|
|
67
|
-
const customBackend = 'https://my-custom-merchi-instance.com/';
|
|
68
|
-
const merchi = new Merchi(undefined, undefined, undefined, undefined, customBackend);
|
|
69
|
-
|
|
70
|
-
// If your custom URI already includes a specific path and you want to control the full endpoint:
|
|
71
|
-
const specificCustomBackend = 'https://my-custom-merchi-instance.com/api/custom_version/';
|
|
72
|
-
const merchiSpecific = new Merchi(undefined, undefined, undefined, undefined, specificCustomBackend);
|
|
73
|
-
|
|
74
|
-
// Now, all API calls made using this 'merchi' or 'merchiSpecific' instance
|
|
75
|
-
// will be directed to your specified backend.
|
|
76
|
-
// For example:
|
|
77
|
-
// merchi.Product.get(1) will call https://my-custom-merchi-instance.com/v6/products/1/
|
|
78
|
-
// merchiSpecific.Product.get(1) will call https://my-custom-merchi-instance.com/api/custom_version/products/1/
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Authentication
|
|
82
|
-
|
|
83
|
-
The SDK supports several authentication methods:
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
// Session token authentication (most common)
|
|
87
|
-
const merchi = new Merchi('your-session-token');
|
|
88
|
-
|
|
89
|
-
// Alternative methods
|
|
90
|
-
const merchi = new Merchi(
|
|
91
|
-
'your-session-token', // Session token
|
|
92
|
-
'your-client-token', // Client token
|
|
93
|
-
'your-invoice-token', // Invoice token
|
|
94
|
-
'your-cart-token' // Cart token
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
// The SDK will also attempt to read session_token from cookies
|
|
98
|
-
// if no token is provided
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Basic Usage
|
|
102
|
-
|
|
103
|
-
### Entity Operations
|
|
104
|
-
|
|
105
|
-
Each entity supports standard CRUD operations:
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
// Fetch a single entity
|
|
109
|
-
Product.get(123).then(product => {
|
|
110
|
-
console.log(product);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
// List entities with filtering
|
|
114
|
-
Product.list({
|
|
115
|
-
limit: 10,
|
|
116
|
-
offset: 0,
|
|
117
|
-
q: 'search-term'
|
|
118
|
-
}).then(response => {
|
|
119
|
-
console.log(response.items); // Array of products
|
|
120
|
-
console.log(response.metadata); // Metadata including count, limit, offset
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// Create a new entity
|
|
124
|
-
const product = new Product();
|
|
125
|
-
product.name = 'New Product';
|
|
126
|
-
product.description = 'Product description';
|
|
127
|
-
product.create().then(newProduct => {
|
|
128
|
-
console.log(newProduct.id);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
// Update an entity
|
|
132
|
-
product.name = 'Updated Product Name';
|
|
133
|
-
product.save().then(updatedProduct => {
|
|
134
|
-
console.log(updatedProduct);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
// Delete an entity
|
|
138
|
-
product.delete().then(() => {
|
|
139
|
-
console.log('Product deleted');
|
|
140
|
-
});
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Embedding Related Entities
|
|
144
|
-
|
|
145
|
-
You can request related entities be included in responses:
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
Product.get(123, {
|
|
149
|
-
embed: {
|
|
150
|
-
domain: {},
|
|
151
|
-
variations: {
|
|
152
|
-
variationFields: {}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}).then(product => {
|
|
156
|
-
console.log(product.domain); // Domain entity is included
|
|
157
|
-
console.log(product.variations); // Variations are included
|
|
158
|
-
console.log(product.variations[0].variationFields); // Fields are included
|
|
159
|
-
});
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Available Entities
|
|
163
|
-
|
|
164
|
-
The SDK provides access to all Merchi entities, including but not limited to:
|
|
165
|
-
|
|
166
|
-
- User, Company, Domain
|
|
167
|
-
- Product, Category, Variation
|
|
168
|
-
- Cart, CartItem
|
|
169
|
-
- Job, Assignment, Invoice
|
|
170
|
-
- File, Draft, DraftTemplate
|
|
171
|
-
- Payment, Shipment
|
|
172
|
-
- And many more...
|
|
173
|
-
|
|
174
|
-
Each entity maps directly to the corresponding API endpoint and data structure.
|
|
175
|
-
|
|
176
|
-
## Examples
|
|
177
|
-
|
|
178
|
-
### Working with Products
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
import { Merchi, Product } from 'merchi_sdk_ts';
|
|
182
|
-
|
|
183
|
-
// Initialize Merchi
|
|
184
|
-
const merchi = new Merchi('your-session-token');
|
|
185
|
-
|
|
186
|
-
// Create a new product
|
|
187
|
-
const product = new Product();
|
|
188
|
-
product.name = 'Custom T-Shirt';
|
|
189
|
-
product.description = 'High-quality custom printed t-shirt';
|
|
190
|
-
product.public = true;
|
|
191
|
-
|
|
192
|
-
product.create().then(newProduct => {
|
|
193
|
-
console.log(`Created product with ID: ${newProduct.id}`);
|
|
194
|
-
});
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Managing a Cart
|
|
198
|
-
|
|
199
|
-
```typescript
|
|
200
|
-
import { Merchi, Cart, CartItem } from 'merchi_sdk_ts';
|
|
201
|
-
|
|
202
|
-
// Initialize Merchi
|
|
203
|
-
const merchi = new Merchi('your-session-token');
|
|
204
|
-
|
|
205
|
-
// Create a new cart
|
|
206
|
-
const cart = new Cart();
|
|
207
|
-
cart.create().then(newCart => {
|
|
208
|
-
// Add an item to the cart
|
|
209
|
-
const cartItem = new CartItem();
|
|
210
|
-
cartItem.productId = 123;
|
|
211
|
-
cartItem.quantity = 2;
|
|
212
|
-
cartItem.cartId = newCart.id;
|
|
213
|
-
|
|
214
|
-
return cartItem.create();
|
|
215
|
-
}).then(newCartItem => {
|
|
216
|
-
console.log('Item added to cart!');
|
|
217
|
-
});
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## TypeScript Support
|
|
221
|
-
|
|
222
|
-
This SDK is built with TypeScript and provides full type definitions for all entities and operations.
|
|
223
|
-
|
|
224
|
-
```typescript
|
|
225
|
-
import { Product, EmbedDescriptor } from 'merchi_sdk_ts';
|
|
226
|
-
|
|
227
|
-
// TypeScript will provide intellisense for all properties
|
|
228
|
-
const product = new Product();
|
|
229
|
-
product.name = 'New Product';
|
|
230
|
-
|
|
231
|
-
// Type checking for embed options
|
|
232
|
-
const embedOptions: EmbedDescriptor = {
|
|
233
|
-
domain: {},
|
|
234
|
-
variations: {
|
|
235
|
-
variationFields: {}
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
Product.get(123, { embed: embedOptions });
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
## License
|
|
243
|
-
|
|
244
|
-
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
|
|
1
|
+
# Merchi TypeScript SDK
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK for interacting with the Merchi API.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/merchi_sdk_ts)
|
|
6
|
+
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Quick Start](#quick-start)
|
|
12
|
+
- [Configuration](#configuration)
|
|
13
|
+
- [Authentication](#authentication)
|
|
14
|
+
- [Basic Usage](#basic-usage)
|
|
15
|
+
- [Entity Operations](#entity-operations)
|
|
16
|
+
- [Embedding Related Entities](#embedding-related-entities)
|
|
17
|
+
- [Available Entities](#available-entities)
|
|
18
|
+
- [Examples](#examples)
|
|
19
|
+
- [TypeScript Support](#typescript-support)
|
|
20
|
+
- [License](#license)
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Using npm
|
|
26
|
+
npm install merchi_sdk_ts
|
|
27
|
+
|
|
28
|
+
# Using yarn
|
|
29
|
+
yarn add merchi_sdk_ts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { Merchi, Product } from 'merchi_sdk_ts';
|
|
36
|
+
|
|
37
|
+
// Initialize the SDK
|
|
38
|
+
const merchi = new Merchi();
|
|
39
|
+
|
|
40
|
+
// Fetch a product by ID
|
|
41
|
+
Product.get(123).then(product => {
|
|
42
|
+
console.log(product.name);
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
The SDK by default is set up to make requests to the Merchi production server at `https://api.merchi.co/v6/`.
|
|
49
|
+
|
|
50
|
+
You can customize the API endpoint by:
|
|
51
|
+
|
|
52
|
+
1. Setting `process.env.MERCHI_BACKEND_URI` in your Node.js environment.
|
|
53
|
+
2. Setting `window.merchiBackendUri` in the browser.
|
|
54
|
+
3. Passing the `backendUri` directly to the `Merchi` constructor (highest precedence).
|
|
55
|
+
|
|
56
|
+
The SDK will look for these in the order of 3, 2, 1, and finally use the default production URL if none are found.
|
|
57
|
+
The API version (e.g., `/v6/`) will be appended automatically if not included in your custom URI, assuming the URI ends with the base domain (e.g. `https://custom.merchi.co`). If your custom URI already includes a path (e.g., `https://custom.merchi.co/api/`), ensure it ends with a trailing slash for the version to be appended correctly (e.g., `https://custom.merchi.co/api/v6/`).
|
|
58
|
+
|
|
59
|
+
**Example: Passing `backendUri` to the constructor**
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { Merchi } from 'merchi_sdk_ts';
|
|
63
|
+
|
|
64
|
+
// Initialize the SDK with a custom backend URI
|
|
65
|
+
// This URI should be the base path to your Merchi backend instance.
|
|
66
|
+
// The API version (e.g., /v6/) will be appended.
|
|
67
|
+
const customBackend = 'https://my-custom-merchi-instance.com/';
|
|
68
|
+
const merchi = new Merchi(undefined, undefined, undefined, undefined, customBackend);
|
|
69
|
+
|
|
70
|
+
// If your custom URI already includes a specific path and you want to control the full endpoint:
|
|
71
|
+
const specificCustomBackend = 'https://my-custom-merchi-instance.com/api/custom_version/';
|
|
72
|
+
const merchiSpecific = new Merchi(undefined, undefined, undefined, undefined, specificCustomBackend);
|
|
73
|
+
|
|
74
|
+
// Now, all API calls made using this 'merchi' or 'merchiSpecific' instance
|
|
75
|
+
// will be directed to your specified backend.
|
|
76
|
+
// For example:
|
|
77
|
+
// merchi.Product.get(1) will call https://my-custom-merchi-instance.com/v6/products/1/
|
|
78
|
+
// merchiSpecific.Product.get(1) will call https://my-custom-merchi-instance.com/api/custom_version/products/1/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Authentication
|
|
82
|
+
|
|
83
|
+
The SDK supports several authentication methods:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
// Session token authentication (most common)
|
|
87
|
+
const merchi = new Merchi('your-session-token');
|
|
88
|
+
|
|
89
|
+
// Alternative methods
|
|
90
|
+
const merchi = new Merchi(
|
|
91
|
+
'your-session-token', // Session token
|
|
92
|
+
'your-client-token', // Client token
|
|
93
|
+
'your-invoice-token', // Invoice token
|
|
94
|
+
'your-cart-token' // Cart token
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// The SDK will also attempt to read session_token from cookies
|
|
98
|
+
// if no token is provided
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Basic Usage
|
|
102
|
+
|
|
103
|
+
### Entity Operations
|
|
104
|
+
|
|
105
|
+
Each entity supports standard CRUD operations:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// Fetch a single entity
|
|
109
|
+
Product.get(123).then(product => {
|
|
110
|
+
console.log(product);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// List entities with filtering
|
|
114
|
+
Product.list({
|
|
115
|
+
limit: 10,
|
|
116
|
+
offset: 0,
|
|
117
|
+
q: 'search-term'
|
|
118
|
+
}).then(response => {
|
|
119
|
+
console.log(response.items); // Array of products
|
|
120
|
+
console.log(response.metadata); // Metadata including count, limit, offset
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Create a new entity
|
|
124
|
+
const product = new Product();
|
|
125
|
+
product.name = 'New Product';
|
|
126
|
+
product.description = 'Product description';
|
|
127
|
+
product.create().then(newProduct => {
|
|
128
|
+
console.log(newProduct.id);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Update an entity
|
|
132
|
+
product.name = 'Updated Product Name';
|
|
133
|
+
product.save().then(updatedProduct => {
|
|
134
|
+
console.log(updatedProduct);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Delete an entity
|
|
138
|
+
product.delete().then(() => {
|
|
139
|
+
console.log('Product deleted');
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Embedding Related Entities
|
|
144
|
+
|
|
145
|
+
You can request related entities be included in responses:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
Product.get(123, {
|
|
149
|
+
embed: {
|
|
150
|
+
domain: {},
|
|
151
|
+
variations: {
|
|
152
|
+
variationFields: {}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}).then(product => {
|
|
156
|
+
console.log(product.domain); // Domain entity is included
|
|
157
|
+
console.log(product.variations); // Variations are included
|
|
158
|
+
console.log(product.variations[0].variationFields); // Fields are included
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Available Entities
|
|
163
|
+
|
|
164
|
+
The SDK provides access to all Merchi entities, including but not limited to:
|
|
165
|
+
|
|
166
|
+
- User, Company, Domain
|
|
167
|
+
- Product, Category, Variation
|
|
168
|
+
- Cart, CartItem
|
|
169
|
+
- Job, Assignment, Invoice
|
|
170
|
+
- File, Draft, DraftTemplate
|
|
171
|
+
- Payment, Shipment
|
|
172
|
+
- And many more...
|
|
173
|
+
|
|
174
|
+
Each entity maps directly to the corresponding API endpoint and data structure.
|
|
175
|
+
|
|
176
|
+
## Examples
|
|
177
|
+
|
|
178
|
+
### Working with Products
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { Merchi, Product } from 'merchi_sdk_ts';
|
|
182
|
+
|
|
183
|
+
// Initialize Merchi
|
|
184
|
+
const merchi = new Merchi('your-session-token');
|
|
185
|
+
|
|
186
|
+
// Create a new product
|
|
187
|
+
const product = new Product();
|
|
188
|
+
product.name = 'Custom T-Shirt';
|
|
189
|
+
product.description = 'High-quality custom printed t-shirt';
|
|
190
|
+
product.public = true;
|
|
191
|
+
|
|
192
|
+
product.create().then(newProduct => {
|
|
193
|
+
console.log(`Created product with ID: ${newProduct.id}`);
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Managing a Cart
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
import { Merchi, Cart, CartItem } from 'merchi_sdk_ts';
|
|
201
|
+
|
|
202
|
+
// Initialize Merchi
|
|
203
|
+
const merchi = new Merchi('your-session-token');
|
|
204
|
+
|
|
205
|
+
// Create a new cart
|
|
206
|
+
const cart = new Cart();
|
|
207
|
+
cart.create().then(newCart => {
|
|
208
|
+
// Add an item to the cart
|
|
209
|
+
const cartItem = new CartItem();
|
|
210
|
+
cartItem.productId = 123;
|
|
211
|
+
cartItem.quantity = 2;
|
|
212
|
+
cartItem.cartId = newCart.id;
|
|
213
|
+
|
|
214
|
+
return cartItem.create();
|
|
215
|
+
}).then(newCartItem => {
|
|
216
|
+
console.log('Item added to cart!');
|
|
217
|
+
});
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## TypeScript Support
|
|
221
|
+
|
|
222
|
+
This SDK is built with TypeScript and provides full type definitions for all entities and operations.
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
import { Product, EmbedDescriptor } from 'merchi_sdk_ts';
|
|
226
|
+
|
|
227
|
+
// TypeScript will provide intellisense for all properties
|
|
228
|
+
const product = new Product();
|
|
229
|
+
product.name = 'New Product';
|
|
230
|
+
|
|
231
|
+
// Type checking for embed options
|
|
232
|
+
const embedOptions: EmbedDescriptor = {
|
|
233
|
+
domain: {},
|
|
234
|
+
variations: {
|
|
235
|
+
variationFields: {}
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
Product.get(123, { embed: embedOptions });
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
|