@controleonline/ui-common 1.2.71 → 1.2.75
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/.github/actions/workers/manager/action.yml +147 -0
- package/.github/actions/workers/qa/action.yml +44 -0
- package/.github/actions/workers/security/action.yml +44 -0
- package/.github/actions/workers/technical-documenter/action.yml +51 -0
- package/.github/workflows/manager-worker.yml +168 -0
- package/.github/workflows/publish-npm.yml +45 -0
- package/.gitmodules +3 -0
- package/AGENTS.md +6 -0
- package/README.md +14 -0
- package/package.json +3 -2
- package/src/api/fetch.js +1 -1
- package/src/api/index.js +92 -22
- package/src/react/components/AddImportModal.js +94 -110
- package/src/react/components/BottomNavigationBar.config.js +211 -231
- package/src/react/components/CategoryForm.js +52 -35
- package/src/react/components/DefaultProvider.native.js +131 -95
- package/src/react/components/DefaultProvider.web.js +148 -74
- package/src/react/components/NetworkPrinterPreviewModal.js +249 -0
- package/src/react/components/NetworkPrinterPreviewModal.styles.js +159 -0
- package/src/react/components/RuntimeInfoFooter.js +100 -36
- package/src/react/components/RuntimeInfoFooter.styles.js +3 -0
- package/src/react/components/UnifiedPaymentBar.js +7 -4
- package/src/react/components/UserAvatar.js +160 -0
- package/src/react/components/integrations/IntegrationHero/index.js +48 -0
- package/src/react/components/integrations/IntegrationHero/styles.js +57 -0
- package/src/react/components/integrations/IntegrationTabs/index.js +89 -0
- package/src/react/components/integrations/IntegrationTabs/styles.js +44 -0
- package/src/react/config/deviceConfigBootstrap.js +5 -3
- package/src/react/pages/Connections.js +229 -0
- package/src/react/pages/Connections.styles.js +222 -0
- package/src/react/pages/DeviceDetailPage.js +2814 -0
- package/src/react/pages/DeviceDetailPage.styles.js +308 -0
- package/src/react/pages/Devices/currentDevice.js +194 -0
- package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +257 -0
- package/src/react/pages/Devices/deviceTypes/all.js +23 -0
- package/src/react/pages/Devices/deviceTypes/device.js +25 -0
- package/src/react/pages/Devices/deviceTypes/deviceListHelpers.js +178 -0
- package/src/react/pages/Devices/deviceTypes/display.js +26 -0
- package/src/react/pages/Devices/deviceTypes/index.js +145 -0
- package/src/react/pages/Devices/deviceTypes/ipCamera.js +35 -0
- package/src/react/pages/Devices/deviceTypes/pdv.js +88 -0
- package/src/react/pages/Devices/deviceTypes/printer.js +37 -0
- package/src/react/pages/Devices/deviceTypes/shared.js +453 -0
- package/src/react/pages/Devices/deviceTypes/useDeviceNetworkConnectivity.js +145 -0
- package/src/react/pages/Devices.js +183 -0
- package/src/react/pages/Devices.styles.js +353 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99ProductCard.js +1 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +181 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -0
- package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -0
- package/src/react/pages/Food99IntegrationPage/index.js +1530 -0
- package/src/react/pages/Food99IntegrationPage/styles.js +792 -0
- package/src/react/pages/Food99IntegrationPage/utils.js +155 -0
- package/src/react/pages/Food99IntegrationPage.js +1 -0
- package/src/react/pages/Food99IntegrationPage.styles.js +1 -0
- package/src/react/pages/GenericLogPage.js +42 -167
- package/src/react/pages/IFoodIntegrationPage/components/IFoodCatalogTab.js +8 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +420 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +103 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodProductCard.js +1 -0
- package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -0
- package/src/react/pages/IFoodIntegrationPage/index.js +1298 -0
- package/src/react/pages/IFoodIntegrationPage/styles.js +764 -0
- package/src/react/pages/IFoodIntegrationPage/utils.js +91 -0
- package/src/react/pages/IFoodIntegrationPage.js +1 -0
- package/src/react/pages/IFoodIntegrationPage.styles.js +1 -0
- package/src/react/pages/Imports.js +214 -166
- package/src/react/pages/IntegrationConfigPage.js +744 -0
- package/src/react/pages/IntegrationConfigPage.styles.js +269 -0
- package/src/react/pages/Integrations.js +299 -0
- package/src/react/pages/Integrations.styles.js +130 -0
- package/src/react/pages/ManagerOrderNotificationsPage.js +642 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -0
- package/src/react/pages/MarketplaceIntegrationPage/components/RemoteMarketplaceMenuTab.js +335 -0
- package/src/react/pages/MarketplaceIntegrationPage/index.js +60 -0
- package/src/react/pages/MarketplaceIntegrationPage/utils.js +137 -0
- package/src/react/pages/MercadoLivreIntegrationPage.js +538 -0
- package/src/react/pages/PrinterDeviceDetailPage.js +1916 -0
- package/src/react/pages/PrinterDeviceDetailPage.styles.js +223 -0
- package/src/react/pages/PrinterDeviceFormPage.js +521 -0
- package/src/react/pages/PrinterDeviceFormPage.styles.js +159 -0
- package/src/react/pages/WhatsAppConnectionPage.js +459 -0
- package/src/react/pages/WhatsAppConnectionPage.styles.js +284 -0
- package/src/react/pages/integrationsCatalog.js +399 -0
- package/src/react/services/Cielo/Cielo.js +193 -193
- package/src/react/utils/categoryContexts.js +46 -0
- package/src/react/utils/entityDisplay.js +222 -217
- package/src/react/utils/fileUrl.js +39 -20
- package/src/react/utils/integrationPage.js +16 -0
- package/src/react/utils/runtimeFooter.js +40 -22
- package/src/react/utils/runtimeLanguage.js +50 -9
- package/src/react/utils/runtimeMenu.js +191 -131
- package/src/react/utils/runtimeZoom.js +43 -0
- package/src/react/utils/shopConfig.js +27 -15
- package/src/react/utils/shopFranchises.js +126 -1
- package/src/react/utils/storeColumns.js +23 -4
- package/src/react/utils/userAvatar.js +104 -0
- package/src/store/categories/index.js +48 -20
- package/src/store/device_config/index.js +62 -21
- package/src/store/entity_log/index.js +22 -1
- package/src/store/imports/customActions.js +51 -0
- package/src/store/imports/index.js +89 -88
- package/src/store/status/index.js +11 -11
- package/src/store/themes/index.js +22 -0
- package/src/store/timezones/index.js +3 -1
- package/src/tests/browser/manager/connections.spec.js +143 -0
- package/src/tests/browser/manager/devices-current.spec.js +343 -0
- package/src/tests/browser/manager/mercado-livre-integration.spec.js +268 -0
- package/src/tests/react/api/deviceHeaders.test.js +114 -0
- package/src/tests/react/components/AddImportModal.test.js +166 -0
- package/src/tests/react/components/BottomNavigationBar.config.test.js +20 -0
- package/src/tests/react/components/UserAvatar.test.js +52 -0
- package/src/tests/react/pages/DevicePickerStyles.test.js +47 -0
- package/src/tests/react/pages/Devices/deviceListHelpers.test.js +39 -0
- package/src/tests/react/pages/DevicesCurrentDevice.test.js +198 -0
- package/src/tests/react/pages/connectionsHelpers.test.js +34 -0
- package/src/tests/react/pages/mercadoLivreIntegrationPageContract.test.mjs +16 -0
- package/src/tests/react/services/Cielo.test.js +190 -190
- package/src/tests/react/store/categoriesOrdering.test.js +26 -0
- package/src/tests/react/utils/appDomain.test.js +62 -0
- package/src/tests/react/utils/entityDisplay.test.js +2 -2
- package/src/tests/react/utils/fileUrl.test.js +3 -3
- package/src/tests/react/utils/formatter.test.mjs +33 -0
- package/src/tests/react/utils/runtimeFooter.test.js +29 -4
- package/src/tests/react/utils/runtimeLanguage.test.js +79 -9
- package/src/tests/react/utils/runtimeMenu.test.js +198 -134
- package/src/tests/react/utils/runtimeZoom.test.js +38 -0
- package/src/tests/react/utils/shopConfig.test.js +10 -9
- package/src/tests/react/utils/shopFranchises.test.js +43 -0
- package/src/tests/react/utils/translate.discovery.test.mjs +170 -0
- package/src/tests/react/utils/translate.test.helpers.mjs +152 -0
- package/src/tests/react/utils/translate.test.mjs +141 -349
- package/src/tests/react/utils/userAvatar.test.js +63 -0
- package/src/utils/appDomain.js +15 -4
- package/src/utils/formatter.js +104 -16
- package/src/utils/integrationConfigs.js +80 -80
- package/src/utils/translate.js +222 -438
- package/src/utils/translateDiscovery.js +96 -0
- package/src/utils/translateNormalize.js +33 -0
- package/src/utils/translatePending.js +92 -0
- package/src/utils/translateStorage.js +142 -0
- package/.github/agents/developer.agent.md +0 -30
- package/.github/agents/devops.agent.md +0 -30
- package/.github/agents/qa.agent.md +0 -30
- package/.github/agents/security.agent.md +0 -30
- package/.github/workflows/npmjs.yml +0 -35
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export async function discoveryAll(translate, options = {}) {
|
|
2
|
+
const stores = translate.getStoreList();
|
|
3
|
+
for (const store of stores) {
|
|
4
|
+
await translate.discoveryStoreTranslate(store, options);
|
|
5
|
+
}
|
|
6
|
+
return translate.translates;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export async function discoveryStoreTranslate(translate, store, options = {}) {
|
|
10
|
+
if (!store || !translate.canDiscoverStore()) {
|
|
11
|
+
return translate.translates;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const companies = translate.getResolveCompaniesToCache();
|
|
15
|
+
if (companies.length === 0) {
|
|
16
|
+
return translate.translates;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let hasChanges = false;
|
|
20
|
+
const force = options.force === true;
|
|
21
|
+
|
|
22
|
+
for (const company of companies) {
|
|
23
|
+
const changed = await translate.fetchTranslates(store, company, {
|
|
24
|
+
...options,
|
|
25
|
+
force,
|
|
26
|
+
clearPending: false,
|
|
27
|
+
});
|
|
28
|
+
hasChanges = changed || hasChanges;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const requests = translate.getQueuedTranslateGroupsForStore(store);
|
|
32
|
+
if (requests.length > 0) {
|
|
33
|
+
requests.forEach((request) => {
|
|
34
|
+
(request.keys || []).forEach((key) => {
|
|
35
|
+
translate.removePendingTranslate(request.store, request.type, key);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (translate.hasCachedBootstrapStore(store)) {
|
|
41
|
+
translate.markStoreDiscovered(store);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (hasChanges) {
|
|
45
|
+
translate.persist();
|
|
46
|
+
translate.notifyTranslationsUpdated();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return translate.translates;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export async function fetchTranslates(translate, store, company, options = {}) {
|
|
53
|
+
if (!company?.id) return false;
|
|
54
|
+
|
|
55
|
+
const force = options.force === true;
|
|
56
|
+
if (!translate.shouldFetchStoreForCompany(store, company, force)) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return translate.resolveStoreTranslates(store, company, options);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export async function resolveStoreTranslates(translate, store, company, options = {}) {
|
|
64
|
+
const companyId = translate.normalizeId(company?.id);
|
|
65
|
+
if (!companyId) return false;
|
|
66
|
+
|
|
67
|
+
const requests = Array.isArray(options.requests)
|
|
68
|
+
? options.requests
|
|
69
|
+
: translate.getQueuedTranslateGroupsForStore(store);
|
|
70
|
+
if (requests.length === 0) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const response = await translate.translateActions.resolveQueuedMessages({
|
|
75
|
+
people: "/people/" + companyId,
|
|
76
|
+
language: translate.language,
|
|
77
|
+
requests,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const resolvedItems = Array.isArray(response)
|
|
81
|
+
? response
|
|
82
|
+
: response?.member || response?.["hydra:member"] || [];
|
|
83
|
+
|
|
84
|
+
let changed = false;
|
|
85
|
+
const clearPending = options.clearPending !== false;
|
|
86
|
+
resolvedItems.forEach((item) => {
|
|
87
|
+
changed =
|
|
88
|
+
translate.cacheTranslateRecord(item, companyId, translate.language) ||
|
|
89
|
+
changed;
|
|
90
|
+
if (clearPending) {
|
|
91
|
+
translate.removePendingTranslate(item.store, item.type, item.key);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return changed;
|
|
96
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function normalizeId(value) {
|
|
2
|
+
if (value == null) return null;
|
|
3
|
+
|
|
4
|
+
const match = String(value).match(/\d+/);
|
|
5
|
+
return match?.[0] || null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function normalizeLanguageCode(value) {
|
|
9
|
+
if (typeof value !== "string") return "";
|
|
10
|
+
return value.trim().replace(/_/g, "-").toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function formatMessage(key) {
|
|
14
|
+
if (!key) return "";
|
|
15
|
+
|
|
16
|
+
return key
|
|
17
|
+
.replace(/([a-z])([A-Z])/g, "$1_$2")
|
|
18
|
+
.replace(/_/g, " ")
|
|
19
|
+
.replace(/-/g, " ")
|
|
20
|
+
.replace(/^\w/, (c) => c.toUpperCase());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function resolveReferenceId(value) {
|
|
24
|
+
if (value == null) return null;
|
|
25
|
+
if (typeof value === "object") {
|
|
26
|
+
return normalizeId(value.id ?? value["@id"] ?? value.iri);
|
|
27
|
+
}
|
|
28
|
+
return normalizeId(value);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function isNonEmptyMessage(value) {
|
|
32
|
+
return value != null && String(value).trim() !== "";
|
|
33
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {normalizeId} from "./translateNormalize.js";
|
|
2
|
+
|
|
3
|
+
export function getPendingMessages(translateStore) {
|
|
4
|
+
const messages = translateStore?.getters?.pendingMessages;
|
|
5
|
+
if (!messages || typeof messages !== "object" || Array.isArray(messages)) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
return messages;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getPendingLanguageBucket(translateStore, language) {
|
|
12
|
+
const pending = getPendingMessages(translateStore);
|
|
13
|
+
const normalizedLanguage = String(language || "").trim().toLowerCase();
|
|
14
|
+
if (!normalizedLanguage) return null;
|
|
15
|
+
return pending?.[normalizedLanguage] || null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getPendingCompanyBucket(translateStore, companyId, language) {
|
|
19
|
+
const normalizedCompanyId = normalizeId(companyId);
|
|
20
|
+
if (!normalizedCompanyId) return null;
|
|
21
|
+
|
|
22
|
+
const languageBucket = getPendingLanguageBucket(translateStore, language);
|
|
23
|
+
return languageBucket?.companies?.[normalizedCompanyId] || null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getPendingStoreBucket(translateStore, companyId, store, language) {
|
|
27
|
+
if (!store) return null;
|
|
28
|
+
|
|
29
|
+
const companyBucket = getPendingCompanyBucket(
|
|
30
|
+
translateStore,
|
|
31
|
+
companyId,
|
|
32
|
+
language,
|
|
33
|
+
);
|
|
34
|
+
if (!companyBucket) return null;
|
|
35
|
+
|
|
36
|
+
return companyBucket[store] || null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function hasPendingTranslate(
|
|
40
|
+
translateStore,
|
|
41
|
+
defaultCompanyId,
|
|
42
|
+
store,
|
|
43
|
+
type,
|
|
44
|
+
key,
|
|
45
|
+
language,
|
|
46
|
+
) {
|
|
47
|
+
const storeBucket = getPendingStoreBucket(
|
|
48
|
+
translateStore,
|
|
49
|
+
defaultCompanyId,
|
|
50
|
+
store,
|
|
51
|
+
language,
|
|
52
|
+
);
|
|
53
|
+
return Boolean(storeBucket?.[type]?.[key]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function getQueuedTranslateGroups(translateStore, defaultCompanyId, language) {
|
|
57
|
+
const companyBucket = getPendingCompanyBucket(
|
|
58
|
+
translateStore,
|
|
59
|
+
defaultCompanyId,
|
|
60
|
+
language,
|
|
61
|
+
);
|
|
62
|
+
if (!companyBucket) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const groups = [];
|
|
67
|
+
Object.entries(companyBucket).forEach(([store, storeBucket]) => {
|
|
68
|
+
if (!storeBucket || typeof storeBucket !== "object") return;
|
|
69
|
+
|
|
70
|
+
Object.entries(storeBucket).forEach(([type, keys]) => {
|
|
71
|
+
if (!keys || typeof keys !== "object") return;
|
|
72
|
+
const keyList = Object.keys(keys).filter(Boolean);
|
|
73
|
+
if (keyList.length === 0) return;
|
|
74
|
+
groups.push({store, type, keys: keyList});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return groups;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function getQueuedTranslateGroupsForStore(
|
|
82
|
+
translateStore,
|
|
83
|
+
defaultCompanyId,
|
|
84
|
+
store,
|
|
85
|
+
language,
|
|
86
|
+
) {
|
|
87
|
+
return getQueuedTranslateGroups(
|
|
88
|
+
translateStore,
|
|
89
|
+
defaultCompanyId,
|
|
90
|
+
language,
|
|
91
|
+
).filter((group) => group.store === store);
|
|
92
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {normalizeId, normalizeLanguageCode} from "./translateNormalize.js";
|
|
2
|
+
|
|
3
|
+
export const TRANSLATES_STORAGE_KEY = "translates";
|
|
4
|
+
|
|
5
|
+
export function loadStorageObject(key) {
|
|
6
|
+
if (typeof localStorage === "undefined") {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const value = localStorage.getItem(key);
|
|
12
|
+
if (!value) return {};
|
|
13
|
+
|
|
14
|
+
const parsed = JSON.parse(value);
|
|
15
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
16
|
+
} catch {
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getLanguageBucket(translates, language, createIfMissing = false) {
|
|
22
|
+
const normalizedLanguage = normalizeLanguageCode(language);
|
|
23
|
+
if (!normalizedLanguage) return null;
|
|
24
|
+
|
|
25
|
+
if (!translates[normalizedLanguage] && createIfMissing) {
|
|
26
|
+
translates[normalizedLanguage] = {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return translates[normalizedLanguage] || null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getCompanyBucket(
|
|
33
|
+
translates,
|
|
34
|
+
companyId,
|
|
35
|
+
createIfMissing = false,
|
|
36
|
+
language,
|
|
37
|
+
) {
|
|
38
|
+
const normalizedCompanyId = normalizeId(companyId);
|
|
39
|
+
if (!normalizedCompanyId) return null;
|
|
40
|
+
|
|
41
|
+
const languageBucket = getLanguageBucket(translates, language, createIfMissing);
|
|
42
|
+
if (!languageBucket) return null;
|
|
43
|
+
|
|
44
|
+
if (!languageBucket.companies && createIfMissing) {
|
|
45
|
+
languageBucket.companies = {};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (
|
|
49
|
+
createIfMissing &&
|
|
50
|
+
languageBucket.companies &&
|
|
51
|
+
!languageBucket.companies[normalizedCompanyId]
|
|
52
|
+
) {
|
|
53
|
+
languageBucket.companies[normalizedCompanyId] = {};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return languageBucket.companies?.[normalizedCompanyId] || null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getStoreBucket(
|
|
60
|
+
translates,
|
|
61
|
+
companyId,
|
|
62
|
+
store,
|
|
63
|
+
createIfMissing = false,
|
|
64
|
+
language,
|
|
65
|
+
) {
|
|
66
|
+
if (!store) return null;
|
|
67
|
+
|
|
68
|
+
if (companyId) {
|
|
69
|
+
const companyBucket = getCompanyBucket(
|
|
70
|
+
translates,
|
|
71
|
+
companyId,
|
|
72
|
+
createIfMissing,
|
|
73
|
+
language,
|
|
74
|
+
);
|
|
75
|
+
if (!companyBucket) return null;
|
|
76
|
+
|
|
77
|
+
if (createIfMissing && !companyBucket[store]) {
|
|
78
|
+
companyBucket[store] = {};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return companyBucket[store] || null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const languageBucket = getLanguageBucket(translates, language, createIfMissing);
|
|
85
|
+
if (!languageBucket) return null;
|
|
86
|
+
|
|
87
|
+
if (createIfMissing && !languageBucket[store]) {
|
|
88
|
+
languageBucket[store] = {};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return languageBucket[store] || null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function collectCompaniesToCache(defaultCompany, currentCompany) {
|
|
95
|
+
const candidates = [defaultCompany, currentCompany].filter(
|
|
96
|
+
(company) => company?.id,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const unique = [];
|
|
100
|
+
const seen = new Set();
|
|
101
|
+
|
|
102
|
+
candidates.forEach((company) => {
|
|
103
|
+
const companyId = normalizeId(company.id);
|
|
104
|
+
if (!companyId || seen.has(companyId)) return;
|
|
105
|
+
|
|
106
|
+
seen.add(companyId);
|
|
107
|
+
unique.push(company);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
return unique;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function writeMessageToBucket(
|
|
114
|
+
translates,
|
|
115
|
+
store,
|
|
116
|
+
type,
|
|
117
|
+
key,
|
|
118
|
+
message,
|
|
119
|
+
companyId = null,
|
|
120
|
+
language,
|
|
121
|
+
) {
|
|
122
|
+
const storeBucket = getStoreBucket(
|
|
123
|
+
translates,
|
|
124
|
+
companyId,
|
|
125
|
+
store,
|
|
126
|
+
true,
|
|
127
|
+
language,
|
|
128
|
+
);
|
|
129
|
+
if (!storeBucket) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (!storeBucket[type]) {
|
|
134
|
+
storeBucket[type] = {};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (message !== null) {
|
|
138
|
+
storeBucket[type][key] = message;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return storeBucket[type][key];
|
|
142
|
+
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Developer
|
|
3
|
-
description: Executor autônomo de issues do repositório ControleOnline/ui-common, com fonte canônica centralizada no cto-mcp.
|
|
4
|
-
target: github-copilot
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Fonte canônica
|
|
8
|
-
|
|
9
|
-
Este wrapper é intencionalmente fino. Antes de agir, leia e siga, nesta ordem:
|
|
10
|
-
|
|
11
|
-
1. `https://github.com/ControleOnline/cto-mcp/blob/master/agents/agent/developer/agent.md`
|
|
12
|
-
|
|
13
|
-
Esse arquivo central referencia as regras-base de `automation/` no `cto-mcp`. Se este wrapper local divergir do conteúdo canônico do `cto-mcp`, prefira o `cto-mcp`, salvo quando o estado real deste repositório exigir adaptação operacional explícita.
|
|
14
|
-
|
|
15
|
-
## Contexto local
|
|
16
|
-
|
|
17
|
-
Você está operando no repositório `ControleOnline/ui-common`.
|
|
18
|
-
|
|
19
|
-
Você conhece o ecossistema completo da ControleOnline. Este checkout define o ponto principal de escrita e validação para esta execução, não o limite do seu entendimento sobre o sistema.
|
|
20
|
-
|
|
21
|
-
- Checkout local: `app-community/modules/controleonline/ui-common`
|
|
22
|
-
- Tipo: submódulo de app-community
|
|
23
|
-
- Família: frontend
|
|
24
|
-
- Branch base operacional: `master`
|
|
25
|
-
- Alvo preferencial de PR: `dev`
|
|
26
|
-
- `AGENTS.md` local: presente
|
|
27
|
-
|
|
28
|
-
Leia o `AGENTS.md` mais próximo antes de editar código. Se esta alteração tocar apenas o repositório atual, trabalhe aqui; se também exigir atualização do superprojeto que consome este repositório, registre ou entregue a composição necessária sem perder a separação de ownership.
|
|
29
|
-
|
|
30
|
-
_Arquivo gerado por `cto-mcp/scripts/sync-copilot-agents.mjs`._
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: DevOps
|
|
3
|
-
description: Operador de fluxo e automações do repositório ControleOnline/ui-common, com fonte canônica centralizada no cto-mcp.
|
|
4
|
-
target: github-copilot
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Fonte canônica
|
|
8
|
-
|
|
9
|
-
Este wrapper é intencionalmente fino. Antes de agir, leia e siga, nesta ordem:
|
|
10
|
-
|
|
11
|
-
1. `https://github.com/ControleOnline/cto-mcp/blob/master/agents/agent/devops/agent.md`
|
|
12
|
-
|
|
13
|
-
Esse arquivo central referencia as regras-base de `automation/` no `cto-mcp`. Se este wrapper local divergir do conteúdo canônico do `cto-mcp`, prefira o `cto-mcp`, salvo quando o estado real deste repositório exigir adaptação operacional explícita.
|
|
14
|
-
|
|
15
|
-
## Contexto local
|
|
16
|
-
|
|
17
|
-
Você está operando no repositório `ControleOnline/ui-common`.
|
|
18
|
-
|
|
19
|
-
Você conhece o ecossistema completo da ControleOnline. Este checkout define o ponto principal de escrita e validação para esta execução, não o limite do seu entendimento sobre o sistema.
|
|
20
|
-
|
|
21
|
-
- Checkout local: `app-community/modules/controleonline/ui-common`
|
|
22
|
-
- Tipo: submódulo de app-community
|
|
23
|
-
- Família: frontend
|
|
24
|
-
- Branch base operacional: `master`
|
|
25
|
-
- Alvo preferencial de PR: `dev`
|
|
26
|
-
- `AGENTS.md` local: presente
|
|
27
|
-
|
|
28
|
-
Leia o `AGENTS.md` mais próximo antes de editar código. Se esta alteração tocar apenas o repositório atual, trabalhe aqui; se também exigir atualização do superprojeto que consome este repositório, registre ou entregue a composição necessária sem perder a separação de ownership.
|
|
29
|
-
|
|
30
|
-
_Arquivo gerado por `cto-mcp/scripts/sync-copilot-agents.mjs`._
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Quality Assurance
|
|
3
|
-
description: Revisor técnico de entregas do repositório ControleOnline/ui-common, com fonte canônica centralizada no cto-mcp.
|
|
4
|
-
target: github-copilot
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Fonte canônica
|
|
8
|
-
|
|
9
|
-
Este wrapper é intencionalmente fino. Antes de agir, leia e siga, nesta ordem:
|
|
10
|
-
|
|
11
|
-
1. `https://github.com/ControleOnline/cto-mcp/blob/master/agents/agent/qa/agent.md`
|
|
12
|
-
|
|
13
|
-
Esse arquivo central referencia as regras-base de `automation/` no `cto-mcp`. Se este wrapper local divergir do conteúdo canônico do `cto-mcp`, prefira o `cto-mcp`, salvo quando o estado real deste repositório exigir adaptação operacional explícita.
|
|
14
|
-
|
|
15
|
-
## Contexto local
|
|
16
|
-
|
|
17
|
-
Você está operando no repositório `ControleOnline/ui-common`.
|
|
18
|
-
|
|
19
|
-
Você conhece o ecossistema completo da ControleOnline. Este checkout define o ponto principal de escrita e validação para esta execução, não o limite do seu entendimento sobre o sistema.
|
|
20
|
-
|
|
21
|
-
- Checkout local: `app-community/modules/controleonline/ui-common`
|
|
22
|
-
- Tipo: submódulo de app-community
|
|
23
|
-
- Família: frontend
|
|
24
|
-
- Branch base operacional: `master`
|
|
25
|
-
- Alvo preferencial de PR: `dev`
|
|
26
|
-
- `AGENTS.md` local: presente
|
|
27
|
-
|
|
28
|
-
Leia o `AGENTS.md` mais próximo antes de editar código. Se esta alteração tocar apenas o repositório atual, trabalhe aqui; se também exigir atualização do superprojeto que consome este repositório, registre ou entregue a composição necessária sem perder a separação de ownership.
|
|
29
|
-
|
|
30
|
-
_Arquivo gerado por `cto-mcp/scripts/sync-copilot-agents.mjs`._
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Security
|
|
3
|
-
description: Revisor de segurança do repositório ControleOnline/ui-common, com fonte canônica centralizada no cto-mcp.
|
|
4
|
-
target: github-copilot
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Fonte canônica
|
|
8
|
-
|
|
9
|
-
Este wrapper é intencionalmente fino. Antes de agir, leia e siga, nesta ordem:
|
|
10
|
-
|
|
11
|
-
1. `https://github.com/ControleOnline/cto-mcp/blob/master/agents/agent/security/agent.md`
|
|
12
|
-
|
|
13
|
-
Esse arquivo central referencia as regras-base de `automation/` no `cto-mcp`. Se este wrapper local divergir do conteúdo canônico do `cto-mcp`, prefira o `cto-mcp`, salvo quando o estado real deste repositório exigir adaptação operacional explícita.
|
|
14
|
-
|
|
15
|
-
## Contexto local
|
|
16
|
-
|
|
17
|
-
Você está operando no repositório `ControleOnline/ui-common`.
|
|
18
|
-
|
|
19
|
-
Você conhece o ecossistema completo da ControleOnline. Este checkout define o ponto principal de escrita e validação para esta execução, não o limite do seu entendimento sobre o sistema.
|
|
20
|
-
|
|
21
|
-
- Checkout local: `app-community/modules/controleonline/ui-common`
|
|
22
|
-
- Tipo: submódulo de app-community
|
|
23
|
-
- Família: frontend
|
|
24
|
-
- Branch base operacional: `master`
|
|
25
|
-
- Alvo preferencial de PR: `dev`
|
|
26
|
-
- `AGENTS.md` local: presente
|
|
27
|
-
|
|
28
|
-
Leia o `AGENTS.md` mais próximo antes de editar código. Se esta alteração tocar apenas o repositório atual, trabalhe aqui; se também exigir atualização do superprojeto que consome este repositório, registre ou entregue a composição necessária sem perder a separação de ownership.
|
|
29
|
-
|
|
30
|
-
_Arquivo gerado por `cto-mcp/scripts/sync-copilot-agents.mjs`._
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
name: Publish Package to npmjs
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
permissions:
|
|
12
|
-
contents: read
|
|
13
|
-
id-token: write
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v5
|
|
16
|
-
with:
|
|
17
|
-
fetch-depth: 2
|
|
18
|
-
|
|
19
|
-
- uses: actions/setup-node@v4
|
|
20
|
-
with:
|
|
21
|
-
node-version: '20.x'
|
|
22
|
-
registry-url: 'https://registry.npmjs.org'
|
|
23
|
-
scope: '@controleonline'
|
|
24
|
-
|
|
25
|
-
- run: npm install
|
|
26
|
-
- run: npm whoami || true
|
|
27
|
-
- run: |
|
|
28
|
-
rm -f ~/.npmrc
|
|
29
|
-
rm -f .npmrc
|
|
30
|
-
- run: |
|
|
31
|
-
CURRENT=$(node -p "require('./package.json').version")
|
|
32
|
-
PREVIOUS=$(git show HEAD~1:package.json | node -p "JSON.parse(require('fs').readFileSync(0)).version")
|
|
33
|
-
[ "$CURRENT" = "$PREVIOUS" ] && exit 0 || true
|
|
34
|
-
|
|
35
|
-
- run: npm publish --provenance --access public
|