@foxy.io/elements 1.24.1-beta.2 → 1.25.0-beta.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/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +3 -3
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -0
- package/dist/cdn/foxy-native-integration-form.js +1 -0
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +1 -1
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +2 -2
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +3 -3
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +4 -4
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-9aa72495.js → shared-074a74c3.js} +1 -1
- package/dist/cdn/{shared-fd40a40c.js → shared-093b64b4.js} +1 -1
- package/dist/cdn/{shared-5db85492.js → shared-1105e4b9.js} +1 -1
- package/dist/cdn/{shared-31d8e3b8.js → shared-112dbca7.js} +1 -1
- package/dist/cdn/{shared-d1f5de89.js → shared-1313f293.js} +1 -1
- package/dist/cdn/{shared-7a455b15.js → shared-131988fc.js} +1 -1
- package/dist/cdn/{shared-ddac7722.js → shared-18672d26.js} +2 -2
- package/dist/cdn/{shared-0c0ee663.js → shared-1a65fd20.js} +1 -1
- package/dist/cdn/{shared-bee111d6.js → shared-1dbad347.js} +1 -1
- package/dist/cdn/{shared-ff7fd5fa.js → shared-21293163.js} +1 -1
- package/dist/cdn/shared-26dea180.js +1 -0
- package/dist/cdn/{shared-406ce9ad.js → shared-2f082f50.js} +1 -1
- package/dist/cdn/{shared-b446c140.js → shared-417ab233.js} +1 -1
- package/dist/cdn/{shared-f0a9f3c2.js → shared-468de081.js} +1 -1
- package/dist/cdn/{shared-de3dae6c.js → shared-4c3cb511.js} +1 -1
- package/dist/cdn/{shared-9954ee26.js → shared-4d555419.js} +1 -1
- package/dist/cdn/{shared-799dc083.js → shared-4e05dfb4.js} +1 -1
- package/dist/cdn/{shared-2edcd981.js → shared-51a5af7e.js} +1 -1
- package/dist/cdn/{shared-6daeb197.js → shared-53d66db2.js} +3 -3
- package/dist/cdn/{shared-601f27b1.js → shared-5742a841.js} +1 -1
- package/dist/cdn/{shared-773e7177.js → shared-5d718eaf.js} +1 -1
- package/dist/cdn/{shared-7723f756.js → shared-5d795aaf.js} +1 -1
- package/dist/cdn/shared-5e932eb5.js +1 -0
- package/dist/cdn/{shared-3b709ddc.js → shared-662c576b.js} +1 -1
- package/dist/cdn/{shared-099c1f57.js → shared-6e704d83.js} +1 -1
- package/dist/cdn/{shared-ba93be6b.js → shared-702eae16.js} +1 -1
- package/dist/cdn/{shared-fff03a45.js → shared-71b3559f.js} +3 -3
- package/dist/cdn/{shared-9048eeb2.js → shared-732bee4b.js} +1 -1
- package/dist/cdn/{shared-f29acc38.js → shared-76e71481.js} +1 -1
- package/dist/cdn/{shared-1196b6a7.js → shared-783f5705.js} +1 -1
- package/dist/cdn/{shared-f5bbb1e0.js → shared-7b771301.js} +1 -1
- package/dist/cdn/{shared-7abbc95c.js → shared-7d933f9d.js} +1 -1
- package/dist/cdn/{shared-5280c80a.js → shared-870074ff.js} +1 -1
- package/dist/cdn/{shared-27d21f4a.js → shared-8771fb61.js} +1 -1
- package/dist/cdn/{shared-621b3283.js → shared-8c681381.js} +1 -1
- package/dist/cdn/{shared-9b486845.js → shared-92de4f37.js} +1 -1
- package/dist/cdn/{shared-ef7f2d07.js → shared-96215749.js} +1 -1
- package/dist/cdn/{shared-ad80244a.js → shared-9771ef0f.js} +1 -1
- package/dist/cdn/{shared-8f922de8.js → shared-a52c3d8c.js} +1 -1
- package/dist/cdn/{shared-94798eb5.js → shared-b8963ec6.js} +1 -1
- package/dist/cdn/{shared-13fbea95.js → shared-c00049b2.js} +1 -1
- package/dist/cdn/{shared-fa7539af.js → shared-c320cfef.js} +1 -1
- package/dist/cdn/{shared-fcfbfbdb.js → shared-ca428891.js} +1 -1
- package/dist/cdn/{shared-b87d1af0.js → shared-cb9cdc88.js} +1 -1
- package/dist/cdn/{shared-c76ef8d8.js → shared-d01f42d0.js} +7 -7
- package/dist/cdn/{shared-59fc6288.js → shared-d123bea6.js} +1 -1
- package/dist/cdn/{shared-c839e147.js → shared-da5e32c1.js} +1 -1
- package/dist/cdn/{shared-f21e5761.js → shared-e2db3ab5.js} +1 -1
- package/dist/cdn/{shared-eb8a0fdf.js → shared-e3096241.js} +1 -1
- package/dist/cdn/{shared-5103c1b4.js → shared-e312da08.js} +1 -1
- package/dist/cdn/{shared-3f04e4cc.js → shared-e60dc924.js} +1 -1
- package/dist/cdn/{shared-efaf8d49.js → shared-e79b5765.js} +1 -1
- package/dist/cdn/{shared-d90dbae7.js → shared-f1b36324.js} +1 -1
- package/dist/cdn/{shared-e5239bec.js → shared-f3b8de28.js} +1 -1
- package/dist/cdn/{shared-3c2414d4.js → shared-fc99076a.js} +1 -1
- package/dist/cdn/{shared-5784c088.js → shared-fe927c53.js} +1 -1
- package/dist/cdn/{shared-4205699e.js → shared-fed6cd4d.js} +1 -1
- package/dist/cdn/{shared-5a889c45.js → shared-fff7db77.js} +1 -1
- package/dist/cdn/translations/native-integration-card/en.json +20 -0
- package/dist/cdn/translations/native-integration-form/en.json +263 -0
- package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.d.ts +19 -0
- package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js +71 -0
- package/dist/elements/public/NativeIntegrationCard/NativeIntegrationCard.js.map +1 -0
- package/dist/elements/public/NativeIntegrationCard/index.d.ts +4 -0
- package/dist/elements/public/NativeIntegrationCard/index.js +6 -0
- package/dist/elements/public/NativeIntegrationCard/index.js.map +1 -0
- package/dist/elements/public/NativeIntegrationCard/types.d.ts +3 -0
- package/dist/elements/public/NativeIntegrationCard/types.js +2 -0
- package/dist/elements/public/NativeIntegrationCard/types.js.map +1 -0
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.d.ts +133 -0
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +753 -0
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -0
- package/dist/elements/public/NativeIntegrationForm/defaults.d.ts +62 -0
- package/dist/elements/public/NativeIntegrationForm/defaults.js +63 -0
- package/dist/elements/public/NativeIntegrationForm/defaults.js.map +1 -0
- package/dist/elements/public/NativeIntegrationForm/index.d.ts +9 -0
- package/dist/elements/public/NativeIntegrationForm/index.js +11 -0
- package/dist/elements/public/NativeIntegrationForm/index.js.map +1 -0
- package/dist/elements/public/NativeIntegrationForm/types.d.ts +89 -0
- package/dist/elements/public/NativeIntegrationForm/types.js +2 -0
- package/dist/elements/public/NativeIntegrationForm/types.js.map +1 -0
- package/dist/elements/public/index.d.ts +2 -0
- package/dist/elements/public/index.defined.d.ts +2 -0
- package/dist/elements/public/index.defined.js +2 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +2 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +4 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-584174ff.js +0 -1
- package/dist/cdn/shared-630a0ff2.js +0 -1
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
import { TranslatableMixin } from "../../../mixins/translatable.js";
|
|
2
|
+
import { BooleanSelector } from '@foxy.io/sdk/core';
|
|
3
|
+
import { InternalForm } from "../../internal/InternalForm/InternalForm.js";
|
|
4
|
+
import { html } from 'lit-html';
|
|
5
|
+
import * as defaults from "./defaults.js";
|
|
6
|
+
import memoize from 'lodash-es/memoize';
|
|
7
|
+
const NS = 'native-integration-form';
|
|
8
|
+
const Base = TranslatableMixin(InternalForm, NS);
|
|
9
|
+
/**
|
|
10
|
+
* Form element for configuring native integrations (`fx:native_integration`).
|
|
11
|
+
*
|
|
12
|
+
* @slot timestamps:before
|
|
13
|
+
* @slot timestamps:after
|
|
14
|
+
* @slot delete:before
|
|
15
|
+
* @slot delete:after
|
|
16
|
+
* @slot create:before
|
|
17
|
+
* @slot create:after
|
|
18
|
+
* @slot provider:before
|
|
19
|
+
* @slot provider:after
|
|
20
|
+
* @slot avalara-service-url:before
|
|
21
|
+
* @slot avalara-service-url:after
|
|
22
|
+
* @slot avalara-id:before
|
|
23
|
+
* @slot avalara-id:after
|
|
24
|
+
* @slot avalara-key:before
|
|
25
|
+
* @slot avalara-key:after
|
|
26
|
+
* @slot avalara-company-code:before
|
|
27
|
+
* @slot avalara-company-code:after
|
|
28
|
+
* @slot avalara-options:before
|
|
29
|
+
* @slot avalara-options:after
|
|
30
|
+
* @slot avalara-address-validation-countries:before
|
|
31
|
+
* @slot avalara-address-validation-countries:after
|
|
32
|
+
* @slot avalara-category-to-product-tax-code-mappings:before
|
|
33
|
+
* @slot avalara-category-to-product-tax-code-mappings:after
|
|
34
|
+
* @slot taxjar-api-token:before
|
|
35
|
+
* @slot taxjar-api-token:after
|
|
36
|
+
* @slot taxjar-category-to-product-tax-code-mappings:before
|
|
37
|
+
* @slot taxjar-category-to-product-tax-code-mappings:after
|
|
38
|
+
* @slot taxjar-options:before
|
|
39
|
+
* @slot taxjar-options:after
|
|
40
|
+
* @slot onesource-service-url:before
|
|
41
|
+
* @slot onesource-service-url:after
|
|
42
|
+
* @slot onesource-external-company-id:before
|
|
43
|
+
* @slot onesource-external-company-id:after
|
|
44
|
+
* @slot onesource-calling-system-number:before
|
|
45
|
+
* @slot onesource-calling-system-number:after
|
|
46
|
+
* @slot onesource-from-city:before
|
|
47
|
+
* @slot onesource-from-city:after
|
|
48
|
+
* @slot onesource-host-system:before
|
|
49
|
+
* @slot onesource-host-system:after
|
|
50
|
+
* @slot onesource-company-role:before
|
|
51
|
+
* @slot onesource-company-role:after
|
|
52
|
+
* @slot onesource-part-number-product-option:before
|
|
53
|
+
* @slot onesource-part-number-product-option:after
|
|
54
|
+
* @slot onesource-product-order-priority:before
|
|
55
|
+
* @slot onesource-product-order-priority:after
|
|
56
|
+
* @slot onesource-audit-settings:before
|
|
57
|
+
* @slot onesource-audit-settings:after
|
|
58
|
+
* @slot webhook-service:before
|
|
59
|
+
* @slot webhook-service:after
|
|
60
|
+
* @slot webhook-json-title:before
|
|
61
|
+
* @slot webhook-json-title:after
|
|
62
|
+
* @slot webhook-json-encryption-key:before
|
|
63
|
+
* @slot webhook-json-encryption-key:after
|
|
64
|
+
* @slot webhook-json-url:before
|
|
65
|
+
* @slot webhook-json-url:after
|
|
66
|
+
* @slot webhook-json-events:before
|
|
67
|
+
* @slot webhook-json-events:after
|
|
68
|
+
* @slot webhook-legacy-xml-title:before
|
|
69
|
+
* @slot webhook-legacy-xml-title:after
|
|
70
|
+
* @slot webhook-legacy-xml-url:before
|
|
71
|
+
* @slot webhook-legacy-xml-url:after
|
|
72
|
+
* @slot webflow-site-id:before
|
|
73
|
+
* @slot webflow-site-id:after
|
|
74
|
+
* @slot webflow-site-name:before
|
|
75
|
+
* @slot webflow-site-name:after
|
|
76
|
+
* @slot webflow-collection-id:before
|
|
77
|
+
* @slot webflow-collection-id:after
|
|
78
|
+
* @slot webflow-collection-name:before
|
|
79
|
+
* @slot webflow-collection-name:after
|
|
80
|
+
* @slot webflow-sku-field-id:before
|
|
81
|
+
* @slot webflow-sku-field-id:after
|
|
82
|
+
* @slot webflow-sku-field-name:before
|
|
83
|
+
* @slot webflow-sku-field-name:after
|
|
84
|
+
* @slot webflow-inventory-field-id:before
|
|
85
|
+
* @slot webflow-inventory-field-id:after
|
|
86
|
+
* @slot webflow-inventory-field-name:before
|
|
87
|
+
* @slot webflow-inventory-field-name:after
|
|
88
|
+
* @slot webflow-auth:before
|
|
89
|
+
* @slot webflow-auth:after
|
|
90
|
+
* @slot zapier-event:before
|
|
91
|
+
* @slot zapier-event:after
|
|
92
|
+
* @slot zapier-url:before
|
|
93
|
+
* @slot zapier-url:after
|
|
94
|
+
*
|
|
95
|
+
* @element foxy-native-integration-form
|
|
96
|
+
* @since 1.25.0
|
|
97
|
+
*/
|
|
98
|
+
export class NativeIntegrationForm extends Base {
|
|
99
|
+
constructor() {
|
|
100
|
+
super(...arguments);
|
|
101
|
+
this.templates = {};
|
|
102
|
+
this.__createConfigGetterFor = memoize((key) => {
|
|
103
|
+
return () => { var _a; return (_a = this.__config) === null || _a === void 0 ? void 0 : _a[key]; };
|
|
104
|
+
});
|
|
105
|
+
this.__createConfigSetterFor = memoize((key) => {
|
|
106
|
+
return (value) => (this.__config = { [key]: value });
|
|
107
|
+
});
|
|
108
|
+
this.__providerGetValue = () => {
|
|
109
|
+
var _a;
|
|
110
|
+
return (_a = this.form.provider) !== null && _a !== void 0 ? _a : 'avalara';
|
|
111
|
+
};
|
|
112
|
+
this.__providerSetValue = (value) => {
|
|
113
|
+
this.edit({ provider: value, config: '{}' });
|
|
114
|
+
this.__config = {};
|
|
115
|
+
};
|
|
116
|
+
this.__templateProviderOptions = [
|
|
117
|
+
{ value: 'avalara', label: 'option_avalara' },
|
|
118
|
+
{ value: 'onesource', label: 'option_onesource' },
|
|
119
|
+
{ value: 'taxjar', label: 'option_taxjar' },
|
|
120
|
+
{ value: 'webflow', label: 'option_webflow' },
|
|
121
|
+
];
|
|
122
|
+
this.__avalaraConfigOptions = [
|
|
123
|
+
{
|
|
124
|
+
value: 'use_ava_tax',
|
|
125
|
+
label: 'option_use_ava_tax',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: 'enable_colorado_delivery_fee',
|
|
129
|
+
label: 'option_enable_colorado_delivery_fee',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
value: 'create_invoice',
|
|
133
|
+
label: 'option_create_invoice',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
value: 'use_address_validation',
|
|
137
|
+
label: 'option_use_address_validation',
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
this.__taxjarConfigOptions = [
|
|
141
|
+
{
|
|
142
|
+
value: 'create_invoice',
|
|
143
|
+
label: 'option_create_invoice',
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
this.__configOptionsGetValue = () => {
|
|
147
|
+
const config = this.__config;
|
|
148
|
+
const value = [];
|
|
149
|
+
if (config === null || config === void 0 ? void 0 : config.enable_colorado_delivery_fee)
|
|
150
|
+
value.push('enable_colorado_delivery_fee');
|
|
151
|
+
if (config === null || config === void 0 ? void 0 : config.use_address_validation)
|
|
152
|
+
value.push('use_address_validation');
|
|
153
|
+
if (config === null || config === void 0 ? void 0 : config.create_invoice)
|
|
154
|
+
value.push('create_invoice');
|
|
155
|
+
if (config === null || config === void 0 ? void 0 : config.use_ava_tax)
|
|
156
|
+
value.push('use_ava_tax');
|
|
157
|
+
return value;
|
|
158
|
+
};
|
|
159
|
+
this.__configOptionsSetValue = (value) => {
|
|
160
|
+
this.__config = {
|
|
161
|
+
enable_colorado_delivery_fee: value.includes('enable_colorado_delivery_fee'),
|
|
162
|
+
use_address_validation: value.includes('use_address_validation'),
|
|
163
|
+
create_invoice: value.includes('create_invoice'),
|
|
164
|
+
use_ava_tax: value.includes('use_ava_tax'),
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
this.__avalaraAddressValidationCountriesOptions = [
|
|
168
|
+
{ value: 'US', label: 'option_US' },
|
|
169
|
+
{ value: 'CA', label: 'option_CA' },
|
|
170
|
+
];
|
|
171
|
+
this.__codeMappingsGetValue = () => {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
const mappings = (_b = (_a = this.__config) === null || _a === void 0 ? void 0 : _a.category_to_product_tax_code_mappings) !== null && _b !== void 0 ? _b : {};
|
|
174
|
+
return Object.entries(mappings).map(([foxyCategory, vndTaxCode]) => {
|
|
175
|
+
return { value: `${foxyCategory}:${vndTaxCode}` };
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
this.__codeMappingsSetValue = (value) => {
|
|
179
|
+
const mappings = {};
|
|
180
|
+
for (const { value: mapping } of value) {
|
|
181
|
+
const [foxyCategory, vndTaxCode] = mapping.split(':');
|
|
182
|
+
if (foxyCategory && vndTaxCode)
|
|
183
|
+
mappings[foxyCategory] = vndTaxCode;
|
|
184
|
+
}
|
|
185
|
+
this.__config = { category_to_product_tax_code_mappings: mappings };
|
|
186
|
+
};
|
|
187
|
+
this.__onesourceCompanyRoleOptions = [
|
|
188
|
+
{ value: 'B', label: 'option_buyer' },
|
|
189
|
+
{ value: 'M', label: 'option_middleman' },
|
|
190
|
+
{ value: 'S', label: 'option_seller' },
|
|
191
|
+
];
|
|
192
|
+
this.__onesourceProductOrderPriorityGetValue = () => {
|
|
193
|
+
var _a, _b;
|
|
194
|
+
const value = (_b = (_a = this.__config) === null || _a === void 0 ? void 0 : _a.product_order_priority.split(',')) !== null && _b !== void 0 ? _b : [];
|
|
195
|
+
return value.filter((v) => !!v).map((v) => ({ value: v }));
|
|
196
|
+
};
|
|
197
|
+
this.__onesourceProductOrderPrioritySetValue = (value) => {
|
|
198
|
+
this.__config = { product_order_priority: value.map(i => i.value).join(',') };
|
|
199
|
+
};
|
|
200
|
+
this.__onesourceAuditSettingsOptions = [
|
|
201
|
+
{ value: 'capture_only', label: 'option_capture_only' },
|
|
202
|
+
{ value: 'auth_and_capture', label: 'option_auth_and_capture' },
|
|
203
|
+
{ value: 'never', label: 'option_never' },
|
|
204
|
+
];
|
|
205
|
+
this.__webhookServiceOptions = [
|
|
206
|
+
{ value: 'json', label: 'option_json' },
|
|
207
|
+
{ value: 'legacy_xml', label: 'option_legacy_xml' },
|
|
208
|
+
];
|
|
209
|
+
this.__webhookJsonEventsOptions = [
|
|
210
|
+
{ value: 'transaction/created', label: 'option_transaction_created' },
|
|
211
|
+
{ value: 'subscription/cancelled', label: 'option_subscription_cancelled' },
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
static get v8n() {
|
|
215
|
+
const parse = memoize(JSON.parse);
|
|
216
|
+
const isURL = memoize((value) => {
|
|
217
|
+
try {
|
|
218
|
+
return Boolean(new URL(value));
|
|
219
|
+
}
|
|
220
|
+
catch (_a) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return [
|
|
225
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
226
|
+
const url = parse(c).service_url;
|
|
227
|
+
const err = url ? (isURL(url) ? null : 'v8n_invalid') : 'v8n_required';
|
|
228
|
+
return p === 'avalara' && err ? `avalara-service-url:${err}` : true;
|
|
229
|
+
},
|
|
230
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
231
|
+
return p !== 'avalara' || !!parse(c).id || 'avalara-id:v8n_required';
|
|
232
|
+
},
|
|
233
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
234
|
+
return p !== 'avalara' || !!parse(c).key || 'avalara-key:v8n_required';
|
|
235
|
+
},
|
|
236
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
237
|
+
return p !== 'avalara' || !!parse(c).company_code || 'avalara-company-code:v8n_required';
|
|
238
|
+
},
|
|
239
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
240
|
+
if (p !== 'avalara')
|
|
241
|
+
return true;
|
|
242
|
+
const mappings = parse(c).category_to_product_tax_code_mappings;
|
|
243
|
+
const err = 'avalara-category-to-product-tax-code-mappings:v8n_required';
|
|
244
|
+
return (mappings && Object.entries(mappings).length > 0) || err;
|
|
245
|
+
},
|
|
246
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
247
|
+
return p !== 'taxjar' || !!parse(c).api_token || 'taxjar-api-token:v8n_required';
|
|
248
|
+
},
|
|
249
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
250
|
+
const url = parse(c).service_url;
|
|
251
|
+
const err = url ? (isURL(url) ? null : 'v8n_invalid') : 'v8n_required';
|
|
252
|
+
return p === 'onesource' && err ? `onesource-service-url:${err}` : true;
|
|
253
|
+
},
|
|
254
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
255
|
+
const prefix = 'onesource-external-company-id';
|
|
256
|
+
return p !== 'onesource' || !!parse(c).external_company_id || `${prefix}:v8n_required`;
|
|
257
|
+
},
|
|
258
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
259
|
+
const prefix = 'onesource-calling-system-number';
|
|
260
|
+
return p !== 'onesource' || !!parse(c).calling_system_number || `${prefix}:v8n_required`;
|
|
261
|
+
},
|
|
262
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
263
|
+
const prefix = 'onesource-from-city';
|
|
264
|
+
return p !== 'onesource' || !!parse(c).from_city || `${prefix}:v8n_required`;
|
|
265
|
+
},
|
|
266
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
267
|
+
const prefix = 'onesource-host-system';
|
|
268
|
+
return p !== 'onesource' || !!parse(c).host_system || `${prefix}:v8n_required`;
|
|
269
|
+
},
|
|
270
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
271
|
+
const { service: s, title: t } = parse(c);
|
|
272
|
+
return p !== 'webhook' || s !== 'json' || !!t || 'webhook-json-title:v8n_required';
|
|
273
|
+
},
|
|
274
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
275
|
+
const { service: s, encryption_key: e } = parse(c);
|
|
276
|
+
return p !== 'webhook' || s !== 'json' || !!e || 'webhook-json-encryption-key:v8n_required';
|
|
277
|
+
},
|
|
278
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
279
|
+
const { service: s, url: u } = parse(c);
|
|
280
|
+
const err = u ? (isURL(u) ? null : 'v8n_invalid') : 'v8n_required';
|
|
281
|
+
return p === 'webhook' && s === 'json' && err ? `webhook-json-url:${err}` : true;
|
|
282
|
+
},
|
|
283
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
284
|
+
const { service: s, title: t } = parse(c);
|
|
285
|
+
const err = 'webhook-legacy-xml-title:v8n_required';
|
|
286
|
+
return p !== 'webhook' || s !== 'legacy_xml' || !!t || err;
|
|
287
|
+
},
|
|
288
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
289
|
+
const { service: s, url: u } = parse(c);
|
|
290
|
+
const err = u ? (isURL(u) ? null : 'v8n_invalid') : 'v8n_required';
|
|
291
|
+
const prefix = 'webhook-legacy-xml-url';
|
|
292
|
+
return p === 'webhook' && s === 'legacy_xml' && err ? `${prefix}:${err}` : true;
|
|
293
|
+
},
|
|
294
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
295
|
+
return p !== 'webflow' || !!parse(c).site_id || 'webflow-site-id:v8n_required';
|
|
296
|
+
},
|
|
297
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
298
|
+
return p !== 'webflow' || !!parse(c).site_name || 'webflow-site-name:v8n_required';
|
|
299
|
+
},
|
|
300
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
301
|
+
return p !== 'webflow' || !!parse(c).collection_id || 'webflow-collection-id:v8n_required';
|
|
302
|
+
},
|
|
303
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
304
|
+
const err = 'webflow-collection-name:v8n_required';
|
|
305
|
+
return p !== 'webflow' || !!parse(c).collection_name || err;
|
|
306
|
+
},
|
|
307
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
308
|
+
return p !== 'webflow' || !!parse(c).sku_field_id || 'webflow-sku-field-id:v8n_required';
|
|
309
|
+
},
|
|
310
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
311
|
+
const err = 'webflow-sku-field-name:v8n_required';
|
|
312
|
+
return p !== 'webflow' || !!parse(c).sku_field_name || err;
|
|
313
|
+
},
|
|
314
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
315
|
+
const err = 'webflow-inventory-field-id:v8n_required';
|
|
316
|
+
return p !== 'webflow' || !!parse(c).inventory_field_id || err;
|
|
317
|
+
},
|
|
318
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
319
|
+
const err = 'webflow-inventory-field-name:v8n_required';
|
|
320
|
+
return p !== 'webflow' || !!parse(c).inventory_field_name || err;
|
|
321
|
+
},
|
|
322
|
+
({ provider: p = 'avalara', config: c = '{}' }) => {
|
|
323
|
+
return p !== 'webflow' || !!parse(c).auth || 'webflow-auth:v8n_required';
|
|
324
|
+
},
|
|
325
|
+
];
|
|
326
|
+
}
|
|
327
|
+
get readonlySelector() {
|
|
328
|
+
const match = [super.readonlySelector.toString()];
|
|
329
|
+
if (this.href)
|
|
330
|
+
match.push('provider', 'zapier-event', 'zapier-url');
|
|
331
|
+
return new BooleanSelector(match.join(' ').trim());
|
|
332
|
+
}
|
|
333
|
+
renderBody() {
|
|
334
|
+
var _a;
|
|
335
|
+
const provider = (_a = this.form.provider) !== null && _a !== void 0 ? _a : 'avalara';
|
|
336
|
+
return html `
|
|
337
|
+
${this.href
|
|
338
|
+
? provider === 'webhook'
|
|
339
|
+
? ''
|
|
340
|
+
: html `<foxy-internal-text-control infer="provider"></foxy-internal-text-control>`
|
|
341
|
+
: html `
|
|
342
|
+
<foxy-internal-radio-group-control
|
|
343
|
+
infer="provider"
|
|
344
|
+
theme="vertical"
|
|
345
|
+
.getValue=${this.__providerGetValue}
|
|
346
|
+
.setValue=${this.__providerSetValue}
|
|
347
|
+
.options=${this.__templateProviderOptions}
|
|
348
|
+
>
|
|
349
|
+
</foxy-internal-radio-group-control>
|
|
350
|
+
`}
|
|
351
|
+
${provider === 'avalara'
|
|
352
|
+
? this.__renderAvalaraConfig()
|
|
353
|
+
: provider === 'taxjar'
|
|
354
|
+
? this.__renderTaxJarConfig()
|
|
355
|
+
: provider === 'onesource'
|
|
356
|
+
? this.__renderOneSourceConfig()
|
|
357
|
+
: provider === 'webflow'
|
|
358
|
+
? this.__renderWebflowConfig()
|
|
359
|
+
: provider === 'zapier'
|
|
360
|
+
? this.__renderZapierConfig()
|
|
361
|
+
: provider === 'webhook'
|
|
362
|
+
? this.__renderWebhookConfig()
|
|
363
|
+
: ''}
|
|
364
|
+
${super.renderBody()}
|
|
365
|
+
`;
|
|
366
|
+
}
|
|
367
|
+
async _fetch(...args) {
|
|
368
|
+
try {
|
|
369
|
+
return await super._fetch(...args);
|
|
370
|
+
}
|
|
371
|
+
catch (err) {
|
|
372
|
+
let message;
|
|
373
|
+
try {
|
|
374
|
+
message = (await err.json())._embedded['fx:errors'][0].message;
|
|
375
|
+
}
|
|
376
|
+
catch (_a) {
|
|
377
|
+
throw err;
|
|
378
|
+
}
|
|
379
|
+
if (message.includes('has already been configured')) {
|
|
380
|
+
throw ['error:already_configured'];
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
throw err;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
get __config() {
|
|
388
|
+
try {
|
|
389
|
+
return JSON.parse(this.form.config);
|
|
390
|
+
}
|
|
391
|
+
catch (_a) {
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
set __config(value) {
|
|
396
|
+
var _a;
|
|
397
|
+
const config = this.__config;
|
|
398
|
+
const provider = (_a = this.form.provider) !== null && _a !== void 0 ? _a : 'avalara';
|
|
399
|
+
const defaultConfig = (() => {
|
|
400
|
+
if (provider === 'avalara')
|
|
401
|
+
return defaults.avalara;
|
|
402
|
+
if (provider === 'taxjar')
|
|
403
|
+
return defaults.taxjar;
|
|
404
|
+
if (provider === 'onesource')
|
|
405
|
+
return defaults.onesource;
|
|
406
|
+
if (provider === 'webflow')
|
|
407
|
+
return defaults.webflow;
|
|
408
|
+
if (provider === 'zapier')
|
|
409
|
+
return defaults.zapier;
|
|
410
|
+
if (provider === 'webhook') {
|
|
411
|
+
if ((config === null || config === void 0 ? void 0 : config.service) === 'legacy_xml')
|
|
412
|
+
return defaults.webhookLegacyXml;
|
|
413
|
+
return defaults.webhookJson;
|
|
414
|
+
}
|
|
415
|
+
})();
|
|
416
|
+
const newConfig = JSON.stringify({ ...defaultConfig, ...config, ...value });
|
|
417
|
+
this.edit({ provider, config: newConfig });
|
|
418
|
+
}
|
|
419
|
+
__renderAvalaraConfig() {
|
|
420
|
+
var _a;
|
|
421
|
+
return html `
|
|
422
|
+
<foxy-internal-text-control
|
|
423
|
+
infer="avalara-service-url"
|
|
424
|
+
.getValue=${this.__createConfigGetterFor('service_url')}
|
|
425
|
+
.setValue=${this.__createConfigSetterFor('service_url')}
|
|
426
|
+
>
|
|
427
|
+
</foxy-internal-text-control>
|
|
428
|
+
|
|
429
|
+
<foxy-internal-text-control
|
|
430
|
+
infer="avalara-id"
|
|
431
|
+
.getValue=${this.__createConfigGetterFor('id')}
|
|
432
|
+
.setValue=${this.__createConfigSetterFor('id')}
|
|
433
|
+
>
|
|
434
|
+
</foxy-internal-text-control>
|
|
435
|
+
|
|
436
|
+
<foxy-internal-password-control
|
|
437
|
+
infer="avalara-key"
|
|
438
|
+
.getValue=${this.__createConfigGetterFor('key')}
|
|
439
|
+
.setValue=${this.__createConfigSetterFor('key')}
|
|
440
|
+
>
|
|
441
|
+
</foxy-internal-password-control>
|
|
442
|
+
|
|
443
|
+
<foxy-internal-text-control
|
|
444
|
+
infer="avalara-company-code"
|
|
445
|
+
.getValue=${this.__createConfigGetterFor('company_code')}
|
|
446
|
+
.setValue=${this.__createConfigSetterFor('company_code')}
|
|
447
|
+
>
|
|
448
|
+
</foxy-internal-text-control>
|
|
449
|
+
|
|
450
|
+
<foxy-internal-editable-list-control
|
|
451
|
+
infer="avalara-category-to-product-tax-code-mappings"
|
|
452
|
+
.getValue=${this.__codeMappingsGetValue}
|
|
453
|
+
.setValue=${this.__codeMappingsSetValue}
|
|
454
|
+
>
|
|
455
|
+
</foxy-internal-editable-list-control>
|
|
456
|
+
|
|
457
|
+
<foxy-internal-checkbox-group-control
|
|
458
|
+
infer="avalara-options"
|
|
459
|
+
.getValue=${this.__configOptionsGetValue}
|
|
460
|
+
.setValue=${this.__configOptionsSetValue}
|
|
461
|
+
.options=${this.__avalaraConfigOptions}
|
|
462
|
+
>
|
|
463
|
+
</foxy-internal-checkbox-group-control>
|
|
464
|
+
|
|
465
|
+
${((_a = this.__config) === null || _a === void 0 ? void 0 : _a.use_address_validation) ? html `
|
|
466
|
+
<foxy-internal-checkbox-group-control
|
|
467
|
+
infer="avalara-address-validation-countries"
|
|
468
|
+
.getValue=${this.__createConfigGetterFor('address_validation_countries')}
|
|
469
|
+
.setValue=${this.__createConfigSetterFor('address_validation_countries')}
|
|
470
|
+
.options=${this.__avalaraAddressValidationCountriesOptions}
|
|
471
|
+
>
|
|
472
|
+
</foxy-internal-checkbox-group-control>
|
|
473
|
+
`
|
|
474
|
+
: ''}
|
|
475
|
+
`;
|
|
476
|
+
}
|
|
477
|
+
__renderTaxJarConfig() {
|
|
478
|
+
return html `
|
|
479
|
+
<foxy-internal-password-control
|
|
480
|
+
infer="taxjar-api-token"
|
|
481
|
+
.getValue=${this.__createConfigGetterFor('api_token')}
|
|
482
|
+
.setValue=${this.__createConfigSetterFor('api_token')}
|
|
483
|
+
>
|
|
484
|
+
</foxy-internal-password-control>
|
|
485
|
+
|
|
486
|
+
<foxy-internal-editable-list-control
|
|
487
|
+
infer="taxjar-category-to-product-tax-code-mappings"
|
|
488
|
+
.getValue=${this.__codeMappingsGetValue}
|
|
489
|
+
.setValue=${this.__codeMappingsSetValue}
|
|
490
|
+
>
|
|
491
|
+
</foxy-internal-editable-list-control>
|
|
492
|
+
|
|
493
|
+
<foxy-internal-checkbox-group-control
|
|
494
|
+
infer="taxjar-options"
|
|
495
|
+
.getValue=${this.__configOptionsGetValue}
|
|
496
|
+
.setValue=${this.__configOptionsSetValue}
|
|
497
|
+
.options=${this.__taxjarConfigOptions}
|
|
498
|
+
>
|
|
499
|
+
</foxy-internal-checkbox-group-control>
|
|
500
|
+
`;
|
|
501
|
+
}
|
|
502
|
+
__renderOneSourceConfig() {
|
|
503
|
+
return html `
|
|
504
|
+
<foxy-internal-text-control
|
|
505
|
+
infer="onesource-service-url"
|
|
506
|
+
.getValue=${this.__createConfigGetterFor('service_url')}
|
|
507
|
+
.setValue=${this.__createConfigSetterFor('service_url')}
|
|
508
|
+
>
|
|
509
|
+
</foxy-internal-text-control>
|
|
510
|
+
|
|
511
|
+
<foxy-internal-text-control
|
|
512
|
+
infer="onesource-external-company-id"
|
|
513
|
+
.getValue=${this.__createConfigGetterFor('external_company_id')}
|
|
514
|
+
.setValue=${this.__createConfigSetterFor('external_company_id')}
|
|
515
|
+
>
|
|
516
|
+
</foxy-internal-text-control>
|
|
517
|
+
|
|
518
|
+
<foxy-internal-text-control
|
|
519
|
+
infer="onesource-calling-system-number"
|
|
520
|
+
.getValue=${this.__createConfigGetterFor('calling_system_number')}
|
|
521
|
+
.setValue=${this.__createConfigSetterFor('calling_system_number')}
|
|
522
|
+
>
|
|
523
|
+
</foxy-internal-text-control>
|
|
524
|
+
|
|
525
|
+
<foxy-internal-text-control
|
|
526
|
+
infer="onesource-from-city"
|
|
527
|
+
.getValue=${this.__createConfigGetterFor('from_city')}
|
|
528
|
+
.setValue=${this.__createConfigSetterFor('from_city')}
|
|
529
|
+
>
|
|
530
|
+
</foxy-internal-text-control>
|
|
531
|
+
|
|
532
|
+
<foxy-internal-text-control
|
|
533
|
+
infer="onesource-host-system"
|
|
534
|
+
.getValue=${this.__createConfigGetterFor('host_system')}
|
|
535
|
+
.setValue=${this.__createConfigSetterFor('host_system')}
|
|
536
|
+
>
|
|
537
|
+
</foxy-internal-text-control>
|
|
538
|
+
|
|
539
|
+
<foxy-internal-radio-group-control
|
|
540
|
+
infer="onesource-company-role"
|
|
541
|
+
.getValue=${this.__createConfigGetterFor('company_role')}
|
|
542
|
+
.setValue=${this.__createConfigSetterFor('company_role')}
|
|
543
|
+
.options=${this.__onesourceCompanyRoleOptions}
|
|
544
|
+
>
|
|
545
|
+
</foxy-internal-radio-group-control>
|
|
546
|
+
|
|
547
|
+
<foxy-internal-text-control
|
|
548
|
+
infer="onesource-part-number-product-option"
|
|
549
|
+
.getValue=${this.__createConfigGetterFor('part_number_product_option')}
|
|
550
|
+
.setValue=${this.__createConfigSetterFor('part_number_product_option')}
|
|
551
|
+
>
|
|
552
|
+
</foxy-internal-text-control>
|
|
553
|
+
|
|
554
|
+
<foxy-internal-editable-list-control
|
|
555
|
+
infer="onesource-product-order-priority"
|
|
556
|
+
.getValue=${this.__onesourceProductOrderPriorityGetValue}
|
|
557
|
+
.setValue=${this.__onesourceProductOrderPrioritySetValue}
|
|
558
|
+
>
|
|
559
|
+
</foxy-internal-editable-list-control>
|
|
560
|
+
|
|
561
|
+
<foxy-internal-radio-group-control
|
|
562
|
+
infer="onesource-audit-settings"
|
|
563
|
+
.getValue=${this.__createConfigGetterFor('audit_settings')}
|
|
564
|
+
.setValue=${this.__createConfigSetterFor('audit_settings')}
|
|
565
|
+
.options=${this.__onesourceAuditSettingsOptions}
|
|
566
|
+
>
|
|
567
|
+
</foxy-internal-radio-group-control>
|
|
568
|
+
`;
|
|
569
|
+
}
|
|
570
|
+
__renderWebhookConfig() {
|
|
571
|
+
var _a, _b;
|
|
572
|
+
return html `
|
|
573
|
+
<p
|
|
574
|
+
style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
|
|
575
|
+
class="rounded bg-error-10 text-error font-medium"
|
|
576
|
+
>
|
|
577
|
+
<foxy-i18n infer="webhook-warning" key="warning_text"></foxy-i18n>
|
|
578
|
+
<br />
|
|
579
|
+
<br />
|
|
580
|
+
<a
|
|
581
|
+
target="_blank"
|
|
582
|
+
class="text-body rounded hover-underline hover-cursor-pointer focus-outline-none focus-ring-2 focus-ring-error-50"
|
|
583
|
+
lang="en"
|
|
584
|
+
rel="noopener"
|
|
585
|
+
href="https://www.foxy.io/blog/new-feature-json-webhook/"
|
|
586
|
+
>
|
|
587
|
+
<foxy-i18n infer="webhook-warning" key="link_text"></foxy-i18n>
|
|
588
|
+
</a>
|
|
589
|
+
</p>
|
|
590
|
+
|
|
591
|
+
${((_a = this.__config) === null || _a === void 0 ? void 0 : _a.service) === 'json'
|
|
592
|
+
? this.__renderWebhookJsonConfig()
|
|
593
|
+
: ((_b = this.__config) === null || _b === void 0 ? void 0 : _b.service) === 'legacy_xml'
|
|
594
|
+
? this.__renderWebhookLegacyXmlConfig()
|
|
595
|
+
: ''}
|
|
596
|
+
`;
|
|
597
|
+
}
|
|
598
|
+
__renderWebhookJsonConfig() {
|
|
599
|
+
return html `
|
|
600
|
+
<foxy-internal-text-control
|
|
601
|
+
infer="webhook-json-title"
|
|
602
|
+
.getValue=${this.__createConfigGetterFor('title')}
|
|
603
|
+
.setValue=${this.__createConfigSetterFor('title')}
|
|
604
|
+
>
|
|
605
|
+
</foxy-internal-text-control>
|
|
606
|
+
|
|
607
|
+
<foxy-internal-text-area-control
|
|
608
|
+
infer="webhook-json-url"
|
|
609
|
+
.getValue=${this.__createConfigGetterFor('url')}
|
|
610
|
+
.setValue=${this.__createConfigSetterFor('url')}
|
|
611
|
+
>
|
|
612
|
+
</foxy-internal-text-area-control>
|
|
613
|
+
|
|
614
|
+
<foxy-internal-radio-group-control
|
|
615
|
+
infer="webhook-service"
|
|
616
|
+
.getValue=${this.__createConfigGetterFor('service')}
|
|
617
|
+
.setValue=${this.__createConfigSetterFor('service')}
|
|
618
|
+
.options=${this.__webhookServiceOptions}
|
|
619
|
+
>
|
|
620
|
+
</foxy-internal-radio-group-control>
|
|
621
|
+
|
|
622
|
+
<foxy-internal-checkbox-group-control
|
|
623
|
+
infer="webhook-json-events"
|
|
624
|
+
.getValue=${this.__createConfigGetterFor('events')}
|
|
625
|
+
.setValue=${this.__createConfigSetterFor('events')}
|
|
626
|
+
.options=${this.__webhookJsonEventsOptions}
|
|
627
|
+
>
|
|
628
|
+
</foxy-internal-checkbox-group-control>
|
|
629
|
+
|
|
630
|
+
<foxy-internal-password-control
|
|
631
|
+
infer="webhook-json-encryption-key"
|
|
632
|
+
.getValue=${this.__createConfigGetterFor('encryption_key')}
|
|
633
|
+
.setValue=${this.__createConfigSetterFor('encryption_key')}
|
|
634
|
+
>
|
|
635
|
+
</foxy-internal-password-control>
|
|
636
|
+
`;
|
|
637
|
+
}
|
|
638
|
+
__renderWebhookLegacyXmlConfig() {
|
|
639
|
+
return html `
|
|
640
|
+
<foxy-internal-text-control
|
|
641
|
+
infer="webhook-legacy-xml-title"
|
|
642
|
+
.getValue=${this.__createConfigGetterFor('title')}
|
|
643
|
+
.setValue=${this.__createConfigSetterFor('title')}
|
|
644
|
+
>
|
|
645
|
+
</foxy-internal-text-control>
|
|
646
|
+
|
|
647
|
+
<foxy-internal-text-area-control
|
|
648
|
+
infer="webhook-legacy-xml-url"
|
|
649
|
+
.getValue=${this.__createConfigGetterFor('url')}
|
|
650
|
+
.setValue=${this.__createConfigSetterFor('url')}
|
|
651
|
+
>
|
|
652
|
+
</foxy-internal-text-area-control>
|
|
653
|
+
|
|
654
|
+
<foxy-internal-radio-group-control
|
|
655
|
+
infer="webhook-service"
|
|
656
|
+
.getValue=${this.__createConfigGetterFor('service')}
|
|
657
|
+
.setValue=${this.__createConfigSetterFor('service')}
|
|
658
|
+
.options=${this.__webhookServiceOptions}
|
|
659
|
+
>
|
|
660
|
+
</foxy-internal-radio-group-control>
|
|
661
|
+
`;
|
|
662
|
+
}
|
|
663
|
+
__renderWebflowConfig() {
|
|
664
|
+
return html `
|
|
665
|
+
<div class="grid grid-cols-2 gap-m">
|
|
666
|
+
<foxy-internal-text-control
|
|
667
|
+
infer="webflow-site-id"
|
|
668
|
+
.getValue=${this.__createConfigGetterFor('site_id')}
|
|
669
|
+
.setValue=${this.__createConfigSetterFor('site_id')}
|
|
670
|
+
>
|
|
671
|
+
</foxy-internal-text-control>
|
|
672
|
+
|
|
673
|
+
<foxy-internal-text-control
|
|
674
|
+
infer="webflow-site-name"
|
|
675
|
+
.getValue=${this.__createConfigGetterFor('site_name')}
|
|
676
|
+
.setValue=${this.__createConfigSetterFor('site_name')}
|
|
677
|
+
>
|
|
678
|
+
</foxy-internal-text-control>
|
|
679
|
+
|
|
680
|
+
<foxy-internal-text-control
|
|
681
|
+
infer="webflow-collection-id"
|
|
682
|
+
.getValue=${this.__createConfigGetterFor('collection_id')}
|
|
683
|
+
.setValue=${this.__createConfigSetterFor('collection_id')}
|
|
684
|
+
>
|
|
685
|
+
</foxy-internal-text-control>
|
|
686
|
+
|
|
687
|
+
<foxy-internal-text-control
|
|
688
|
+
infer="webflow-collection-name"
|
|
689
|
+
.getValue=${this.__createConfigGetterFor('collection_name')}
|
|
690
|
+
.setValue=${this.__createConfigSetterFor('collection_name')}
|
|
691
|
+
>
|
|
692
|
+
</foxy-internal-text-control>
|
|
693
|
+
|
|
694
|
+
<foxy-internal-text-control
|
|
695
|
+
infer="webflow-sku-field-id"
|
|
696
|
+
.getValue=${this.__createConfigGetterFor('sku_field_id')}
|
|
697
|
+
.setValue=${this.__createConfigSetterFor('sku_field_id')}
|
|
698
|
+
>
|
|
699
|
+
</foxy-internal-text-control>
|
|
700
|
+
|
|
701
|
+
<foxy-internal-text-control
|
|
702
|
+
infer="webflow-sku-field-name"
|
|
703
|
+
.getValue=${this.__createConfigGetterFor('sku_field_name')}
|
|
704
|
+
.setValue=${this.__createConfigSetterFor('sku_field_name')}
|
|
705
|
+
>
|
|
706
|
+
</foxy-internal-text-control>
|
|
707
|
+
|
|
708
|
+
<foxy-internal-text-control
|
|
709
|
+
infer="webflow-inventory-field-id"
|
|
710
|
+
.getValue=${this.__createConfigGetterFor('inventory_field_id')}
|
|
711
|
+
.setValue=${this.__createConfigSetterFor('inventory_field_id')}
|
|
712
|
+
>
|
|
713
|
+
</foxy-internal-text-control>
|
|
714
|
+
|
|
715
|
+
<foxy-internal-text-control
|
|
716
|
+
infer="webflow-inventory-field-name"
|
|
717
|
+
.getValue=${this.__createConfigGetterFor('inventory_field_name')}
|
|
718
|
+
.setValue=${this.__createConfigSetterFor('inventory_field_name')}
|
|
719
|
+
>
|
|
720
|
+
</foxy-internal-text-control>
|
|
721
|
+
</div>
|
|
722
|
+
|
|
723
|
+
<foxy-internal-password-control
|
|
724
|
+
infer="webflow-auth"
|
|
725
|
+
.getValue=${this.__createConfigGetterFor('auth')}
|
|
726
|
+
.setValue=${this.__createConfigSetterFor('auth')}
|
|
727
|
+
>
|
|
728
|
+
</foxy-internal-password-control>
|
|
729
|
+
`;
|
|
730
|
+
}
|
|
731
|
+
__renderZapierConfig() {
|
|
732
|
+
return html `
|
|
733
|
+
<foxy-internal-text-control
|
|
734
|
+
infer="zapier-event"
|
|
735
|
+
.getValue=${this.__createConfigGetterFor('event')}
|
|
736
|
+
.setValue=${this.__createConfigSetterFor('event')}
|
|
737
|
+
>
|
|
738
|
+
</foxy-internal-text-control>
|
|
739
|
+
|
|
740
|
+
<foxy-internal-text-area-control
|
|
741
|
+
infer="zapier-url"
|
|
742
|
+
.getValue=${this.__createConfigGetterFor('url')}
|
|
743
|
+
.setValue=${this.__createConfigSetterFor('url')}
|
|
744
|
+
>
|
|
745
|
+
</foxy-internal-text-area-control>
|
|
746
|
+
|
|
747
|
+
<p class="text-xs text-secondary leading-xs">
|
|
748
|
+
<foxy-i18n infer="zapier-warning" key="warning_text"></foxy-i18n>
|
|
749
|
+
</p>
|
|
750
|
+
`;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
//# sourceMappingURL=NativeIntegrationForm.js.map
|