@sincpro/mobile 0.4.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/README.md +3 -3
  2. package/dist/adapters/JsonSerializer.adapter.d.ts +1 -1
  3. package/dist/adapters/JsonSerializer.adapter.js +2 -2
  4. package/dist/adapters/repositories/database_table.repository.d.ts +3 -2
  5. package/dist/adapters/repositories/database_table.repository.js +1 -1
  6. package/dist/adapters/repositories/document.repository.d.ts +81 -0
  7. package/dist/adapters/repositories/document.repository.js +653 -0
  8. package/dist/adapters/repositories/domain_event.repository.d.ts +17 -17
  9. package/dist/adapters/repositories/domain_event.repository.js +25 -31
  10. package/dist/adapters/repositories/domain_event_dead_letter.repository.d.ts +10 -10
  11. package/dist/adapters/repositories/domain_event_dead_letter.repository.js +14 -13
  12. package/dist/adapters/repositories/event_row.d.ts +13 -0
  13. package/dist/adapters/repositories/event_row.js +22 -0
  14. package/dist/adapters/repositories/sqlite_document_store.d.ts +33 -0
  15. package/dist/adapters/repositories/sqlite_document_store.js +201 -0
  16. package/dist/domain/connectivity/events.d.ts +5 -5
  17. package/dist/domain/connectivity/events.js +3 -3
  18. package/dist/domain/database/criteria.d.ts +19 -0
  19. package/dist/domain/database/criteria.js +36 -0
  20. package/dist/domain/database/criteria_clock.d.ts +8 -0
  21. package/dist/domain/database/criteria_clock.js +305 -0
  22. package/dist/domain/database/criteria_sql.d.ts +61 -0
  23. package/dist/domain/database/criteria_sql.js +476 -0
  24. package/dist/domain/database/database.d.ts +1 -0
  25. package/dist/domain/database/index.d.ts +3 -1
  26. package/dist/domain/database/index.js +3 -1
  27. package/dist/domain/database/migration_plan.d.ts +14 -0
  28. package/dist/domain/database/migration_plan.js +44 -0
  29. package/dist/domain/entity/change_tracking.d.ts +21 -0
  30. package/dist/domain/entity/change_tracking.js +71 -0
  31. package/dist/domain/entity/checks.d.ts +8 -0
  32. package/dist/domain/entity/checks.js +82 -0
  33. package/dist/domain/entity/entity.d.ts +39 -32
  34. package/dist/domain/entity/entity.js +94 -105
  35. package/dist/domain/entity/entity_collection.d.ts +15 -30
  36. package/dist/domain/entity/entity_collection.js +30 -121
  37. package/dist/domain/entity/index.d.ts +5 -0
  38. package/dist/domain/entity/index.js +5 -0
  39. package/dist/domain/entity/reconcile.d.ts +7 -0
  40. package/dist/domain/entity/reconcile.js +12 -0
  41. package/dist/domain/entity/relations.d.ts +27 -0
  42. package/dist/domain/entity/relations.js +69 -0
  43. package/dist/domain/entity/remote_sync.d.ts +4 -0
  44. package/dist/domain/entity/remote_sync.js +19 -0
  45. package/dist/domain/entity/values.d.ts +6 -0
  46. package/dist/domain/entity/values.js +13 -0
  47. package/dist/domain/events/catalog.d.ts +29 -0
  48. package/dist/domain/{events.js → events/catalog.js} +7 -11
  49. package/dist/domain/events/chain.d.ts +5 -0
  50. package/dist/domain/events/chain.js +6 -0
  51. package/dist/domain/{event_sourcing → events}/domain_event.d.ts +20 -22
  52. package/dist/domain/events/domain_event.js +227 -0
  53. package/dist/domain/events/index.d.ts +8 -0
  54. package/dist/domain/events/index.js +8 -0
  55. package/dist/domain/events/integration_event.d.ts +103 -0
  56. package/dist/domain/events/integration_event.js +72 -0
  57. package/dist/domain/events/label.d.ts +2 -0
  58. package/dist/domain/events/label.js +26 -0
  59. package/dist/domain/index.d.ts +0 -1
  60. package/dist/domain/index.js +0 -1
  61. package/dist/domain/print/events.d.ts +8 -4
  62. package/dist/domain/print/events.js +9 -4
  63. package/dist/domain/repositories/document_store.d.ts +33 -0
  64. package/dist/domain/repositories/document_store.js +5 -0
  65. package/dist/domain/repositories/hooks.d.ts +23 -0
  66. package/dist/domain/repositories/hooks.js +32 -0
  67. package/dist/domain/repositories/index.d.ts +4 -0
  68. package/dist/domain/repositories/index.js +4 -0
  69. package/dist/domain/{database → repositories}/repository.d.ts +9 -3
  70. package/dist/domain/settings.d.ts +4 -1
  71. package/dist/domain/settings.js +3 -0
  72. package/dist/domain/webview/events.d.ts +2 -2
  73. package/dist/domain/webview/events.js +2 -2
  74. package/dist/entrypoints/db/migrations.js +10 -10
  75. package/dist/entrypoints/queue/QueueProcessor.d.ts +1 -1
  76. package/dist/entrypoints/queue/activateDomain.subscriber.d.ts +2 -2
  77. package/dist/entrypoints/queue/activateDomain.subscriber.js +2 -2
  78. package/dist/entrypoints/queue/newAppSettings.handler.d.ts +2 -2
  79. package/dist/entrypoints/queue/newAppSettings.handler.js +1 -1
  80. package/dist/entrypoints/queue/printImage.subscriber.d.ts +1 -1
  81. package/dist/entrypoints/queue/printImage.subscriber.js +2 -2
  82. package/dist/entrypoints/queue/processWebViewMessage.subscriber.d.ts +1 -1
  83. package/dist/entrypoints/queue/processWebViewMessage.subscriber.js +1 -1
  84. package/dist/entrypoints/ui/AppShell.js +2 -2
  85. package/dist/entrypoints/ui/common_provider.d.ts +0 -12
  86. package/dist/entrypoints/ui/common_provider.js +2 -131
  87. package/dist/event_driven/index.d.ts +1 -0
  88. package/dist/event_driven/index.js +1 -0
  89. package/dist/{domain/event_sourcing/event_handler.d.ts → event_driven/subscriber.d.ts} +1 -1
  90. package/dist/exceptions.d.ts +21 -0
  91. package/dist/exceptions.js +30 -0
  92. package/dist/framework/base_module.d.ts +1 -1
  93. package/dist/framework/createApp.d.ts +3 -3
  94. package/dist/framework/domain_module.d.ts +1 -1
  95. package/dist/framework/kernel.d.ts +1 -1
  96. package/dist/framework/kernel.js +17 -8
  97. package/dist/infrastructure/database/connector.d.ts +2 -0
  98. package/dist/infrastructure/database/connector.js +22 -0
  99. package/dist/infrastructure/database/index.d.ts +1 -0
  100. package/dist/infrastructure/database/index.js +1 -0
  101. package/dist/infrastructure/database/schema.d.ts +9 -0
  102. package/dist/infrastructure/database/schema.js +61 -0
  103. package/dist/infrastructure/database/utils.d.ts +2 -0
  104. package/dist/infrastructure/database/utils.js +12 -4
  105. package/dist/infrastructure/event_chain.d.ts +6 -0
  106. package/dist/infrastructure/event_chain.js +25 -0
  107. package/dist/infrastructure/telemetry/tracing/tracing_hooks.js +8 -5
  108. package/dist/infrastructure/ui/UIEventBus.d.ts +3 -1
  109. package/dist/infrastructure/ui/UIEventBus.js +8 -1
  110. package/dist/infrastructure/ui/activity.d.ts +37 -0
  111. package/dist/infrastructure/ui/activity.js +84 -0
  112. package/dist/infrastructure/workers/CronWorker.d.ts +6 -4
  113. package/dist/infrastructure/workers/CronWorker.js +24 -18
  114. package/dist/infrastructure/workers/EventBus.d.ts +9 -5
  115. package/dist/infrastructure/workers/EventBus.js +68 -33
  116. package/dist/services/bluetooth.service.js +16 -14
  117. package/dist/services/dead_letter_queue.service.d.ts +7 -7
  118. package/dist/services/dead_letter_queue.service.js +0 -2
  119. package/dist/services/event.service.d.ts +3 -3
  120. package/dist/services/event.service.js +1 -1
  121. package/dist/services/network.service.d.ts +1 -1
  122. package/dist/services/network.service.js +17 -15
  123. package/dist/services/printer.service.d.ts +1 -1
  124. package/dist/services/printer.service.js +50 -44
  125. package/dist/tools/utils/date.js +4 -3
  126. package/dist/tools/utils/monetary.d.ts +6 -3
  127. package/dist/tools/utils/monetary.js +33 -21
  128. package/dist/tools/utils/serializer.d.ts +1 -1
  129. package/dist/tools/utils/serializer.js +32 -35
  130. package/dist/ui/activity/DeviceNotices.d.ts +1 -0
  131. package/dist/ui/activity/DeviceNotices.js +29 -0
  132. package/dist/ui/activity/ProcessToast.d.ts +2 -0
  133. package/dist/ui/activity/ProcessToast.js +71 -0
  134. package/dist/ui/activity/index.d.ts +4 -0
  135. package/dist/ui/activity/index.js +4 -0
  136. package/dist/ui/activity/useActivity.d.ts +9 -0
  137. package/dist/ui/activity/useActivity.js +48 -0
  138. package/dist/ui/components/molecules/EventTimelineItem.d.ts +2 -2
  139. package/dist/ui/components/molecules/EventTimelineItem.js +1 -1
  140. package/dist/ui/components/molecules/index.d.ts +1 -2
  141. package/dist/ui/components/molecules/index.js +1 -2
  142. package/dist/ui/components/organisms/DeadLetterQueueRow.d.ts +3 -3
  143. package/dist/ui/components/organisms/EventRow.d.ts +3 -3
  144. package/dist/ui/components/organisms/EventRow.js +1 -1
  145. package/dist/ui/screens/dead_letter_queue/dead_letter_queue.context.d.ts +5 -5
  146. package/dist/ui/screens/events/events.context.d.ts +4 -4
  147. package/package.json +13 -8
  148. package/dist/domain/event_sourcing/domain_event.js +0 -164
  149. package/dist/domain/event_sourcing/event.d.ts +0 -25
  150. package/dist/domain/event_sourcing/event.js +0 -25
  151. package/dist/domain/event_sourcing/index.d.ts +0 -2
  152. package/dist/domain/event_sourcing/index.js +0 -2
  153. package/dist/domain/events.d.ts +0 -33
  154. package/dist/infrastructure/ui/ToastHost.d.ts +0 -6
  155. package/dist/infrastructure/ui/ToastHost.js +0 -28
  156. package/dist/infrastructure/ui/events.d.ts +0 -1
  157. package/dist/infrastructure/ui/events.js +0 -1
  158. package/dist/ui/components/molecules/ProcessToast.d.ts +0 -8
  159. package/dist/ui/components/molecules/ProcessToast.js +0 -52
  160. /package/dist/domain/{repositories.d.ts → repositories/catalog.d.ts} +0 -0
  161. /package/dist/domain/{repositories.js → repositories/catalog.js} +0 -0
  162. /package/dist/domain/{database → repositories}/repository.js +0 -0
  163. /package/dist/{domain/event_sourcing/event_handler.js → event_driven/subscriber.js} +0 -0
  164. /package/dist/ui/{components/molecules → activity}/ProcessToastProvider.d.ts +0 -0
  165. /package/dist/ui/{components/molecules → activity}/ProcessToastProvider.js +0 -0
@@ -1,31 +1,43 @@
1
- import { Big } from "big.js";
2
- export function parseToMonetaryNumber(input) {
1
+ import { Decimal } from "@sincpro/client-framework";
2
+ export function toDecimal(input) {
3
3
  if (input == null)
4
- return 0;
5
- const s = String(input).trim();
6
- if (!/[0-9]/.test(s))
7
- return 0;
8
- const cleaned = s.replace(/[^0-9.-]+/g, "");
4
+ return new Decimal(0);
5
+ if (typeof input === "number" && !Number.isFinite(input))
6
+ return new Decimal(0);
7
+ if (typeof input === "string") {
8
+ const text = input.trim();
9
+ if (!/[0-9]/.test(text))
10
+ return new Decimal(0);
11
+ try {
12
+ return new Decimal(text.replace(/[^0-9.-]+/g, ""));
13
+ }
14
+ catch {
15
+ return new Decimal(0);
16
+ }
17
+ }
9
18
  try {
10
- return Number(new Big(cleaned).toString());
19
+ return new Decimal(input);
11
20
  }
12
21
  catch {
13
- return 0;
22
+ return new Decimal(0);
14
23
  }
15
24
  }
25
+ export function parseToMonetaryNumber(input) {
26
+ return toDecimal(input);
27
+ }
16
28
  export function formatTwoDecimals(value) {
17
- const raw = parseToMonetaryNumber(value);
18
- const rounded = new Big(raw).toFixed(2);
19
- const num = Number(rounded);
20
- return new Intl.NumberFormat("de-DE", {
21
- minimumFractionDigits: 2,
22
- maximumFractionDigits: 2,
23
- }).format(num);
29
+ const text = toDecimal(value).rounded(2).toString();
30
+ const negative = text.startsWith("-");
31
+ const [whole, fraction = "00"] = (negative ? text.slice(1) : text).split(".");
32
+ const grouped = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
33
+ return `${negative ? "-" : ""}${grouped},${fraction}`;
34
+ }
35
+ export function discountOf(total, discount) {
36
+ const rate = toDecimal(discount);
37
+ if (rate.isZero)
38
+ return new Decimal(0);
39
+ return toDecimal(total).times(rate).dividedBy(100, 8);
24
40
  }
25
41
  export function calculateDiscountedTotal(total, discount) {
26
- if (discount === 0) {
27
- return 0;
28
- }
29
- const result = (parseToMonetaryNumber(total) * discount) / 100;
30
- return parseToMonetaryNumber(result);
42
+ return discountOf(total, discount);
31
43
  }
@@ -1,2 +1,2 @@
1
- export declare function safeJsonStringify(obj: any, pretty?: boolean): string;
1
+ export declare function safeJsonStringify(obj: unknown, pretty?: boolean): string;
2
2
  export declare function safeJsonParse(json: string): any;
@@ -1,44 +1,41 @@
1
- export function safeJsonStringify(obj, pretty = false) {
2
- const seen = new WeakSet();
3
- if (pretty) {
4
- return JSON.stringify(obj, (key, value) => {
5
- if (key.startsWith("_")) {
6
- return undefined;
7
- }
8
- if (value instanceof Map) {
9
- return Object.fromEntries(value);
10
- }
11
- if (value instanceof Set) {
12
- return Array.from(value);
13
- }
14
- if (typeof value === "object" && value !== null) {
15
- if (seen.has(value)) {
16
- return "[Circular]";
17
- }
18
- seen.add(value);
19
- }
20
- return value;
21
- }, 2);
1
+ import { readValues, valuesOf } from "@sincpro/client-framework";
2
+ function publishable(value, seen) {
3
+ if (value === null || typeof value !== "object")
4
+ return value;
5
+ if (seen.has(value))
6
+ return "[Circular]";
7
+ if (value instanceof Uint8Array ||
8
+ value instanceof ArrayBuffer ||
9
+ value instanceof DataView ||
10
+ typeof value.toJSON === "function") {
11
+ return value;
22
12
  }
23
- return JSON.stringify(obj, (key, value) => {
24
- if (key.startsWith("_")) {
25
- return undefined;
26
- }
13
+ seen.add(value);
14
+ try {
27
15
  if (value instanceof Map) {
28
- return Object.fromEntries(value);
16
+ return new Map([...value].map(([key, item]) => [key, publishable(item, seen)]));
29
17
  }
30
18
  if (value instanceof Set) {
31
- return Array.from(value);
19
+ return new Set([...value].map((item) => publishable(item, seen)));
32
20
  }
33
- if (typeof value === "object" && value !== null) {
34
- if (seen.has(value)) {
35
- return "[Circular]";
36
- }
37
- seen.add(value);
21
+ if (Array.isArray(value))
22
+ return value.map((item) => publishable(item, seen));
23
+ const published = {};
24
+ for (const [key, item] of Object.entries(value)) {
25
+ if (key.startsWith("_") || typeof item === "function")
26
+ continue;
27
+ published[key] = publishable(item, seen);
38
28
  }
39
- return value;
40
- });
29
+ return published;
30
+ }
31
+ finally {
32
+ seen.delete(value);
33
+ }
34
+ }
35
+ export function safeJsonStringify(obj, pretty = false) {
36
+ const wire = valuesOf(publishable(obj, new WeakSet()));
37
+ return JSON.stringify(wire, null, pretty ? 2 : undefined);
41
38
  }
42
39
  export function safeJsonParse(json) {
43
- return JSON.parse(json);
40
+ return readValues(json);
44
41
  }
@@ -0,0 +1 @@
1
+ export declare function DeviceNotices(): null;
@@ -0,0 +1,29 @@
1
+ import { textOf } from "../../domain/events/label";
2
+ import { useCommon } from "../../entrypoints/ui/common_provider";
3
+ import { useToast } from "@sincpro/mobile-ui/Feedback";
4
+ import { useEffect, useRef } from "react";
5
+ import { useActivity } from "./useActivity";
6
+ const VARIANT = {
7
+ success: "success",
8
+ danger: "danger",
9
+ info: "info",
10
+ };
11
+ export function DeviceNotices() {
12
+ const { notices } = useActivity();
13
+ const { locale } = useCommon();
14
+ const toast = useToast();
15
+ const shownRef = useRef(new Set());
16
+ useEffect(() => {
17
+ for (const notice of notices) {
18
+ if (shownRef.current.has(notice.id))
19
+ continue;
20
+ shownRef.current.add(notice.id);
21
+ toast.show({
22
+ title: textOf(notice.label, locale),
23
+ message: textOf(notice.detail ?? notice.label, locale),
24
+ variant: VARIANT[notice.variant ?? "info"],
25
+ });
26
+ }
27
+ }, [locale, notices, toast]);
28
+ return null;
29
+ }
@@ -0,0 +1,2 @@
1
+ declare function ProcessToast(): null;
2
+ export default ProcessToast;
@@ -0,0 +1,71 @@
1
+ import { textOf } from "../../domain/events/label";
2
+ import { useCommon } from "../../entrypoints/ui/common_provider";
3
+ import { useToast } from "@sincpro/mobile-ui/Feedback";
4
+ import { useEffect, useRef } from "react";
5
+ import { useActivity } from "./useActivity";
6
+ const MAX_ERROR_LEN = 150;
7
+ const MIN_VISIBLE_MS = 1200;
8
+ function ProcessToast() {
9
+ const { queue, crons, failure } = useActivity();
10
+ const { locale } = useCommon();
11
+ const toast = useToast();
12
+ const loadingIdRef = useRef(null);
13
+ const shownErrorRef = useRef(null);
14
+ const startedAtRef = useRef(null);
15
+ const hideTimerRef = useRef(null);
16
+ const progress = queue ?? crons[0];
17
+ const progressLabel = textOf(progress?.label, locale);
18
+ useEffect(() => {
19
+ if (hideTimerRef.current) {
20
+ clearTimeout(hideTimerRef.current);
21
+ hideTimerRef.current = null;
22
+ }
23
+ const hideLoading = () => {
24
+ if (!loadingIdRef.current)
25
+ return;
26
+ toast.hide(loadingIdRef.current);
27
+ loadingIdRef.current = null;
28
+ startedAtRef.current = null;
29
+ };
30
+ if (progress && !failure) {
31
+ if (startedAtRef.current == null)
32
+ startedAtRef.current = Date.now();
33
+ if (loadingIdRef.current) {
34
+ toast.update(loadingIdRef.current, { message: progressLabel, variant: "loading" });
35
+ }
36
+ else {
37
+ loadingIdRef.current = toast.loading(progressLabel);
38
+ }
39
+ }
40
+ else if (loadingIdRef.current) {
41
+ const elapsed = startedAtRef.current
42
+ ? Date.now() - startedAtRef.current
43
+ : MIN_VISIBLE_MS;
44
+ const wait = failure ? 0 : Math.max(0, MIN_VISIBLE_MS - elapsed);
45
+ hideTimerRef.current = setTimeout(hideLoading, wait);
46
+ }
47
+ return () => {
48
+ if (hideTimerRef.current)
49
+ clearTimeout(hideTimerRef.current);
50
+ };
51
+ }, [failure, progress, progressLabel, toast]);
52
+ useEffect(() => {
53
+ if (!failure) {
54
+ shownErrorRef.current = null;
55
+ return;
56
+ }
57
+ if (shownErrorRef.current === failure.id)
58
+ return;
59
+ shownErrorRef.current = failure.id;
60
+ const raw = failure.detail != null ? textOf(failure.detail, locale) : undefined;
61
+ const detail = raw
62
+ ? raw.length > MAX_ERROR_LEN
63
+ ? `${raw.slice(0, MAX_ERROR_LEN)}...`
64
+ : raw
65
+ : undefined;
66
+ const title = textOf(failure.label, locale);
67
+ toast.danger(detail ?? title, { title: `Error: ${title}` });
68
+ }, [failure, locale, toast]);
69
+ return null;
70
+ }
71
+ export default ProcessToast;
@@ -0,0 +1,4 @@
1
+ export { DeviceNotices } from "./DeviceNotices";
2
+ export { default as ProcessToast } from "./ProcessToast";
3
+ export { ProcessToastProvider } from "./ProcessToastProvider";
4
+ export { useActivity } from "./useActivity";
@@ -0,0 +1,4 @@
1
+ export { DeviceNotices } from "./DeviceNotices";
2
+ export { default as ProcessToast } from "./ProcessToast";
3
+ export { ProcessToastProvider } from "./ProcessToastProvider";
4
+ export { useActivity } from "./useActivity";
@@ -0,0 +1,9 @@
1
+ import { type ActivityFact } from "../../infrastructure/ui/activity";
2
+ export declare function useActivity(options?: {
3
+ all?: boolean;
4
+ }): {
5
+ queue: ActivityFact;
6
+ crons: ActivityFact[];
7
+ failure: ActivityFact | undefined;
8
+ notices: ActivityFact[];
9
+ };
@@ -0,0 +1,48 @@
1
+ import { ACTIVITY_EVENT, ACTIVITY_SETTING_EVENT, activityVisible, applyActivity, emptyActivity, loadActivityEnabled, } from "../../infrastructure/ui/activity";
2
+ import { UIEventBus } from "../../infrastructure/ui/UIEventBus";
3
+ import { useEffect, useMemo, useState } from "react";
4
+ const CHANNELS_ON = {
5
+ queue: true,
6
+ cron: true,
7
+ device: true,
8
+ };
9
+ export function useActivity(options) {
10
+ const all = options?.all ?? false;
11
+ const [state, setState] = useState(emptyActivity);
12
+ const [enabled, setEnabled] = useState(CHANNELS_ON);
13
+ useEffect(() => {
14
+ let alive = true;
15
+ loadActivityEnabled().then((next) => {
16
+ if (alive)
17
+ setEnabled(next);
18
+ });
19
+ return () => {
20
+ alive = false;
21
+ };
22
+ }, []);
23
+ useEffect(() => {
24
+ const offFact = UIEventBus.on(ACTIVITY_EVENT, (payload) => {
25
+ setState((current) => applyActivity(current, payload));
26
+ }, { debounce: false });
27
+ const offSetting = UIEventBus.on(ACTIVITY_SETTING_EVENT, (payload) => {
28
+ const change = payload;
29
+ setEnabled((current) => ({ ...current, [change.channel]: change.enabled }));
30
+ }, { debounce: false });
31
+ return () => {
32
+ offFact();
33
+ offSetting();
34
+ };
35
+ }, []);
36
+ return useMemo(() => {
37
+ const visible = state.running.filter((fact) => activityVisible(fact, enabled, all));
38
+ const queues = visible.filter((fact) => fact.channel === "queue");
39
+ return {
40
+ queue: queues[queues.length - 1],
41
+ crons: visible.filter((fact) => fact.channel === "cron"),
42
+ failure: state.failure && activityVisible(state.failure, enabled, all)
43
+ ? state.failure
44
+ : undefined,
45
+ notices: state.notices.filter((fact) => activityVisible(fact, enabled, all)),
46
+ };
47
+ }, [all, enabled, state]);
48
+ }
@@ -1,6 +1,6 @@
1
- import { DomainEvent } from "../../../domain/event_sourcing";
1
+ import { IntegrationEvent } from "../../../domain/events";
2
2
  interface EventTimelineItemProps {
3
- event: DomainEvent;
3
+ event: IntegrationEvent;
4
4
  isLast?: boolean;
5
5
  }
6
6
  declare function EventTimelineItem({ event, isLast }: EventTimelineItemProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import { EEventStatus } from "../../../domain/event_sourcing";
2
+ import { EEventStatus } from "../../../domain/events";
3
3
  import { Display } from "@sincpro/mobile-ui/Display";
4
4
  import CopyableText from "@sincpro/mobile-ui/Display/Display.CopyableText";
5
5
  import { useTheme } from "@sincpro/mobile-ui/theme";
@@ -2,8 +2,7 @@ export { BluetoothDeviceSelectorModal } from "./BluetoothDeviceSelectorModal";
2
2
  export { default as DeadLetterErrorBlock } from "./DeadLetterErrorBlock";
3
3
  export { default as EventTimelineItem } from "./EventTimelineItem";
4
4
  export { default as GeoPermissionCard } from "./GeoPermissionCard";
5
- export { default as ProcessToast } from "./ProcessToast";
6
- export { ProcessToastProvider } from "./ProcessToastProvider";
7
5
  export type { TimezoneLocale } from "./timezone";
8
6
  export { TimeZoneSelector } from "./TimeZoneSelector";
9
7
  export { TimeZoneSelectorModal } from "./TimeZoneSelectorModal";
8
+ export { DeviceNotices, ProcessToast, ProcessToastProvider, } from "../../../ui/activity";
@@ -2,7 +2,6 @@ export { BluetoothDeviceSelectorModal } from "./BluetoothDeviceSelectorModal";
2
2
  export { default as DeadLetterErrorBlock } from "./DeadLetterErrorBlock";
3
3
  export { default as EventTimelineItem } from "./EventTimelineItem";
4
4
  export { default as GeoPermissionCard } from "./GeoPermissionCard";
5
- export { default as ProcessToast } from "./ProcessToast";
6
- export { ProcessToastProvider } from "./ProcessToastProvider";
7
5
  export { TimeZoneSelector } from "./TimeZoneSelector";
8
6
  export { TimeZoneSelectorModal } from "./TimeZoneSelectorModal";
7
+ export { DeviceNotices, ProcessToast, ProcessToastProvider, } from "../../../ui/activity";
@@ -1,8 +1,8 @@
1
- import { DomainEvent } from "../../../domain/event_sourcing";
1
+ import { IntegrationEvent } from "../../../domain/events";
2
2
  import { IRowItemProps } from "@sincpro/mobile-ui/views/types/IListView";
3
3
  import React from "react";
4
- interface DeadLetterQueueRowProps extends IRowItemProps<DomainEvent> {
5
- onRetry: (event: DomainEvent) => Promise<void> | void;
4
+ interface DeadLetterQueueRowProps extends IRowItemProps<IntegrationEvent> {
5
+ onRetry: (event: IntegrationEvent) => Promise<void> | void;
6
6
  }
7
7
  declare function DeadLetterQueueRow({ item, onRetry }: DeadLetterQueueRowProps): React.JSX.Element | null;
8
8
  export default DeadLetterQueueRow;
@@ -1,7 +1,7 @@
1
- import { DomainEvent } from "../../../domain/event_sourcing";
1
+ import { IntegrationEvent } from "../../../domain/events";
2
2
  interface EventRowProps {
3
- item: DomainEvent;
4
- onRetry: (event: DomainEvent) => Promise<void> | void;
3
+ item: IntegrationEvent;
4
+ onRetry: (event: IntegrationEvent) => Promise<void> | void;
5
5
  }
6
6
  declare function EventRow({ item, onRetry }: EventRowProps): import("react").JSX.Element | null;
7
7
  export default EventRow;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import { EEventStatus } from "../../../domain/event_sourcing";
2
+ import { EEventStatus } from "../../../domain/events";
3
3
  import { Display } from "@sincpro/mobile-ui/Display";
4
4
  import { Form } from "@sincpro/mobile-ui/Form";
5
5
  import { Typography } from "@sincpro/mobile-ui/Typography";
@@ -1,19 +1,19 @@
1
- import { DomainEvent } from "../../../domain/event_sourcing";
1
+ import { IntegrationEvent } from "../../../domain/events";
2
2
  import React, { ReactNode } from "react";
3
3
  interface IDeadLetterQueueContext {
4
- events: DomainEvent[];
5
- enrichedEvents: DomainEvent[];
4
+ events: IntegrationEvent[];
5
+ enrichedEvents: IntegrationEvent[];
6
6
  selectedEvents: Set<string>;
7
7
  isLoading: boolean;
8
8
  isRetrying: boolean;
9
9
  isDeleting: boolean;
10
10
  loadEvents: () => Promise<void>;
11
- retryEvent: (event: DomainEvent) => Promise<void>;
11
+ retryEvent: (event: IntegrationEvent) => Promise<void>;
12
12
  retrySelectedEvents: () => Promise<{
13
13
  success: number;
14
14
  failed: number;
15
15
  }>;
16
- deleteEvent: (event: DomainEvent) => Promise<void>;
16
+ deleteEvent: (event: IntegrationEvent) => Promise<void>;
17
17
  deleteSelectedEvents: () => Promise<{
18
18
  success: number;
19
19
  failed: number;
@@ -1,9 +1,9 @@
1
- import { DomainEvent } from "../../../domain/event_sourcing";
1
+ import { IntegrationEvent } from "../../../domain/events";
2
2
  import React, { ReactNode } from "react";
3
3
  type EventFilter = "ALL" | "FAILED" | "ACKNOWLEDGED" | "PENDING";
4
4
  interface IEventsContext {
5
- events: DomainEvent[];
6
- pagedEvents: DomainEvent[];
5
+ events: IntegrationEvent[];
6
+ pagedEvents: IntegrationEvent[];
7
7
  isLoading: boolean;
8
8
  isLoadingMore: boolean;
9
9
  isRetrying: boolean;
@@ -15,7 +15,7 @@ interface IEventsContext {
15
15
  loadEvents: () => Promise<void>;
16
16
  refreshEvents: () => Promise<void>;
17
17
  loadMore: () => Promise<void>;
18
- retryEvent: (event: DomainEvent) => Promise<void>;
18
+ retryEvent: (event: IntegrationEvent) => Promise<void>;
19
19
  }
20
20
  export declare function EventsProvider({ children, pageSize, }: {
21
21
  children: ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sincpro/mobile",
3
- "version": "0.4.4",
3
+ "version": "1.0.0",
4
4
  "description": "Sincpro Mobile framework core: offline-first infra (DB, queue/events, cron), DDD patterns, adapters, AppShell and module-driven composition for React Native",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -34,18 +34,19 @@
34
34
  "@opentelemetry/core": "^2.10.0",
35
35
  "@opentelemetry/resources": "^2.10.0",
36
36
  "@opentelemetry/sdk-trace-base": "^2.10.0",
37
+ "@sincpro/client-framework": "^0.6.0",
38
+ "@sincpro/criteria": "^2.1.0",
37
39
  "async-mutex": "^0.5.0",
38
40
  "big.js": "^7.0.1",
39
41
  "dayjs": "^1.11.21",
40
42
  "mitt": "^3.0.1",
41
43
  "pdf-lib": "^1.17.1",
42
- "tailwind-variants": "^3.2.2",
43
- "uuid": "^14.0.1"
44
+ "tailwind-variants": "^3.2.2"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@react-navigation/native": ">=7",
47
48
  "@react-navigation/native-stack": ">=7",
48
- "@sincpro/mobile-ui": "^0.7.2",
49
+ "@sincpro/mobile-ui": "^2.0.0",
49
50
  "expo-background-task": "*",
50
51
  "expo-clipboard": "*",
51
52
  "expo-crypto": "*",
@@ -75,10 +76,11 @@
75
76
  "@opentelemetry/api": "^1.9.0",
76
77
  "@react-navigation/native": "^7.0.0",
77
78
  "@react-navigation/native-stack": "^7.0.0",
78
- "@sincpro/mobile-ui": "^0.7.2",
79
+ "@expo-google-fonts/ibm-plex-mono": "^0.4.1",
80
+ "@expo-google-fonts/ibm-plex-sans": "^0.4.1",
81
+ "@sincpro/mobile-ui": "^2.0.0",
79
82
  "@types/big.js": "^6.2.2",
80
83
  "@types/react": "~19.3.0",
81
- "@types/uuid": "^10.0.0",
82
84
  "eslint": "^9.35.0",
83
85
  "eslint-config-expo": "~58.0.4",
84
86
  "eslint-config-prettier": "^10.1.8",
@@ -89,6 +91,7 @@
89
91
  "expo-clipboard": "~58.0.4",
90
92
  "expo-crypto": "~58.0.7",
91
93
  "expo-file-system": "~58.0.13",
94
+ "expo-image": "~58.0.18",
92
95
  "expo-linking": "~58.0.16",
93
96
  "expo-localization": "~58.0.5",
94
97
  "expo-location": "~58.0.20",
@@ -99,7 +102,6 @@
99
102
  "expo-sqlite": "~58.0.15",
100
103
  "expo-task-manager": "~58.0.13",
101
104
  "nativewind": "4.2.7",
102
- "tailwindcss": "3.4.19",
103
105
  "prettier": "^3.6.2",
104
106
  "react": "19.3.0",
105
107
  "react-native": "0.88.1",
@@ -113,6 +115,7 @@
113
115
  "react-native-view-shot": "6.1.1",
114
116
  "react-native-webview": "14.0.1",
115
117
  "react-native-worklets": "0.13.0",
118
+ "tailwindcss": "3.4.19",
116
119
  "tsc-alias": "^1.8.17",
117
120
  "tsx": "^4.22.4",
118
121
  "typescript": "~5.9.2"
@@ -121,7 +124,9 @@
121
124
  ".": "./dist/index.js",
122
125
  "./domain": "./dist/domain/index.js",
123
126
  "./domain/entity": "./dist/domain/entity/index.js",
124
- "./domain/event_sourcing": "./dist/domain/event_sourcing/index.js",
127
+ "./domain/events": "./dist/domain/events/index.js",
128
+ "./domain/repositories": "./dist/domain/repositories/index.js",
129
+ "./event_driven": "./dist/event_driven/index.js",
125
130
  "./domain/database": "./dist/domain/database/index.js",
126
131
  "./domain/connectivity": "./dist/domain/connectivity/index.js",
127
132
  "./domain/print": "./dist/domain/print/index.js",