merchi_sdk_ts 1.40.1 → 1.41.0
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/dist/entities/domain.js +4 -0
- package/dist/entities/domain.test.js +10 -0
- package/package.json +1 -1
- package/src/entities/domain.test.ts +14 -0
- package/src/entities/domain.ts +3 -0
- package/coverage/clover.xml +0 -5062
- package/coverage/coverage-final.json +0 -133
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/discount.ts.html +0 -136
- package/coverage/lcov-report/estimate.ts.html +0 -1015
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -191
- 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/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/round.ts.html +0 -166
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +0 -103
- package/coverage/lcov-report/src/constants/call_to_actions.ts.html +0 -127
- package/coverage/lcov-report/src/constants/discount_types.ts.html +0 -100
- package/coverage/lcov-report/src/constants/domain_types.ts.html +0 -121
- package/coverage/lcov-report/src/constants/errors.ts.html +0 -181
- package/coverage/lcov-report/src/constants/event_types.ts.html +0 -100
- package/coverage/lcov-report/src/constants/field_types.ts.html +0 -133
- package/coverage/lcov-report/src/constants/index.html +0 -551
- package/coverage/lcov-report/src/constants/index.ts.html +0 -238
- package/coverage/lcov-report/src/constants/input_types.ts.html +0 -124
- package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +0 -103
- package/coverage/lcov-report/src/constants/invoice_types.ts.html +0 -100
- package/coverage/lcov-report/src/constants/item_types.ts.html +0 -100
- package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +0 -106
- package/coverage/lcov-report/src/constants/job/index.html +0 -176
- package/coverage/lcov-report/src/constants/job/payment_status.ts.html +0 -106
- package/coverage/lcov-report/src/constants/job/production_status.ts.html +0 -121
- package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +0 -118
- package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +0 -103
- package/coverage/lcov-report/src/constants/job_priorities.ts.html +0 -103
- package/coverage/lcov-report/src/constants/job_status.ts.html +0 -232
- package/coverage/lcov-report/src/constants/job_types.ts.html +0 -133
- package/coverage/lcov-report/src/constants/notification_sections.ts.html +0 -124
- package/coverage/lcov-report/src/constants/notification_types.ts.html +0 -385
- package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +0 -106
- package/coverage/lcov-report/src/constants/payment_types.ts.html +0 -115
- package/coverage/lcov-report/src/constants/platform.ts.html +0 -103
- package/coverage/lcov-report/src/constants/product_types.ts.html +0 -163
- package/coverage/lcov-report/src/constants/rights.ts.html +0 -100
- package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +0 -118
- package/coverage/lcov-report/src/constants/roles.ts.html +0 -223
- package/coverage/lcov-report/src/constants/shipment_companies.ts.html +0 -142
- package/coverage/lcov-report/src/constants/shipment_services.ts.html +0 -94
- package/coverage/lcov-report/src/constants/system_roles.ts.html +0 -94
- package/coverage/lcov-report/src/constants/theme_foundations.ts.html +0 -103
- package/coverage/lcov-report/src/constants/theme_status.ts.html +0 -100
- package/coverage/lcov-report/src/constants/user_types.ts.html +0 -136
- package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +0 -103
- package/coverage/lcov-report/src/cookie.ts.html +0 -133
- package/coverage/lcov-report/src/entities/address.ts.html +0 -280
- package/coverage/lcov-report/src/entities/agent_conversation.ts.html +0 -202
- package/coverage/lcov-report/src/entities/agent_skill.ts.html +0 -382
- package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +0 -163
- package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +0 -277
- package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +0 -349
- package/coverage/lcov-report/src/entities/assignment.ts.html +0 -382
- package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +0 -172
- package/coverage/lcov-report/src/entities/bank.ts.html +0 -220
- package/coverage/lcov-report/src/entities/cart.ts.html +0 -391
- package/coverage/lcov-report/src/entities/cart_item.ts.html +0 -340
- package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +0 -148
- package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +0 -184
- package/coverage/lcov-report/src/entities/category.ts.html +0 -262
- package/coverage/lcov-report/src/entities/company.ts.html +0 -1276
- package/coverage/lcov-report/src/entities/company_invitation.ts.html +0 -184
- 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/country_tax.ts.html +0 -223
- package/coverage/lcov-report/src/entities/discount.ts.html +0 -235
- package/coverage/lcov-report/src/entities/discount_group.ts.html +0 -214
- package/coverage/lcov-report/src/entities/domain.ts.html +0 -3349
- package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +0 -331
- package/coverage/lcov-report/src/entities/domain_invitation.ts.html +0 -193
- package/coverage/lcov-report/src/entities/domain_tag.ts.html +0 -211
- package/coverage/lcov-report/src/entities/draft.ts.html +0 -322
- package/coverage/lcov-report/src/entities/draft_comment.ts.html +0 -274
- package/coverage/lcov-report/src/entities/draft_preview.ts.html +0 -196
- package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +0 -148
- package/coverage/lcov-report/src/entities/draft_template.ts.html +0 -328
- package/coverage/lcov-report/src/entities/email_address.ts.html +0 -157
- package/coverage/lcov-report/src/entities/email_counter.ts.html +0 -145
- package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +0 -205
- package/coverage/lcov-report/src/entities/exchange_rate.ts.html +0 -151
- package/coverage/lcov-report/src/entities/file.ts.html +0 -580
- package/coverage/lcov-report/src/entities/index.html +0 -1271
- package/coverage/lcov-report/src/entities/internal_tag.ts.html +0 -238
- package/coverage/lcov-report/src/entities/inventory.ts.html +0 -274
- package/coverage/lcov-report/src/entities/inventory_group.ts.html +0 -193
- package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +0 -172
- package/coverage/lcov-report/src/entities/invoice.ts.html +0 -661
- package/coverage/lcov-report/src/entities/item.ts.html +0 -262
- package/coverage/lcov-report/src/entities/job.ts.html +0 -1288
- package/coverage/lcov-report/src/entities/job_comment.ts.html +0 -244
- package/coverage/lcov-report/src/entities/job_note.ts.html +0 -205
- package/coverage/lcov-report/src/entities/job_operation_log.ts.html +0 -208
- package/coverage/lcov-report/src/entities/matching_inventory.ts.html +0 -172
- 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/notification.ts.html +0 -403
- package/coverage/lcov-report/src/entities/page.ts.html +0 -181
- package/coverage/lcov-report/src/entities/payment.ts.html +0 -316
- package/coverage/lcov-report/src/entities/payment_device.ts.html +0 -175
- package/coverage/lcov-report/src/entities/phone_number.ts.html +0 -193
- package/coverage/lcov-report/src/entities/product.ts.html +0 -1543
- package/coverage/lcov-report/src/entities/product_form.ts.html +0 -238
- package/coverage/lcov-report/src/entities/product_form_version.ts.html +0 -238
- package/coverage/lcov-report/src/entities/product_review.ts.html +0 -748
- package/coverage/lcov-report/src/entities/production_comment.ts.html +0 -244
- package/coverage/lcov-report/src/entities/quote.ts.html +0 -505
- package/coverage/lcov-report/src/entities/quote_item.ts.html +0 -298
- package/coverage/lcov-report/src/entities/reminder.ts.html +0 -307
- package/coverage/lcov-report/src/entities/seo_domain_page.ts.html +0 -184
- package/coverage/lcov-report/src/entities/session.ts.html +0 -169
- package/coverage/lcov-report/src/entities/shipment.ts.html +0 -673
- package/coverage/lcov-report/src/entities/shipment_item.ts.html +0 -130
- package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +0 -130
- package/coverage/lcov-report/src/entities/shipment_log.ts.html +0 -196
- package/coverage/lcov-report/src/entities/shipment_method.ts.html +0 -268
- package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +0 -202
- package/coverage/lcov-report/src/entities/short_url.ts.html +0 -193
- package/coverage/lcov-report/src/entities/subscription_plan.ts.html +0 -304
- package/coverage/lcov-report/src/entities/supply_domain.ts.html +0 -166
- package/coverage/lcov-report/src/entities/support_conversation.ts.html +0 -280
- package/coverage/lcov-report/src/entities/support_message.ts.html +0 -175
- package/coverage/lcov-report/src/entities/system_role.ts.html +0 -136
- package/coverage/lcov-report/src/entities/theme.ts.html +0 -331
- package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +0 -154
- package/coverage/lcov-report/src/entities/user.ts.html +0 -1369
- package/coverage/lcov-report/src/entities/user_company.ts.html +0 -166
- package/coverage/lcov-report/src/entities/variation.ts.html +0 -277
- package/coverage/lcov-report/src/entities/variation_field.ts.html +0 -889
- package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +0 -406
- package/coverage/lcov-report/src/entities/variation_option.ts.html +0 -259
- package/coverage/lcov-report/src/entities/variations_group.ts.html +0 -208
- package/coverage/lcov-report/src/entity.ts.html +0 -3379
- package/coverage/lcov-report/src/index.html +0 -221
- package/coverage/lcov-report/src/index.ts.html +0 -652
- package/coverage/lcov-report/src/merchi.ts.html +0 -1420
- package/coverage/lcov-report/src/pricing/discount.ts.html +0 -136
- package/coverage/lcov-report/src/pricing/estimate.ts.html +0 -1015
- package/coverage/lcov-report/src/pricing/index.html +0 -206
- package/coverage/lcov-report/src/pricing/index.ts.html +0 -106
- package/coverage/lcov-report/src/pricing/inventory.ts.html +0 -352
- package/coverage/lcov-report/src/pricing/matrix.ts.html +0 -736
- package/coverage/lcov-report/src/pricing/round.ts.html +0 -166
- package/coverage/lcov-report/src/pricing/visibility.ts.html +0 -418
- package/coverage/lcov-report/src/request.ts.html +0 -700
- package/coverage/lcov-report/src/test_util.ts.html +0 -139
- package/coverage/lcov-report/src/toasts.ts.html +0 -187
- package/coverage/lcov-report/src/util/float.ts.html +0 -121
- package/coverage/lcov-report/src/util/index.html +0 -161
- package/coverage/lcov-report/src/util/index.ts.html +0 -106
- package/coverage/lcov-report/src/util/query_string.ts.html +0 -124
- package/coverage/lcov-report/src/util/validation.ts.html +0 -91
- package/coverage/lcov-report/src/uuid.ts.html +0 -109
- package/coverage/lcov-report/visibility.ts.html +0 -418
- package/coverage/lcov.info +0 -7771
- 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/dist/entities/domain.js
CHANGED
|
@@ -362,6 +362,10 @@ var Domain = /** @class */ (function (_super) {
|
|
|
362
362
|
Domain.property({ type: String }),
|
|
363
363
|
__metadata("design:type", Object)
|
|
364
364
|
], Domain.prototype, "apiSecret", void 0);
|
|
365
|
+
__decorate([
|
|
366
|
+
Domain.property({ type: jsonPropertyType }),
|
|
367
|
+
__metadata("design:type", Object)
|
|
368
|
+
], Domain.prototype, "apiAllowedOrigins", void 0);
|
|
365
369
|
__decorate([
|
|
366
370
|
Domain.property({ type: String }),
|
|
367
371
|
__metadata("design:type", Object)
|
|
@@ -28,6 +28,16 @@ test('can create domain on server', function () {
|
|
|
28
28
|
var sentToServer = Array.from(fetch.mock.calls[0][1]['body'].entries());
|
|
29
29
|
expect(sentToServer).toEqual(data);
|
|
30
30
|
});
|
|
31
|
+
test('serialises apiAllowedOrigins JSON for form data', function () {
|
|
32
|
+
var merchi = new Merchi();
|
|
33
|
+
var domain = new merchi.Domain();
|
|
34
|
+
domain.id = 7;
|
|
35
|
+
domain.apiAllowedOrigins = ['https://shop.example.com', 'https://preview.example.com'];
|
|
36
|
+
var entries = Array.from(domain.toFormData().entries());
|
|
37
|
+
var data = Object.fromEntries(entries);
|
|
38
|
+
expect(data.apiAllowedOrigins).toBe(JSON.stringify(['https://shop.example.com', 'https://preview.example.com']));
|
|
39
|
+
expect(data.apiAllowedOrigins).not.toBe('[object Object]');
|
|
40
|
+
});
|
|
31
41
|
test('serialises jobAgentPolicy JSON for form data', function () {
|
|
32
42
|
var merchi = new Merchi();
|
|
33
43
|
var domain = new merchi.Domain();
|
package/package.json
CHANGED
|
@@ -34,6 +34,20 @@ test('can create domain on server', () => {
|
|
|
34
34
|
expect(sentToServer).toEqual(data);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
test('serialises apiAllowedOrigins JSON for form data', () => {
|
|
38
|
+
const merchi = new Merchi();
|
|
39
|
+
const domain = new merchi.Domain();
|
|
40
|
+
domain.id = 7;
|
|
41
|
+
domain.apiAllowedOrigins = ['https://shop.example.com', 'https://preview.example.com'];
|
|
42
|
+
const entries = Array.from((domain.toFormData() as any).entries()) as
|
|
43
|
+
Array<[string, string]>;
|
|
44
|
+
const data = Object.fromEntries(entries);
|
|
45
|
+
expect(data.apiAllowedOrigins).toBe(
|
|
46
|
+
JSON.stringify(['https://shop.example.com', 'https://preview.example.com'])
|
|
47
|
+
);
|
|
48
|
+
expect(data.apiAllowedOrigins).not.toBe('[object Object]');
|
|
49
|
+
});
|
|
50
|
+
|
|
37
51
|
test('serialises jobAgentPolicy JSON for form data', () => {
|
|
38
52
|
const merchi = new Merchi();
|
|
39
53
|
const domain = new merchi.Domain();
|
package/src/entities/domain.ts
CHANGED
|
@@ -558,6 +558,9 @@ export class Domain extends Entity {
|
|
|
558
558
|
@Domain.property({type: String})
|
|
559
559
|
public apiSecret?: string | null;
|
|
560
560
|
|
|
561
|
+
@Domain.property({type: jsonPropertyType})
|
|
562
|
+
public apiAllowedOrigins?: string[] | null;
|
|
563
|
+
|
|
561
564
|
@Domain.property({type: String})
|
|
562
565
|
public webflowApiKey?: string | null;
|
|
563
566
|
|