@twin.org/standards-w3c-activity-streams 0.0.2-next.9 → 0.0.3-next.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/dist/es/dataTypes/activityStreamsDataTypes.js +32 -0
- package/dist/es/dataTypes/activityStreamsDataTypes.js.map +1 -0
- package/dist/es/index.js +8 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IActivity.js +2 -0
- package/dist/es/models/IActivity.js.map +1 -0
- package/dist/es/models/activityStreamsContextType.js +2 -0
- package/dist/es/models/activityStreamsContextType.js.map +1 -0
- package/dist/es/models/activityStreamsContexts.js +21 -0
- package/dist/es/models/activityStreamsContexts.js.map +1 -0
- package/dist/es/models/activityStreamsTypes.js +155 -0
- package/dist/es/models/activityStreamsTypes.js.map +1 -0
- package/dist/es/schemas/Activity.json +236 -0
- package/dist/es/schemas/ActivityStreamsTypes.json +37 -0
- package/dist/types/index.d.ts +5 -5
- package/dist/types/models/IActivity.d.ts +2 -2
- package/dist/types/models/activityStreamsContextType.d.ts +1 -1
- package/dist/types/models/activityStreamsTypes.d.ts +129 -13
- package/docs/changelog.md +70 -0
- package/docs/reference/interfaces/IActivity.md +2 -2
- package/docs/reference/type-aliases/ActivityStreamsTypes.md +1 -0
- package/docs/reference/variables/ActivityStreamsTypes.md +244 -17
- package/package.json +20 -8
- package/dist/cjs/index.cjs +0 -402
- package/dist/esm/index.mjs +0 -398
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { DataTypeHandlerFactory } from "@twin.org/data-core";
|
|
4
|
+
import { ActivityStreamsContexts } from "../models/activityStreamsContexts.js";
|
|
5
|
+
import { ActivityStreamsTypes } from "../models/activityStreamsTypes.js";
|
|
6
|
+
import ActivitySchema from "../schemas/Activity.json" with { type: "json" };
|
|
7
|
+
import ActivityStreamsTypesSchema from "../schemas/ActivityStreamsTypes.json" with { type: "json" };
|
|
8
|
+
/**
|
|
9
|
+
* Data Type registration for the Data Space Connector
|
|
10
|
+
*/
|
|
11
|
+
export class ActivityStreamsDataTypes {
|
|
12
|
+
/**
|
|
13
|
+
* Register all the data types.
|
|
14
|
+
*/
|
|
15
|
+
static registerTypes() {
|
|
16
|
+
for (const activityStreamsType of Object.values(ActivityStreamsTypes)) {
|
|
17
|
+
DataTypeHandlerFactory.register(`${ActivityStreamsContexts.ActivityStreamsNamespace}${activityStreamsType}`, () => ({
|
|
18
|
+
context: ActivityStreamsContexts.ActivityStreamsNamespace,
|
|
19
|
+
type: `${activityStreamsType}`,
|
|
20
|
+
defaultValue: {},
|
|
21
|
+
jsonSchema: async () => ActivitySchema
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
DataTypeHandlerFactory.register(`${ActivityStreamsContexts.TwinContext}/${"ActivityStreamsTypes"}`, () => ({
|
|
25
|
+
context: ActivityStreamsContexts.TwinContext,
|
|
26
|
+
type: "ActivityStreamsTypes",
|
|
27
|
+
defaultValue: {},
|
|
28
|
+
jsonSchema: async () => ActivityStreamsTypesSchema
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=activityStreamsDataTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityStreamsDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/activityStreamsDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,cAAc,MAAM,0BAA0B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5E,OAAO,0BAA0B,MAAM,sCAAsC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEpG;;GAEG;AACH,MAAM,OAAgB,wBAAwB;IAC7C;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,KAAK,MAAM,mBAAmB,IAAI,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACvE,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,uBAAuB,CAAC,wBAAwB,GAAG,mBAAmB,EAAE,EAC3E,GAAG,EAAE,CAAC,CAAC;gBACN,OAAO,EAAE,uBAAuB,CAAC,wBAAwB;gBACzD,IAAI,EAAE,GAAG,mBAAmB,EAAE;gBAC9B,YAAY,EAAE,EAAE;gBAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAA6B;aACrD,CAAC,CACF,CAAC;QACH,CAAC;QAED,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,uBAAuB,CAAC,WAAW,IAAI,sBAA8B,EAAE,EAC1E,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,uBAAuB,CAAC,WAAW;YAC5C,IAAI,wBAAgC;YACpC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,0BAAyC;SACjE,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory } from \"@twin.org/data-core\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { JSONSchema7 } from \"json-schema\";\nimport { ActivityStreamsContexts } from \"../models/activityStreamsContexts.js\";\nimport { ActivityStreamsTypes } from \"../models/activityStreamsTypes.js\";\nimport ActivitySchema from \"../schemas/Activity.json\" with { type: \"json\" };\nimport ActivityStreamsTypesSchema from \"../schemas/ActivityStreamsTypes.json\" with { type: \"json\" };\n\n/**\n * Data Type registration for the Data Space Connector\n */\nexport abstract class ActivityStreamsDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tfor (const activityStreamsType of Object.values(ActivityStreamsTypes)) {\n\t\t\tDataTypeHandlerFactory.register(\n\t\t\t\t`${ActivityStreamsContexts.ActivityStreamsNamespace}${activityStreamsType}`,\n\t\t\t\t() => ({\n\t\t\t\t\tcontext: ActivityStreamsContexts.ActivityStreamsNamespace,\n\t\t\t\t\ttype: `${activityStreamsType}`,\n\t\t\t\t\tdefaultValue: {},\n\t\t\t\t\tjsonSchema: async () => ActivitySchema as JSONSchema7\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${ActivityStreamsContexts.TwinContext}/${nameof<ActivityStreamsTypes>()}`,\n\t\t\t() => ({\n\t\t\t\tcontext: ActivityStreamsContexts.TwinContext,\n\t\t\t\ttype: nameof<ActivityStreamsTypes>(),\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => ActivityStreamsTypesSchema as JSONSchema7\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./dataTypes/activityStreamsDataTypes.js";
|
|
4
|
+
export * from "./models/IActivity.js";
|
|
5
|
+
export * from "./models/activityStreamsContexts.js";
|
|
6
|
+
export * from "./models/activityStreamsContextType.js";
|
|
7
|
+
export * from "./models/activityStreamsTypes.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\nexport * from \"./dataTypes/activityStreamsDataTypes.js\";\nexport * from \"./models/IActivity.js\";\nexport * from \"./models/activityStreamsContexts.js\";\nexport * from \"./models/activityStreamsContextType.js\";\nexport * from \"./models/activityStreamsTypes.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IActivity.js","sourceRoot":"","sources":["../../../src/models/IActivity.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ObjectOrArray } from \"@twin.org/core\";\nimport type { IJsonLdLanguageMap, IJsonLdNodeObject, IJsonLdObject } from \"@twin.org/data-json-ld\";\nimport type { ActivityStreamsContextType } from \"./activityStreamsContextType.js\";\nimport type { ActivityStreamsTypes } from \"./activityStreamsTypes.js\";\n\n/**\n * A W3C Activity from Activity Streams\n * @see https://www.w3.org/TR/activitystreams-core/#activities\n */\nexport interface IActivity extends IJsonLdNodeObject {\n\t/**\n\t * The LD Context.\n\t *\n\t */\n\t\"@context\": ActivityStreamsContextType;\n\n\t/**\n\t * Activity Type.\n\t */\n\ttype: ObjectOrArray<ActivityStreamsTypes | string>;\n\n\t/**\n\t * The generator of the Activity.\n\t */\n\tgenerator?: IJsonLdObject[\"@id\"] | IJsonLdNodeObject;\n\n\t/**\n\t * The Actor behind the Activity.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor\n\t */\n\tactor: IJsonLdObject[\"@id\"] | IJsonLdNodeObject;\n\n\t/**\n\t * The object affected by the Activity.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object\n\t */\n\tobject: IJsonLdNodeObject;\n\n\t/**\n\t * The target of the Activity.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-target\n\t */\n\ttarget?: IJsonLdNodeObject;\n\n\t/**\n\t * Summary of the Activity.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-summary\n\t */\n\tsummary?: string | IJsonLdLanguageMap;\n\n\t/**\n\t * Result of the Activity.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-result\n\t */\n\tresult?: IJsonLdNodeObject;\n\n\t/**\n\t * Activity's origin.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-origin\n\t */\n\torigin?: IJsonLdObject[\"@id\"] | IJsonLdNodeObject;\n\n\t/**\n\t * The date and time at which the object was updated.\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-updated\n\t */\n\tupdated: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityStreamsContextType.js","sourceRoot":"","sources":["../../../src/models/activityStreamsContextType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { ActivityStreamsContexts } from \"./activityStreamsContexts.js\";\n\n/**\n * The Activity Streams JSON-LD context type.\n */\nexport type ActivityStreamsContextType =\n\t| typeof ActivityStreamsContexts.ContextRoot\n\t| [typeof ActivityStreamsContexts.ContextRoot]\n\t| [...IJsonLdContextDefinitionElement[], typeof ActivityStreamsContexts.ContextRoot];\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The LD Contexts concerning Activity Streams.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const ActivityStreamsContexts = {
|
|
8
|
+
/**
|
|
9
|
+
* The Activity Streams LD Context.
|
|
10
|
+
*/
|
|
11
|
+
ContextRoot: "https://www.w3.org/ns/activitystreams",
|
|
12
|
+
/**
|
|
13
|
+
* The Activity Streams namespace.
|
|
14
|
+
*/
|
|
15
|
+
ActivityStreamsNamespace: "https://www.w3.org/ns/activitystreams#",
|
|
16
|
+
/**
|
|
17
|
+
* The TWIN context for Activity Streams.
|
|
18
|
+
*/
|
|
19
|
+
TwinContext: "https://schema.twindev.org/w3c-activity-streams"
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=activityStreamsContexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityStreamsContexts.js","sourceRoot":"","sources":["../../../src/models/activityStreamsContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC;;OAEG;IACH,WAAW,EAAE,uCAAuC;IAEpD;;OAEG;IACH,wBAAwB,EAAE,wCAAwC;IAElE;;OAEG;IACH,WAAW,EAAE,iDAAiD;CACrD,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The LD Contexts concerning Activity Streams.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ActivityStreamsContexts = {\n\t/**\n\t * The Activity Streams LD Context.\n\t */\n\tContextRoot: \"https://www.w3.org/ns/activitystreams\",\n\n\t/**\n\t * The Activity Streams namespace.\n\t */\n\tActivityStreamsNamespace: \"https://www.w3.org/ns/activitystreams#\",\n\n\t/**\n\t * The TWIN context for Activity Streams.\n\t */\n\tTwinContext: \"https://schema.twindev.org/w3c-activity-streams\"\n} as const;\n\n/**\n * The LD Contexts concerning Activity Streams.\n */\nexport type ActivityStreamsContexts =\n\t(typeof ActivityStreamsContexts)[keyof typeof ActivityStreamsContexts];\n"]}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The types concerning Activity Streams.
|
|
5
|
+
* Section 3.1 Activity Types: https://www.w3.org/TR/activitystreams-vocabulary/#activity-types
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
|
+
export const ActivityStreamsTypes = {
|
|
9
|
+
/**
|
|
10
|
+
* Activity
|
|
11
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity
|
|
12
|
+
*/
|
|
13
|
+
Activity: "Activity",
|
|
14
|
+
/**
|
|
15
|
+
* Accept
|
|
16
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept
|
|
17
|
+
*/
|
|
18
|
+
Accept: "Accept",
|
|
19
|
+
/**
|
|
20
|
+
* Add
|
|
21
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add
|
|
22
|
+
*/
|
|
23
|
+
Add: "Add",
|
|
24
|
+
/**
|
|
25
|
+
* Announce
|
|
26
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce
|
|
27
|
+
*/
|
|
28
|
+
Announce: "Announce",
|
|
29
|
+
/**
|
|
30
|
+
* Arrive
|
|
31
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-arrive
|
|
32
|
+
*/
|
|
33
|
+
Arrive: "Arrive",
|
|
34
|
+
/**
|
|
35
|
+
* Block
|
|
36
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block
|
|
37
|
+
*/
|
|
38
|
+
Block: "Block",
|
|
39
|
+
/**
|
|
40
|
+
* Create
|
|
41
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create
|
|
42
|
+
*/
|
|
43
|
+
Create: "Create",
|
|
44
|
+
/**
|
|
45
|
+
* Delete
|
|
46
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete
|
|
47
|
+
*/
|
|
48
|
+
Delete: "Delete",
|
|
49
|
+
/**
|
|
50
|
+
* Dislike
|
|
51
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike
|
|
52
|
+
*/
|
|
53
|
+
Dislike: "Dislike",
|
|
54
|
+
/**
|
|
55
|
+
* Flag
|
|
56
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-flag
|
|
57
|
+
*/
|
|
58
|
+
Flag: "Flag",
|
|
59
|
+
/**
|
|
60
|
+
* Follow
|
|
61
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow
|
|
62
|
+
*/
|
|
63
|
+
Follow: "Follow",
|
|
64
|
+
/**
|
|
65
|
+
* Ignore
|
|
66
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore
|
|
67
|
+
*/
|
|
68
|
+
Ignore: "Ignore",
|
|
69
|
+
/**
|
|
70
|
+
* Invite
|
|
71
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite
|
|
72
|
+
*/
|
|
73
|
+
Invite: "Invite",
|
|
74
|
+
/**
|
|
75
|
+
* Join
|
|
76
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join
|
|
77
|
+
*/
|
|
78
|
+
Join: "Join",
|
|
79
|
+
/**
|
|
80
|
+
* Leave
|
|
81
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-leave
|
|
82
|
+
*/
|
|
83
|
+
Leave: "Leave",
|
|
84
|
+
/**
|
|
85
|
+
* Like
|
|
86
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like
|
|
87
|
+
*/
|
|
88
|
+
Like: "Like",
|
|
89
|
+
/**
|
|
90
|
+
* Listen
|
|
91
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen
|
|
92
|
+
*/
|
|
93
|
+
Listen: "Listen",
|
|
94
|
+
/**
|
|
95
|
+
* Move
|
|
96
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-move
|
|
97
|
+
*/
|
|
98
|
+
Move: "Move",
|
|
99
|
+
/**
|
|
100
|
+
* Offer
|
|
101
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-offer
|
|
102
|
+
*/
|
|
103
|
+
Offer: "Offer",
|
|
104
|
+
/**
|
|
105
|
+
* Question
|
|
106
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-question
|
|
107
|
+
*/
|
|
108
|
+
Question: "Question",
|
|
109
|
+
/**
|
|
110
|
+
* Reject
|
|
111
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject
|
|
112
|
+
*/
|
|
113
|
+
Reject: "Reject",
|
|
114
|
+
/**
|
|
115
|
+
* Read
|
|
116
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read
|
|
117
|
+
*/
|
|
118
|
+
Read: "Read",
|
|
119
|
+
/**
|
|
120
|
+
* Remove
|
|
121
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove
|
|
122
|
+
*/
|
|
123
|
+
Remove: "Remove",
|
|
124
|
+
/**
|
|
125
|
+
* TentativeReject
|
|
126
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativereject
|
|
127
|
+
*/
|
|
128
|
+
TentativeReject: "TentativeReject",
|
|
129
|
+
/**
|
|
130
|
+
* TentativeAccept
|
|
131
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativeaccept
|
|
132
|
+
*/
|
|
133
|
+
TentativeAccept: "TentativeAccept",
|
|
134
|
+
/**
|
|
135
|
+
* Travel
|
|
136
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-travel
|
|
137
|
+
*/
|
|
138
|
+
Travel: "Travel",
|
|
139
|
+
/**
|
|
140
|
+
* Undo
|
|
141
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo
|
|
142
|
+
*/
|
|
143
|
+
Undo: "Undo",
|
|
144
|
+
/**
|
|
145
|
+
* Update
|
|
146
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update
|
|
147
|
+
*/
|
|
148
|
+
Update: "Update",
|
|
149
|
+
/**
|
|
150
|
+
* View
|
|
151
|
+
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view
|
|
152
|
+
*/
|
|
153
|
+
View: "View"
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=activityStreamsTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityStreamsTypes.js","sourceRoot":"","sources":["../../../src/models/activityStreamsTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;GAGG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;;;OAGG;IACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,GAAG,EAAE,KAAK;IAEV;;;OAGG;IACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,KAAK,EAAE,OAAO;IAEd;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,OAAO,EAAE,SAAS;IAElB;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,KAAK,EAAE,OAAO;IAEd;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,KAAK,EAAE,OAAO;IAEd;;;OAGG;IACH,QAAQ,EAAE,UAAU;IAEpB;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;OAGG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM;IAEZ;;;OAGG;IACH,MAAM,EAAE,QAAQ;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM;CACH,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types concerning Activity Streams.\n * Section 3.1 Activity Types: https://www.w3.org/TR/activitystreams-vocabulary/#activity-types\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ActivityStreamsTypes = {\n\t/**\n\t * Activity\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity\n\t */\n\tActivity: \"Activity\",\n\n\t/**\n\t * Accept\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept\n\t */\n\tAccept: \"Accept\",\n\n\t/**\n\t * Add\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-add\n\t */\n\tAdd: \"Add\",\n\n\t/**\n\t * Announce\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce\n\t */\n\tAnnounce: \"Announce\",\n\n\t/**\n\t * Arrive\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-arrive\n\t */\n\tArrive: \"Arrive\",\n\n\t/**\n\t * Block\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-block\n\t */\n\tBlock: \"Block\",\n\n\t/**\n\t * Create\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create\n\t */\n\tCreate: \"Create\",\n\n\t/**\n\t * Delete\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete\n\t */\n\tDelete: \"Delete\",\n\n\t/**\n\t * Dislike\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike\n\t */\n\tDislike: \"Dislike\",\n\n\t/**\n\t * Flag\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-flag\n\t */\n\tFlag: \"Flag\",\n\n\t/**\n\t * Follow\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow\n\t */\n\tFollow: \"Follow\",\n\n\t/**\n\t * Ignore\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore\n\t */\n\tIgnore: \"Ignore\",\n\n\t/**\n\t * Invite\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite\n\t */\n\tInvite: \"Invite\",\n\n\t/**\n\t * Join\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join\n\t */\n\tJoin: \"Join\",\n\n\t/**\n\t * Leave\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-leave\n\t */\n\tLeave: \"Leave\",\n\n\t/**\n\t * Like\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like\n\t */\n\tLike: \"Like\",\n\n\t/**\n\t * Listen\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen\n\t */\n\tListen: \"Listen\",\n\n\t/**\n\t * Move\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-move\n\t */\n\tMove: \"Move\",\n\n\t/**\n\t * Offer\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-offer\n\t */\n\tOffer: \"Offer\",\n\n\t/**\n\t * Question\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-question\n\t */\n\tQuestion: \"Question\",\n\n\t/**\n\t * Reject\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject\n\t */\n\tReject: \"Reject\",\n\n\t/**\n\t * Read\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read\n\t */\n\tRead: \"Read\",\n\n\t/**\n\t * Remove\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-remove\n\t */\n\tRemove: \"Remove\",\n\n\t/**\n\t * TentativeReject\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativereject\n\t */\n\tTentativeReject: \"TentativeReject\",\n\n\t/**\n\t * TentativeAccept\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tentativeaccept\n\t */\n\tTentativeAccept: \"TentativeAccept\",\n\n\t/**\n\t * Travel\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-travel\n\t */\n\tTravel: \"Travel\",\n\n\t/**\n\t * Undo\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-undo\n\t */\n\tUndo: \"Undo\",\n\n\t/**\n\t * Update\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update\n\t */\n\tUpdate: \"Update\",\n\n\t/**\n\t * View\n\t * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view\n\t */\n\tView: \"View\"\n} as const;\n\n/**\n * The types concerning Activity.\n * Section 3.1 Activity Types: https://www.w3.org/TR/activitystreams-vocabulary/#activity-types\n */\nexport type ActivityStreamsTypes = (typeof ActivityStreamsTypes)[keyof typeof ActivityStreamsTypes];\n"]}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-activity-streams/Activity",
|
|
4
|
+
"description": "A W3C Activity from Activity Streams",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"@context": {
|
|
8
|
+
"description": "The Activity Streams JSON-LD context type.",
|
|
9
|
+
"anyOf": [
|
|
10
|
+
{
|
|
11
|
+
"type": "string",
|
|
12
|
+
"const": "https://www.w3.org/ns/activitystreams"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "https://www.w3.org/ns/activitystreams"
|
|
19
|
+
},
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"maxItems": 1
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "array",
|
|
25
|
+
"minItems": 1,
|
|
26
|
+
"prefixItems": [
|
|
27
|
+
{
|
|
28
|
+
"type": "string",
|
|
29
|
+
"const": "https://www.w3.org/ns/activitystreams"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"@id": {
|
|
39
|
+
"anyOf": [
|
|
40
|
+
{
|
|
41
|
+
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"@included": {
|
|
52
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
|
|
53
|
+
},
|
|
54
|
+
"@graph": {
|
|
55
|
+
"anyOf": [
|
|
56
|
+
{
|
|
57
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"@nest": {
|
|
68
|
+
"anyOf": [
|
|
69
|
+
{
|
|
70
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdJsonObject"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": {
|
|
75
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdJsonObject"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"@type": {
|
|
81
|
+
"anyOf": [
|
|
82
|
+
{
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"@reverse": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"@index": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"type": {
|
|
103
|
+
"description": "Object or array data type",
|
|
104
|
+
"anyOf": [
|
|
105
|
+
{
|
|
106
|
+
"$ref": "https://schema.twindev.org/w3c-activity-streams/ActivityStreamsTypes"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"anyOf": [
|
|
115
|
+
{
|
|
116
|
+
"$ref": "https://schema.twindev.org/w3c-activity-streams/ActivityStreamsTypes"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "string"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"generator": {
|
|
127
|
+
"anyOf": [
|
|
128
|
+
{
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "array",
|
|
133
|
+
"items": {
|
|
134
|
+
"type": "string"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"description": "The generator of the Activity."
|
|
142
|
+
},
|
|
143
|
+
"actor": {
|
|
144
|
+
"anyOf": [
|
|
145
|
+
{
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"description": "The Actor behind the Activity."
|
|
159
|
+
},
|
|
160
|
+
"object": {
|
|
161
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
162
|
+
"description": "The object affected by the Activity."
|
|
163
|
+
},
|
|
164
|
+
"target": {
|
|
165
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
166
|
+
"description": "The target of the Activity."
|
|
167
|
+
},
|
|
168
|
+
"summary": {
|
|
169
|
+
"anyOf": [
|
|
170
|
+
{
|
|
171
|
+
"type": "string"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"description": "Summary of the Activity."
|
|
178
|
+
},
|
|
179
|
+
"result": {
|
|
180
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
181
|
+
"description": "Result of the Activity."
|
|
182
|
+
},
|
|
183
|
+
"origin": {
|
|
184
|
+
"anyOf": [
|
|
185
|
+
{
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"description": "Activity's origin."
|
|
199
|
+
},
|
|
200
|
+
"updated": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"description": "The date and time at which the object was updated."
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"required": [
|
|
206
|
+
"@context",
|
|
207
|
+
"type",
|
|
208
|
+
"object",
|
|
209
|
+
"updated"
|
|
210
|
+
],
|
|
211
|
+
"additionalProperties": {
|
|
212
|
+
"anyOf": [
|
|
213
|
+
{
|
|
214
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodePrimitive"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdLanguageMap"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdIndexMap"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdIncludedBlock"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdIdMap"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdTypeMap"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"type": "array"
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/w3c-activity-streams/ActivityStreamsTypes",
|
|
4
|
+
"description": "The types concerning Activity Streams. Section 3.1 Activity Types: https://www.w3.org/TR/activitystreams-vocabulary/#activity-types The types concerning Activity. Section 3.1 Activity Types: https://www.w3.org/TR/activitystreams-vocabulary/#activity-types",
|
|
5
|
+
"type": "string",
|
|
6
|
+
"enum": [
|
|
7
|
+
"Activity",
|
|
8
|
+
"Accept",
|
|
9
|
+
"Add",
|
|
10
|
+
"Announce",
|
|
11
|
+
"Arrive",
|
|
12
|
+
"Block",
|
|
13
|
+
"Create",
|
|
14
|
+
"Delete",
|
|
15
|
+
"Dislike",
|
|
16
|
+
"Flag",
|
|
17
|
+
"Follow",
|
|
18
|
+
"Ignore",
|
|
19
|
+
"Invite",
|
|
20
|
+
"Join",
|
|
21
|
+
"Leave",
|
|
22
|
+
"Like",
|
|
23
|
+
"Listen",
|
|
24
|
+
"Move",
|
|
25
|
+
"Offer",
|
|
26
|
+
"Question",
|
|
27
|
+
"Reject",
|
|
28
|
+
"Read",
|
|
29
|
+
"Remove",
|
|
30
|
+
"TentativeReject",
|
|
31
|
+
"TentativeAccept",
|
|
32
|
+
"Travel",
|
|
33
|
+
"Undo",
|
|
34
|
+
"Update",
|
|
35
|
+
"View"
|
|
36
|
+
]
|
|
37
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./dataTypes/activityStreamsDataTypes";
|
|
2
|
-
export * from "./models/IActivity";
|
|
3
|
-
export * from "./models/activityStreamsContexts";
|
|
4
|
-
export * from "./models/activityStreamsContextType";
|
|
5
|
-
export * from "./models/activityStreamsTypes";
|
|
1
|
+
export * from "./dataTypes/activityStreamsDataTypes.js";
|
|
2
|
+
export * from "./models/IActivity.js";
|
|
3
|
+
export * from "./models/activityStreamsContexts.js";
|
|
4
|
+
export * from "./models/activityStreamsContextType.js";
|
|
5
|
+
export * from "./models/activityStreamsTypes.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ObjectOrArray } from "@twin.org/core";
|
|
2
2
|
import type { IJsonLdLanguageMap, IJsonLdNodeObject, IJsonLdObject } from "@twin.org/data-json-ld";
|
|
3
|
-
import type { ActivityStreamsContextType } from "./activityStreamsContextType";
|
|
4
|
-
import type { ActivityStreamsTypes } from "./activityStreamsTypes";
|
|
3
|
+
import type { ActivityStreamsContextType } from "./activityStreamsContextType.js";
|
|
4
|
+
import type { ActivityStreamsTypes } from "./activityStreamsTypes.js";
|
|
5
5
|
/**
|
|
6
6
|
* A W3C Activity from Activity Streams
|
|
7
7
|
* @see https://www.w3.org/TR/activitystreams-core/#activities
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
-
import type { ActivityStreamsContexts } from "./activityStreamsContexts";
|
|
2
|
+
import type { ActivityStreamsContexts } from "./activityStreamsContexts.js";
|
|
3
3
|
/**
|
|
4
4
|
* The Activity Streams JSON-LD context type.
|
|
5
5
|
*/
|