@hypercerts-org/sdk-core 0.10.0-beta.0 → 0.10.0-beta.2
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/CHANGELOG.md +281 -0
- package/README.md +97 -114
- package/dist/index.cjs +435 -534
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +160 -271
- package/dist/index.mjs +387 -499
- package/dist/index.mjs.map +1 -1
- package/dist/lexicons.cjs +103 -374
- package/dist/lexicons.cjs.map +1 -1
- package/dist/lexicons.d.ts +90 -188
- package/dist/lexicons.mjs +103 -367
- package/dist/lexicons.mjs.map +1 -1
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +24 -37
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -1
- package/package.json +10 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,231 +1,11 @@
|
|
|
1
|
-
import { Agent } from '@atproto/api';
|
|
2
|
-
import { LexiconDoc } from '@atproto/lexicon';
|
|
3
1
|
import { NodeSavedSession, NodeSavedState, OAuthSession } from '@atproto/oauth-client-node';
|
|
4
2
|
import { z } from 'zod';
|
|
5
3
|
import { EventEmitter } from 'eventemitter3';
|
|
6
|
-
import {
|
|
7
|
-
export { AppCertifiedDefs, AppCertifiedLocation, ComAtprotoRepoStrongRef,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
interface ValidationResult {
|
|
13
|
-
/**
|
|
14
|
-
* Whether the record is valid according to the lexicon schema.
|
|
15
|
-
*/
|
|
16
|
-
valid: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Error message if validation failed.
|
|
19
|
-
*
|
|
20
|
-
* Only present when `valid` is `false`.
|
|
21
|
-
*/
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Registry for managing and validating AT Protocol lexicon schemas.
|
|
26
|
-
*
|
|
27
|
-
* Lexicons are schema definitions that describe the structure of records
|
|
28
|
-
* in the AT Protocol. This registry allows you to:
|
|
29
|
-
*
|
|
30
|
-
* - Register custom lexicons for your application's record types
|
|
31
|
-
* - Validate records against their lexicon schemas
|
|
32
|
-
* - Extend the AT Protocol Agent with custom lexicon support
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* The SDK automatically registers hypercert lexicons when creating a Repository.
|
|
36
|
-
* You only need to use this class directly if you're working with custom
|
|
37
|
-
* record types.
|
|
38
|
-
*
|
|
39
|
-
* **Lexicon IDs** follow the NSID (Namespaced Identifier) format:
|
|
40
|
-
* `{authority}.{name}` (e.g., `org.hypercerts.hypercert`)
|
|
41
|
-
*
|
|
42
|
-
* @example Registering custom lexicons
|
|
43
|
-
* ```typescript
|
|
44
|
-
* const registry = sdk.getLexiconRegistry();
|
|
45
|
-
*
|
|
46
|
-
* // Register a single lexicon
|
|
47
|
-
* registry.register({
|
|
48
|
-
* lexicon: 1,
|
|
49
|
-
* id: "org.example.myRecord",
|
|
50
|
-
* defs: {
|
|
51
|
-
* main: {
|
|
52
|
-
* type: "record",
|
|
53
|
-
* key: "tid",
|
|
54
|
-
* record: {
|
|
55
|
-
* type: "object",
|
|
56
|
-
* required: ["title", "createdAt"],
|
|
57
|
-
* properties: {
|
|
58
|
-
* title: { type: "string" },
|
|
59
|
-
* description: { type: "string" },
|
|
60
|
-
* createdAt: { type: "string", format: "datetime" },
|
|
61
|
-
* },
|
|
62
|
-
* },
|
|
63
|
-
* },
|
|
64
|
-
* },
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
* // Register multiple lexicons at once
|
|
68
|
-
* registry.registerMany([lexicon1, lexicon2, lexicon3]);
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example Validating records
|
|
72
|
-
* ```typescript
|
|
73
|
-
* const result = registry.validate("org.example.myRecord", {
|
|
74
|
-
* title: "Test",
|
|
75
|
-
* createdAt: new Date().toISOString(),
|
|
76
|
-
* });
|
|
77
|
-
*
|
|
78
|
-
* if (!result.valid) {
|
|
79
|
-
* console.error(`Validation failed: ${result.error}`);
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @see https://atproto.com/specs/lexicon for the Lexicon specification
|
|
84
|
-
*/
|
|
85
|
-
declare class LexiconRegistry {
|
|
86
|
-
/** Map of lexicon ID to lexicon document */
|
|
87
|
-
private lexicons;
|
|
88
|
-
/** Lexicons collection for validation */
|
|
89
|
-
private lexiconsCollection;
|
|
90
|
-
/**
|
|
91
|
-
* Creates a new LexiconRegistry.
|
|
92
|
-
*
|
|
93
|
-
* The registry starts empty. Use {@link register} or {@link registerMany}
|
|
94
|
-
* to add lexicons.
|
|
95
|
-
*/
|
|
96
|
-
constructor();
|
|
97
|
-
/**
|
|
98
|
-
* Registers a single lexicon schema.
|
|
99
|
-
*
|
|
100
|
-
* @param lexicon - The lexicon document to register
|
|
101
|
-
* @throws {@link ValidationError} if the lexicon doesn't have an `id` field
|
|
102
|
-
*
|
|
103
|
-
* @remarks
|
|
104
|
-
* If a lexicon with the same ID is already registered, it will be
|
|
105
|
-
* replaced with the new definition. This is useful for testing but
|
|
106
|
-
* should generally be avoided in production.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```typescript
|
|
110
|
-
* registry.register({
|
|
111
|
-
* lexicon: 1,
|
|
112
|
-
* id: "org.example.post",
|
|
113
|
-
* defs: {
|
|
114
|
-
* main: {
|
|
115
|
-
* type: "record",
|
|
116
|
-
* key: "tid",
|
|
117
|
-
* record: {
|
|
118
|
-
* type: "object",
|
|
119
|
-
* required: ["text", "createdAt"],
|
|
120
|
-
* properties: {
|
|
121
|
-
* text: { type: "string", maxLength: 300 },
|
|
122
|
-
* createdAt: { type: "string", format: "datetime" },
|
|
123
|
-
* },
|
|
124
|
-
* },
|
|
125
|
-
* },
|
|
126
|
-
* },
|
|
127
|
-
* });
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
register(lexicon: LexiconDoc): void;
|
|
131
|
-
/**
|
|
132
|
-
* Registers multiple lexicons at once.
|
|
133
|
-
*
|
|
134
|
-
* @param lexicons - Array of lexicon documents to register
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```typescript
|
|
138
|
-
* import { HYPERCERT_LEXICONS } from "@hypercerts-org/sdk/lexicons";
|
|
139
|
-
*
|
|
140
|
-
* registry.registerMany(HYPERCERT_LEXICONS);
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
registerMany(lexicons: LexiconDoc[]): void;
|
|
144
|
-
/**
|
|
145
|
-
* Gets a lexicon document by ID.
|
|
146
|
-
*
|
|
147
|
-
* @param id - The lexicon NSID (e.g., "org.hypercerts.hypercert")
|
|
148
|
-
* @returns The lexicon document, or `undefined` if not registered
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* const lexicon = registry.get("org.hypercerts.hypercert");
|
|
153
|
-
* if (lexicon) {
|
|
154
|
-
* console.log(`Found lexicon: ${lexicon.id}`);
|
|
155
|
-
* }
|
|
156
|
-
* ```
|
|
157
|
-
*/
|
|
158
|
-
get(id: string): LexiconDoc | undefined;
|
|
159
|
-
/**
|
|
160
|
-
* Validates a record against a collection's lexicon schema.
|
|
161
|
-
*
|
|
162
|
-
* @param collection - The collection NSID (same as lexicon ID)
|
|
163
|
-
* @param record - The record data to validate
|
|
164
|
-
* @returns Validation result with `valid` boolean and optional `error` message
|
|
165
|
-
*
|
|
166
|
-
* @remarks
|
|
167
|
-
* - If no lexicon is registered for the collection, validation passes
|
|
168
|
-
* (we can't validate against unknown schemas)
|
|
169
|
-
* - Validation checks required fields and type constraints defined
|
|
170
|
-
* in the lexicon schema
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```typescript
|
|
174
|
-
* const result = registry.validate("org.hypercerts.hypercert", {
|
|
175
|
-
* title: "My Hypercert",
|
|
176
|
-
* description: "Description...",
|
|
177
|
-
* // ... other fields
|
|
178
|
-
* });
|
|
179
|
-
*
|
|
180
|
-
* if (!result.valid) {
|
|
181
|
-
* throw new Error(`Invalid record: ${result.error}`);
|
|
182
|
-
* }
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
validate(collection: string, record: unknown): ValidationResult;
|
|
186
|
-
/**
|
|
187
|
-
* Adds all registered lexicons to an AT Protocol Agent instance.
|
|
188
|
-
*
|
|
189
|
-
* This allows the Agent to understand custom lexicon types when making
|
|
190
|
-
* API requests.
|
|
191
|
-
*
|
|
192
|
-
* @param agent - The Agent instance to extend
|
|
193
|
-
*
|
|
194
|
-
* @remarks
|
|
195
|
-
* This is called automatically when creating a Repository. You typically
|
|
196
|
-
* don't need to call this directly unless you're using the Agent
|
|
197
|
-
* independently.
|
|
198
|
-
*
|
|
199
|
-
* @internal
|
|
200
|
-
*/
|
|
201
|
-
addToAgent(agent: Agent): void;
|
|
202
|
-
/**
|
|
203
|
-
* Gets all registered lexicon IDs.
|
|
204
|
-
*
|
|
205
|
-
* @returns Array of lexicon NSIDs
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* const ids = registry.getRegisteredIds();
|
|
210
|
-
* console.log(`Registered lexicons: ${ids.join(", ")}`);
|
|
211
|
-
* ```
|
|
212
|
-
*/
|
|
213
|
-
getRegisteredIds(): string[];
|
|
214
|
-
/**
|
|
215
|
-
* Checks if a lexicon is registered.
|
|
216
|
-
*
|
|
217
|
-
* @param id - The lexicon NSID to check
|
|
218
|
-
* @returns `true` if the lexicon is registered
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* ```typescript
|
|
222
|
-
* if (registry.has("org.hypercerts.hypercert")) {
|
|
223
|
-
* // Hypercert lexicon is available
|
|
224
|
-
* }
|
|
225
|
-
* ```
|
|
226
|
-
*/
|
|
227
|
-
has(id: string): boolean;
|
|
228
|
-
}
|
|
4
|
+
import { OrgHypercertsClaimEvidence, OrgHypercertsClaimActivity, OrgHypercertsClaimCollection, ComAtprotoRepoStrongRef, OrgHypercertsClaimRights, OrgHypercertsClaimContribution, OrgHypercertsClaimMeasurement, OrgHypercertsClaimEvaluation, OrgHypercertsClaimProject, AppCertifiedLocation, AppCertifiedBadgeAward, AppCertifiedBadgeDefinition, AppCertifiedBadgeResponse, OrgHypercertsFundingReceipt, OrgHypercertsDefs } from '@hypercerts-org/lexicon';
|
|
5
|
+
export { AppCertifiedBadgeAward, AppCertifiedBadgeDefinition, AppCertifiedBadgeResponse, AppCertifiedDefs, AppCertifiedLocation, ComAtprotoRepoStrongRef, HYPERCERTS_LEXICON_DOC, HYPERCERTS_LEXICON_JSON, HYPERCERTS_NSIDS, HYPERCERTS_NSIDS_BY_TYPE, HYPERCERTS_SCHEMAS, HYPERCERTS_SCHEMA_DICT, OrgHypercertsClaimActivity, OrgHypercertsClaimCollection, OrgHypercertsClaimContribution, OrgHypercertsClaimEvaluation, OrgHypercertsClaimEvidence, OrgHypercertsClaimMeasurement, OrgHypercertsClaimProject, OrgHypercertsClaimRights, OrgHypercertsDefs, OrgHypercertsFundingReceipt, lexicons, validate } from '@hypercerts-org/lexicon';
|
|
6
|
+
import { Agent } from '@atproto/api';
|
|
7
|
+
import { LexiconDoc } from '@atproto/lexicon';
|
|
8
|
+
export { BlobRef, JsonBlobRef } from '@atproto/lexicon';
|
|
229
9
|
|
|
230
10
|
/**
|
|
231
11
|
* Storage interface for persisting OAuth sessions.
|
|
@@ -1043,6 +823,132 @@ interface ProgressStep {
|
|
|
1043
823
|
error?: Error;
|
|
1044
824
|
}
|
|
1045
825
|
|
|
826
|
+
/**
|
|
827
|
+
* Lexicons entrypoint - Lexicon definitions and registry.
|
|
828
|
+
*
|
|
829
|
+
* This sub-entrypoint exports the lexicon registry and hypercert
|
|
830
|
+
* lexicon constants for working with AT Protocol record schemas.
|
|
831
|
+
*
|
|
832
|
+
* @remarks
|
|
833
|
+
* Import from `@hypercerts-org/sdk/lexicons`:
|
|
834
|
+
*
|
|
835
|
+
* ```typescript
|
|
836
|
+
* import {
|
|
837
|
+
* LexiconRegistry,
|
|
838
|
+
* HYPERCERT_LEXICONS,
|
|
839
|
+
* HYPERCERT_COLLECTIONS,
|
|
840
|
+
* } from "@hypercerts-org/sdk/lexicons";
|
|
841
|
+
* ```
|
|
842
|
+
*
|
|
843
|
+
* **Exports**:
|
|
844
|
+
* - {@link LexiconRegistry} - Registry for managing and validating lexicons
|
|
845
|
+
* - {@link HYPERCERT_LEXICONS} - Array of all hypercert lexicon documents
|
|
846
|
+
* - {@link HYPERCERT_COLLECTIONS} - Constants for collection NSIDs
|
|
847
|
+
*
|
|
848
|
+
* @example Using collection constants
|
|
849
|
+
* ```typescript
|
|
850
|
+
* import { HYPERCERT_COLLECTIONS } from "@hypercerts-org/sdk/lexicons";
|
|
851
|
+
*
|
|
852
|
+
* // List hypercerts using the correct collection name
|
|
853
|
+
* const records = await repo.records.list({
|
|
854
|
+
* collection: HYPERCERT_COLLECTIONS.RECORD,
|
|
855
|
+
* });
|
|
856
|
+
*
|
|
857
|
+
* // List contributions
|
|
858
|
+
* const contributions = await repo.records.list({
|
|
859
|
+
* collection: HYPERCERT_COLLECTIONS.CONTRIBUTION,
|
|
860
|
+
* });
|
|
861
|
+
* ```
|
|
862
|
+
*
|
|
863
|
+
* @example Custom lexicon registration
|
|
864
|
+
* ```typescript
|
|
865
|
+
* import { LexiconRegistry } from "@hypercerts-org/sdk/lexicons";
|
|
866
|
+
*
|
|
867
|
+
* const registry = sdk.getLexiconRegistry();
|
|
868
|
+
*
|
|
869
|
+
* // Register custom lexicon
|
|
870
|
+
* registry.register({
|
|
871
|
+
* lexicon: 1,
|
|
872
|
+
* id: "org.myapp.customRecord",
|
|
873
|
+
* defs: { ... },
|
|
874
|
+
* });
|
|
875
|
+
*
|
|
876
|
+
* // Validate a record
|
|
877
|
+
* const result = registry.validate("org.myapp.customRecord", record);
|
|
878
|
+
* if (!result.valid) {
|
|
879
|
+
* console.error(result.error);
|
|
880
|
+
* }
|
|
881
|
+
* ```
|
|
882
|
+
*
|
|
883
|
+
* @packageDocumentation
|
|
884
|
+
*/
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* All hypercert-related lexicons for registration with AT Protocol Agent.
|
|
888
|
+
* This array contains all lexicon documents from the published package.
|
|
889
|
+
*/
|
|
890
|
+
declare const HYPERCERT_LEXICONS: LexiconDoc[];
|
|
891
|
+
/**
|
|
892
|
+
* Collection NSIDs (Namespaced Identifiers) for hypercert records.
|
|
893
|
+
*
|
|
894
|
+
* Use these constants when performing record operations to ensure
|
|
895
|
+
* correct collection names.
|
|
896
|
+
*/
|
|
897
|
+
declare const HYPERCERT_COLLECTIONS: {
|
|
898
|
+
/**
|
|
899
|
+
* Main hypercert claim record collection.
|
|
900
|
+
*/
|
|
901
|
+
readonly CLAIM: "org.hypercerts.claim.activity";
|
|
902
|
+
/**
|
|
903
|
+
* Rights record collection.
|
|
904
|
+
*/
|
|
905
|
+
readonly RIGHTS: "org.hypercerts.claim.rights";
|
|
906
|
+
/**
|
|
907
|
+
* Location record collection (shared certified lexicon).
|
|
908
|
+
*/
|
|
909
|
+
readonly LOCATION: "app.certified.location";
|
|
910
|
+
/**
|
|
911
|
+
* Contribution record collection.
|
|
912
|
+
*/
|
|
913
|
+
readonly CONTRIBUTION: "org.hypercerts.claim.contribution";
|
|
914
|
+
/**
|
|
915
|
+
* Measurement record collection.
|
|
916
|
+
*/
|
|
917
|
+
readonly MEASUREMENT: "org.hypercerts.claim.measurement";
|
|
918
|
+
/**
|
|
919
|
+
* Evaluation record collection.
|
|
920
|
+
*/
|
|
921
|
+
readonly EVALUATION: "org.hypercerts.claim.evaluation";
|
|
922
|
+
/**
|
|
923
|
+
* Evidence record collection.
|
|
924
|
+
*/
|
|
925
|
+
readonly EVIDENCE: "org.hypercerts.claim.evidence";
|
|
926
|
+
/**
|
|
927
|
+
* Collection record collection (groups of hypercerts).
|
|
928
|
+
*/
|
|
929
|
+
readonly COLLECTION: "org.hypercerts.claim.collection";
|
|
930
|
+
/**
|
|
931
|
+
* Project record collection.
|
|
932
|
+
*/
|
|
933
|
+
readonly PROJECT: "org.hypercerts.claim.project";
|
|
934
|
+
/**
|
|
935
|
+
* Badge award record collection.
|
|
936
|
+
*/
|
|
937
|
+
readonly BADGE_AWARD: "app.certified.badge.award";
|
|
938
|
+
/**
|
|
939
|
+
* Badge definition record collection.
|
|
940
|
+
*/
|
|
941
|
+
readonly BADGE_DEFINITION: "app.certified.badge.definition";
|
|
942
|
+
/**
|
|
943
|
+
* Badge response record collection.
|
|
944
|
+
*/
|
|
945
|
+
readonly BADGE_RESPONSE: "app.certified.badge.response";
|
|
946
|
+
/**
|
|
947
|
+
* Funding receipt record collection.
|
|
948
|
+
*/
|
|
949
|
+
readonly FUNDING_RECEIPT: "org.hypercerts.funding.receipt";
|
|
950
|
+
};
|
|
951
|
+
|
|
1046
952
|
/**
|
|
1047
953
|
* TypeScript types for hypercert lexicon schemas.
|
|
1048
954
|
*
|
|
@@ -1052,30 +958,32 @@ interface ProgressStep {
|
|
|
1052
958
|
*/
|
|
1053
959
|
|
|
1054
960
|
type StrongRef = ComAtprotoRepoStrongRef.Main;
|
|
1055
|
-
type HypercertClaim =
|
|
961
|
+
type HypercertClaim = OrgHypercertsClaimActivity.Main;
|
|
1056
962
|
type HypercertRights = OrgHypercertsClaimRights.Main;
|
|
1057
963
|
type HypercertContribution = OrgHypercertsClaimContribution.Main;
|
|
1058
964
|
type HypercertMeasurement = OrgHypercertsClaimMeasurement.Main;
|
|
1059
965
|
type HypercertEvaluation = OrgHypercertsClaimEvaluation.Main;
|
|
1060
|
-
type
|
|
1061
|
-
type
|
|
966
|
+
type HypercertEvidence = OrgHypercertsClaimEvidence.Main;
|
|
967
|
+
type HypercertCollection = OrgHypercertsClaimCollection.Main;
|
|
968
|
+
type HypercertCollectionClaimItem = OrgHypercertsClaimActivity.ActivityWeight;
|
|
969
|
+
type HypercertProject = OrgHypercertsClaimProject.Main;
|
|
1062
970
|
type HypercertLocation = AppCertifiedLocation.Main;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
971
|
+
type BadgeAward = AppCertifiedBadgeAward.Main;
|
|
972
|
+
type BadgeDefinition = AppCertifiedBadgeDefinition.Main;
|
|
973
|
+
type BadgeResponse = AppCertifiedBadgeResponse.Main;
|
|
974
|
+
type FundingReceipt = OrgHypercertsFundingReceipt.Main;
|
|
975
|
+
/**
|
|
976
|
+
* Image input for SDK operations.
|
|
977
|
+
*
|
|
978
|
+
* Can be either:
|
|
979
|
+
* - A URI reference (for external images)
|
|
980
|
+
* - A Blob to be uploaded
|
|
981
|
+
*
|
|
982
|
+
* The SDK will convert these to the appropriate lexicon types:
|
|
983
|
+
* - OrgHypercertsDefs.Uri
|
|
984
|
+
* - OrgHypercertsDefs.SmallImage
|
|
985
|
+
* - OrgHypercertsDefs.LargeImage
|
|
986
|
+
*/
|
|
1079
987
|
type HypercertImage = {
|
|
1080
988
|
type: "uri";
|
|
1081
989
|
uri: string;
|
|
@@ -1083,6 +991,11 @@ type HypercertImage = {
|
|
|
1083
991
|
type: "blob";
|
|
1084
992
|
blob: Blob;
|
|
1085
993
|
};
|
|
994
|
+
/**
|
|
995
|
+
* Lexicon-defined image types (union of Uri and image blob types).
|
|
996
|
+
* Use this when working with stored records.
|
|
997
|
+
*/
|
|
998
|
+
type HypercertImageRecord = OrgHypercertsDefs.Uri | OrgHypercertsDefs.SmallImage | OrgHypercertsDefs.LargeImage;
|
|
1086
999
|
/** Hypercert with AT Protocol metadata */
|
|
1087
1000
|
interface HypercertWithMetadata {
|
|
1088
1001
|
uri: string;
|
|
@@ -2071,7 +1984,6 @@ declare class Repository {
|
|
|
2071
1984
|
private session;
|
|
2072
1985
|
private serverUrl;
|
|
2073
1986
|
private repoDid;
|
|
2074
|
-
private lexiconRegistry;
|
|
2075
1987
|
private logger?;
|
|
2076
1988
|
private agent;
|
|
2077
1989
|
private _isSDS;
|
|
@@ -2087,7 +1999,6 @@ declare class Repository {
|
|
|
2087
1999
|
* @param session - Authenticated OAuth session
|
|
2088
2000
|
* @param serverUrl - Base URL of the AT Protocol server
|
|
2089
2001
|
* @param repoDid - DID of the repository to operate on
|
|
2090
|
-
* @param lexiconRegistry - Registry for lexicon validation
|
|
2091
2002
|
* @param isSDS - Whether this is a Shared Data Server
|
|
2092
2003
|
* @param logger - Optional logger for debugging
|
|
2093
2004
|
*
|
|
@@ -2097,7 +2008,7 @@ declare class Repository {
|
|
|
2097
2008
|
*
|
|
2098
2009
|
* @internal
|
|
2099
2010
|
*/
|
|
2100
|
-
constructor(session: Session, serverUrl: string, repoDid: string,
|
|
2011
|
+
constructor(session: Session, serverUrl: string, repoDid: string, isSDS: boolean, logger?: LoggerInterface);
|
|
2101
2012
|
/**
|
|
2102
2013
|
* The DID (Decentralized Identifier) of this repository.
|
|
2103
2014
|
*
|
|
@@ -2852,7 +2763,6 @@ declare class ATProtoSDK {
|
|
|
2852
2763
|
private oauthClient;
|
|
2853
2764
|
private config;
|
|
2854
2765
|
private logger?;
|
|
2855
|
-
private lexiconRegistry;
|
|
2856
2766
|
/**
|
|
2857
2767
|
* Creates a new ATProto SDK instance.
|
|
2858
2768
|
*
|
|
@@ -3072,27 +2982,6 @@ declare class ATProtoSDK {
|
|
|
3072
2982
|
* ```
|
|
3073
2983
|
*/
|
|
3074
2984
|
repository(session: Session, options?: RepositoryOptions): Repository;
|
|
3075
|
-
/**
|
|
3076
|
-
* Gets the lexicon registry for schema validation.
|
|
3077
|
-
*
|
|
3078
|
-
* The lexicon registry manages AT Protocol lexicon schemas used for
|
|
3079
|
-
* validating record data. You can register custom lexicons to extend
|
|
3080
|
-
* the SDK's capabilities.
|
|
3081
|
-
*
|
|
3082
|
-
* @returns The {@link LexiconRegistry} instance
|
|
3083
|
-
*
|
|
3084
|
-
* @example
|
|
3085
|
-
* ```typescript
|
|
3086
|
-
* const registry = sdk.getLexiconRegistry();
|
|
3087
|
-
*
|
|
3088
|
-
* // Register custom lexicons
|
|
3089
|
-
* registry.register(myCustomLexicons);
|
|
3090
|
-
*
|
|
3091
|
-
* // Check if a lexicon is registered
|
|
3092
|
-
* const hasLexicon = registry.has("org.example.myRecord");
|
|
3093
|
-
* ```
|
|
3094
|
-
*/
|
|
3095
|
-
getLexiconRegistry(): LexiconRegistry;
|
|
3096
2985
|
/**
|
|
3097
2986
|
* The configured PDS (Personal Data Server) URL.
|
|
3098
2987
|
*
|
|
@@ -4708,5 +4597,5 @@ declare function validateScope(scope: string): {
|
|
|
4708
4597
|
invalidPermissions: string[];
|
|
4709
4598
|
};
|
|
4710
4599
|
|
|
4711
|
-
export { ATPROTO_SCOPE, ATProtoSDK, ATProtoSDKConfigSchema, ATProtoSDKError, AccountActionSchema, AccountAttrSchema, AccountPermissionSchema, AuthenticationError, BlobPermissionSchema, CollaboratorPermissionsSchema, CollaboratorSchema, ConfigurableAgent, IdentityAttrSchema, IdentityPermissionSchema, InMemorySessionStore, InMemoryStateStore, IncludePermissionSchema,
|
|
4712
|
-
export type { ATProtoSDKConfig, AccountAction, AccountAttr, AccountPermissionInput, AuthorizeOptions, BlobOperations, BlobPermissionInput,
|
|
4600
|
+
export { ATPROTO_SCOPE, ATProtoSDK, ATProtoSDKConfigSchema, ATProtoSDKError, AccountActionSchema, AccountAttrSchema, AccountPermissionSchema, AuthenticationError, BlobPermissionSchema, CollaboratorPermissionsSchema, CollaboratorSchema, ConfigurableAgent, HYPERCERT_COLLECTIONS, HYPERCERT_LEXICONS, IdentityAttrSchema, IdentityPermissionSchema, InMemorySessionStore, InMemoryStateStore, IncludePermissionSchema, MimeTypeSchema, NetworkError, NsidSchema, OAuthConfigSchema, OrganizationSchema, PermissionBuilder, PermissionSchema, RepoActionSchema, RepoPermissionSchema, Repository, RpcPermissionSchema, SDSRequiredError, ScopePresets, ServerConfigSchema, SessionExpiredError, TRANSITION_SCOPES, TimeoutConfigSchema, TransitionScopeSchema, ValidationError, buildScope, createATProtoSDK, hasAllPermissions, hasAnyPermission, hasPermission, mergeScopes, parseScope, removePermissions, validateScope };
|
|
4601
|
+
export type { ATProtoSDKConfig, AccountAction, AccountAttr, AccountPermissionInput, AuthorizeOptions, BadgeAward, BadgeDefinition, BadgeResponse, BlobOperations, BlobPermissionInput, CacheInterface, Collaborator, CollaboratorOperations, CollaboratorPermissions, CreateHypercertParams, CreateHypercertResult, CreateResult, DID, FundingReceipt, HypercertClaim, HypercertCollection, HypercertCollectionClaimItem, HypercertContribution, HypercertEvaluation, HypercertEvents, HypercertEvidence, HypercertImage, HypercertImageRecord, HypercertLocation, HypercertMeasurement, HypercertOperations, HypercertProject, HypercertRights, HypercertWithMetadata, IdentityAttr, IdentityPermissionInput, IncludePermissionInput, ListParams, LoggerInterface, Organization, OrganizationInfo, OrganizationOperations, PaginatedList, Permission, PermissionInput, ProfileOperations, ProgressStep, RecordOperations, RepoAction, RepoPermissionInput, RepositoryAccessGrant, RepositoryOptions, RepositoryRole, RpcPermissionInput, Session, SessionStore, StateStore, StrongRef, TransitionScope, UpdateResult };
|