@bunnyapp/components 1.0.68-beta.4 → 1.0.68-beta.5
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/cjs/index.js
CHANGED
|
@@ -174,7 +174,7 @@ var BrandContext = react.createContext({
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
// This will be replaced at build time by rollup-plugin-replace
|
|
177
|
-
var PACKAGE_VERSION = '1.0.68-beta.
|
|
177
|
+
var PACKAGE_VERSION = '1.0.68-beta.5';
|
|
178
178
|
var createRequestHeaders = function (token) {
|
|
179
179
|
var headers = common.createClientDevHeaders(token);
|
|
180
180
|
// Add the components version header
|
|
@@ -590,7 +590,7 @@ var filterPaymentPluginsByEntity = function (plugins, selectedEntityId) {
|
|
|
590
590
|
var _a, _b;
|
|
591
591
|
return selectedEntityId === undefined ||
|
|
592
592
|
selectedEntityId === null ||
|
|
593
|
-
((_a = plugin.
|
|
593
|
+
((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(selectedEntityId)) ||
|
|
594
594
|
((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
595
595
|
});
|
|
596
596
|
};
|
|
@@ -626,14 +626,10 @@ var usePaymentPlugins = function (_a) {
|
|
|
626
626
|
queryFn: function () { return getPaymentPlugins({ apiHost: apiHost, token: token }); },
|
|
627
627
|
staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
|
|
628
628
|
}), paymentPlugins = _b.data, isFetched = _b.isFetched;
|
|
629
|
-
console.log('selectedEntityId', selectedEntityId);
|
|
630
|
-
console.log('paymentPlugins', paymentPlugins);
|
|
631
629
|
var filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
|
|
632
|
-
console.log('filteredPaymentPlugins', filteredPaymentPlugins);
|
|
633
630
|
var filteredPaymentPluginsByEntity = selectedEntityId
|
|
634
631
|
? filterPaymentPluginsByEntity(filteredPaymentPlugins, selectedEntityId)
|
|
635
632
|
: filteredPaymentPlugins;
|
|
636
|
-
console.log('filteredPaymentPluginsByEntity', filteredPaymentPluginsByEntity);
|
|
637
633
|
return {
|
|
638
634
|
paymentPlugins: filteredPaymentPluginsByEntity,
|
|
639
635
|
isFetched: isFetched,
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
type PaymentPlugin = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
entities: string[];
|
|
4
|
+
guid: string;
|
|
5
|
+
hidden: boolean;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
status: string;
|
|
9
|
+
type: string;
|
|
10
|
+
webhookEnabled: boolean;
|
|
11
|
+
components: {
|
|
12
|
+
frontend: {
|
|
13
|
+
name: string;
|
|
14
|
+
scenarios: string[];
|
|
15
|
+
}[];
|
|
16
|
+
backend: {
|
|
17
|
+
name: string;
|
|
18
|
+
access: string[];
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
2
22
|
export declare const usePaymentPlugins: ({ apiHost, token, selectedEntityId, }: {
|
|
3
23
|
apiHost: string;
|
|
4
24
|
token?: string | undefined;
|
|
5
25
|
selectedEntityId?: string | null | undefined;
|
|
6
26
|
}) => {
|
|
7
|
-
paymentPlugins:
|
|
27
|
+
paymentPlugins: PaymentPlugin[];
|
|
8
28
|
isFetched: boolean;
|
|
9
29
|
};
|
|
10
30
|
export default usePaymentPlugins;
|
package/dist/esm/index.js
CHANGED
|
@@ -144,7 +144,7 @@ var BrandContext = createContext({
|
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
// This will be replaced at build time by rollup-plugin-replace
|
|
147
|
-
var PACKAGE_VERSION = '1.0.68-beta.
|
|
147
|
+
var PACKAGE_VERSION = '1.0.68-beta.5';
|
|
148
148
|
var createRequestHeaders = function (token) {
|
|
149
149
|
var headers = createClientDevHeaders(token);
|
|
150
150
|
// Add the components version header
|
|
@@ -560,7 +560,7 @@ var filterPaymentPluginsByEntity = function (plugins, selectedEntityId) {
|
|
|
560
560
|
var _a, _b;
|
|
561
561
|
return selectedEntityId === undefined ||
|
|
562
562
|
selectedEntityId === null ||
|
|
563
|
-
((_a = plugin.
|
|
563
|
+
((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(selectedEntityId)) ||
|
|
564
564
|
((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
565
565
|
});
|
|
566
566
|
};
|
|
@@ -596,14 +596,10 @@ var usePaymentPlugins = function (_a) {
|
|
|
596
596
|
queryFn: function () { return getPaymentPlugins({ apiHost: apiHost, token: token }); },
|
|
597
597
|
staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
|
|
598
598
|
}), paymentPlugins = _b.data, isFetched = _b.isFetched;
|
|
599
|
-
console.log('selectedEntityId', selectedEntityId);
|
|
600
|
-
console.log('paymentPlugins', paymentPlugins);
|
|
601
599
|
var filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
|
|
602
|
-
console.log('filteredPaymentPlugins', filteredPaymentPlugins);
|
|
603
600
|
var filteredPaymentPluginsByEntity = selectedEntityId
|
|
604
601
|
? filterPaymentPluginsByEntity(filteredPaymentPlugins, selectedEntityId)
|
|
605
602
|
: filteredPaymentPlugins;
|
|
606
|
-
console.log('filteredPaymentPluginsByEntity', filteredPaymentPluginsByEntity);
|
|
607
603
|
return {
|
|
608
604
|
paymentPlugins: filteredPaymentPluginsByEntity,
|
|
609
605
|
isFetched: isFetched,
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
type PaymentPlugin = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
entities: string[];
|
|
4
|
+
guid: string;
|
|
5
|
+
hidden: boolean;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
status: string;
|
|
9
|
+
type: string;
|
|
10
|
+
webhookEnabled: boolean;
|
|
11
|
+
components: {
|
|
12
|
+
frontend: {
|
|
13
|
+
name: string;
|
|
14
|
+
scenarios: string[];
|
|
15
|
+
}[];
|
|
16
|
+
backend: {
|
|
17
|
+
name: string;
|
|
18
|
+
access: string[];
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
2
22
|
export declare const usePaymentPlugins: ({ apiHost, token, selectedEntityId, }: {
|
|
3
23
|
apiHost: string;
|
|
4
24
|
token?: string | undefined;
|
|
5
25
|
selectedEntityId?: string | null | undefined;
|
|
6
26
|
}) => {
|
|
7
|
-
paymentPlugins:
|
|
27
|
+
paymentPlugins: PaymentPlugin[];
|
|
8
28
|
isFetched: boolean;
|
|
9
29
|
};
|
|
10
30
|
export default usePaymentPlugins;
|
package/package.json
CHANGED