Skip to content

Commit b4271bf

Browse files
author
Wes Biggs
committed
Adds remaining DSNP 1.3 items
Note: cli scripts read.ts and find.ts are in api-augment limbo and won't lint/compile
1 parent f38fd59 commit b4271bf

File tree

3 files changed

+617
-172
lines changed

3 files changed

+617
-172
lines changed

dsnp/index.ts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const reaction = descriptorForAnnouncementType(AnnouncementType.Reaction).parque
1818
const reply = descriptorForAnnouncementType(AnnouncementType.Reply).parquetSchema;
1919
const tombstone = descriptorForAnnouncementType(AnnouncementType.Tombstone).parquetSchema;
2020
const update = descriptorForAnnouncementType(AnnouncementType.Update).parquetSchema;
21+
const userAttributeSet = descriptorForAnnouncementType(AnnouncementType.Update).parquetSchema;
22+
const dsnpContentAttributeSet = descriptorForAnnouncementType(AnnouncementType.DSNPContentAttributeSet).parquetSchema;
23+
const externalContentAttributeSet = descriptorForAnnouncementType(
24+
AnnouncementType.ExternalContentAttributeSet,
25+
).parquetSchema;
2126

2227
const profile = descriptorForUserDataType(UserDataType.ProfileResources).avroSchema;
2328
const publicKey = descriptorForUserDataType(UserDataType.KeyAgreementPublicKeys).avroSchema;
@@ -69,7 +74,15 @@ type AvroDeploy = {
6974

7075
export type Deploy = ParquetDeploy | AvroDeploy;
7176

72-
export type ParquetSchemaName = "broadcast" | "reaction" | "reply" | "tombstone" | "update";
77+
export type ParquetSchemaName =
78+
| "broadcast"
79+
| "reaction"
80+
| "reply"
81+
| "tombstone"
82+
| "update"
83+
| "user-attribute-set"
84+
| "dsnp-content-attribute-set"
85+
| "ext-content-attribute-set";
7386
export type AvroSchemaName =
7487
| "public-key-key-agreement"
7588
| "public-key-assertion-method"
@@ -194,6 +207,36 @@ export const schemas = new Map<SchemaName, Deploy>([
194207
dsnpVersion: "1.3",
195208
},
196209
],
210+
[
211+
"user-attribute-set",
212+
{
213+
model: userAttributeSet,
214+
modelType: "Parquet",
215+
payloadLocation: "IPFS",
216+
settings: [],
217+
dsnpVersion: "1.3",
218+
},
219+
],
220+
[
221+
"dsnp-content-attribute-set",
222+
{
223+
model: dsnpContentAttributeSet,
224+
modelType: "Parquet",
225+
payloadLocation: "IPFS",
226+
settings: [],
227+
dsnpVersion: "1.3",
228+
},
229+
],
230+
[
231+
"ext-content-attribute-set",
232+
{
233+
model: externalContentAttributeSet,
234+
modelType: "Parquet",
235+
payloadLocation: "IPFS",
236+
settings: [],
237+
dsnpVersion: "1.3",
238+
},
239+
],
197240
]);
198241

199242
export const getSchema = (name: SchemaName): Deploy | null => {
@@ -219,6 +262,9 @@ chainMapping[GENESIS_HASH_TESTNET_PASEO] = {
219262
"private-connections": { "1.2": 10 },
220263
"public-key-assertion-method": { "1.3": 11 },
221264
"profile-resources": { "1.3": 570 },
265+
"user-attribute-set": { "1.3": 579 },
266+
"dsnp-content-attribute-set": { "1.3": 580 },
267+
"ext-content-attribute-set": { "1.3": 581 },
222268
};
223269
chainMapping[GENESIS_HASH_MAINNET] = {
224270
tombstone: { "1.2": 1 },
@@ -232,6 +278,9 @@ chainMapping[GENESIS_HASH_MAINNET] = {
232278
"private-connections": { "1.2": 10 },
233279
// "public-key-assertion-method": { "1.3": TBD },
234280
// "profile-resources": { "1.3": TBD },
281+
// "user-attribute-set": { "1.3": TBD },
282+
// "dsnp-content-attribute-set": { "1.3": TBD },
283+
// "ext-content-attribute-set": { "1.3": TBD },
235284
};
236285
/*
237286
* Schemas in "default" deployments (e.g. to a clean local node) are

0 commit comments

Comments
 (0)