@sockethub/platform-dummy 3.0.0-alpha.10 → 3.0.0-alpha.12

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/README.md CHANGED
@@ -8,7 +8,7 @@ This platform provides basic testing functionality for Sockethub development. It
8
8
  simple verbs that can be used to test ActivityStreams message flow, error handling, and
9
9
  platform communication without requiring external service connections.
10
10
 
11
- ## Implemented Verbs (`@type`)
11
+ ## Implemented Verbs (`type`)
12
12
 
13
13
  * **echo** - Returns the received message unchanged
14
14
  * **fail** - Intentionally fails with an error message
@@ -21,12 +21,18 @@ platform communication without requiring external service connections.
21
21
 
22
22
  ```json
23
23
  {
24
- "@type": "echo",
25
- "context": "dummy",
24
+ "type": "echo",
25
+ "@context": [
26
+ "https://www.w3.org/ns/activitystreams",
27
+ "https://sockethub.org/ns/context/v1.jsonld",
28
+ "https://sockethub.org/ns/context/platform/dummy/v1.jsonld"
29
+ ],
26
30
  "actor": {
27
- "@id": "test-user"
31
+ "id": "test-user",
32
+ "type": "person"
28
33
  },
29
34
  "object": {
35
+ "type": "message",
30
36
  "content": "Hello World"
31
37
  }
32
38
  }
@@ -36,12 +42,22 @@ platform communication without requiring external service connections.
36
42
 
37
43
  ```json
38
44
  {
39
- "@type": "echo",
40
- "context": "dummy",
45
+ "type": "echo",
46
+ "@context": [
47
+ "https://www.w3.org/ns/activitystreams",
48
+ "https://sockethub.org/ns/context/v1.jsonld",
49
+ "https://sockethub.org/ns/context/platform/dummy/v1.jsonld"
50
+ ],
41
51
  "actor": {
42
- "@id": "test-user"
52
+ "id": "dummy",
53
+ "type": "platform"
54
+ },
55
+ "target": {
56
+ "id": "test-user",
57
+ "type": "person"
43
58
  },
44
59
  "object": {
60
+ "type": "message",
45
61
  "content": "Hello World"
46
62
  }
47
63
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  var package_default = {
3
3
  name: "@sockethub/platform-dummy",
4
4
  description: "A sockethub platform dummy module",
5
- version: "3.0.0-alpha.10",
5
+ version: "3.0.0-alpha.12",
6
6
  type: "module",
7
7
  private: false,
8
8
  author: "Nick Jennings <nick@silverbucket.net>",
@@ -18,17 +18,23 @@ var package_default = {
18
18
  default: "./dist/index.js"
19
19
  }
20
20
  },
21
- files: ["src/", "dist/"],
21
+ files: [
22
+ "src/",
23
+ "dist/"
24
+ ],
22
25
  engines: {
23
26
  bun: ">=1.2"
24
27
  },
25
- keywords: ["sockethub", "dummy"],
28
+ keywords: [
29
+ "sockethub",
30
+ "dummy"
31
+ ],
26
32
  devDependencies: {
27
- "@sockethub/schemas": "^3.0.0-alpha.10",
33
+ "@sockethub/schemas": "^3.0.0-alpha.12",
28
34
  "@types/bun": "latest"
29
35
  },
30
36
  peerDependencies: {
31
- "@sockethub/server": "^5.0.0-alpha.10"
37
+ "@sockethub/server": "^5.0.0-alpha.12"
32
38
  },
33
39
  peerDependenciesMeta: {
34
40
  "@sockethub/server": {
@@ -37,7 +43,8 @@ var package_default = {
37
43
  },
38
44
  scripts: {
39
45
  build: "bun build src/index.ts --outdir dist --target node --format esm --sourcemap=external",
40
- clean: "rm -rf dist"
46
+ clean: "rm -rf dist",
47
+ "clean:deps": "rm -rf node_modules"
41
48
  },
42
49
  repository: {
43
50
  type: "git",
@@ -45,34 +52,52 @@ var package_default = {
45
52
  directory: "packages/platform-dummy"
46
53
  },
47
54
  homepage: "https://github.com/sockethub/sockethub/tree/master/packages/platform-dummy",
48
- gitHead: "2dc0a34eab5c62afed5a336fc89a8b0318c8b5d4"
55
+ gitHead: "cc495a5fcf7ce19a8f328a34bbc8cd1439bb67ce"
49
56
  };
50
57
 
51
58
  // src/index.ts
52
59
  class Dummy {
53
- debug;
60
+ log;
54
61
  config = {
55
62
  persist: false,
56
63
  greeting: "Hello"
57
64
  };
58
65
  constructor(session) {
59
- this.debug = session.debug;
66
+ this.log = session.log;
60
67
  }
61
68
  get schema() {
62
69
  return {
63
70
  name: "dummy",
64
71
  version: package_default.version,
72
+ contextUrl: "https://sockethub.org/ns/context/platform/dummy/v1.jsonld",
73
+ contextVersion: "1",
74
+ schemaVersion: "1",
65
75
  messages: {
66
76
  required: ["type"],
67
77
  properties: {
68
78
  type: {
69
- enum: ["echo", "fail", "throw", "greet"]
79
+ enum: [
80
+ "echo",
81
+ "fail",
82
+ "throw",
83
+ "greet",
84
+ "exit0",
85
+ "exit1",
86
+ "throwTypeError",
87
+ "throwReferenceError",
88
+ "sigterm",
89
+ "sigkill",
90
+ "hang"
91
+ ]
70
92
  }
71
93
  }
72
94
  },
73
95
  credentials: {}
74
96
  };
75
97
  }
98
+ isInitialized() {
99
+ return true;
100
+ }
76
101
  echo(job, cb) {
77
102
  job.target = job.actor;
78
103
  job.actor = {
@@ -85,7 +110,34 @@ class Dummy {
85
110
  cb(new Error(job.object.content));
86
111
  }
87
112
  throw(job, cb) {
88
- throw new Error(job.object.content);
113
+ cb(new Error(job.object.content));
114
+ }
115
+ exit0(_job, _cb) {
116
+ process.exit(0);
117
+ }
118
+ exit1(_job, _cb) {
119
+ process.exit(1);
120
+ }
121
+ throwTypeError(_job, _cb) {
122
+ setTimeout(() => {
123
+ throw new TypeError("dummy type error");
124
+ }, 0);
125
+ }
126
+ throwReferenceError(_job, _cb) {
127
+ setTimeout(() => {
128
+ throw new ReferenceError("dummy reference error");
129
+ }, 0);
130
+ }
131
+ sigterm(_job, _cb) {
132
+ process.kill(process.pid, "SIGTERM");
133
+ }
134
+ sigkill(_job, _cb) {
135
+ process.kill(process.pid, "SIGKILL");
136
+ }
137
+ hang(_job, _cb) {
138
+ const buf = new SharedArrayBuffer(4);
139
+ const arr = new Int32Array(buf);
140
+ Atomics.wait(arr, 0, 0, 60000);
89
141
  }
90
142
  greet(job, cb) {
91
143
  job.target = job.actor;
@@ -97,6 +149,7 @@ class Dummy {
97
149
  cb(undefined, job);
98
150
  }
99
151
  cleanup(cb) {
152
+ this.log.debug("cleanup");
100
153
  cb();
101
154
  }
102
155
  }
@@ -104,4 +157,4 @@ export {
104
157
  Dummy as default
105
158
  };
106
159
 
107
- //# debugId=761414A7B3219EB564756E2164756E21
160
+ //# debugId=ED4A01CC88CCE3CE64756E2164756E21
package/dist/index.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": [
5
- "import type {\n ActivityStream,\n Logger,\n PlatformCallback,\n PlatformInterface,\n PlatformSchemaStruct,\n PlatformSession,\n StatelessPlatformConfig,\n} from \"@sockethub/schemas\";\n\nimport packageJSON from \"../package.json\" with { type: \"json\" };\n\ninterface DummyPlatformConfig extends StatelessPlatformConfig {\n greeting: string;\n}\n\nexport default class Dummy implements PlatformInterface {\n debug: Logger;\n config: DummyPlatformConfig = {\n persist: false,\n greeting: \"Hello\",\n };\n\n constructor(session: PlatformSession) {\n this.debug = session.debug;\n }\n\n get schema(): PlatformSchemaStruct {\n return {\n name: \"dummy\",\n version: packageJSON.version,\n messages: {\n required: [\"type\"],\n properties: {\n type: {\n enum: [\"echo\", \"fail\", \"throw\", \"greet\"],\n },\n },\n },\n credentials: {},\n };\n }\n\n echo(job: ActivityStream, cb: PlatformCallback) {\n job.target = job.actor;\n job.actor = {\n id: \"dummy\",\n type: \"platform\",\n };\n cb(undefined, job);\n }\n\n fail(job: ActivityStream, cb: PlatformCallback) {\n cb(new Error(job.object.content));\n }\n\n throw(job: ActivityStream, cb: PlatformCallback) {\n throw new Error(job.object.content);\n }\n\n greet(job: ActivityStream, cb: PlatformCallback) {\n job.target = job.actor;\n job.actor = {\n id: \"dummy\",\n type: \"platform\",\n };\n job.object.content = `${this.config.greeting} ${job.object.content}`;\n cb(undefined, job);\n }\n\n cleanup(cb: PlatformCallback) {\n cb();\n }\n}\n"
5
+ "import type {\n ActivityStream,\n Logger,\n PlatformCallback,\n PlatformInterface,\n PlatformSchemaStruct,\n PlatformSession,\n StatelessPlatformConfig,\n} from \"@sockethub/schemas\";\n\nimport packageJSON from \"../package.json\" with { type: \"json\" };\n\ninterface DummyPlatformConfig extends StatelessPlatformConfig {\n greeting: string;\n}\n\nexport default class Dummy implements PlatformInterface {\n private readonly log: Logger;\n config: DummyPlatformConfig = {\n persist: false,\n greeting: \"Hello\",\n };\n\n constructor(session: PlatformSession) {\n this.log = session.log;\n }\n\n get schema(): PlatformSchemaStruct {\n return {\n name: \"dummy\",\n version: packageJSON.version,\n contextUrl:\n \"https://sockethub.org/ns/context/platform/dummy/v1.jsonld\",\n contextVersion: \"1\",\n schemaVersion: \"1\",\n messages: {\n required: [\"type\"],\n properties: {\n type: {\n enum: [\n \"echo\",\n \"fail\",\n \"throw\",\n \"greet\",\n \"exit0\",\n \"exit1\",\n \"throwTypeError\",\n \"throwReferenceError\",\n \"sigterm\",\n \"sigkill\",\n \"hang\",\n ],\n },\n },\n },\n credentials: {},\n };\n }\n\n /**\n * Stateless platforms are always ready to handle jobs.\n */\n isInitialized(): boolean {\n return true;\n }\n\n echo(job: ActivityStream, cb: PlatformCallback) {\n job.target = job.actor;\n job.actor = {\n id: \"dummy\",\n type: \"platform\",\n };\n cb(undefined, job);\n }\n\n fail(job: ActivityStream, cb: PlatformCallback) {\n cb(new Error(job.object.content));\n }\n\n throw(job: ActivityStream, cb: PlatformCallback) {\n cb(new Error(job.object.content));\n }\n\n exit0(_job: ActivityStream, _cb: PlatformCallback) {\n process.exit(0);\n }\n\n exit1(_job: ActivityStream, _cb: PlatformCallback) {\n process.exit(1);\n }\n\n throwTypeError(_job: ActivityStream, _cb: PlatformCallback) {\n setTimeout(() => {\n throw new TypeError(\"dummy type error\");\n }, 0);\n }\n\n throwReferenceError(_job: ActivityStream, _cb: PlatformCallback) {\n setTimeout(() => {\n throw new ReferenceError(\"dummy reference error\");\n }, 0);\n }\n\n sigterm(_job: ActivityStream, _cb: PlatformCallback) {\n process.kill(process.pid, \"SIGTERM\");\n }\n\n sigkill(_job: ActivityStream, _cb: PlatformCallback) {\n process.kill(process.pid, \"SIGKILL\");\n }\n\n hang(_job: ActivityStream, _cb: PlatformCallback) {\n const buf = new SharedArrayBuffer(4);\n const arr = new Int32Array(buf);\n Atomics.wait(arr, 0, 0, 60_000);\n }\n\n greet(job: ActivityStream, cb: PlatformCallback) {\n job.target = job.actor;\n job.actor = {\n id: \"dummy\",\n type: \"platform\",\n };\n job.object.content = `${this.config.greeting} ${job.object.content}`;\n cb(undefined, job);\n }\n\n cleanup(cb: PlatformCallback) {\n this.log.debug(\"cleanup\");\n cb();\n }\n}\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAqB,MAAmC;AAAA,EACpD;AAAA,EACA,SAA8B;AAAA,IAC1B,SAAS;AAAA,IACT,UAAU;AAAA,EACd;AAAA,EAEA,WAAW,CAAC,SAA0B;AAAA,IAClC,KAAK,QAAQ,QAAQ;AAAA;AAAA,MAGrB,MAAM,GAAyB;AAAA,IAC/B,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,gBAAY;AAAA,MACrB,UAAU;AAAA,QACN,UAAU,CAAC,MAAM;AAAA,QACjB,YAAY;AAAA,UACR,MAAM;AAAA,YACF,MAAM,CAAC,QAAQ,QAAQ,SAAS,OAAO;AAAA,UAC3C;AAAA,QACJ;AAAA,MACJ;AAAA,MACA,aAAa,CAAC;AAAA,IAClB;AAAA;AAAA,EAGJ,IAAI,CAAC,KAAqB,IAAsB;AAAA,IAC5C,IAAI,SAAS,IAAI;AAAA,IACjB,IAAI,QAAQ;AAAA,MACR,IAAI;AAAA,MACJ,MAAM;AAAA,IACV;AAAA,IACA,GAAG,WAAW,GAAG;AAAA;AAAA,EAGrB,IAAI,CAAC,KAAqB,IAAsB;AAAA,IAC5C,GAAG,IAAI,MAAM,IAAI,OAAO,OAAO,CAAC;AAAA;AAAA,EAGpC,KAAK,CAAC,KAAqB,IAAsB;AAAA,IAC7C,MAAM,IAAI,MAAM,IAAI,OAAO,OAAO;AAAA;AAAA,EAGtC,KAAK,CAA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AAA,EAGrB,OAAO,CAAC,IAAsB;AAAA,IAC1B,KAAK,IAAI,MAAM,SAAS;AAAA,IACxB,GAAG;AAAA;AAEX;",
8
+ "debugId": "ED4A01CC88CCE3CE64756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sockethub/platform-dummy",
3
3
  "description": "A sockethub platform dummy module",
4
- "version": "3.0.0-alpha.10",
4
+ "version": "3.0.0-alpha.12",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "author": "Nick Jennings <nick@silverbucket.net>",
@@ -29,11 +29,11 @@
29
29
  "dummy"
30
30
  ],
31
31
  "devDependencies": {
32
- "@sockethub/schemas": "^3.0.0-alpha.10",
32
+ "@sockethub/schemas": "^3.0.0-alpha.12",
33
33
  "@types/bun": "latest"
34
34
  },
35
35
  "peerDependencies": {
36
- "@sockethub/server": "^5.0.0-alpha.10"
36
+ "@sockethub/server": "^5.0.0-alpha.12"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@sockethub/server": {
@@ -42,7 +42,8 @@
42
42
  },
43
43
  "scripts": {
44
44
  "build": "bun build src/index.ts --outdir dist --target node --format esm --sourcemap=external",
45
- "clean": "rm -rf dist"
45
+ "clean": "rm -rf dist",
46
+ "clean:deps": "rm -rf node_modules"
46
47
  },
47
48
  "repository": {
48
49
  "type": "git",
@@ -50,5 +51,5 @@
50
51
  "directory": "packages/platform-dummy"
51
52
  },
52
53
  "homepage": "https://github.com/sockethub/sockethub/tree/master/packages/platform-dummy",
53
- "gitHead": "8e1abf116b2a6b57d33c6e1a4af9143870517bae"
54
+ "gitHead": "f039dab3c3f67cbbf204476fc397532e973f82a8"
54
55
  }
package/src/index.ts CHANGED
@@ -15,25 +15,41 @@ interface DummyPlatformConfig extends StatelessPlatformConfig {
15
15
  }
16
16
 
17
17
  export default class Dummy implements PlatformInterface {
18
- debug: Logger;
18
+ private readonly log: Logger;
19
19
  config: DummyPlatformConfig = {
20
20
  persist: false,
21
21
  greeting: "Hello",
22
22
  };
23
23
 
24
24
  constructor(session: PlatformSession) {
25
- this.debug = session.debug;
25
+ this.log = session.log;
26
26
  }
27
27
 
28
28
  get schema(): PlatformSchemaStruct {
29
29
  return {
30
30
  name: "dummy",
31
31
  version: packageJSON.version,
32
+ contextUrl:
33
+ "https://sockethub.org/ns/context/platform/dummy/v1.jsonld",
34
+ contextVersion: "1",
35
+ schemaVersion: "1",
32
36
  messages: {
33
37
  required: ["type"],
34
38
  properties: {
35
39
  type: {
36
- enum: ["echo", "fail", "throw", "greet"],
40
+ enum: [
41
+ "echo",
42
+ "fail",
43
+ "throw",
44
+ "greet",
45
+ "exit0",
46
+ "exit1",
47
+ "throwTypeError",
48
+ "throwReferenceError",
49
+ "sigterm",
50
+ "sigkill",
51
+ "hang",
52
+ ],
37
53
  },
38
54
  },
39
55
  },
@@ -41,6 +57,13 @@ export default class Dummy implements PlatformInterface {
41
57
  };
42
58
  }
43
59
 
60
+ /**
61
+ * Stateless platforms are always ready to handle jobs.
62
+ */
63
+ isInitialized(): boolean {
64
+ return true;
65
+ }
66
+
44
67
  echo(job: ActivityStream, cb: PlatformCallback) {
45
68
  job.target = job.actor;
46
69
  job.actor = {
@@ -55,7 +78,41 @@ export default class Dummy implements PlatformInterface {
55
78
  }
56
79
 
57
80
  throw(job: ActivityStream, cb: PlatformCallback) {
58
- throw new Error(job.object.content);
81
+ cb(new Error(job.object.content));
82
+ }
83
+
84
+ exit0(_job: ActivityStream, _cb: PlatformCallback) {
85
+ process.exit(0);
86
+ }
87
+
88
+ exit1(_job: ActivityStream, _cb: PlatformCallback) {
89
+ process.exit(1);
90
+ }
91
+
92
+ throwTypeError(_job: ActivityStream, _cb: PlatformCallback) {
93
+ setTimeout(() => {
94
+ throw new TypeError("dummy type error");
95
+ }, 0);
96
+ }
97
+
98
+ throwReferenceError(_job: ActivityStream, _cb: PlatformCallback) {
99
+ setTimeout(() => {
100
+ throw new ReferenceError("dummy reference error");
101
+ }, 0);
102
+ }
103
+
104
+ sigterm(_job: ActivityStream, _cb: PlatformCallback) {
105
+ process.kill(process.pid, "SIGTERM");
106
+ }
107
+
108
+ sigkill(_job: ActivityStream, _cb: PlatformCallback) {
109
+ process.kill(process.pid, "SIGKILL");
110
+ }
111
+
112
+ hang(_job: ActivityStream, _cb: PlatformCallback) {
113
+ const buf = new SharedArrayBuffer(4);
114
+ const arr = new Int32Array(buf);
115
+ Atomics.wait(arr, 0, 0, 60_000);
59
116
  }
60
117
 
61
118
  greet(job: ActivityStream, cb: PlatformCallback) {
@@ -69,6 +126,7 @@ export default class Dummy implements PlatformInterface {
69
126
  }
70
127
 
71
128
  cleanup(cb: PlatformCallback) {
129
+ this.log.debug("cleanup");
72
130
  cb();
73
131
  }
74
132
  }