-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new announcement types for Attribute Sets (#1)
Co-authored-by: Wes Biggs <[email protected]>
- Loading branch information
Showing
9 changed files
with
283 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { testCompression, testParquetSchema } from "../test/parquet.js"; | ||
import * as generators from "@dsnp/test-generators"; | ||
import dsnpContentAttributeSetSchema from "./dsnp-content-attribute-set.js"; | ||
|
||
describe("DSNP Content Attribute Set Spec", () => { | ||
testParquetSchema(dsnpContentAttributeSetSchema); | ||
|
||
testCompression("dsnpContentAttributeSet", dsnpContentAttributeSetSchema, () => ({ | ||
announcementType: 9, | ||
fromId: generators.randInt(10000000), | ||
subject: `dsnp://${generators.randInt(10000000)}/bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna`, | ||
url: `https://www.imadapp.com/data/vcs/${generators.generateHash()}`, | ||
contentHash: "bciqdnu347gcfmxzbkhgoubiobphm6readngitfywktdtbdocgogop2q", | ||
attributeSetType: `did:dsnp:${generators.randInt(10000000)}$MyAttributeSetType`, | ||
issuer: `did:dsnp:${generators.randInt(10000000)}`, | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { DSNPParquetSchema } from "../types/dsnp-parquet.js"; | ||
|
||
const dsnpContentAttributeSet: DSNPParquetSchema = [ | ||
{ | ||
name: "announcementType", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 32, | ||
sign: true, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "fromId", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 64, | ||
sign: false, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "subject", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "url", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "contentHash", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "attributeSetType", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "issuer", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
]; | ||
|
||
export default dsnpContentAttributeSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { testCompression, testParquetSchema } from "../test/parquet.js"; | ||
import * as generators from "@dsnp/test-generators"; | ||
import externalContentAttributeSetSchema from "./external-content-attribute-set.js"; | ||
|
||
describe("External Content Attribute Set Spec", () => { | ||
testParquetSchema(externalContentAttributeSetSchema); | ||
|
||
testCompression("externalContentAttributeSet", externalContentAttributeSetSchema, () => ({ | ||
announcementType: 10, | ||
fromId: generators.randInt(10000000), | ||
subject: "https://www.website.com/somecontent.html", | ||
subjectContentHash: "bciqdnu347gcfmxzbkhgoubiobphm6readngitfywktdtbdocgogop2q", | ||
url: `https://www.imadapp.com/data/vcs/${generators.generateHash()}`, | ||
contentHash: "bciqdnu347gcfmxzbkhgoubiobphm6readngitfywktdtbdocgogop2q", | ||
attributeSetType: `did:dsnp:${generators.randInt(10000000)}$MyAttributeSetType`, | ||
issuer: `did:dsnp:${generators.randInt(10000000)}`, | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { DSNPParquetSchema } from "../types/dsnp-parquet.js"; | ||
|
||
const externalContentAttributeSet: DSNPParquetSchema = [ | ||
{ | ||
name: "announcementType", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 32, | ||
sign: true, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "fromId", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 64, | ||
sign: false, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "subject", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "subjectContentHash", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "url", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "contentHash", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "attributeSetType", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "issuer", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
]; | ||
|
||
export default externalContentAttributeSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { testCompression, testParquetSchema } from "../test/parquet.js"; | ||
import * as generators from "@dsnp/test-generators"; | ||
import userAttributeSetSchema from "./user-attribute-set.js"; | ||
|
||
describe("User Attribute Set Spec", () => { | ||
testParquetSchema(userAttributeSetSchema); | ||
|
||
testCompression("userAttributeSet", userAttributeSetSchema, () => ({ | ||
announcementType: 8, | ||
fromId: generators.randInt(10000000), | ||
subject: generators.randInt(10000000), | ||
url: `https://www.imadapp.com/data/vcs/${generators.generateHash()}`, | ||
contentHash: "bciqdnu347gcfmxzbkhgoubiobphm6readngitfywktdtbdocgogop2q", | ||
attributeSetType: `did:dsnp:${generators.randInt(10000000)}$MyAttributeSetType`, | ||
issuer: `did:dsnp:${generators.randInt(10000000)}`, | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { DSNPParquetSchema } from "../types/dsnp-parquet.js"; | ||
|
||
const userAttributeSet: DSNPParquetSchema = [ | ||
{ | ||
name: "announcementType", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 32, | ||
sign: true, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "fromId", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 64, | ||
sign: false, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "subject", | ||
column_type: { | ||
INTEGER: { | ||
bit_width: 64, | ||
sign: false, | ||
}, | ||
}, | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "url", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: false, | ||
}, | ||
{ | ||
name: "contentHash", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "attributeSetType", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
{ | ||
name: "issuer", | ||
column_type: "STRING", | ||
compression: "GZIP", | ||
bloom_filter: true, | ||
}, | ||
]; | ||
|
||
export default userAttributeSet; |
Oops, something went wrong.