Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish actor and statement types #11

Merged
merged 4 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 22 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
{
"name": "ngx-xapi",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^16.1.0",
"@angular/common": "^16.1.0",
"@angular/compiler": "^16.1.0",
"@angular/core": "^16.1.0",
"@angular/forms": "^16.1.0",
"@angular/platform-browser": "^16.1.0",
"@angular/platform-browser-dynamic": "^16.1.0",
"@angular/router": "^16.1.0",
"@types/uuid": "^9.0.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"uuid": "^9.0.0",
Expand All @@ -29,6 +17,7 @@
"@angular/cli": "~16.1.4",
"@angular/compiler-cli": "^16.1.0",
"@types/jasmine": "~4.3.0",
"@types/uuid": "^9.0.2",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-xapi/model/src/lib/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type IdentifiedActor =
/**
* An email address. The required format is "mailto:email address".
*/
mbox: string;
mbox: `mailto:${string}`;
thomasturrell marked this conversation as resolved.
Show resolved Hide resolved
mbox_sha1sum?: undefined;
openid?: undefined;
account?: undefined;
Expand Down
18 changes: 13 additions & 5 deletions projects/ngx-xapi/model/src/lib/statement.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Activity } from './activity';
import { Actor, Group } from './actor';
import { Agent, Actor, Group } from './actor';
import { Attachment } from './attachment';
import { Extensions } from './extensions';
import { Result } from './result';
Expand Down Expand Up @@ -84,11 +84,10 @@ export interface Context {
* Platform used in the experience of this learning activity.
*/
platform?: string;

/**
* The language in which the experience being recorded in this Statement (mainly) occurred in.
*/
language?: string;
language?: Exclude<string, 'und' | 'Und' | 'UND'>;
thomasturrell marked this conversation as resolved.
Show resolved Hide resolved

/**
* Another Statement to be considered as context for this Statement.
Expand Down Expand Up @@ -122,7 +121,12 @@ export interface Statement {
/**
* Activity, Actor, or another Statement that is the Object of the Statement.
*/
object: Activity | StatementReference | Actor | SubStatement;
object:
| Activity
| StatementReference
| SubStatement
| Group
| (Agent & { objectType: 'Agent' });

/**
* Result Object, further details representing a measured outcome.
Expand Down Expand Up @@ -167,5 +171,9 @@ export interface Statement {
*/
export interface SubStatement extends Statement {
objectType: 'SubStatement';
object: Activity | StatementReference | Actor;
object:
| Activity
| StatementReference
| Group
| (Agent & { objectType: 'Agent' });
}