@takosjp/yurucommu-api 3.0.2 → 3.2.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.
- package/dist/index.js +340 -6
- package/dist/lib/api/browser-push.d.ts +70 -0
- package/dist/lib/api/browser-push.d.ts.map +1 -0
- package/dist/lib/api/communities.d.ts +14 -1
- package/dist/lib/api/communities.d.ts.map +1 -1
- package/dist/lib/api/dm.d.ts +8 -2
- package/dist/lib/api/dm.d.ts.map +1 -1
- package/dist/lib/api/notifications.d.ts +19 -1
- package/dist/lib/api/notifications.d.ts.map +1 -1
- package/dist/lib/api.d.ts +1 -0
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/social-server.d.ts +2 -0
- package/dist/social-server.d.ts.map +1 -1
- package/dist/types/index.d.ts +36 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -453,11 +453,15 @@ async function fetchCommunityMessages(identifier, options) {
|
|
|
453
453
|
const data = await res.json();
|
|
454
454
|
return {
|
|
455
455
|
messages: (data.messages || []).map(normalizeCommunityMessage),
|
|
456
|
-
hasMore: data.has_more ?? false
|
|
456
|
+
hasMore: data.has_more ?? false,
|
|
457
|
+
readStates: data.read_states ?? []
|
|
457
458
|
};
|
|
458
459
|
}
|
|
459
|
-
async function sendCommunityMessage(identifier, content) {
|
|
460
|
-
const res = await apiPost(`/api/communities/${encodeURIComponent(identifier)}/messages`, {
|
|
460
|
+
async function sendCommunityMessage(identifier, content, attachments) {
|
|
461
|
+
const res = await apiPost(`/api/communities/${encodeURIComponent(identifier)}/messages`, {
|
|
462
|
+
content,
|
|
463
|
+
...attachments && attachments.length > 0 ? { attachments } : {}
|
|
464
|
+
});
|
|
461
465
|
await assertOk(res, "Failed to send message");
|
|
462
466
|
const data = await res.json();
|
|
463
467
|
return normalizeCommunityMessage(data.message);
|
|
@@ -570,11 +574,15 @@ async function fetchUserDMMessages(userApId, options) {
|
|
|
570
574
|
return {
|
|
571
575
|
messages: (data.messages || []).map(normalizeDmMessage),
|
|
572
576
|
conversation_id: data.conversation_id ?? null,
|
|
573
|
-
hasMore: data.has_more ?? false
|
|
577
|
+
hasMore: data.has_more ?? false,
|
|
578
|
+
partnerLastReadAt: data.partner_last_read_at ?? null
|
|
574
579
|
};
|
|
575
580
|
}
|
|
576
|
-
async function sendUserDMMessage(userApId, content) {
|
|
577
|
-
const res = await apiPost(`/api/dm/user/${encodeURIComponent(userApId)}/messages`, {
|
|
581
|
+
async function sendUserDMMessage(userApId, content, attachments) {
|
|
582
|
+
const res = await apiPost(`/api/dm/user/${encodeURIComponent(userApId)}/messages`, {
|
|
583
|
+
content,
|
|
584
|
+
...attachments && attachments.length > 0 ? { attachments } : {}
|
|
585
|
+
});
|
|
578
586
|
await assertOk(res, "Failed to send message");
|
|
579
587
|
const data = await res.json();
|
|
580
588
|
return {
|
|
@@ -678,6 +686,324 @@ async function archiveAllNotifications() {
|
|
|
678
686
|
const data = await res.json();
|
|
679
687
|
return data.archived_count ?? 0;
|
|
680
688
|
}
|
|
689
|
+
async function registerNotificationPusher(input) {
|
|
690
|
+
const res = await apiPost("/api/notifications/pushers", input);
|
|
691
|
+
await assertOk(res, "Failed to register notification pusher");
|
|
692
|
+
const data = await res.json();
|
|
693
|
+
return data.pusher;
|
|
694
|
+
}
|
|
695
|
+
async function unregisterNotificationPusher(input) {
|
|
696
|
+
const res = await apiDelete("/api/notifications/pushers", input);
|
|
697
|
+
await assertOk(res, "Failed to unregister notification pusher");
|
|
698
|
+
}
|
|
699
|
+
async function fetchNotificationPusherPublicConfig() {
|
|
700
|
+
const res = await apiFetch("/api/notifications/pushers/config");
|
|
701
|
+
await assertOk(res, "Failed to load notification pusher configuration");
|
|
702
|
+
const value = await res.json();
|
|
703
|
+
const gatewayUrl = typeof value.gateway_url === "string" ? value.gateway_url : null;
|
|
704
|
+
const publicKey = typeof value.web_push_public_key === "string" ? value.web_push_public_key : null;
|
|
705
|
+
return {
|
|
706
|
+
enabled: Boolean(gatewayUrl && publicKey),
|
|
707
|
+
gateway_url: gatewayUrl,
|
|
708
|
+
web_push_public_key: publicKey
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// src/lib/api/browser-push.ts
|
|
713
|
+
async function getBrowserNotificationPushState(config, runtime = browserPushRuntime()) {
|
|
714
|
+
if (!runtime.serviceWorker || !runtime.notification)
|
|
715
|
+
return "unsupported";
|
|
716
|
+
const normalized = normalizeBrowserPushConfig(config);
|
|
717
|
+
if (!normalized)
|
|
718
|
+
return "unconfigured";
|
|
719
|
+
if (runtime.notification.permission === "denied")
|
|
720
|
+
return "denied";
|
|
721
|
+
const registration = await runtime.serviceWorker.getRegistration();
|
|
722
|
+
const subscription = await registration?.pushManager.getSubscription();
|
|
723
|
+
return subscription && subscriptionMatchesConfig(normalized, subscription, runtime) ? "enabled" : "disabled";
|
|
724
|
+
}
|
|
725
|
+
async function enableBrowserNotificationPush(config, runtime = browserPushRuntime()) {
|
|
726
|
+
if (!runtime.serviceWorker || !runtime.notification) {
|
|
727
|
+
return { state: "unsupported" };
|
|
728
|
+
}
|
|
729
|
+
const normalized = requireBrowserPushConfig(config);
|
|
730
|
+
const permission = runtime.notification.permission === "default" ? await runtime.notification.requestPermission() : runtime.notification.permission;
|
|
731
|
+
if (permission !== "granted") {
|
|
732
|
+
return { state: permission === "denied" ? "denied" : "disabled" };
|
|
733
|
+
}
|
|
734
|
+
const serviceWorker = await runtime.serviceWorker.register(normalized.serviceWorkerPath, { scope: "/" });
|
|
735
|
+
let existing = await serviceWorker.pushManager.getSubscription();
|
|
736
|
+
if (existing && !subscriptionMatchesConfig(normalized, existing, runtime)) {
|
|
737
|
+
await retireBrowserSubscription(normalized, existing, runtime);
|
|
738
|
+
existing = null;
|
|
739
|
+
}
|
|
740
|
+
const subscription = existing ?? await serviceWorker.pushManager.subscribe({
|
|
741
|
+
userVisibleOnly: true,
|
|
742
|
+
applicationServerKey: normalized.applicationServerKey
|
|
743
|
+
});
|
|
744
|
+
const registration = await registerBrowserSubscription(normalized, subscription);
|
|
745
|
+
storeBrowserPushBinding(normalized, subscription, runtime);
|
|
746
|
+
return { state: "enabled", registration };
|
|
747
|
+
}
|
|
748
|
+
async function refreshBrowserNotificationPush(config, runtime = browserPushRuntime()) {
|
|
749
|
+
if (!runtime.serviceWorker || !runtime.notification)
|
|
750
|
+
return "unsupported";
|
|
751
|
+
const normalized = normalizeBrowserPushConfig(config);
|
|
752
|
+
if (!normalized)
|
|
753
|
+
return "unconfigured";
|
|
754
|
+
if (runtime.notification.permission !== "granted") {
|
|
755
|
+
return runtime.notification.permission === "denied" ? "denied" : "disabled";
|
|
756
|
+
}
|
|
757
|
+
const serviceWorker = await runtime.serviceWorker.register(normalized.serviceWorkerPath, { scope: "/" });
|
|
758
|
+
const subscription = await serviceWorker.pushManager.getSubscription();
|
|
759
|
+
if (!subscription)
|
|
760
|
+
return "disabled";
|
|
761
|
+
if (!subscriptionMatchesConfig(normalized, subscription, runtime)) {
|
|
762
|
+
await retireBrowserSubscription(normalized, subscription, runtime);
|
|
763
|
+
return "disabled";
|
|
764
|
+
}
|
|
765
|
+
await registerBrowserSubscription(normalized, subscription);
|
|
766
|
+
storeBrowserPushBinding(normalized, subscription, runtime);
|
|
767
|
+
return "enabled";
|
|
768
|
+
}
|
|
769
|
+
async function disableBrowserNotificationPush(config, runtime = browserPushRuntime()) {
|
|
770
|
+
if (!runtime.serviceWorker || !runtime.notification)
|
|
771
|
+
return "unsupported";
|
|
772
|
+
const normalized = requireBrowserPushConfig(config);
|
|
773
|
+
const serviceWorker = await runtime.serviceWorker.getRegistration();
|
|
774
|
+
const subscription = await serviceWorker?.pushManager.getSubscription();
|
|
775
|
+
if (!subscription) {
|
|
776
|
+
clearBrowserPushBinding(normalized, runtime);
|
|
777
|
+
return "disabled";
|
|
778
|
+
}
|
|
779
|
+
await retireBrowserSubscription(normalized, subscription, runtime, true);
|
|
780
|
+
return "disabled";
|
|
781
|
+
}
|
|
782
|
+
async function clearBrowserNotificationPush(identity, runtime = browserPushRuntime()) {
|
|
783
|
+
if (!runtime.serviceWorker)
|
|
784
|
+
return "unsupported";
|
|
785
|
+
const registration = await runtime.serviceWorker.getRegistration();
|
|
786
|
+
const subscription = await registration?.pushManager.getSubscription();
|
|
787
|
+
if (subscription)
|
|
788
|
+
await subscription.unsubscribe();
|
|
789
|
+
clearBrowserPushBindingForIdentity(identity, runtime);
|
|
790
|
+
return "disabled";
|
|
791
|
+
}
|
|
792
|
+
function browserPushRuntime() {
|
|
793
|
+
const navigatorValue = globalThis.navigator;
|
|
794
|
+
const notificationValue = globalThis.Notification;
|
|
795
|
+
let storage;
|
|
796
|
+
try {
|
|
797
|
+
storage = globalThis.localStorage;
|
|
798
|
+
} catch {
|
|
799
|
+
storage = undefined;
|
|
800
|
+
}
|
|
801
|
+
return {
|
|
802
|
+
...navigatorValue?.serviceWorker ? {
|
|
803
|
+
serviceWorker: navigatorValue.serviceWorker
|
|
804
|
+
} : {},
|
|
805
|
+
...notificationValue ? {
|
|
806
|
+
notification: notificationValue
|
|
807
|
+
} : {},
|
|
808
|
+
...storage ? { storage } : {}
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
function requireBrowserPushConfig(config) {
|
|
812
|
+
const normalized = normalizeBrowserPushConfig(config);
|
|
813
|
+
if (!normalized) {
|
|
814
|
+
throw new Error("Browser notification push requires a valid HTTPS gateway URL, VAPID public key, app id, and root-relative service worker path.");
|
|
815
|
+
}
|
|
816
|
+
return normalized;
|
|
817
|
+
}
|
|
818
|
+
function normalizeBrowserPushConfig(config) {
|
|
819
|
+
if (!config)
|
|
820
|
+
return null;
|
|
821
|
+
const appId = config.appId.trim();
|
|
822
|
+
const appDisplayName = config.appDisplayName.trim();
|
|
823
|
+
const serverOrigin = normalizeServerOrigin(config.serverOrigin);
|
|
824
|
+
const gatewayUrl = normalizeGatewayUrl(config.gatewayUrl);
|
|
825
|
+
const vapidPublicKey = config.vapidPublicKey.trim();
|
|
826
|
+
const applicationServerKey = decodeVapidPublicKey(vapidPublicKey);
|
|
827
|
+
const serviceWorkerPath = config.serviceWorkerPath.trim();
|
|
828
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$/.test(appId) || !appDisplayName || appDisplayName.length > 255 || !serverOrigin || !gatewayUrl || !applicationServerKey || !serviceWorkerPath.startsWith("/") || serviceWorkerPath.startsWith("//") || serviceWorkerPath.length > 512) {
|
|
829
|
+
return null;
|
|
830
|
+
}
|
|
831
|
+
return {
|
|
832
|
+
...config,
|
|
833
|
+
appId,
|
|
834
|
+
appDisplayName,
|
|
835
|
+
serverOrigin,
|
|
836
|
+
gatewayUrl,
|
|
837
|
+
vapidPublicKey,
|
|
838
|
+
serviceWorkerPath,
|
|
839
|
+
applicationServerKey
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
function normalizeServerOrigin(value) {
|
|
843
|
+
try {
|
|
844
|
+
const url = new URL(value.trim());
|
|
845
|
+
if (url.username || url.password || url.hash)
|
|
846
|
+
return null;
|
|
847
|
+
const loopback = url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "[::1]";
|
|
848
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && loopback)) {
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
return url.origin;
|
|
852
|
+
} catch {
|
|
853
|
+
return null;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
function normalizeGatewayUrl(value) {
|
|
857
|
+
try {
|
|
858
|
+
const url = new URL(value.trim());
|
|
859
|
+
if (url.username || url.password || url.hash)
|
|
860
|
+
return null;
|
|
861
|
+
if (url.protocol === "https:") {
|
|
862
|
+
if (url.port && url.port !== "443")
|
|
863
|
+
return null;
|
|
864
|
+
if (!isPublicHttpsHostname(url.hostname))
|
|
865
|
+
return null;
|
|
866
|
+
return url.toString();
|
|
867
|
+
}
|
|
868
|
+
if (url.protocol !== "http:" || !isLoopbackHostname(url.hostname)) {
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
return url.toString();
|
|
872
|
+
} catch {
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
function isLoopbackHostname(hostname) {
|
|
877
|
+
const normalized = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
878
|
+
if (normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "::1") {
|
|
879
|
+
return true;
|
|
880
|
+
}
|
|
881
|
+
const octets = normalized.split(".").map(Number);
|
|
882
|
+
return octets.length === 4 && octets.every((part) => Number.isInteger(part) && part >= 0 && part <= 255) && octets[0] === 127;
|
|
883
|
+
}
|
|
884
|
+
function isPublicHttpsHostname(hostname) {
|
|
885
|
+
const normalized = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
886
|
+
if (!normalized.includes(".") || normalized.endsWith(".localhost") || normalized.endsWith(".local") || normalized.endsWith(".internal") || normalized.endsWith(".home") || normalized.endsWith(".lan")) {
|
|
887
|
+
return false;
|
|
888
|
+
}
|
|
889
|
+
const ipv4 = normalized.split(".").map(Number);
|
|
890
|
+
if (ipv4.length === 4 && ipv4.every((part) => Number.isInteger(part) && part >= 0 && part <= 255)) {
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
return !normalized.includes(":");
|
|
894
|
+
}
|
|
895
|
+
function decodeVapidPublicKey(value) {
|
|
896
|
+
const normalized = value.trim().replace(/-/g, "+").replace(/_/g, "/");
|
|
897
|
+
if (!normalized || normalized.length > 256)
|
|
898
|
+
return null;
|
|
899
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
|
900
|
+
try {
|
|
901
|
+
const binary = globalThis.atob(padded);
|
|
902
|
+
const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
903
|
+
return bytes.byteLength === 65 && bytes[0] === 4 ? bytes : null;
|
|
904
|
+
} catch {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
async function registerBrowserSubscription(config, subscription) {
|
|
909
|
+
const registration = await registerNotificationPusher({
|
|
910
|
+
product: config.product,
|
|
911
|
+
...config.scope ? { scope: config.scope } : {},
|
|
912
|
+
pusher: {
|
|
913
|
+
kind: "http",
|
|
914
|
+
app_id: config.appId,
|
|
915
|
+
app_display_name: config.appDisplayName,
|
|
916
|
+
pushkey: subscription.endpoint,
|
|
917
|
+
...config.lang ? { lang: config.lang } : {},
|
|
918
|
+
data: {
|
|
919
|
+
url: config.gatewayUrl,
|
|
920
|
+
format: "event_id_only",
|
|
921
|
+
provider: "webpush",
|
|
922
|
+
ttl: 60,
|
|
923
|
+
urgency: "normal"
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
return registration;
|
|
928
|
+
}
|
|
929
|
+
function browserPushBindingKey(identity) {
|
|
930
|
+
return `yurucommu.browser-push.v1.${identity.product}.${identity.appId}`;
|
|
931
|
+
}
|
|
932
|
+
function readBrowserPushBinding(config, runtime) {
|
|
933
|
+
try {
|
|
934
|
+
const value = runtime.storage?.getItem(browserPushBindingKey(config));
|
|
935
|
+
if (!value || value.length > 4096)
|
|
936
|
+
return null;
|
|
937
|
+
const parsed = JSON.parse(value);
|
|
938
|
+
return typeof parsed.endpoint === "string" && typeof parsed.serverOrigin === "string" && typeof parsed.vapidPublicKey === "string" ? {
|
|
939
|
+
endpoint: parsed.endpoint,
|
|
940
|
+
serverOrigin: parsed.serverOrigin,
|
|
941
|
+
vapidPublicKey: parsed.vapidPublicKey
|
|
942
|
+
} : null;
|
|
943
|
+
} catch {
|
|
944
|
+
return null;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
function storeBrowserPushBinding(config, subscription, runtime) {
|
|
948
|
+
try {
|
|
949
|
+
runtime.storage?.setItem(browserPushBindingKey(config), JSON.stringify({
|
|
950
|
+
endpoint: subscription.endpoint,
|
|
951
|
+
serverOrigin: config.serverOrigin,
|
|
952
|
+
vapidPublicKey: config.vapidPublicKey
|
|
953
|
+
}));
|
|
954
|
+
} catch {}
|
|
955
|
+
}
|
|
956
|
+
function clearBrowserPushBinding(config, runtime) {
|
|
957
|
+
clearBrowserPushBindingForIdentity(config, runtime);
|
|
958
|
+
}
|
|
959
|
+
function clearBrowserPushBindingForIdentity(identity, runtime) {
|
|
960
|
+
try {
|
|
961
|
+
runtime.storage?.removeItem(browserPushBindingKey(identity));
|
|
962
|
+
} catch {}
|
|
963
|
+
}
|
|
964
|
+
function subscriptionMatchesConfig(config, subscription, runtime) {
|
|
965
|
+
const binding = readBrowserPushBinding(config, runtime);
|
|
966
|
+
if (binding && (binding.endpoint !== subscription.endpoint || binding.serverOrigin !== config.serverOrigin || binding.vapidPublicKey !== config.vapidPublicKey)) {
|
|
967
|
+
return false;
|
|
968
|
+
}
|
|
969
|
+
const existingKey = subscription.options?.applicationServerKey;
|
|
970
|
+
if (!existingKey)
|
|
971
|
+
return binding !== null;
|
|
972
|
+
return equalBufferSources(existingKey, config.applicationServerKey);
|
|
973
|
+
}
|
|
974
|
+
function equalBufferSources(left, right) {
|
|
975
|
+
const leftBytes = bufferSourceBytes(left);
|
|
976
|
+
const rightBytes = bufferSourceBytes(right);
|
|
977
|
+
if (leftBytes.byteLength !== rightBytes.byteLength)
|
|
978
|
+
return false;
|
|
979
|
+
for (let index = 0;index < leftBytes.byteLength; index += 1) {
|
|
980
|
+
if (leftBytes[index] !== rightBytes[index])
|
|
981
|
+
return false;
|
|
982
|
+
}
|
|
983
|
+
return true;
|
|
984
|
+
}
|
|
985
|
+
function bufferSourceBytes(value) {
|
|
986
|
+
return ArrayBuffer.isView(value) ? new Uint8Array(value.buffer, value.byteOffset, value.byteLength) : new Uint8Array(value);
|
|
987
|
+
}
|
|
988
|
+
async function retireBrowserSubscription(config, subscription, runtime, unregisterCurrentServer = false) {
|
|
989
|
+
const binding = readBrowserPushBinding(config, runtime);
|
|
990
|
+
const canUnregisterCurrentServer = unregisterCurrentServer || !binding || binding.serverOrigin === config.serverOrigin;
|
|
991
|
+
if (canUnregisterCurrentServer) {
|
|
992
|
+
try {
|
|
993
|
+
await unregisterNotificationPusher({
|
|
994
|
+
product: config.product,
|
|
995
|
+
...config.scope ? { scope: config.scope } : {},
|
|
996
|
+
app_id: config.appId,
|
|
997
|
+
pushkey: subscription.endpoint
|
|
998
|
+
});
|
|
999
|
+
} catch {}
|
|
1000
|
+
}
|
|
1001
|
+
try {
|
|
1002
|
+
await subscription.unsubscribe();
|
|
1003
|
+
} finally {
|
|
1004
|
+
clearBrowserPushBinding(config, runtime);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
681
1007
|
|
|
682
1008
|
// src/lib/api/search.ts
|
|
683
1009
|
function pageParams(query, opts) {
|
|
@@ -932,6 +1258,7 @@ export {
|
|
|
932
1258
|
updateCommunitySettings,
|
|
933
1259
|
updateCommunityMemberRole,
|
|
934
1260
|
unrepostPost,
|
|
1261
|
+
unregisterNotificationPusher,
|
|
935
1262
|
unmuteUser,
|
|
936
1263
|
unlikeStory,
|
|
937
1264
|
unlikePost,
|
|
@@ -962,6 +1289,8 @@ export {
|
|
|
962
1289
|
rejectFollowRequest,
|
|
963
1290
|
rejectDMRequest,
|
|
964
1291
|
rejectCommunityJoinRequest,
|
|
1292
|
+
registerNotificationPusher,
|
|
1293
|
+
refreshBrowserNotificationPush,
|
|
965
1294
|
normalizeStory,
|
|
966
1295
|
normalizePost,
|
|
967
1296
|
normalizeNotification,
|
|
@@ -984,6 +1313,7 @@ export {
|
|
|
984
1313
|
joinCommunity,
|
|
985
1314
|
getYurucommuApiTransport,
|
|
986
1315
|
getStoryViewers,
|
|
1316
|
+
getBrowserNotificationPushState,
|
|
987
1317
|
follow,
|
|
988
1318
|
fetchUserDMTyping,
|
|
989
1319
|
fetchUserDMMessages,
|
|
@@ -997,6 +1327,7 @@ export {
|
|
|
997
1327
|
fetchRecommendedUsers,
|
|
998
1328
|
fetchPost,
|
|
999
1329
|
fetchNotifications,
|
|
1330
|
+
fetchNotificationPusherPublicConfig,
|
|
1000
1331
|
fetchNotes,
|
|
1001
1332
|
fetchMutedUsers,
|
|
1002
1333
|
fetchFollowing,
|
|
@@ -1022,7 +1353,9 @@ export {
|
|
|
1022
1353
|
fetchActor,
|
|
1023
1354
|
fetchAccounts,
|
|
1024
1355
|
extractErrorMessage,
|
|
1356
|
+
enableBrowserNotificationPush,
|
|
1025
1357
|
editPost,
|
|
1358
|
+
disableBrowserNotificationPush,
|
|
1026
1359
|
deleteStory,
|
|
1027
1360
|
deletePost,
|
|
1028
1361
|
deleteMyNote,
|
|
@@ -1035,6 +1368,7 @@ export {
|
|
|
1035
1368
|
createCommunity,
|
|
1036
1369
|
createAccount,
|
|
1037
1370
|
clearYurucommuApiTransport,
|
|
1371
|
+
clearBrowserNotificationPush,
|
|
1038
1372
|
bookmarkPost,
|
|
1039
1373
|
blockUser,
|
|
1040
1374
|
blockDomain,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { NotificationPusherProduct, NotificationPusherRegistration } from "../../types/index.js";
|
|
2
|
+
export type BrowserNotificationPushState = "unsupported" | "unconfigured" | "denied" | "disabled" | "enabled";
|
|
3
|
+
export interface BrowserNotificationPushConfig {
|
|
4
|
+
readonly product: NotificationPusherProduct;
|
|
5
|
+
readonly appId: string;
|
|
6
|
+
readonly appDisplayName: string;
|
|
7
|
+
/** Origin of the yurucommu-compatible API that owns this registration. */
|
|
8
|
+
readonly serverOrigin: string;
|
|
9
|
+
/** Public stateless gateway notify endpoint. */
|
|
10
|
+
readonly gatewayUrl: string;
|
|
11
|
+
/** Public uncompressed P-256 VAPID key, base64url encoded. */
|
|
12
|
+
readonly vapidPublicKey: string;
|
|
13
|
+
readonly serviceWorkerPath: string;
|
|
14
|
+
readonly scope?: string;
|
|
15
|
+
readonly lang?: string;
|
|
16
|
+
}
|
|
17
|
+
interface BrowserPushSubscriptionLike {
|
|
18
|
+
readonly endpoint: string;
|
|
19
|
+
readonly options?: {
|
|
20
|
+
readonly applicationServerKey: ArrayBuffer | null;
|
|
21
|
+
};
|
|
22
|
+
unsubscribe(): Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
interface BrowserPushManagerLike {
|
|
25
|
+
getSubscription(): Promise<BrowserPushSubscriptionLike | null>;
|
|
26
|
+
subscribe(options: {
|
|
27
|
+
readonly userVisibleOnly: true;
|
|
28
|
+
readonly applicationServerKey: BufferSource;
|
|
29
|
+
}): Promise<BrowserPushSubscriptionLike>;
|
|
30
|
+
}
|
|
31
|
+
interface BrowserServiceWorkerRegistrationLike {
|
|
32
|
+
readonly pushManager: BrowserPushManagerLike;
|
|
33
|
+
}
|
|
34
|
+
interface BrowserServiceWorkerContainerLike {
|
|
35
|
+
register(scriptURL: string, options?: RegistrationOptions): Promise<BrowserServiceWorkerRegistrationLike>;
|
|
36
|
+
getRegistration(clientURL?: string): Promise<BrowserServiceWorkerRegistrationLike | undefined>;
|
|
37
|
+
}
|
|
38
|
+
interface BrowserNotificationApiLike {
|
|
39
|
+
readonly permission: NotificationPermission;
|
|
40
|
+
requestPermission(): Promise<NotificationPermission>;
|
|
41
|
+
}
|
|
42
|
+
interface BrowserPushStorageLike {
|
|
43
|
+
getItem(key: string): string | null;
|
|
44
|
+
setItem(key: string, value: string): void;
|
|
45
|
+
removeItem(key: string): void;
|
|
46
|
+
}
|
|
47
|
+
export interface BrowserNotificationPushRuntime {
|
|
48
|
+
readonly serviceWorker?: BrowserServiceWorkerContainerLike;
|
|
49
|
+
readonly notification?: BrowserNotificationApiLike;
|
|
50
|
+
readonly storage?: BrowserPushStorageLike;
|
|
51
|
+
}
|
|
52
|
+
export declare function getBrowserNotificationPushState(config: BrowserNotificationPushConfig | null | undefined, runtime?: BrowserNotificationPushRuntime): Promise<BrowserNotificationPushState>;
|
|
53
|
+
export declare function enableBrowserNotificationPush(config: BrowserNotificationPushConfig, runtime?: BrowserNotificationPushRuntime): Promise<{
|
|
54
|
+
readonly state: BrowserNotificationPushState;
|
|
55
|
+
readonly registration?: NotificationPusherRegistration;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Rebind an existing browser subscription to the current signed-in actor.
|
|
59
|
+
* This never requests permission and never creates a new subscription.
|
|
60
|
+
*/
|
|
61
|
+
export declare function refreshBrowserNotificationPush(config: BrowserNotificationPushConfig | null | undefined, runtime?: BrowserNotificationPushRuntime): Promise<BrowserNotificationPushState>;
|
|
62
|
+
export declare function disableBrowserNotificationPush(config: BrowserNotificationPushConfig, runtime?: BrowserNotificationPushRuntime): Promise<BrowserNotificationPushState>;
|
|
63
|
+
/**
|
|
64
|
+
* Invalidate this product's browser endpoint without requiring runtime push
|
|
65
|
+
* configuration. Use this during logout/account teardown so a removed or
|
|
66
|
+
* temporarily unavailable server cannot keep waking a signed-out device.
|
|
67
|
+
*/
|
|
68
|
+
export declare function clearBrowserNotificationPush(identity: Pick<BrowserNotificationPushConfig, "product" | "appId" | "serviceWorkerPath">, runtime?: BrowserNotificationPushRuntime): Promise<BrowserNotificationPushState>;
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=browser-push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-push.d.ts","sourceRoot":"","sources":["../../../src/lib/api/browser-push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAM9B,MAAM,MAAM,4BAA4B,GACtC,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CA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|
3
4
|
name: string;
|
|
@@ -35,8 +36,18 @@ export interface CommunityMessage {
|
|
|
35
36
|
icon_url: string | null;
|
|
36
37
|
};
|
|
37
38
|
content: string;
|
|
39
|
+
/** Media attachments (image/video), same shape as post attachments. */
|
|
40
|
+
attachments?: MediaAttachment[];
|
|
38
41
|
created_at: string;
|
|
39
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* A member's chat read position (LOCAL-ONLY read receipt). Only local members
|
|
45
|
+
* that opened the chat appear; remote members never report read state.
|
|
46
|
+
*/
|
|
47
|
+
export interface CommunityReadState {
|
|
48
|
+
actor_ap_id: string;
|
|
49
|
+
last_read_at: string;
|
|
50
|
+
}
|
|
40
51
|
export interface JoinCommunityResult {
|
|
41
52
|
status: "joined" | "pending" | "invite_required";
|
|
42
53
|
}
|
|
@@ -91,8 +102,10 @@ export declare function fetchCommunityMessages(identifier: string, options?: {
|
|
|
91
102
|
}): Promise<{
|
|
92
103
|
messages: CommunityMessage[];
|
|
93
104
|
hasMore: boolean;
|
|
105
|
+
/** Per-member read positions (local members only; see CommunityReadState). */
|
|
106
|
+
readStates: CommunityReadState[];
|
|
94
107
|
}>;
|
|
95
|
-
export declare function sendCommunityMessage(identifier: string, content: string): Promise<CommunityMessage>;
|
|
108
|
+
export declare function sendCommunityMessage(identifier: string, content: string, attachments?: MediaAttachment[]): Promise<CommunityMessage>;
|
|
96
109
|
export declare function fetchCommunityMembers(identifier: string): Promise<CommunityMember[]>;
|
|
97
110
|
export declare function fetchCommunityJoinRequests(identifier: string): Promise<CommunityJoinRequest[]>;
|
|
98
111
|
export declare function acceptCommunityJoinRequest(identifier: string, actorApId: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communities.d.ts","sourceRoot":"","sources":["../../../src/lib/api/communities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"communities.d.ts","sourceRoot":"","sources":["../../../src/lib/api/communities.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AC1C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
package/dist/lib/api/dm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DMMessage } from "../../types/index.js";
|
|
1
|
+
import type { DMMessage, MediaAttachment } from "../../types/index.js";
|
|
2
2
|
export interface DMContact {
|
|
3
3
|
type: "user" | "community";
|
|
4
4
|
ap_id: string;
|
|
@@ -48,8 +48,14 @@ export declare function fetchUserDMMessages(userApId: string, options?: {
|
|
|
48
48
|
messages: DMMessage[];
|
|
49
49
|
conversation_id: string | null;
|
|
50
50
|
hasMore: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The partner's last-read time (LOCAL-ONLY read receipt), or null when
|
|
53
|
+
* unknown — a remote partner never reports read state, so null must render
|
|
54
|
+
* as "no receipt", not "unread".
|
|
55
|
+
*/
|
|
56
|
+
partnerLastReadAt: string | null;
|
|
51
57
|
}>;
|
|
52
|
-
export declare function sendUserDMMessage(userApId: string, content: string): Promise<{
|
|
58
|
+
export declare function sendUserDMMessage(userApId: string, content: string, attachments?: MediaAttachment[]): Promise<{
|
|
53
59
|
message: DMMessage;
|
|
54
60
|
conversation_id: string;
|
|
55
61
|
}>;
|
package/dist/lib/api/dm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dm.d.ts","sourceRoot":"","sources":["../../../src/lib/api/dm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"dm.d.ts","sourceRoot":"","sources":["../../../src/lib/api/dm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,KAAK,EAAE,MAAM,C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GACpB,OAAO,CAAC,IAAI,CAAC,CAKf;AAKD,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAM5E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Notification } from "../../types/index.js";
|
|
1
|
+
import type { Notification, NotificationPusherInput, NotificationPusherProduct, NotificationPusherRegistration } from "../../types/index.js";
|
|
2
2
|
export declare function fetchNotifications(options?: {
|
|
3
3
|
limit?: number;
|
|
4
4
|
type?: string;
|
|
@@ -14,4 +14,22 @@ export declare function markNotificationsRead(ids?: string[]): Promise<void>;
|
|
|
14
14
|
export declare function archiveNotifications(ids: string[]): Promise<void>;
|
|
15
15
|
export declare function unarchiveNotifications(ids: string[]): Promise<void>;
|
|
16
16
|
export declare function archiveAllNotifications(): Promise<number>;
|
|
17
|
+
export declare function registerNotificationPusher(input: {
|
|
18
|
+
product: NotificationPusherProduct;
|
|
19
|
+
scope?: string;
|
|
20
|
+
pusher: NotificationPusherInput;
|
|
21
|
+
}): Promise<NotificationPusherRegistration>;
|
|
22
|
+
export declare function unregisterNotificationPusher(input: {
|
|
23
|
+
product: NotificationPusherProduct;
|
|
24
|
+
scope?: string;
|
|
25
|
+
app_id: string;
|
|
26
|
+
pushkey: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
export interface NotificationPusherPublicConfig {
|
|
29
|
+
readonly enabled: boolean;
|
|
30
|
+
readonly gateway_url: string | null;
|
|
31
|
+
readonly web_push_public_key: string | null;
|
|
32
|
+
}
|
|
33
|
+
/** Non-secret runtime configuration used by browser/PWA clients. */
|
|
34
|
+
export declare function fetchNotificationPusherPublicConfig(): Promise<NotificationPusherPublicConfig>;
|
|
17
35
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/lib/api/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED,oEAAoE;AACpE,wBAAsB,mCAAmC,IAAI,OAAO,CAAC,8BAA8B,CAAC,CAenG"}
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./api/posts.js";
|
|
|
7
7
|
export * from "./api/communities.js";
|
|
8
8
|
export * from "./api/dm.js";
|
|
9
9
|
export * from "./api/notifications.js";
|
|
10
|
+
export * from "./api/browser-push.js";
|
|
10
11
|
export * from "./api/search.js";
|
|
11
12
|
export * from "./api/media.js";
|
|
12
13
|
export * from "./api/stories.js";
|
package/dist/lib/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/dist/social-server.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface SocialServerDiscovery {
|
|
|
26
26
|
readonly timeline: string;
|
|
27
27
|
readonly conversations: string;
|
|
28
28
|
readonly notifications: string;
|
|
29
|
+
readonly notificationPushers: string;
|
|
30
|
+
/** @deprecated Use notificationPushers. */
|
|
29
31
|
readonly mobilePushRegistrations: string;
|
|
30
32
|
};
|
|
31
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-server.d.ts","sourceRoot":"","sources":["../src/social-server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,EAAE,EAAE,kBAAkB,CAAC;QAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;KACpC,CAAC;IACF,Q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AAO,CAAC,qBAAqB,CAAC,CAIjF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -81,6 +81,8 @@ export interface DMMessage {
|
|
|
81
81
|
id: string;
|
|
82
82
|
sender: DMSender;
|
|
83
83
|
content: string;
|
|
84
|
+
/** Media attachments (image/video), same shape as post attachments. */
|
|
85
|
+
attachments?: MediaAttachment[];
|
|
84
86
|
created_at: string;
|
|
85
87
|
}
|
|
86
88
|
export interface NotificationActor {
|
|
@@ -95,9 +97,43 @@ export interface Notification {
|
|
|
95
97
|
type: "follow" | "follow_request" | "like" | "announce" | "reply" | "mention";
|
|
96
98
|
actor: NotificationActor;
|
|
97
99
|
object_ap_id: string | null;
|
|
100
|
+
target_kind: "post" | "story" | "profile" | "community" | "notifications";
|
|
101
|
+
target_id: string | null;
|
|
102
|
+
/** Same-origin in-app path. Clients must not treat this as an external URL. */
|
|
103
|
+
target_url: string;
|
|
98
104
|
read: boolean;
|
|
99
105
|
created_at: string;
|
|
100
106
|
}
|
|
107
|
+
export type NotificationPusherProduct = "yurucommu" | "yurume";
|
|
108
|
+
export interface NotificationPusherInput {
|
|
109
|
+
kind: "http";
|
|
110
|
+
app_id: string;
|
|
111
|
+
pushkey: string;
|
|
112
|
+
app_display_name?: string;
|
|
113
|
+
device_display_name?: string;
|
|
114
|
+
profile_tag?: string;
|
|
115
|
+
lang?: string;
|
|
116
|
+
data: {
|
|
117
|
+
url: string;
|
|
118
|
+
format?: "event_id_only" | "full";
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export interface NotificationPusherRegistration {
|
|
123
|
+
id: string;
|
|
124
|
+
kind: "http";
|
|
125
|
+
app_id: string;
|
|
126
|
+
app_display_name?: string;
|
|
127
|
+
device_display_name?: string;
|
|
128
|
+
profile_tag?: string;
|
|
129
|
+
lang?: string;
|
|
130
|
+
data: Record<string, unknown>;
|
|
131
|
+
gateway_url: string;
|
|
132
|
+
product: NotificationPusherProduct;
|
|
133
|
+
scope: string | null;
|
|
134
|
+
registered_at: string;
|
|
135
|
+
last_seen_at: string;
|
|
136
|
+
}
|
|
101
137
|
export interface StoryAttachment {
|
|
102
138
|
type: string;
|
|
103
139
|
mediaType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAI3C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAGD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAA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