@endora-commerce/mod-pwa 0.100.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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/dist/admin/api/pwa-client.d.ts +15 -0
  4. package/dist/admin/api/pwa-client.d.ts.map +1 -0
  5. package/dist/admin/api/pwa-client.js +56 -0
  6. package/dist/admin/api/pwa-client.js.map +1 -0
  7. package/dist/admin/components/PushAudienceRuleBuilder.d.ts +19 -0
  8. package/dist/admin/components/PushAudienceRuleBuilder.d.ts.map +1 -0
  9. package/dist/admin/components/PushAudienceRuleBuilder.js +211 -0
  10. package/dist/admin/components/PushAudienceRuleBuilder.js.map +1 -0
  11. package/dist/admin/index.d.ts +39 -0
  12. package/dist/admin/index.d.ts.map +1 -0
  13. package/dist/admin/index.js +61 -0
  14. package/dist/admin/index.js.map +1 -0
  15. package/dist/admin/pages/PwaPage.d.ts +16 -0
  16. package/dist/admin/pages/PwaPage.d.ts.map +1 -0
  17. package/dist/admin/pages/PwaPage.js +207 -0
  18. package/dist/admin/pages/PwaPage.js.map +1 -0
  19. package/dist/backend/entities/push-message-delivery.entity.d.ts +18 -0
  20. package/dist/backend/entities/push-message-delivery.entity.d.ts.map +1 -0
  21. package/dist/backend/entities/push-message-delivery.entity.js +68 -0
  22. package/dist/backend/entities/push-message-delivery.entity.js.map +1 -0
  23. package/dist/backend/entities/push-message.entity.d.ts +26 -0
  24. package/dist/backend/entities/push-message.entity.d.ts.map +1 -0
  25. package/dist/backend/entities/push-message.entity.js +102 -0
  26. package/dist/backend/entities/push-message.entity.js.map +1 -0
  27. package/dist/backend/entities/push-subscription.entity.d.ts +49 -0
  28. package/dist/backend/entities/push-subscription.entity.d.ts.map +1 -0
  29. package/dist/backend/entities/push-subscription.entity.js +117 -0
  30. package/dist/backend/entities/push-subscription.entity.js.map +1 -0
  31. package/dist/backend/entities/pwa-icon-rendition.entity.d.ts +21 -0
  32. package/dist/backend/entities/pwa-icon-rendition.entity.d.ts.map +1 -0
  33. package/dist/backend/entities/pwa-icon-rendition.entity.js +69 -0
  34. package/dist/backend/entities/pwa-icon-rendition.entity.js.map +1 -0
  35. package/dist/backend/index.d.ts +100 -0
  36. package/dist/backend/index.d.ts.map +1 -0
  37. package/dist/backend/index.js +107 -0
  38. package/dist/backend/index.js.map +1 -0
  39. package/dist/backend/plugin.d.ts +119 -0
  40. package/dist/backend/plugin.d.ts.map +1 -0
  41. package/dist/backend/plugin.js +109 -0
  42. package/dist/backend/plugin.js.map +1 -0
  43. package/dist/backend/request-actor.d.ts +24 -0
  44. package/dist/backend/request-actor.d.ts.map +1 -0
  45. package/dist/backend/request-actor.js +29 -0
  46. package/dist/backend/request-actor.js.map +1 -0
  47. package/dist/backend/routes.admin.d.ts +52 -0
  48. package/dist/backend/routes.admin.d.ts.map +1 -0
  49. package/dist/backend/routes.admin.js +222 -0
  50. package/dist/backend/routes.admin.js.map +1 -0
  51. package/dist/backend/routes.storefront.d.ts +29 -0
  52. package/dist/backend/routes.storefront.d.ts.map +1 -0
  53. package/dist/backend/routes.storefront.js +66 -0
  54. package/dist/backend/routes.storefront.js.map +1 -0
  55. package/dist/backend/services/cross-module-context.d.ts +90 -0
  56. package/dist/backend/services/cross-module-context.d.ts.map +1 -0
  57. package/dist/backend/services/cross-module-context.js +84 -0
  58. package/dist/backend/services/cross-module-context.js.map +1 -0
  59. package/dist/backend/services/providers/web-push-provider.d.ts +31 -0
  60. package/dist/backend/services/providers/web-push-provider.d.ts.map +1 -0
  61. package/dist/backend/services/providers/web-push-provider.js +72 -0
  62. package/dist/backend/services/providers/web-push-provider.js.map +1 -0
  63. package/dist/backend/services/push-audience-evaluator.d.ts +24 -0
  64. package/dist/backend/services/push-audience-evaluator.d.ts.map +1 -0
  65. package/dist/backend/services/push-audience-evaluator.js +29 -0
  66. package/dist/backend/services/push-audience-evaluator.js.map +1 -0
  67. package/dist/backend/services/push-delivery-queue.d.ts +14 -0
  68. package/dist/backend/services/push-delivery-queue.d.ts.map +1 -0
  69. package/dist/backend/services/push-delivery-queue.js +30 -0
  70. package/dist/backend/services/push-delivery-queue.js.map +1 -0
  71. package/dist/backend/services/push-event-subscriber.d.ts +86 -0
  72. package/dist/backend/services/push-event-subscriber.d.ts.map +1 -0
  73. package/dist/backend/services/push-event-subscriber.js +109 -0
  74. package/dist/backend/services/push-event-subscriber.js.map +1 -0
  75. package/dist/backend/services/push-message-service.d.ts +58 -0
  76. package/dist/backend/services/push-message-service.d.ts.map +1 -0
  77. package/dist/backend/services/push-message-service.js +145 -0
  78. package/dist/backend/services/push-message-service.js.map +1 -0
  79. package/dist/backend/services/push-provider-registry.d.ts +17 -0
  80. package/dist/backend/services/push-provider-registry.d.ts.map +1 -0
  81. package/dist/backend/services/push-provider-registry.js +32 -0
  82. package/dist/backend/services/push-provider-registry.js.map +1 -0
  83. package/dist/backend/services/push-subscription-service.d.ts +67 -0
  84. package/dist/backend/services/push-subscription-service.d.ts.map +1 -0
  85. package/dist/backend/services/push-subscription-service.js +165 -0
  86. package/dist/backend/services/push-subscription-service.js.map +1 -0
  87. package/dist/backend/services/pwa-config-resolver.d.ts +29 -0
  88. package/dist/backend/services/pwa-config-resolver.d.ts.map +1 -0
  89. package/dist/backend/services/pwa-config-resolver.js +92 -0
  90. package/dist/backend/services/pwa-config-resolver.js.map +1 -0
  91. package/dist/backend/services/pwa-icon-service.d.ts +44 -0
  92. package/dist/backend/services/pwa-icon-service.d.ts.map +1 -0
  93. package/dist/backend/services/pwa-icon-service.js +105 -0
  94. package/dist/backend/services/pwa-icon-service.js.map +1 -0
  95. package/dist/backend/workers/push-delivery-worker.d.ts +17 -0
  96. package/dist/backend/workers/push-delivery-worker.d.ts.map +1 -0
  97. package/dist/backend/workers/push-delivery-worker.js +105 -0
  98. package/dist/backend/workers/push-delivery-worker.js.map +1 -0
  99. package/dist/manifest.d.ts +184 -0
  100. package/dist/manifest.d.ts.map +1 -0
  101. package/dist/manifest.js +207 -0
  102. package/dist/manifest.js.map +1 -0
  103. package/dist/migrations/20260625T144228_pwa_init.d.ts +18 -0
  104. package/dist/migrations/20260625T144228_pwa_init.d.ts.map +1 -0
  105. package/dist/migrations/20260625T144228_pwa_init.js +105 -0
  106. package/dist/migrations/20260625T144228_pwa_init.js.map +1 -0
  107. package/dist/migrations/20260830T172022_pwa_organization_attribution.d.ts +102 -0
  108. package/dist/migrations/20260830T172022_pwa_organization_attribution.d.ts.map +1 -0
  109. package/dist/migrations/20260830T172022_pwa_organization_attribution.js +169 -0
  110. package/dist/migrations/20260830T172022_pwa_organization_attribution.js.map +1 -0
  111. package/dist/migrations/index.d.ts +28 -0
  112. package/dist/migrations/index.d.ts.map +1 -0
  113. package/dist/migrations/index.js +31 -0
  114. package/dist/migrations/index.js.map +1 -0
  115. package/docs/pwa.md +93 -0
  116. package/i18n/en.json +43 -0
  117. package/i18n/pl.json +43 -0
  118. package/package.json +105 -0
  119. package/tailwind.css +14 -0
@@ -0,0 +1,207 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { KeyRound, Save, Send, Upload } from 'lucide-react';
4
+ import { apiClient } from '@endora-commerce/admin-kit/lib';
5
+ import { Alert, AlertDescription, Button, Card, CardContent, CardHeader, CardTitle, Checkbox, ColorPicker, Input, Label, PageHeader } from '@endora-commerce/admin-kit/ui';
6
+ import { pwaClient } from '../api/pwa-client.js';
7
+ import { PushAudienceRuleBuilder } from '../components/PushAudienceRuleBuilder.js';
8
+ /**
9
+ * List sales channels (feature 091, P6).
10
+ *
11
+ * The request is built here rather than through `sales_channels`' own admin
12
+ * API client: that client is another module's **code**, which is what the
13
+ * cross-module ledger recorded, while `/api/v1/admin/sales-channels` and
14
+ * `SalesChannelListResponse` are an HTTP path and a
15
+ * `@endora-commerce/contracts` type that both sides already compile. That is
16
+ * the exit P2 established and `admin-kit-surface.md` R6 records — one `GET`
17
+ * out of that client's ten methods, and no dependency on the owner's code.
18
+ */
19
+ function listSalesChannels(activeOnly, pageSize) {
20
+ const qs = new URLSearchParams();
21
+ qs.set('activeOnly', String(activeOnly));
22
+ qs.set('pageSize', String(pageSize));
23
+ return apiClient.get(`/api/v1/admin/sales-channels?${qs.toString()}`);
24
+ }
25
+ /** Pick a display label from a multilingual sales-channel name. */
26
+ function channelLabel(name, code) {
27
+ const values = Object.values(name);
28
+ return values[0] ?? code;
29
+ }
30
+ /**
31
+ * PWA configuration page (feature 046, US2 + US4 admin surface). Edits the
32
+ * global PWA identity + toggles, uploads the icon (sharp-derived sizes),
33
+ * generates VAPID keys, and sends a broadcast push. The Scope selector switches
34
+ * between the global value and a per-Sales-Channel override; a per-channel scope
35
+ * can be reset back to the global value with "Reset to global".
36
+ */
37
+ export function PwaPage() {
38
+ const [config, setConfig] = useState(null);
39
+ const [busy, setBusy] = useState(false);
40
+ const [error, setError] = useState(null);
41
+ const [info, setInfo] = useState(null);
42
+ const [stats, setStats] = useState(null);
43
+ const fileRef = useRef(null);
44
+ // Scope selector — null = global, otherwise a per-channel override.
45
+ const [channels, setChannels] = useState([]);
46
+ const [selectedChannelId, setSelectedChannelId] = useState(null);
47
+ // Send-push form.
48
+ const [pushTitle, setPushTitle] = useState('');
49
+ const [pushBody, setPushBody] = useState('');
50
+ const [pushUrl, setPushUrl] = useState('');
51
+ // Audience targeting — 'all' broadcasts; 'rule' narrows via the Rule Builder.
52
+ const [audienceMode, setAudienceMode] = useState('all');
53
+ const [audienceRule, setAudienceRule] = useState({ kind: 'all' });
54
+ const refresh = useCallback(async () => {
55
+ setError(null);
56
+ try {
57
+ const [cfg, st] = await Promise.all([
58
+ pwaClient.getConfig(selectedChannelId),
59
+ pwaClient.getSubscriptionStats(selectedChannelId).catch(() => null),
60
+ ]);
61
+ setConfig(cfg);
62
+ setStats(st);
63
+ }
64
+ catch (err) {
65
+ setError(err instanceof Error ? err.message : 'Failed to load PWA settings.');
66
+ }
67
+ }, [selectedChannelId]);
68
+ // Load the channel list once for the scope selector.
69
+ useEffect(() => {
70
+ void listSalesChannels(true, 200)
71
+ .then((res) => setChannels(res.items))
72
+ .catch(() => setChannels([]));
73
+ }, []);
74
+ // (Re)load config + stats whenever the selected scope changes.
75
+ useEffect(() => {
76
+ void refresh();
77
+ }, [refresh]);
78
+ const patch = (next) => {
79
+ setConfig((c) => (c ? { ...c, ...next } : c));
80
+ };
81
+ const save = async () => {
82
+ if (!config)
83
+ return;
84
+ setBusy(true);
85
+ setError(null);
86
+ setInfo(null);
87
+ try {
88
+ await pwaClient.updateConfig({
89
+ ...(selectedChannelId ? { salesChannelId: selectedChannelId } : {}),
90
+ appName: config.appName,
91
+ shortName: config.shortName,
92
+ themeColor: config.themeColor,
93
+ backgroundColor: config.backgroundColor,
94
+ displayMode: config.displayMode,
95
+ cachingEnabled: config.cachingEnabled,
96
+ pushEnabled: config.pushEnabled,
97
+ });
98
+ setInfo('Settings saved.');
99
+ await refresh();
100
+ }
101
+ catch (err) {
102
+ setError(err instanceof Error ? err.message : 'Save failed.');
103
+ }
104
+ finally {
105
+ setBusy(false);
106
+ }
107
+ };
108
+ const resetToGlobal = async () => {
109
+ if (!selectedChannelId)
110
+ return;
111
+ setBusy(true);
112
+ setError(null);
113
+ setInfo(null);
114
+ try {
115
+ await pwaClient.resetConfig(selectedChannelId);
116
+ setInfo('Channel override cleared; this channel now inherits the global configuration.');
117
+ await refresh();
118
+ }
119
+ catch (err) {
120
+ setError(err instanceof Error ? err.message : 'Reset failed.');
121
+ }
122
+ finally {
123
+ setBusy(false);
124
+ }
125
+ };
126
+ const generateVapid = async () => {
127
+ setBusy(true);
128
+ setError(null);
129
+ setInfo(null);
130
+ try {
131
+ await pwaClient.generateVapid();
132
+ setInfo('VAPID keys generated.');
133
+ await refresh();
134
+ }
135
+ catch (err) {
136
+ setError(err instanceof Error ? err.message : 'Could not generate VAPID keys.');
137
+ }
138
+ finally {
139
+ setBusy(false);
140
+ }
141
+ };
142
+ const uploadIcon = async (file) => {
143
+ setBusy(true);
144
+ setError(null);
145
+ setInfo(null);
146
+ try {
147
+ await pwaClient.uploadIcon(file, selectedChannelId);
148
+ setInfo('Icon uploaded and resized.');
149
+ await refresh();
150
+ }
151
+ catch (err) {
152
+ setError(err instanceof Error ? err.message : 'Icon upload failed.');
153
+ }
154
+ finally {
155
+ setBusy(false);
156
+ if (fileRef.current)
157
+ fileRef.current.value = '';
158
+ }
159
+ };
160
+ const sendPush = async () => {
161
+ // Sends are per-channel: the operator must pick a concrete channel scope.
162
+ if (!selectedChannelId) {
163
+ setError('Select a sales channel above to send a notification.');
164
+ return;
165
+ }
166
+ setBusy(true);
167
+ setError(null);
168
+ setInfo(null);
169
+ try {
170
+ // A 'rule' audience that resolves to "all" is equivalent to a broadcast.
171
+ const audience = audienceMode === 'rule' && audienceRule.kind !== 'all'
172
+ ? { kind: 'rule', rule: audienceRule }
173
+ : { kind: 'all' };
174
+ const res = await pwaClient.sendMessage({
175
+ salesChannelId: selectedChannelId,
176
+ title: pushTitle,
177
+ body: pushBody,
178
+ ...(pushUrl ? { url: pushUrl } : {}),
179
+ audience,
180
+ });
181
+ setInfo(`Queued ${res.queuedDeliveries} notification(s).`);
182
+ setPushTitle('');
183
+ setPushBody('');
184
+ setPushUrl('');
185
+ }
186
+ catch (err) {
187
+ setError(err instanceof Error ? err.message : 'Send failed.');
188
+ }
189
+ finally {
190
+ setBusy(false);
191
+ }
192
+ };
193
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(PageHeader, { title: "Progressive Web App", description: "Installable-app identity, asset caching, and push notifications." }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Label, { htmlFor: "pwa-scope", children: "Scope" }), _jsxs("select", { id: "pwa-scope", className: "h-9 rounded-md border border-input bg-transparent px-3 text-sm", value: selectedChannelId ?? '', onChange: (e) => setSelectedChannelId(e.target.value === '' ? null : e.target.value), children: [_jsx("option", { value: "", children: "Global (all channels)" }), channels.map((c) => (_jsxs("option", { value: c.id, children: [channelLabel(c.name, c.code), " (", c.code, ")"] }, c.id)))] }), _jsx("span", { className: "text-sm text-muted-foreground", children: selectedChannelId ? 'Editing a per-channel override.' : 'Editing the global value.' }), selectedChannelId ? (_jsx(Button, { type: "button", variant: "outline", size: "sm", disabled: busy, onClick: () => void resetToGlobal(), children: "Reset to global" })) : null] }), error ? (_jsx(Alert, { variant: "destructive", children: _jsx(AlertDescription, { children: error }) })) : null, info ? (_jsx(Alert, { variant: "success", children: _jsx(AlertDescription, { children: info }) })) : null, config ? (_jsxs(_Fragment, { children: [_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "App identity" }) }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsxs("div", { children: [_jsx(Label, { htmlFor: "pwa-name", children: "App name" }), _jsx(Input, { id: "pwa-name", value: config.appName, onChange: (e) => patch({ appName: e.target.value }) })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "pwa-short", children: "Short name" }), _jsx(Input, { id: "pwa-short", value: config.shortName, onChange: (e) => patch({ shortName: e.target.value }) })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { children: "Theme color" }), _jsx(ColorPicker, { value: config.themeColor, onChange: (hex) => patch({ themeColor: hex }), label: "Theme color", customLabel: "Custom theme color" })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx(Label, { children: "Background color" }), _jsx(ColorPicker, { value: config.backgroundColor, onChange: (hex) => patch({ backgroundColor: hex }), label: "Background color", customLabel: "Custom background color" })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "pwa-display", children: "Display mode" }), _jsxs("select", { id: "pwa-display", className: "h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm", value: config.displayMode, onChange: (e) => patch({ displayMode: e.target.value }), children: [_jsx("option", { value: "standalone", children: "standalone" }), _jsx("option", { value: "fullscreen", children: "fullscreen" }), _jsx("option", { value: "minimal-ui", children: "minimal-ui" })] })] })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("input", { ref: fileRef, type: "file", accept: "image/png,image/webp", className: "hidden", onChange: (e) => {
194
+ const f = e.target.files?.[0];
195
+ if (f)
196
+ void uploadIcon(f);
197
+ } }), _jsxs(Button, { type: "button", variant: "outline", disabled: busy, onClick: () => fileRef.current?.click(), children: [_jsx(Upload, { className: "mr-2 h-4 w-4" }), " Upload icon"] }), _jsxs("span", { className: "text-sm text-muted-foreground", children: ["PNG or WebP, at least 512\u00D7512, square.", config.iconAssetId ? ' Icon set.' : ''] })] })] })] }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Capabilities" }) }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("label", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { checked: config.cachingEnabled, onChange: (e) => patch({ cachingEnabled: e.target.checked }) }), _jsx("span", { children: "Enable static-asset caching on the storefront" })] }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { checked: config.pushEnabled, onChange: (e) => patch({ pushEnabled: e.target.checked }) }), _jsx("span", { children: "Enable push notifications" })] }), _jsxs("div", { className: "flex items-center gap-3 pt-1", children: [_jsxs(Button, { type: "button", variant: "outline", disabled: busy, onClick: () => void generateVapid(), children: [_jsx(KeyRound, { className: "mr-2 h-4 w-4" }), " Generate VAPID keys"] }), _jsx("span", { className: "text-sm text-muted-foreground", children: config.vapidPrivateKeyIsSet ? 'VAPID keys configured.' : 'No VAPID keys configured.' })] })] })] }), _jsx("div", { className: "flex justify-end", children: _jsxs(Button, { type: "button", disabled: busy, onClick: () => void save(), children: [_jsx(Save, { className: "mr-2 h-4 w-4" }), " Save"] }) }), _jsxs(Card, { children: [_jsx(CardHeader, { children: _jsx(CardTitle, { children: "Send push notification" }) }), _jsxs(CardContent, { className: "space-y-4", children: [stats ? (_jsxs("p", { className: "text-sm text-muted-foreground", children: ["Subscribers \u2014 active: ", stats.active, ", invalid: ", stats.invalid] })) : null, _jsxs("div", { children: [_jsx(Label, { htmlFor: "push-title", children: "Title" }), _jsx(Input, { id: "push-title", value: pushTitle, onChange: (e) => setPushTitle(e.target.value) })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "push-body", children: "Message" }), _jsx(Input, { id: "push-body", value: pushBody, onChange: (e) => setPushBody(e.target.value) })] }), _jsxs("div", { children: [_jsx(Label, { htmlFor: "push-url", children: "Link (optional, opened on tap)" }), _jsx(Input, { id: "push-url", value: pushUrl, onChange: (e) => setPushUrl(e.target.value), placeholder: "/account/orders/123" })] }), _jsxs("div", { className: "space-y-2", children: [_jsx(Label, { children: "Audience" }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "radio", name: "push-audience-mode", checked: audienceMode === 'all', onChange: () => setAudienceMode('all') }), "All subscribers"] }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx("input", { type: "radio", name: "push-audience-mode", checked: audienceMode === 'rule', onChange: () => setAudienceMode('rule') }), "Target by criteria"] })] }), audienceMode === 'rule' ? (_jsx(PushAudienceRuleBuilder, { value: audienceRule, onChange: setAudienceRule, disabled: busy })) : null] }), !selectedChannelId ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Select a sales channel in the Scope selector above to send a notification." })) : null, _jsx("div", { className: "flex justify-end", children: _jsxs(Button, { type: "button", disabled: busy || !selectedChannelId || !config.pushEnabled || !pushTitle || !pushBody, onClick: () => void sendPush(), children: [_jsx(Send, { className: "mr-2 h-4 w-4" }), ' ', audienceMode === 'rule' && audienceRule.kind !== 'all'
198
+ ? 'Send to targeted subscribers'
199
+ : 'Send to all subscribers'] }) })] })] })] })) : (_jsx("p", { className: "text-sm text-muted-foreground", children: "Loading\u2026" }))] }));
200
+ }
201
+ /**
202
+ * The registry loads a route component through a dynamic-import factory and
203
+ * reads its default export (feature 091, FR-013). The named export stays: it is
204
+ * the spelling this module's own code and its tests use.
205
+ */
206
+ export default PwaPage;
207
+ //# sourceMappingURL=PwaPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PwaPage.js","sourceRoot":"","sources":["../../../src/admin/pages/PwaPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAS5D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3K,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAEnF;;;;;;;;;;GAUG;AACH,SAAS,iBAAiB,CAAC,UAAmB,EAAE,QAAgB;IAC9D,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAC;IACjC,EAAE,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IACzC,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,OAAO,SAAS,CAAC,GAAG,CAClB,gCAAgC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAChD,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,SAAS,YAAY,CAAC,IAAiC,EAAE,IAAY;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CA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GAIG;AACH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { OptionalProps } from '@mikro-orm/core';
2
+ /**
3
+ * PushMessageDelivery (feature 046, US4). One row per (message × subscription) —
4
+ * the unit the BullMQ worker processes. `(messageId, subscriptionId)` is unique,
5
+ * providing delivery idempotency across retries (Principle X).
6
+ */
7
+ export declare class PushMessageDelivery {
8
+ [OptionalProps]?: 'id' | 'createdAt' | 'attemptedAt' | 'status' | 'attempts' | 'lastError';
9
+ id: string;
10
+ messageId: string;
11
+ subscriptionId: string;
12
+ status: 'pending' | 'sent' | 'failed' | 'pruned';
13
+ attempts: number;
14
+ lastError?: string | null;
15
+ attemptedAt?: Date | null;
16
+ createdAt: Date;
17
+ }
18
+ //# sourceMappingURL=push-message-delivery.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-message-delivery.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/push-message-delivery.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAI7F;;;;GAIG;AACH,qBAGa,mBAAmB;IAC9B,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;IAG3F,EAAE,EAAE,MAAM,CAAgB;IAG1B,SAAS,EAAG,MAAM,CAAC;IAGnB,cAAc,EAAG,MAAM,CAAC;IAIxB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAa;IAG7D,QAAQ,EAAE,MAAM,CAAK;IAGrB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAG1B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
@@ -0,0 +1,68 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Entity, Index, OptionalProps, PrimaryKey, Property, Unique } from '@mikro-orm/core';
11
+ import { GlobalEntity } from '@endora-commerce/platform/tenancy';
12
+ import { randomUUID } from 'crypto';
13
+ /**
14
+ * PushMessageDelivery (feature 046, US4). One row per (message × subscription) —
15
+ * the unit the BullMQ worker processes. `(messageId, subscriptionId)` is unique,
16
+ * providing delivery idempotency across retries (Principle X).
17
+ */
18
+ let PushMessageDelivery = class PushMessageDelivery {
19
+ [OptionalProps];
20
+ id = randomUUID();
21
+ messageId;
22
+ subscriptionId;
23
+ status = 'pending';
24
+ attempts = 0;
25
+ lastError;
26
+ attemptedAt;
27
+ createdAt = new Date();
28
+ };
29
+ __decorate([
30
+ PrimaryKey({ type: 'uuid' }),
31
+ __metadata("design:type", String)
32
+ ], PushMessageDelivery.prototype, "id", void 0);
33
+ __decorate([
34
+ Property({ type: 'uuid' }),
35
+ __metadata("design:type", String)
36
+ ], PushMessageDelivery.prototype, "messageId", void 0);
37
+ __decorate([
38
+ Property({ type: 'uuid' }),
39
+ __metadata("design:type", String)
40
+ ], PushMessageDelivery.prototype, "subscriptionId", void 0);
41
+ __decorate([
42
+ Property({ type: 'string', length: 16 }),
43
+ Index(),
44
+ __metadata("design:type", String)
45
+ ], PushMessageDelivery.prototype, "status", void 0);
46
+ __decorate([
47
+ Property({ type: 'integer' }),
48
+ __metadata("design:type", Number)
49
+ ], PushMessageDelivery.prototype, "attempts", void 0);
50
+ __decorate([
51
+ Property({ type: 'text', nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], PushMessageDelivery.prototype, "lastError", void 0);
54
+ __decorate([
55
+ Property({ type: 'datetime', nullable: true }),
56
+ __metadata("design:type", Object)
57
+ ], PushMessageDelivery.prototype, "attemptedAt", void 0);
58
+ __decorate([
59
+ Property({ type: 'datetime', onCreate: () => new Date() }),
60
+ __metadata("design:type", Date)
61
+ ], PushMessageDelivery.prototype, "createdAt", void 0);
62
+ PushMessageDelivery = __decorate([
63
+ GlobalEntity(),
64
+ Entity({ tableName: 'push_message_deliveries' }),
65
+ Unique({ properties: ['messageId', 'subscriptionId'] })
66
+ ], PushMessageDelivery);
67
+ export { PushMessageDelivery };
68
+ //# sourceMappingURL=push-message-delivery.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-message-delivery.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/push-message-delivery.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;;GAIG;AAII,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,CAAC,aAAa,CAAC,CAA4E;IAG3F,EAAE,GAAW,UAAU,EAAE,CAAC;IAG1B,SAAS,CAAU;IAGnB,cAAc,CAAU;IAIxB,MAAM,GAA6C,SAAS,CAAC;IAG7D,QAAQ,GAAW,CAAC,CAAC;IAGrB,SAAS,CAAiB;IAG1B,WAAW,CAAe;IAG1B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AAvBC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACH;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDACR;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DACH;AAIxB;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACxC,KAAK,EAAE;;mDACqD;AAG7D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;qDACT;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACjB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACrB;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAChD,IAAI;sDAAc;AA1BlB,mBAAmB;IAH/B,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;IAChD,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,CAAC;GAC3C,mBAAmB,CA2B/B"}
@@ -0,0 +1,26 @@
1
+ import { OptionalProps } from '@mikro-orm/core';
2
+ import type { PushAudience, PushTrigger, PushMessageStatus } from '@endora-commerce/contracts';
3
+ /**
4
+ * PushMessage (feature 046, US4). A notification to be delivered, admin-initiated
5
+ * or event-triggered. `(trigger, sourceEventId)` is unique when sourceEventId is
6
+ * present, so a business event cannot produce duplicate messages (FR-024).
7
+ */
8
+ export declare class PushMessage {
9
+ [OptionalProps]?: 'id' | 'createdAt' | 'sentAt' | 'status' | 'sentCount' | 'failedCount' | 'iconUrl' | 'url' | 'sourceEventId' | 'createdByAdminUserId';
10
+ id: string;
11
+ salesChannelId: string;
12
+ title: string;
13
+ body: string;
14
+ iconUrl?: string | null;
15
+ url?: string | null;
16
+ audience: PushAudience;
17
+ trigger: PushTrigger;
18
+ sourceEventId?: string | null;
19
+ status: PushMessageStatus;
20
+ sentCount: number;
21
+ failedCount: number;
22
+ createdByAdminUserId?: string | null;
23
+ createdAt: Date;
24
+ sentAt?: Date | null;
25
+ }
26
+ //# sourceMappingURL=push-message.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-message.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/push-message.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAwB,MAAM,iBAAiB,CAAC;AAGrF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/F;;;;GAIG;AACH,qBAEa,WAAW;IACtB,CAAC,aAAa,CAAC,CAAC,EACZ,IAAI,GACJ,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,aAAa,GACb,SAAS,GACT,KAAK,GACL,eAAe,GACf,sBAAsB,CAAC;IAG3B,EAAE,EAAE,MAAM,CAAgB;IAI1B,cAAc,EAAG,MAAM,CAAC;IAGxB,KAAK,EAAG,MAAM,CAAC;IAGf,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,QAAQ,EAAG,YAAY,CAAC;IAGxB,OAAO,EAAG,WAAW,CAAC;IAGtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,MAAM,EAAE,iBAAiB,CAAY;IAGrC,SAAS,EAAE,MAAM,CAAK;IAGtB,WAAW,EAAE,MAAM,CAAK;IAGxB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrC,SAAS,EAAE,IAAI,CAAc;IAG7B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACtB"}
@@ -0,0 +1,102 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
11
+ import { GlobalEntity } from '@endora-commerce/platform/tenancy';
12
+ import { randomUUID } from 'crypto';
13
+ /**
14
+ * PushMessage (feature 046, US4). A notification to be delivered, admin-initiated
15
+ * or event-triggered. `(trigger, sourceEventId)` is unique when sourceEventId is
16
+ * present, so a business event cannot produce duplicate messages (FR-024).
17
+ */
18
+ let PushMessage = class PushMessage {
19
+ [OptionalProps];
20
+ id = randomUUID();
21
+ salesChannelId;
22
+ title;
23
+ body;
24
+ iconUrl;
25
+ url;
26
+ audience;
27
+ trigger;
28
+ sourceEventId;
29
+ status = 'queued';
30
+ sentCount = 0;
31
+ failedCount = 0;
32
+ createdByAdminUserId;
33
+ createdAt = new Date();
34
+ sentAt;
35
+ };
36
+ __decorate([
37
+ PrimaryKey({ type: 'uuid' }),
38
+ __metadata("design:type", String)
39
+ ], PushMessage.prototype, "id", void 0);
40
+ __decorate([
41
+ Property({ type: 'uuid' }),
42
+ Index(),
43
+ __metadata("design:type", String)
44
+ ], PushMessage.prototype, "salesChannelId", void 0);
45
+ __decorate([
46
+ Property({ type: 'string', length: 120 }),
47
+ __metadata("design:type", String)
48
+ ], PushMessage.prototype, "title", void 0);
49
+ __decorate([
50
+ Property({ type: 'string', length: 500 }),
51
+ __metadata("design:type", String)
52
+ ], PushMessage.prototype, "body", void 0);
53
+ __decorate([
54
+ Property({ type: 'text', nullable: true }),
55
+ __metadata("design:type", Object)
56
+ ], PushMessage.prototype, "iconUrl", void 0);
57
+ __decorate([
58
+ Property({ type: 'text', nullable: true }),
59
+ __metadata("design:type", Object)
60
+ ], PushMessage.prototype, "url", void 0);
61
+ __decorate([
62
+ Property({ type: 'json' }),
63
+ __metadata("design:type", Object)
64
+ ], PushMessage.prototype, "audience", void 0);
65
+ __decorate([
66
+ Property({ type: 'string', length: 32 }),
67
+ __metadata("design:type", String)
68
+ ], PushMessage.prototype, "trigger", void 0);
69
+ __decorate([
70
+ Property({ type: 'string', length: 128, nullable: true }),
71
+ __metadata("design:type", Object)
72
+ ], PushMessage.prototype, "sourceEventId", void 0);
73
+ __decorate([
74
+ Property({ type: 'string', length: 16 }),
75
+ __metadata("design:type", String)
76
+ ], PushMessage.prototype, "status", void 0);
77
+ __decorate([
78
+ Property({ type: 'integer' }),
79
+ __metadata("design:type", Number)
80
+ ], PushMessage.prototype, "sentCount", void 0);
81
+ __decorate([
82
+ Property({ type: 'integer' }),
83
+ __metadata("design:type", Number)
84
+ ], PushMessage.prototype, "failedCount", void 0);
85
+ __decorate([
86
+ Property({ type: 'uuid', nullable: true }),
87
+ __metadata("design:type", Object)
88
+ ], PushMessage.prototype, "createdByAdminUserId", void 0);
89
+ __decorate([
90
+ Property({ type: 'datetime', onCreate: () => new Date() }),
91
+ __metadata("design:type", Date)
92
+ ], PushMessage.prototype, "createdAt", void 0);
93
+ __decorate([
94
+ Property({ type: 'datetime', nullable: true }),
95
+ __metadata("design:type", Object)
96
+ ], PushMessage.prototype, "sentAt", void 0);
97
+ PushMessage = __decorate([
98
+ GlobalEntity(),
99
+ Entity({ tableName: 'push_messages' })
100
+ ], PushMessage);
101
+ export { PushMessage };
102
+ //# sourceMappingURL=push-message.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-message.entity.js","sourceRoot":"","sources":["../../../src/backend/entities/push-message.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC;;;;GAIG;AAGI,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,CAAC,aAAa,CAAC,CAUY;IAG3B,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,cAAc,CAAU;IAGxB,KAAK,CAAU;IAGf,IAAI,CAAU;IAGd,OAAO,CAAiB;IAGxB,GAAG,CAAiB;IAGpB,QAAQ,CAAgB;IAGxB,OAAO,CAAe;IAGtB,aAAa,CAAiB;IAG9B,MAAM,GAAsB,QAAQ,CAAC;IAGrC,SAAS,GAAW,CAAC,CAAC;IAGtB,WAAW,GAAW,CAAC,CAAC;IAGxB,oBAAoB,CAAiB;IAGrC,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAG7B,MAAM,CAAe;CACtB,CAAA;AA5CC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uCACH;AAI1B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE;;mDACgB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;0CAC3B;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;yCAC5B;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACvB;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACH;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;4CACnB;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;2CACJ;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;8CACR;AAGtB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gDACN;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACN;AAGrC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,CAAC;8BAChD,IAAI;8CAAc;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC1B;AAzDV,WAAW;IAFvB,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;GAC1B,WAAW,CA0DvB"}
@@ -0,0 +1,49 @@
1
+ import { OptionalProps } from '@mikro-orm/core';
2
+ /**
3
+ * PushSubscription (feature 046, US4). One subscribed storefront device/browser —
4
+ * a standard Web-Push subscription (endpoint + p256dh + auth). Idempotent on
5
+ * `endpoint` (upsert on re-subscribe). `customerAccountId` is null for anonymous
6
+ * devices (FR-023). Constraints/indexes are declared in migration 080.
7
+ */
8
+ export declare class PushSubscription {
9
+ [OptionalProps]?: 'id' | 'createdAt' | 'lastSeenAt' | 'status' | 'provider' | 'customerAccountId' | 'organizationId' | 'userAgent';
10
+ id: string;
11
+ salesChannelId: string;
12
+ customerAccountId?: string | null;
13
+ /**
14
+ * The organisation that owns this subscription — feature 087 Group B, ruling
15
+ * D-187.
16
+ *
17
+ * Derived from {@link customerAccountId}'s account and stamped at the write,
18
+ * never resolved on read: `customerOrganizationColumn` asks the ORM's own
19
+ * metadata whether this property exists, so its presence is what makes
20
+ * `customerFilterCond`'s `allowed-set` arm **grant** on this table rather
21
+ * than refuse it whole. A sales representative assigned to the buyer's
22
+ * organisation sees this device because this column is here.
23
+ *
24
+ * Nullable, and the constraint is an implication rather than an equivalence:
25
+ * `push_subscriptions_organization_attribution_chk` requires an organisation
26
+ * of a row that names an account and says nothing about a row that names
27
+ * none. An **anonymous** device is a representable state (FR-011, FR-023) —
28
+ * a browser subscribes before anybody signs in — and who such a row belongs
29
+ * to is R-6's open question, which a constraint must not answer.
30
+ *
31
+ * It moves in **both** directions with {@link customerAccountId}, because
32
+ * this table's write is an upsert on `endpoint`: signing in on a device
33
+ * stamps the account and the organisation together, and re-subscribing that
34
+ * same device anonymously clears both. The second direction is the one the
35
+ * implication does not cover — an ownerless row keeping an organisation is
36
+ * a disclosure the schema permits — so it is held by the service's resolved
37
+ * owner type and by a test, not by the check.
38
+ */
39
+ organizationId?: string | null;
40
+ endpoint: string;
41
+ p256dh: string;
42
+ auth: string;
43
+ provider: string;
44
+ status: 'active' | 'invalid';
45
+ userAgent?: string | null;
46
+ createdAt: Date;
47
+ lastSeenAt: Date;
48
+ }
49
+ //# sourceMappingURL=push-subscription.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-subscription.entity.d.ts","sourceRoot":"","sources":["../../../src/backend/entities/push-subscription.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgC,MAAM,iBAAiB,CAAC;AAI7F;;;;;GAKG;AACH,qBAGa,gBAAgB;IAC3B,CAAC,aAAa,CAAC,CAAC,EACZ,IAAI,GACJ,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,CAAC;IAGhB,EAAE,EAAE,MAAM,CAAgB;IAI1B,cAAc,EAAG,MAAM,CAAC;IAIxB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IAGH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,QAAQ,EAAG,MAAM,CAAC;IAGlB,MAAM,EAAG,MAAM,CAAC;IAGhB,IAAI,EAAG,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAc;IAG9B,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAY;IAGxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,SAAS,EAAE,IAAI,CAAc;IAG7B,UAAU,EAAE,IAAI,CAAc;CAC/B"}