@oxy.so/contracts 1.4.0 → 2.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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +9 -22
- package/dist/cjs/linkedAccounts.js +93 -0
- package/dist/cjs/notifications.js +81 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/linkedAccounts.js +90 -0
- package/dist/esm/notifications.js +78 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/deviceDirectory.d.ts +46 -46
- package/dist/types/deviceSession.d.ts +2 -2
- package/dist/types/externalIdentity.d.ts +4 -4
- package/dist/types/index.d.ts +2 -2
- package/dist/types/inference/aliaModelRelease.d.ts +4 -4
- package/dist/types/inference/modelDocumentation.d.ts +8 -8
- package/dist/types/inference/providerConnection.d.ts +4 -4
- package/dist/types/linkedAccounts.d.ts +341 -0
- package/dist/types/notifications.d.ts +93 -0
- package/dist/types/oauth.d.ts +16 -16
- package/dist/types/sessionStatus.d.ts +6 -6
- package/dist/types/userResponse.d.ts +4 -4
- package/package.json +1 -1
- package/dist/cjs/browserHub.js +0 -215
- package/dist/esm/browserHub.js +0 -212
- package/dist/types/browserHub.d.ts +0 -856
|
@@ -389,6 +389,7 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
389
389
|
}>, "many">;
|
|
390
390
|
}, "strict", z.ZodTypeAny, {
|
|
391
391
|
schemaVersion: 1;
|
|
392
|
+
issuedAt: string;
|
|
392
393
|
revision: {
|
|
393
394
|
schemaVersion: 1;
|
|
394
395
|
revision: string;
|
|
@@ -413,7 +414,6 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
413
414
|
safetyCardUrl?: string | undefined;
|
|
414
415
|
} | undefined;
|
|
415
416
|
};
|
|
416
|
-
issuedAt: string;
|
|
417
417
|
signatures: {
|
|
418
418
|
signature: string;
|
|
419
419
|
signedAt: string;
|
|
@@ -443,6 +443,7 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
443
443
|
}[];
|
|
444
444
|
}, {
|
|
445
445
|
schemaVersion: 1;
|
|
446
|
+
issuedAt: string;
|
|
446
447
|
revision: {
|
|
447
448
|
schemaVersion: 1;
|
|
448
449
|
revision: string;
|
|
@@ -467,7 +468,6 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
467
468
|
knownLimitations?: string[] | undefined;
|
|
468
469
|
} | undefined;
|
|
469
470
|
};
|
|
470
|
-
issuedAt: string;
|
|
471
471
|
signatures: {
|
|
472
472
|
signature: string;
|
|
473
473
|
signedAt: string;
|
|
@@ -497,6 +497,7 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
497
497
|
}[];
|
|
498
498
|
}>, {
|
|
499
499
|
schemaVersion: 1;
|
|
500
|
+
issuedAt: string;
|
|
500
501
|
revision: {
|
|
501
502
|
schemaVersion: 1;
|
|
502
503
|
revision: string;
|
|
@@ -521,7 +522,6 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
521
522
|
safetyCardUrl?: string | undefined;
|
|
522
523
|
} | undefined;
|
|
523
524
|
};
|
|
524
|
-
issuedAt: string;
|
|
525
525
|
signatures: {
|
|
526
526
|
signature: string;
|
|
527
527
|
signedAt: string;
|
|
@@ -551,6 +551,7 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
551
551
|
}[];
|
|
552
552
|
}, {
|
|
553
553
|
schemaVersion: 1;
|
|
554
|
+
issuedAt: string;
|
|
554
555
|
revision: {
|
|
555
556
|
schemaVersion: 1;
|
|
556
557
|
revision: string;
|
|
@@ -575,7 +576,6 @@ export declare const aliaModelReleaseManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
575
576
|
knownLimitations?: string[] | undefined;
|
|
576
577
|
} | undefined;
|
|
577
578
|
};
|
|
578
|
-
issuedAt: string;
|
|
579
579
|
signatures: {
|
|
580
580
|
signature: string;
|
|
581
581
|
signedAt: string;
|
|
@@ -638,6 +638,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
638
638
|
}>, "many">;
|
|
639
639
|
}, "strict", z.ZodTypeAny, {
|
|
640
640
|
schemaVersion: 1;
|
|
641
|
+
issuedAt: string;
|
|
641
642
|
revision: {
|
|
642
643
|
schemaVersion: 1;
|
|
643
644
|
revision: string;
|
|
@@ -662,7 +663,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
662
663
|
safetyCardUrl?: string | undefined;
|
|
663
664
|
} | undefined;
|
|
664
665
|
};
|
|
665
|
-
issuedAt: string;
|
|
666
666
|
signatures: {
|
|
667
667
|
signature: string;
|
|
668
668
|
signedAt: string;
|
|
@@ -692,6 +692,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
692
692
|
}[];
|
|
693
693
|
}, {
|
|
694
694
|
schemaVersion: 1;
|
|
695
|
+
issuedAt: string;
|
|
695
696
|
revision: {
|
|
696
697
|
schemaVersion: 1;
|
|
697
698
|
revision: string;
|
|
@@ -716,7 +717,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
716
717
|
knownLimitations?: string[] | undefined;
|
|
717
718
|
} | undefined;
|
|
718
719
|
};
|
|
719
|
-
issuedAt: string;
|
|
720
720
|
signatures: {
|
|
721
721
|
signature: string;
|
|
722
722
|
signedAt: string;
|
|
@@ -746,6 +746,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
746
746
|
}[];
|
|
747
747
|
}>, {
|
|
748
748
|
schemaVersion: 1;
|
|
749
|
+
issuedAt: string;
|
|
749
750
|
revision: {
|
|
750
751
|
schemaVersion: 1;
|
|
751
752
|
revision: string;
|
|
@@ -770,7 +771,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
770
771
|
safetyCardUrl?: string | undefined;
|
|
771
772
|
} | undefined;
|
|
772
773
|
};
|
|
773
|
-
issuedAt: string;
|
|
774
774
|
signatures: {
|
|
775
775
|
signature: string;
|
|
776
776
|
signedAt: string;
|
|
@@ -800,6 +800,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
800
800
|
}[];
|
|
801
801
|
}, {
|
|
802
802
|
schemaVersion: 1;
|
|
803
|
+
issuedAt: string;
|
|
803
804
|
revision: {
|
|
804
805
|
schemaVersion: 1;
|
|
805
806
|
revision: string;
|
|
@@ -824,7 +825,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
824
825
|
knownLimitations?: string[] | undefined;
|
|
825
826
|
} | undefined;
|
|
826
827
|
};
|
|
827
|
-
issuedAt: string;
|
|
828
828
|
signatures: {
|
|
829
829
|
signature: string;
|
|
830
830
|
signedAt: string;
|
|
@@ -1059,6 +1059,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
1059
1059
|
};
|
|
1060
1060
|
manifest: {
|
|
1061
1061
|
schemaVersion: 1;
|
|
1062
|
+
issuedAt: string;
|
|
1062
1063
|
revision: {
|
|
1063
1064
|
schemaVersion: 1;
|
|
1064
1065
|
revision: string;
|
|
@@ -1083,7 +1084,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
1083
1084
|
safetyCardUrl?: string | undefined;
|
|
1084
1085
|
} | undefined;
|
|
1085
1086
|
};
|
|
1086
|
-
issuedAt: string;
|
|
1087
1087
|
signatures: {
|
|
1088
1088
|
signature: string;
|
|
1089
1089
|
signedAt: string;
|
|
@@ -1150,6 +1150,7 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
1150
1150
|
};
|
|
1151
1151
|
manifest: {
|
|
1152
1152
|
schemaVersion: 1;
|
|
1153
|
+
issuedAt: string;
|
|
1153
1154
|
revision: {
|
|
1154
1155
|
schemaVersion: 1;
|
|
1155
1156
|
revision: string;
|
|
@@ -1174,7 +1175,6 @@ export declare const modelReleaseIngestionRequestSchema: z.ZodObject<{
|
|
|
1174
1175
|
knownLimitations?: string[] | undefined;
|
|
1175
1176
|
} | undefined;
|
|
1176
1177
|
};
|
|
1177
|
-
issuedAt: string;
|
|
1178
1178
|
signatures: {
|
|
1179
1179
|
signature: string;
|
|
1180
1180
|
signedAt: string;
|
|
@@ -1243,8 +1243,8 @@ export declare const modelReleaseIngestionResultSchema: z.ZodObject<{
|
|
|
1243
1243
|
ingestedAt: z.ZodString;
|
|
1244
1244
|
}, "strict", z.ZodTypeAny, {
|
|
1245
1245
|
schemaVersion: 1;
|
|
1246
|
-
revision: string;
|
|
1247
1246
|
outcome: "ingested" | "already_ingested";
|
|
1247
|
+
revision: string;
|
|
1248
1248
|
modelId: string;
|
|
1249
1249
|
reference: string;
|
|
1250
1250
|
releaseId: string;
|
|
@@ -1254,8 +1254,8 @@ export declare const modelReleaseIngestionResultSchema: z.ZodObject<{
|
|
|
1254
1254
|
ingestedAt: string;
|
|
1255
1255
|
}, {
|
|
1256
1256
|
schemaVersion: 1;
|
|
1257
|
-
revision: string;
|
|
1258
1257
|
outcome: "ingested" | "already_ingested";
|
|
1258
|
+
revision: string;
|
|
1259
1259
|
modelId: string;
|
|
1260
1260
|
reference: string;
|
|
1261
1261
|
releaseId: string;
|
|
@@ -855,7 +855,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
855
855
|
};
|
|
856
856
|
provider: string;
|
|
857
857
|
connectionId: string;
|
|
858
|
-
custodyState: "
|
|
858
|
+
custodyState: "pending" | "revoked" | "ready" | "reconcile";
|
|
859
859
|
upstreamBillsCustomerDirectly: true;
|
|
860
860
|
credentialHandle?: string | undefined;
|
|
861
861
|
credentialRevision?: number | undefined;
|
|
@@ -885,7 +885,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
885
885
|
};
|
|
886
886
|
provider: string;
|
|
887
887
|
connectionId: string;
|
|
888
|
-
custodyState: "
|
|
888
|
+
custodyState: "pending" | "revoked" | "ready" | "reconcile";
|
|
889
889
|
upstreamBillsCustomerDirectly: true;
|
|
890
890
|
credentialHandle?: string | undefined;
|
|
891
891
|
credentialRevision?: number | undefined;
|
|
@@ -915,7 +915,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
915
915
|
};
|
|
916
916
|
provider: string;
|
|
917
917
|
connectionId: string;
|
|
918
|
-
custodyState: "
|
|
918
|
+
custodyState: "pending" | "revoked" | "ready" | "reconcile";
|
|
919
919
|
upstreamBillsCustomerDirectly: true;
|
|
920
920
|
credentialHandle?: string | undefined;
|
|
921
921
|
credentialRevision?: number | undefined;
|
|
@@ -945,7 +945,7 @@ export declare const providerConnectionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
945
945
|
};
|
|
946
946
|
provider: string;
|
|
947
947
|
connectionId: string;
|
|
948
|
-
custodyState: "
|
|
948
|
+
custodyState: "pending" | "revoked" | "ready" | "reconcile";
|
|
949
949
|
upstreamBillsCustomerDirectly: true;
|
|
950
950
|
credentialHandle?: string | undefined;
|
|
951
951
|
credentialRevision?: number | undefined;
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract for Oxy linked accounts — external accounts (any Mastodon-API
|
|
3
|
+
* server, Bluesky) a LOCAL Oxy user has proven they own by completing an OAuth
|
|
4
|
+
* authorization there.
|
|
5
|
+
*
|
|
6
|
+
* Every response schema is `.strict()` and carries no field a third-party token
|
|
7
|
+
* could occupy: Oxy uses the OAuth flow only to learn which account authorized
|
|
8
|
+
* it, then discards the token. See `docs/identity/linked-accounts.md`.
|
|
9
|
+
*
|
|
10
|
+
* Platform-agnostic — zod only, no react/react-native/expo.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
export declare const LINKED_ACCOUNT_NETWORKS: readonly ["activitypub", "atproto"];
|
|
14
|
+
export type LinkedAccountNetwork = (typeof LINKED_ACCOUNT_NETWORKS)[number];
|
|
15
|
+
export declare const linkedAccountNetworkSchema: z.ZodEnum<["activitypub", "atproto"]>;
|
|
16
|
+
/**
|
|
17
|
+
* `POST /linked-accounts/:network/start`.
|
|
18
|
+
*
|
|
19
|
+
* - `instance` (activitypub): `mastodon.social`, `https://mastodon.social` or
|
|
20
|
+
* `@user@mastodon.social`.
|
|
21
|
+
* - `handle` (atproto): a handle (`alice.bsky.social`) or a DID.
|
|
22
|
+
* - `returnTo` + `clientId`: where the browser lands afterwards, with
|
|
23
|
+
* `?link_code=` or `?link_error=`. `returnTo` must exactly match a redirect
|
|
24
|
+
* URI registered on the TRUSTED (first-party) application `clientId` names.
|
|
25
|
+
*/
|
|
26
|
+
export declare const startLinkedAccountRequestSchema: z.ZodObject<{
|
|
27
|
+
instance: z.ZodOptional<z.ZodString>;
|
|
28
|
+
handle: z.ZodOptional<z.ZodString>;
|
|
29
|
+
clientId: z.ZodString;
|
|
30
|
+
returnTo: z.ZodString;
|
|
31
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
|
+
clientId: string;
|
|
33
|
+
returnTo: string;
|
|
34
|
+
handle?: string | undefined;
|
|
35
|
+
instance?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
clientId: string;
|
|
38
|
+
returnTo: string;
|
|
39
|
+
handle?: string | undefined;
|
|
40
|
+
instance?: string | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export type StartLinkedAccountRequest = z.infer<typeof startLinkedAccountRequestSchema>;
|
|
43
|
+
export declare const startLinkedAccountResponseSchema: z.ZodObject<{
|
|
44
|
+
authorizeUrl: z.ZodString;
|
|
45
|
+
expiresAt: z.ZodString;
|
|
46
|
+
}, "strict", z.ZodTypeAny, {
|
|
47
|
+
expiresAt: string;
|
|
48
|
+
authorizeUrl: string;
|
|
49
|
+
}, {
|
|
50
|
+
expiresAt: string;
|
|
51
|
+
authorizeUrl: string;
|
|
52
|
+
}>;
|
|
53
|
+
export type StartLinkedAccountResponse = z.infer<typeof startLinkedAccountResponseSchema>;
|
|
54
|
+
/**
|
|
55
|
+
* `POST /linked-accounts/complete`, with the session of the user who STARTED
|
|
56
|
+
* the flow: `code` is the one-time `link_code` the callback appended to
|
|
57
|
+
* `returnTo`. It expires five minutes after the callback. Presented by any
|
|
58
|
+
* other user it is refused (403) and burned.
|
|
59
|
+
*/
|
|
60
|
+
export declare const completeLinkedAccountRequestSchema: z.ZodObject<{
|
|
61
|
+
code: z.ZodString;
|
|
62
|
+
}, "strict", z.ZodTypeAny, {
|
|
63
|
+
code: string;
|
|
64
|
+
}, {
|
|
65
|
+
code: string;
|
|
66
|
+
}>;
|
|
67
|
+
export type CompleteLinkedAccountRequest = z.infer<typeof completeLinkedAccountRequestSchema>;
|
|
68
|
+
/** One live linked account, as its owner sees it. */
|
|
69
|
+
export declare const linkedAccountSchema: z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
network: z.ZodEnum<["activitypub", "atproto"]>;
|
|
72
|
+
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
73
|
+
accountKey: z.ZodString;
|
|
74
|
+
/** ActivityPub actor id, or the DID for atproto. */
|
|
75
|
+
actorUri: z.ZodString;
|
|
76
|
+
handle: z.ZodString;
|
|
77
|
+
host: z.ZodString;
|
|
78
|
+
proofMethod: z.ZodLiteral<"oauth">;
|
|
79
|
+
verifiedAt: z.ZodString;
|
|
80
|
+
createdAt: z.ZodString;
|
|
81
|
+
}, "strict", z.ZodTypeAny, {
|
|
82
|
+
id: string;
|
|
83
|
+
createdAt: string;
|
|
84
|
+
verifiedAt: string;
|
|
85
|
+
network: "activitypub" | "atproto";
|
|
86
|
+
actorUri: string;
|
|
87
|
+
handle: string;
|
|
88
|
+
accountKey: string;
|
|
89
|
+
host: string;
|
|
90
|
+
proofMethod: "oauth";
|
|
91
|
+
}, {
|
|
92
|
+
id: string;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
verifiedAt: string;
|
|
95
|
+
network: "activitypub" | "atproto";
|
|
96
|
+
actorUri: string;
|
|
97
|
+
handle: string;
|
|
98
|
+
accountKey: string;
|
|
99
|
+
host: string;
|
|
100
|
+
proofMethod: "oauth";
|
|
101
|
+
}>;
|
|
102
|
+
export type LinkedAccount = z.infer<typeof linkedAccountSchema>;
|
|
103
|
+
export declare const completeLinkedAccountResponseSchema: z.ZodObject<{
|
|
104
|
+
linkedAccount: z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
network: z.ZodEnum<["activitypub", "atproto"]>;
|
|
107
|
+
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
108
|
+
accountKey: z.ZodString;
|
|
109
|
+
/** ActivityPub actor id, or the DID for atproto. */
|
|
110
|
+
actorUri: z.ZodString;
|
|
111
|
+
handle: z.ZodString;
|
|
112
|
+
host: z.ZodString;
|
|
113
|
+
proofMethod: z.ZodLiteral<"oauth">;
|
|
114
|
+
verifiedAt: z.ZodString;
|
|
115
|
+
createdAt: z.ZodString;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
id: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
verifiedAt: string;
|
|
120
|
+
network: "activitypub" | "atproto";
|
|
121
|
+
actorUri: string;
|
|
122
|
+
handle: string;
|
|
123
|
+
accountKey: string;
|
|
124
|
+
host: string;
|
|
125
|
+
proofMethod: "oauth";
|
|
126
|
+
}, {
|
|
127
|
+
id: string;
|
|
128
|
+
createdAt: string;
|
|
129
|
+
verifiedAt: string;
|
|
130
|
+
network: "activitypub" | "atproto";
|
|
131
|
+
actorUri: string;
|
|
132
|
+
handle: string;
|
|
133
|
+
accountKey: string;
|
|
134
|
+
host: string;
|
|
135
|
+
proofMethod: "oauth";
|
|
136
|
+
}>;
|
|
137
|
+
}, "strict", z.ZodTypeAny, {
|
|
138
|
+
linkedAccount: {
|
|
139
|
+
id: string;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
verifiedAt: string;
|
|
142
|
+
network: "activitypub" | "atproto";
|
|
143
|
+
actorUri: string;
|
|
144
|
+
handle: string;
|
|
145
|
+
accountKey: string;
|
|
146
|
+
host: string;
|
|
147
|
+
proofMethod: "oauth";
|
|
148
|
+
};
|
|
149
|
+
}, {
|
|
150
|
+
linkedAccount: {
|
|
151
|
+
id: string;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
verifiedAt: string;
|
|
154
|
+
network: "activitypub" | "atproto";
|
|
155
|
+
actorUri: string;
|
|
156
|
+
handle: string;
|
|
157
|
+
accountKey: string;
|
|
158
|
+
host: string;
|
|
159
|
+
proofMethod: "oauth";
|
|
160
|
+
};
|
|
161
|
+
}>;
|
|
162
|
+
export type CompleteLinkedAccountResponse = z.infer<typeof completeLinkedAccountResponseSchema>;
|
|
163
|
+
export declare const linkedAccountListResponseSchema: z.ZodObject<{
|
|
164
|
+
linkedAccounts: z.ZodArray<z.ZodObject<{
|
|
165
|
+
id: z.ZodString;
|
|
166
|
+
network: z.ZodEnum<["activitypub", "atproto"]>;
|
|
167
|
+
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
168
|
+
accountKey: z.ZodString;
|
|
169
|
+
/** ActivityPub actor id, or the DID for atproto. */
|
|
170
|
+
actorUri: z.ZodString;
|
|
171
|
+
handle: z.ZodString;
|
|
172
|
+
host: z.ZodString;
|
|
173
|
+
proofMethod: z.ZodLiteral<"oauth">;
|
|
174
|
+
verifiedAt: z.ZodString;
|
|
175
|
+
createdAt: z.ZodString;
|
|
176
|
+
}, "strict", z.ZodTypeAny, {
|
|
177
|
+
id: string;
|
|
178
|
+
createdAt: string;
|
|
179
|
+
verifiedAt: string;
|
|
180
|
+
network: "activitypub" | "atproto";
|
|
181
|
+
actorUri: string;
|
|
182
|
+
handle: string;
|
|
183
|
+
accountKey: string;
|
|
184
|
+
host: string;
|
|
185
|
+
proofMethod: "oauth";
|
|
186
|
+
}, {
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: string;
|
|
189
|
+
verifiedAt: string;
|
|
190
|
+
network: "activitypub" | "atproto";
|
|
191
|
+
actorUri: string;
|
|
192
|
+
handle: string;
|
|
193
|
+
accountKey: string;
|
|
194
|
+
host: string;
|
|
195
|
+
proofMethod: "oauth";
|
|
196
|
+
}>, "many">;
|
|
197
|
+
}, "strict", z.ZodTypeAny, {
|
|
198
|
+
linkedAccounts: {
|
|
199
|
+
id: string;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
verifiedAt: string;
|
|
202
|
+
network: "activitypub" | "atproto";
|
|
203
|
+
actorUri: string;
|
|
204
|
+
handle: string;
|
|
205
|
+
accountKey: string;
|
|
206
|
+
host: string;
|
|
207
|
+
proofMethod: "oauth";
|
|
208
|
+
}[];
|
|
209
|
+
}, {
|
|
210
|
+
linkedAccounts: {
|
|
211
|
+
id: string;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
verifiedAt: string;
|
|
214
|
+
network: "activitypub" | "atproto";
|
|
215
|
+
actorUri: string;
|
|
216
|
+
handle: string;
|
|
217
|
+
accountKey: string;
|
|
218
|
+
host: string;
|
|
219
|
+
proofMethod: "oauth";
|
|
220
|
+
}[];
|
|
221
|
+
}>;
|
|
222
|
+
export type LinkedAccountListResponse = z.infer<typeof linkedAccountListResponseSchema>;
|
|
223
|
+
/**
|
|
224
|
+
* `GET /linked-accounts/by-user/:userId` (service token with the privileged
|
|
225
|
+
* `linked-accounts:read`). Adds `federatedUserId`: the FEDERATED shadow user Oxy
|
|
226
|
+
* already holds for that external account, if any — the anchor for adopting
|
|
227
|
+
* content Oxy federated in before the account was linked.
|
|
228
|
+
*/
|
|
229
|
+
export declare const serviceLinkedAccountSchema: z.ZodObject<{
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
network: z.ZodEnum<["activitypub", "atproto"]>;
|
|
232
|
+
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
233
|
+
accountKey: z.ZodString;
|
|
234
|
+
/** ActivityPub actor id, or the DID for atproto. */
|
|
235
|
+
actorUri: z.ZodString;
|
|
236
|
+
handle: z.ZodString;
|
|
237
|
+
host: z.ZodString;
|
|
238
|
+
proofMethod: z.ZodLiteral<"oauth">;
|
|
239
|
+
verifiedAt: z.ZodString;
|
|
240
|
+
createdAt: z.ZodString;
|
|
241
|
+
} & {
|
|
242
|
+
federatedUserId: z.ZodNullable<z.ZodString>;
|
|
243
|
+
}, "strict", z.ZodTypeAny, {
|
|
244
|
+
id: string;
|
|
245
|
+
createdAt: string;
|
|
246
|
+
verifiedAt: string;
|
|
247
|
+
network: "activitypub" | "atproto";
|
|
248
|
+
actorUri: string;
|
|
249
|
+
handle: string;
|
|
250
|
+
accountKey: string;
|
|
251
|
+
host: string;
|
|
252
|
+
proofMethod: "oauth";
|
|
253
|
+
federatedUserId: string | null;
|
|
254
|
+
}, {
|
|
255
|
+
id: string;
|
|
256
|
+
createdAt: string;
|
|
257
|
+
verifiedAt: string;
|
|
258
|
+
network: "activitypub" | "atproto";
|
|
259
|
+
actorUri: string;
|
|
260
|
+
handle: string;
|
|
261
|
+
accountKey: string;
|
|
262
|
+
host: string;
|
|
263
|
+
proofMethod: "oauth";
|
|
264
|
+
federatedUserId: string | null;
|
|
265
|
+
}>;
|
|
266
|
+
export type ServiceLinkedAccount = z.infer<typeof serviceLinkedAccountSchema>;
|
|
267
|
+
export declare const serviceLinkedAccountListResponseSchema: z.ZodObject<{
|
|
268
|
+
userId: z.ZodString;
|
|
269
|
+
linkedAccounts: z.ZodArray<z.ZodObject<{
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
network: z.ZodEnum<["activitypub", "atproto"]>;
|
|
272
|
+
/** `username@domain` for ActivityPub; the DID for atproto. */
|
|
273
|
+
accountKey: z.ZodString;
|
|
274
|
+
/** ActivityPub actor id, or the DID for atproto. */
|
|
275
|
+
actorUri: z.ZodString;
|
|
276
|
+
handle: z.ZodString;
|
|
277
|
+
host: z.ZodString;
|
|
278
|
+
proofMethod: z.ZodLiteral<"oauth">;
|
|
279
|
+
verifiedAt: z.ZodString;
|
|
280
|
+
createdAt: z.ZodString;
|
|
281
|
+
} & {
|
|
282
|
+
federatedUserId: z.ZodNullable<z.ZodString>;
|
|
283
|
+
}, "strict", z.ZodTypeAny, {
|
|
284
|
+
id: string;
|
|
285
|
+
createdAt: string;
|
|
286
|
+
verifiedAt: string;
|
|
287
|
+
network: "activitypub" | "atproto";
|
|
288
|
+
actorUri: string;
|
|
289
|
+
handle: string;
|
|
290
|
+
accountKey: string;
|
|
291
|
+
host: string;
|
|
292
|
+
proofMethod: "oauth";
|
|
293
|
+
federatedUserId: string | null;
|
|
294
|
+
}, {
|
|
295
|
+
id: string;
|
|
296
|
+
createdAt: string;
|
|
297
|
+
verifiedAt: string;
|
|
298
|
+
network: "activitypub" | "atproto";
|
|
299
|
+
actorUri: string;
|
|
300
|
+
handle: string;
|
|
301
|
+
accountKey: string;
|
|
302
|
+
host: string;
|
|
303
|
+
proofMethod: "oauth";
|
|
304
|
+
federatedUserId: string | null;
|
|
305
|
+
}>, "many">;
|
|
306
|
+
}, "strict", z.ZodTypeAny, {
|
|
307
|
+
userId: string;
|
|
308
|
+
linkedAccounts: {
|
|
309
|
+
id: string;
|
|
310
|
+
createdAt: string;
|
|
311
|
+
verifiedAt: string;
|
|
312
|
+
network: "activitypub" | "atproto";
|
|
313
|
+
actorUri: string;
|
|
314
|
+
handle: string;
|
|
315
|
+
accountKey: string;
|
|
316
|
+
host: string;
|
|
317
|
+
proofMethod: "oauth";
|
|
318
|
+
federatedUserId: string | null;
|
|
319
|
+
}[];
|
|
320
|
+
}, {
|
|
321
|
+
userId: string;
|
|
322
|
+
linkedAccounts: {
|
|
323
|
+
id: string;
|
|
324
|
+
createdAt: string;
|
|
325
|
+
verifiedAt: string;
|
|
326
|
+
network: "activitypub" | "atproto";
|
|
327
|
+
actorUri: string;
|
|
328
|
+
handle: string;
|
|
329
|
+
accountKey: string;
|
|
330
|
+
host: string;
|
|
331
|
+
proofMethod: "oauth";
|
|
332
|
+
federatedUserId: string | null;
|
|
333
|
+
}[];
|
|
334
|
+
}>;
|
|
335
|
+
export type ServiceLinkedAccountListResponse = z.infer<typeof serviceLinkedAccountListResponseSchema>;
|
|
336
|
+
/**
|
|
337
|
+
* Error codes the callback appends as `?link_error=<code>` to `returnTo`. An
|
|
338
|
+
* account already linked to someone else is reported by `/complete` (409).
|
|
339
|
+
*/
|
|
340
|
+
export declare const LINKED_ACCOUNT_CALLBACK_ERRORS: readonly ["access_denied", "verification_failed", "provider_unavailable"];
|
|
341
|
+
export type LinkedAccountCallbackError = (typeof LINKED_ACCOUNT_CALLBACK_ERRORS)[number];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The closed set of Oxy in-app notification types — owned here so the API's
|
|
3
|
+
* CHECK constraint (`notifications.type`), its request validation and the SDK
|
|
4
|
+
* all read one tuple.
|
|
5
|
+
*
|
|
6
|
+
* `system` is a message from an Oxy service about the recipient's OWN account
|
|
7
|
+
* (Oxy Move's "your migration finished"): the actor is the recipient, and the
|
|
8
|
+
* entity is their profile or an `app` id. It is the only type an actor does not
|
|
9
|
+
* cause.
|
|
10
|
+
*
|
|
11
|
+
* Platform-agnostic — zod only, no react/react-native/expo.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
export declare const OXY_NOTIFICATION_TYPES: readonly ["like", "reply", "mention", "follow", "repost", "quote", "welcome", "system"];
|
|
15
|
+
export type OxyNotificationType = (typeof OXY_NOTIFICATION_TYPES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* What a notification's `entityId` names.
|
|
18
|
+
*
|
|
19
|
+
* `app` means `entityId` is an OPAQUE id in the notifying application's own
|
|
20
|
+
* namespace (Oxy Move's migration job id). Oxy never resolves it; it exists so
|
|
21
|
+
* a `system` notification about something that is not a post or a profile does
|
|
22
|
+
* not have to pretend to be one. Valid only with `type: 'system'`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const OXY_NOTIFICATION_ENTITY_TYPES: readonly ["post", "reply", "profile", "app"];
|
|
25
|
+
export type OxyNotificationEntityType = (typeof OXY_NOTIFICATION_ENTITY_TYPES)[number];
|
|
26
|
+
/** Length caps on the text a `system` notification carries (enforced by CHECKs too). */
|
|
27
|
+
export declare const OXY_SYSTEM_NOTIFICATION_TITLE_MAX = 120;
|
|
28
|
+
export declare const OXY_SYSTEM_NOTIFICATION_MESSAGE_MAX = 500;
|
|
29
|
+
export declare const OXY_NOTIFICATION_URL_MAX = 2048;
|
|
30
|
+
/**
|
|
31
|
+
* `POST /notifications` (service token with `notifications:write`).
|
|
32
|
+
*
|
|
33
|
+
* Only a `system` notification carries text: `title` and `message` are REQUIRED
|
|
34
|
+
* for it and stored, and `url` is an optional deep link (https, or a custom
|
|
35
|
+
* scheme registered as a redirect URI on the calling application). For every
|
|
36
|
+
* other type the client renders from `type` + entity, and `title` / `message` /
|
|
37
|
+
* `data` are accepted but discarded, as they always were.
|
|
38
|
+
*
|
|
39
|
+
* `system` notifications share the duplicate guard (recipient, actor, type,
|
|
40
|
+
* entityId): use a caller-unique `entityId` (a job id) for each distinct event.
|
|
41
|
+
*/
|
|
42
|
+
export declare const createOxyNotificationRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
43
|
+
recipientId: z.ZodString;
|
|
44
|
+
actorId: z.ZodString;
|
|
45
|
+
type: z.ZodEnum<["like", "reply", "mention", "follow", "repost", "quote", "welcome", "system"]>;
|
|
46
|
+
entityId: z.ZodString;
|
|
47
|
+
entityType: z.ZodEnum<["post", "reply", "profile", "app"]>;
|
|
48
|
+
title: z.ZodOptional<z.ZodString>;
|
|
49
|
+
message: z.ZodOptional<z.ZodString>;
|
|
50
|
+
url: z.ZodOptional<z.ZodString>;
|
|
51
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "system" | "like" | "reply" | "follow" | "mention" | "quote" | "repost" | "welcome";
|
|
54
|
+
recipientId: string;
|
|
55
|
+
actorId: string;
|
|
56
|
+
entityId: string;
|
|
57
|
+
entityType: "profile" | "reply" | "post" | "app";
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
data?: Record<string, unknown> | undefined;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
title?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: "system" | "like" | "reply" | "follow" | "mention" | "quote" | "repost" | "welcome";
|
|
64
|
+
recipientId: string;
|
|
65
|
+
actorId: string;
|
|
66
|
+
entityId: string;
|
|
67
|
+
entityType: "profile" | "reply" | "post" | "app";
|
|
68
|
+
message?: string | undefined;
|
|
69
|
+
data?: Record<string, unknown> | undefined;
|
|
70
|
+
url?: string | undefined;
|
|
71
|
+
title?: string | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
type: "system" | "like" | "reply" | "follow" | "mention" | "quote" | "repost" | "welcome";
|
|
74
|
+
recipientId: string;
|
|
75
|
+
actorId: string;
|
|
76
|
+
entityId: string;
|
|
77
|
+
entityType: "profile" | "reply" | "post" | "app";
|
|
78
|
+
message?: string | undefined;
|
|
79
|
+
data?: Record<string, unknown> | undefined;
|
|
80
|
+
url?: string | undefined;
|
|
81
|
+
title?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
type: "system" | "like" | "reply" | "follow" | "mention" | "quote" | "repost" | "welcome";
|
|
84
|
+
recipientId: string;
|
|
85
|
+
actorId: string;
|
|
86
|
+
entityId: string;
|
|
87
|
+
entityType: "profile" | "reply" | "post" | "app";
|
|
88
|
+
message?: string | undefined;
|
|
89
|
+
data?: Record<string, unknown> | undefined;
|
|
90
|
+
url?: string | undefined;
|
|
91
|
+
title?: string | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export type CreateOxyNotificationRequest = z.infer<typeof createOxyNotificationRequestSchema>;
|