@astral/features 3.92.0 → 3.93.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/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/AutocompleteListItem.d.ts +13 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/AutocompleteListItem.js +24 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/styles.d.ts +684 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/styles.js +52 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/getShortFullName/getShortFullName.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/getShortFullName/getShortFullName.js +12 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/getShortFullName/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/getShortFullName/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/AutocompleteListItem/utils/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/CryptoProCertAutocomplete.d.ts +6 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/CryptoProCertAutocomplete.js +33 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/transformCertificates/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/transformCertificates/index.js +17 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/transformCertificates/transformCertificates.d.ts +12 -0
- package/node/cryproPro/components/CryptoProCertAutocomplete/utils/transformCertificates/transformCertificates.js +22 -0
- package/node/cryproPro/components/CryptoProCertFormAutocomplete/CryptoProCertFormAutocomplete.d.ts +7 -0
- package/node/cryproPro/components/CryptoProCertFormAutocomplete/CryptoProCertFormAutocomplete.js +15 -0
- package/node/cryproPro/components/CryptoProCertFormAutocomplete/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProCertFormAutocomplete/index.js +17 -0
- package/node/cryproPro/components/CryptoProProvider/CryptoProProvider.d.ts +14 -0
- package/node/cryproPro/components/CryptoProProvider/CryptoProProvider.js +17 -0
- package/node/cryproPro/components/CryptoProProvider/index.d.ts +1 -0
- package/node/cryproPro/components/CryptoProProvider/index.js +17 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/CryptoproviderInfo.d.ts +6 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/CryptoproviderInfo.js +29 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/index.d.ts +1 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/index.js +17 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/styles.d.ts +5 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/CryptoproviderInfo/styles.js +15 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/PluginInfo/PluginInfo.d.ts +6 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/PluginInfo/PluginInfo.js +15 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/PluginInfo/index.d.ts +1 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/PluginInfo/index.js +17 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/SetupCryptoProWorkspaceModal.d.ts +8 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/SetupCryptoProWorkspaceModal.js +16 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/index.d.ts +1 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/index.js +17 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/styles.d.ts +9 -0
- package/node/cryproPro/components/SetupCryptoProWorkspaceModal/styles.js +21 -0
- package/node/cryproPro/components/index.d.ts +4 -0
- package/node/cryproPro/components/index.js +20 -0
- package/node/cryproPro/constants/enums.d.ts +5 -0
- package/node/cryproPro/constants/enums.js +9 -0
- package/node/cryproPro/constants/error.d.ts +3 -0
- package/node/cryproPro/constants/error.js +6 -0
- package/node/cryproPro/constants/index.d.ts +2 -0
- package/node/cryproPro/constants/index.js +18 -0
- package/node/cryproPro/index.d.ts +3 -0
- package/node/cryproPro/index.js +12 -0
- package/node/cryproPro/services/CryptoProCertificateService/CryptoProCertificateService.d.ts +30 -0
- package/node/cryproPro/services/CryptoProCertificateService/CryptoProCertificateService.js +61 -0
- package/node/cryproPro/services/CryptoProCertificateService/index.d.ts +2 -0
- package/node/cryproPro/services/CryptoProCertificateService/index.js +18 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/convertBase64toBlob/convertBase64toBlob.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/convertBase64toBlob/convertBase64toBlob.js +7 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/convertBase64toBlob/index.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/convertBase64toBlob/index.js +17 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateExpiresDate/getCertificateExpiresDate.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateExpiresDate/getCertificateExpiresDate.js +10 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateExpiresDate/index.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateExpiresDate/index.js +17 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateOwnerShortName/getCertificateOwnerShortName.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateOwnerShortName/getCertificateOwnerShortName.js +15 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateOwnerShortName/index.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateOwnerShortName/index.js +17 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateType/getCertificateType.d.ts +2 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateType/getCertificateType.js +16 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateType/index.d.ts +1 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/getCertificateType/index.js +17 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/index.d.ts +4 -0
- package/node/cryproPro/services/CryptoProCertificateService/utils/index.js +20 -0
- package/node/cryproPro/services/CryptoProSignService/CryptoProSignService.d.ts +33 -0
- package/node/cryproPro/services/CryptoProSignService/CryptoProSignService.js +56 -0
- package/node/cryproPro/services/CryptoProSignService/index.d.ts +1 -0
- package/node/cryproPro/services/CryptoProSignService/index.js +17 -0
- package/node/cryproPro/services/WorkspaceSetupService/WorkspaceSetupService.d.ts +42 -0
- package/node/cryproPro/services/WorkspaceSetupService/WorkspaceSetupService.js +98 -0
- package/node/cryproPro/services/WorkspaceSetupService/index.d.ts +1 -0
- package/node/cryproPro/services/WorkspaceSetupService/index.js +17 -0
- package/node/cryproPro/services/index.d.ts +3 -0
- package/node/cryproPro/services/index.js +19 -0
- package/node/cryproPro/stores/CryptoProStore/CryptoProStore.d.ts +89 -0
- package/node/cryproPro/stores/CryptoProStore/CryptoProStore.js +139 -0
- package/node/cryproPro/stores/CryptoProStore/index.d.ts +1 -0
- package/node/cryproPro/stores/CryptoProStore/index.js +17 -0
- package/node/cryproPro/stores/index.d.ts +1 -0
- package/node/cryproPro/stores/index.js +17 -0
- package/node/cryproPro/types.d.ts +1 -0
- package/node/cryproPro/types.js +5 -0
- package/node/index.d.ts +2 -0
- package/node/index.js +21 -0
- package/node/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.d.ts +12 -0
- package/node/productSwitcher/components/AstralProductSwitcher/AstralProductSwitcher.js +29 -0
- package/node/productSwitcher/components/AstralProductSwitcher/index.d.ts +1 -0
- package/node/productSwitcher/components/AstralProductSwitcher/index.js +17 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/IdentityProductSwitcher.d.ts +8 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/IdentityProductSwitcher.js +20 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/index.d.ts +1 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/index.js +5 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/useLogic/index.d.ts +1 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/useLogic/index.js +17 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/useLogic/useLogic.d.ts +12 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/hooks/useLogic/useLogic.js +67 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/index.d.ts +1 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/index.js +17 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/styles.d.ts +22 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/styles.js +45 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/getIdentityTenants.d.ts +6 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/getIdentityTenants.js +25 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/index.d.ts +1 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/index.js +17 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/getTenantsProducts.d.ts +7 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/getTenantsProducts.js +28 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/index.d.ts +1 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/index.js +17 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/index.d.ts +2 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/utils/index.js +18 -0
- package/node/productSwitcher/components/index.d.ts +2 -0
- package/node/productSwitcher/components/index.js +18 -0
- package/node/productSwitcher/index.d.ts +1 -0
- package/node/productSwitcher/index.js +6 -0
- package/node/productSwitcher/types.d.ts +54 -0
- package/node/productSwitcher/types.js +2 -0
- package/node/productSwitcher/utils/formatIdentityProducts/formatIdentityProducts.d.ts +8 -0
- package/node/productSwitcher/utils/formatIdentityProducts/formatIdentityProducts.js +18 -0
- package/node/productSwitcher/utils/formatIdentityProducts/index.d.ts +1 -0
- package/node/productSwitcher/utils/formatIdentityProducts/index.js +17 -0
- package/node/productSwitcher/utils/getIdentityProducts/getIdentityProducts.d.ts +6 -0
- package/node/productSwitcher/utils/getIdentityProducts/getIdentityProducts.js +31 -0
- package/node/productSwitcher/utils/getIdentityProducts/index.d.ts +1 -0
- package/node/productSwitcher/utils/getIdentityProducts/index.js +17 -0
- package/node/productSwitcher/utils/index.d.ts +2 -0
- package/node/productSwitcher/utils/index.js +18 -0
- package/package.json +8 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantToggleButton = exports.TenantsToggleButtonGroup = exports.ErrorContainer = exports.Logo = exports.StyledMenuItem = exports.StyledMenu = void 0;
|
|
4
|
+
const ui_1 = require("@astral/ui");
|
|
5
|
+
exports.StyledMenu = (0, ui_1.styled)(ui_1.Menu) `
|
|
6
|
+
.MuiPaper-root > .MuiList-root {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
|
|
12
|
+
width: 285px;
|
|
13
|
+
min-height: 100px;
|
|
14
|
+
padding: ${({ theme }) => theme.spacing(3, 0)};
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
// as typeof MenuItem необходим для возможности прокинуть component
|
|
18
|
+
// https://github.com/mui/material-ui/issues/15695
|
|
19
|
+
exports.StyledMenuItem = (0, ui_1.styled)(ui_1.MenuItem) `
|
|
20
|
+
padding-left: ${({ theme }) => theme.spacing(6)};
|
|
21
|
+
`;
|
|
22
|
+
exports.Logo = (0, ui_1.styled)('img', {
|
|
23
|
+
shouldForwardProp: (prop) => prop !== 'color',
|
|
24
|
+
}) `
|
|
25
|
+
width: 40px;
|
|
26
|
+
height: 40px;
|
|
27
|
+
margin-right: ${({ theme }) => theme.spacing(4)};
|
|
28
|
+
|
|
29
|
+
background-color: ${({ color }) => color};
|
|
30
|
+
border-radius: ${({ theme }) => theme.shape.small};
|
|
31
|
+
`;
|
|
32
|
+
exports.ErrorContainer = (0, ui_1.styled)(ui_1.LegacyGrid) `
|
|
33
|
+
column-gap: ${({ theme }) => theme.spacing(2)};
|
|
34
|
+
|
|
35
|
+
color: ${({ theme }) => theme.palette.error.dark};
|
|
36
|
+
`;
|
|
37
|
+
exports.TenantsToggleButtonGroup = (0, ui_1.styled)(ui_1.ToggleButtonGroup) `
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding: ${({ theme }) => theme.spacing(1, 4, 4)};
|
|
40
|
+
`;
|
|
41
|
+
exports.TenantToggleButton = (0, ui_1.styled)(ui_1.ToggleButton) `
|
|
42
|
+
flex: 1;
|
|
43
|
+
|
|
44
|
+
text-transform: uppercase;
|
|
45
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getIdentityTenants = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Получение данных из identity
|
|
15
|
+
* @param identityUrl - адрес identity
|
|
16
|
+
*/
|
|
17
|
+
const getIdentityTenants = (identityUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
return fetch(`${identityUrl}/api/tenants/widget`).then((response) => {
|
|
19
|
+
if (!response.ok) {
|
|
20
|
+
throw new Error(response.statusText);
|
|
21
|
+
}
|
|
22
|
+
return response.json();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
exports.getIdentityTenants = getIdentityTenants;
|
package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getIdentityTenants';
|
package/node/productSwitcher/components/IdentityProductSwitcher/utils/getIdentityTenants/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getIdentityTenants"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WidgetProduct } from '@astral/ui';
|
|
2
|
+
/**
|
|
3
|
+
* Получение всех продуктов из разных экосистем и группировка в единую мапу
|
|
4
|
+
* @param identityUrl - сслыка на identity
|
|
5
|
+
* @param tenants - список экосистем, чтобы была возможность не все экосистемы показывать в виджете.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getTenantsProducts: (identityUrl: string, tenants: string[]) => Promise<Record<string, WidgetProduct[]>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getTenantsProducts = void 0;
|
|
13
|
+
const utils_1 = require("../../../../utils");
|
|
14
|
+
/**
|
|
15
|
+
* Получение всех продуктов из разных экосистем и группировка в единую мапу
|
|
16
|
+
* @param identityUrl - сслыка на identity
|
|
17
|
+
* @param tenants - список экосистем, чтобы была возможность не все экосистемы показывать в виджете.
|
|
18
|
+
*/
|
|
19
|
+
const getTenantsProducts = (identityUrl, tenants) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const { hostname } = new URL(window.origin);
|
|
21
|
+
const tenantsProducts = tenants.map((tenant) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const products = yield (0, utils_1.getIdentityProducts)(identityUrl, tenant).then((tenantProducts) => tenantProducts.filter((product) => new URL(product.url).hostname !== hostname));
|
|
23
|
+
return [tenant, products];
|
|
24
|
+
}));
|
|
25
|
+
const products = yield Promise.all(tenantsProducts);
|
|
26
|
+
return Object.fromEntries(products);
|
|
27
|
+
});
|
|
28
|
+
exports.getTenantsProducts = getTenantsProducts;
|
package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getTenantsProducts';
|
package/node/productSwitcher/components/IdentityProductSwitcher/utils/getTenantsProducts/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getTenantsProducts"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getTenantsProducts"), exports);
|
|
18
|
+
__exportStar(require("./getIdentityTenants"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AstralProductSwitcher"), exports);
|
|
18
|
+
__exportStar(require("./IdentityProductSwitcher"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AstralProductSwitcher, IdentityProductSwitcher } from './components';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentityProductSwitcher = exports.AstralProductSwitcher = void 0;
|
|
4
|
+
var components_1 = require("./components");
|
|
5
|
+
Object.defineProperty(exports, "AstralProductSwitcher", { enumerable: true, get: function () { return components_1.AstralProductSwitcher; } });
|
|
6
|
+
Object.defineProperty(exports, "IdentityProductSwitcher", { enumerable: true, get: function () { return components_1.IdentityProductSwitcher; } });
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Информация о продукте в identity
|
|
3
|
+
* */
|
|
4
|
+
export type IdentityProductsWidgetDTO = {
|
|
5
|
+
/**
|
|
6
|
+
* ИД продукта
|
|
7
|
+
* */
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Наименование продукта
|
|
11
|
+
* */
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* URL адрес продукта
|
|
15
|
+
* */
|
|
16
|
+
productUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Описание продукта
|
|
19
|
+
* */
|
|
20
|
+
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Короткое описание продукта
|
|
23
|
+
* */
|
|
24
|
+
shortDescription?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Идентификатор иконки продукта
|
|
27
|
+
* */
|
|
28
|
+
iconFileId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Ссылка на логотип продукта
|
|
31
|
+
* */
|
|
32
|
+
logoUrl?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Цвет продукта
|
|
35
|
+
* */
|
|
36
|
+
backgroundHexColor?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Идентификатор экосистемы
|
|
39
|
+
* */
|
|
40
|
+
tenantId?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Описание экосистем
|
|
44
|
+
*/
|
|
45
|
+
export type IdentityTenantsDTO = {
|
|
46
|
+
/**
|
|
47
|
+
* Идентификатор экосистемы
|
|
48
|
+
* */
|
|
49
|
+
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* Наименование экосистемы
|
|
52
|
+
* */
|
|
53
|
+
name: string;
|
|
54
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WidgetProduct } from '@astral/ui';
|
|
2
|
+
import { type IdentityProductsWidgetDTO } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Форматирование данных identity под виджет UIKIT
|
|
5
|
+
* @param identityProducts - список продуктов от identity
|
|
6
|
+
* @param identityUrl - Url адрес identity
|
|
7
|
+
*/
|
|
8
|
+
export declare const formatIdentityProducts: (identityUrl: string, identityProducts?: IdentityProductsWidgetDTO[]) => WidgetProduct[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatIdentityProducts = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Форматирование данных identity под виджет UIKIT
|
|
6
|
+
* @param identityProducts - список продуктов от identity
|
|
7
|
+
* @param identityUrl - Url адрес identity
|
|
8
|
+
*/
|
|
9
|
+
const formatIdentityProducts = (identityUrl, identityProducts = []) => (identityProducts === null || identityProducts === void 0 ? void 0 : identityProducts.map(({ id, productUrl = '', name = '', logoUrl, iconFileId, backgroundHexColor = '', }) => {
|
|
10
|
+
return {
|
|
11
|
+
id: id,
|
|
12
|
+
url: productUrl,
|
|
13
|
+
name: name,
|
|
14
|
+
logoUrl: logoUrl || `${identityUrl}/api/files/${iconFileId}`,
|
|
15
|
+
color: backgroundHexColor,
|
|
16
|
+
};
|
|
17
|
+
})) || [];
|
|
18
|
+
exports.formatIdentityProducts = formatIdentityProducts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './formatIdentityProducts';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./formatIdentityProducts"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Получение данных из identity
|
|
3
|
+
* @param identityUrl - адрес identity
|
|
4
|
+
* @param tenantId - идентификатор экосистемы
|
|
5
|
+
*/
|
|
6
|
+
export declare const getIdentityProducts: (identityUrl: string, tenantId?: string) => Promise<import("@astral/components").WidgetProduct[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getIdentityProducts = void 0;
|
|
13
|
+
const formatIdentityProducts_1 = require("../formatIdentityProducts");
|
|
14
|
+
/**
|
|
15
|
+
* Получение данных из identity
|
|
16
|
+
* @param identityUrl - адрес identity
|
|
17
|
+
* @param tenantId - идентификатор экосистемы
|
|
18
|
+
*/
|
|
19
|
+
const getIdentityProducts = (identityUrl, tenantId = 'astral') => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
return fetch(`${identityUrl}/api/products/widget?tenantId=${tenantId}`)
|
|
21
|
+
.then((response) => {
|
|
22
|
+
if (!response.ok) {
|
|
23
|
+
throw new Error(response.statusText);
|
|
24
|
+
}
|
|
25
|
+
return response.json();
|
|
26
|
+
})
|
|
27
|
+
.then(({ data }) => {
|
|
28
|
+
return (0, formatIdentityProducts_1.formatIdentityProducts)(identityUrl, data);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
exports.getIdentityProducts = getIdentityProducts;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getIdentityProducts';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getIdentityProducts"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getIdentityProducts"), exports);
|
|
18
|
+
__exportStar(require("./formatIdentityProducts"), exports);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/features",
|
|
3
3
|
"browser": "./index.js",
|
|
4
|
-
"main": "./index.js",
|
|
5
|
-
"version": "3.
|
|
4
|
+
"main": "./node/index.js",
|
|
5
|
+
"version": "3.93.1",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@astral/ui": "^3.
|
|
7
|
+
"@astral/ui": "^3.93.1",
|
|
8
8
|
"mobx": "^6.8.0",
|
|
9
9
|
"mobx-react-lite": "^3.4.0",
|
|
10
10
|
"@astral/cryptopro-cades": "^1.5.1"
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"types": "./index.d.ts",
|
|
27
27
|
"module": "./index.js",
|
|
28
28
|
"exports": {
|
|
29
|
-
".":
|
|
29
|
+
".": {
|
|
30
|
+
"vitest": "./node/index.js",
|
|
31
|
+
"module": "./index.js",
|
|
32
|
+
"require": "./node/index.js"
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
35
|
}
|