Skip to content

Commit

Permalink
Merge pull request #35 from litentry/p-716-magiccraft-schema
Browse files Browse the repository at this point in the history
feat(24-platform-user): add MagicCraft
  • Loading branch information
BillyWooo authored May 12, 2024
2 parents dad1888 + 72a822b commit a5b2525
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ It contains:
- `example` directory: exemplary VC for each assertion type
- `packages/schema` directory: JSONSchema for each assertion type
- `packages/validator` directory: Utility to validate schemas from a VC string.

## Contributing

1. Locate the schema you want to update on `packages/schema`. You can tell it from the VC's `credentialSchema.id` value.
1. Follow the versioning described in `packages/schema`'s README to name the new version.
1. The README describes how to generate the schemas from its model too.
1. Update the CHANGELOG.
1. Publish the pull request.
2 changes: 1 addition & 1 deletion dist/schemas/24-platform-user/1-1-1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/24-platform-user/1-1-0.json",
"$id": "https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/24-platform-user/1-1-1.json",
"title": "Platform user",
"description": "You are a user of a certain platform",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion dist/schemas/24-platform-user/latest.json
12 changes: 12 additions & 0 deletions packages/schemas/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project follows [Schema Versioning](https://docs.snowplow.io/docs/pipel

-

## 2024-05-10

(ADDITION) [`24-platform-user`](./src/lib/24-platform-user/) bumped to 1-1-s1

- Support `MagicCraft` platform.

## 2024-04-30

(REVISION) [`25-token-holding-amount`](./src/lib/25-token-holding-amount/) bumped to 1-1-0
Expand All @@ -23,6 +29,12 @@ and this project follows [Schema Versioning](https://docs.snowplow.io/docs/pipel

(MODEL) [`25-token-holding-amount`](./src/lib/25-token-holding-amount/) initial to 1-0-0

## 2024-04-25

(ADDITION) [`21-evm-holding-amount`](./src/lib/21-evm-holding-amount/) bumped to 1-1-1

- Support `MCRT` token.

## 2024-04-02

(ADDITION) Schema [`21-evm-holding-amount`](./src//lib/21-evm-holding-amount/) bumped to 1-1-1
Expand Down
37 changes: 37 additions & 0 deletions packages/schemas/src/lib/24-platform-user/1-1-1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { JSONSchema7 } from 'json-schema';

import { schema as base } from '../0-base/1-1-0';
import { resolveGitHubPath } from '../helpers';
import { credentialSubject, assertion } from '../schema-helpers';

const supportedPlatforms = [
// https://github.com/litentry/litentry-parachain/blob/dev/tee-worker/litentry/core/credentials-v2/src/platform_user/mod.rs
'KaratDao',
'MagicCraft',
];

export const schema: JSONSchema7 = {
...base,

$id: resolveGitHubPath('24-platform-user/1-1-1.json'),

title: 'Platform user',
description: 'You are a user of a certain platform',

properties: {
...base.properties,

credentialSubject: credentialSubject({
title: 'Credential Subject of Platform user',
assertions: assertion.and({
items: [
assertion.clause({
src: ['$platform'],
op: ['=='],
dst: supportedPlatforms,
}),
],
}),
}),
},
};

0 comments on commit a5b2525

Please sign in to comment.