@evanp/activitypub-bot 0.13.0 → 0.13.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.
Files changed (41) hide show
  1. package/package.json +2 -2
  2. package/.github/dependabot.yml +0 -11
  3. package/.github/workflows/main.yml +0 -34
  4. package/.github/workflows/tag.yml +0 -106
  5. package/.nvmrc +0 -1
  6. package/Dockerfile +0 -17
  7. package/docs/activitypub.bot.drawio +0 -110
  8. package/tests/activitydistributor.test.js +0 -606
  9. package/tests/activityhandler.test.js +0 -2276
  10. package/tests/activitypubclient.test.js +0 -210
  11. package/tests/actorstorage.test.js +0 -283
  12. package/tests/app.test.js +0 -17
  13. package/tests/authorizer.test.js +0 -301
  14. package/tests/bot.donothing.test.js +0 -30
  15. package/tests/bot.ok.test.js +0 -101
  16. package/tests/botcontext.test.js +0 -720
  17. package/tests/botdatastorage.test.js +0 -88
  18. package/tests/botfactory.provincebotfactory.test.js +0 -430
  19. package/tests/digester.test.js +0 -56
  20. package/tests/fixtures/bots.js +0 -27
  21. package/tests/fixtures/eventloggingbot.js +0 -57
  22. package/tests/fixtures/provincebotfactory.js +0 -53
  23. package/tests/httpsignature.test.js +0 -199
  24. package/tests/httpsignatureauthenticator.test.js +0 -463
  25. package/tests/index.test.js +0 -12
  26. package/tests/keystorage.test.js +0 -124
  27. package/tests/microsyntax.test.js +0 -123
  28. package/tests/objectcache.test.js +0 -133
  29. package/tests/objectstorage.test.js +0 -149
  30. package/tests/remotekeystorage.test.js +0 -78
  31. package/tests/routes.actor.test.js +0 -214
  32. package/tests/routes.collection.test.js +0 -310
  33. package/tests/routes.health.test.js +0 -41
  34. package/tests/routes.inbox.test.js +0 -216
  35. package/tests/routes.object.test.js +0 -525
  36. package/tests/routes.server.test.js +0 -69
  37. package/tests/routes.sharedinbox.test.js +0 -473
  38. package/tests/routes.webfinger.test.js +0 -68
  39. package/tests/urlformatter.test.js +0 -164
  40. package/tests/utils/digest.js +0 -7
  41. package/tests/utils/nock.js +0 -499
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@evanp/activitypub-bot",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "server-side ActivityPub bot framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "bin": {
8
- "activitypub-bot": "./bin/activitypub-bot.js"
8
+ "activitypub-bot": "bin/activitypub-bot.js"
9
9
  },
10
10
  "scripts": {
11
11
  "test": "NODE_ENV=test node --test",
@@ -1,11 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "npm" # See documentation for possible values
9
- directory: "/" # Location of package manifests
10
- schedule:
11
- interval: "weekly"
@@ -1,34 +0,0 @@
1
- name: Run tests on main
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches:
7
- - main
8
-
9
- permissions:
10
- contents: read
11
- packages: write
12
-
13
- jobs:
14
-
15
- runTests:
16
- runs-on: ubuntu-latest
17
- strategy:
18
- matrix:
19
- node-version: [20, 22, 24, 25]
20
- steps:
21
-
22
- - uses: actions/checkout@v4
23
-
24
- - uses: actions/setup-node@v4
25
- with:
26
- node-version: ${{ matrix.node-version }}
27
- cache: npm
28
- cache-dependency-path: package-lock.json
29
-
30
- - name: Install dependencies
31
- run: npm ci
32
-
33
- - name: Run tests
34
- run: npm run test
@@ -1,106 +0,0 @@
1
- name: Build and Push Docker Image
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v[0-9]+.[0-9]+.[0-9]+'
7
-
8
- permissions:
9
- contents: read
10
- packages: write
11
-
12
- jobs:
13
-
14
- runTests:
15
- runs-on: ubuntu-latest
16
- strategy:
17
- matrix:
18
- node-version: [20, 22, 24, 25]
19
- steps:
20
-
21
- - uses: actions/checkout@v4
22
-
23
- - uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
- cache: npm
27
- cache-dependency-path: package-lock.json
28
-
29
- - name: Install dependencies
30
- run: npm ci
31
-
32
- - name: Run tests
33
- run: npm run test
34
-
35
- publish-npm:
36
- needs: runTests
37
- runs-on: ubuntu-latest
38
-
39
- permissions:
40
- contents: read
41
- id-token: write
42
-
43
- steps:
44
- - name: Checkout code
45
- uses: actions/checkout@v4
46
-
47
- - name: Set up Node.js
48
- uses: actions/setup-node@v4
49
- with:
50
- node-version: 25
51
- registry-url: https://registry.npmjs.org
52
- cache: npm
53
- cache-dependency-path: package-lock.json
54
-
55
- - name: Publish to NPM
56
- run: npm publish --access public --provenance
57
-
58
- build-and-push:
59
- needs: publish-npm
60
- runs-on: ubuntu-latest
61
-
62
- permissions:
63
- contents: read
64
- packages: write
65
-
66
- steps:
67
- - name: Checkout code
68
- uses: actions/checkout@v4
69
-
70
- - name: Set up Docker Buildx
71
- uses: docker/setup-buildx-action@v3
72
-
73
- - name: Extract version components from tag
74
- id: get_version
75
- run: |
76
- FULL_VERSION=${GITHUB_REF#refs/tags/v}
77
- MAJOR=$(echo $FULL_VERSION | cut -d. -f1)
78
- MINOR=$(echo $FULL_VERSION | cut -d. -f2)
79
- PATCH=$(echo $FULL_VERSION | cut -d. -f3)
80
-
81
- echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_OUTPUT
82
- echo "MAJOR_VERSION=$MAJOR" >> $GITHUB_OUTPUT
83
- echo "MAJOR_MINOR_VERSION=$MAJOR.$MINOR" >> $GITHUB_OUTPUT
84
-
85
- - name: Login to GitHub Container Registry
86
- uses: docker/login-action@v3
87
- with:
88
- registry: ghcr.io
89
- username: ${{ github.actor }}
90
- password: ${{ secrets.GITHUB_TOKEN }}
91
-
92
- - name: Build and push Docker image
93
- uses: docker/build-push-action@v5
94
- with:
95
- context: .
96
- push: true
97
- platforms: linux/amd64,linux/arm64
98
- build-args: |
99
- PACKAGE_VERSION=${{ steps.get_version.outputs.FULL_VERSION }}
100
- tags: |
101
- ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.FULL_VERSION }}
102
- ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.MAJOR_MINOR_VERSION }}
103
- ghcr.io/${{ github.repository }}:${{ steps.get_version.outputs.MAJOR_VERSION }}
104
- ghcr.io/${{ github.repository }}:${{ github.sha }}
105
- cache-from: type=gha
106
- cache-to: type=gha,mode=max
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 24
package/Dockerfile DELETED
@@ -1,17 +0,0 @@
1
- FROM node:24-alpine
2
-
3
- WORKDIR /app
4
-
5
- RUN apk add --no-cache libstdc++ sqlite sqlite-libs
6
-
7
- ARG PACKAGE_VERSION
8
-
9
- ENV DATABASE_URL=
10
- ENV ORIGIN=
11
- ENV PORT=
12
- ENV BOTS_CONFIG_FILE=
13
- ENV LOG_LEVEL=
14
-
15
- RUN npm install -g @evanp/activitypub-bot@${PACKAGE_VERSION:-latest}
16
-
17
- CMD ["activitypub-bot"]
@@ -1,110 +0,0 @@
1
- <mxfile host="app.diagrams.net" modified="2024-01-14T17:20:53.624Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0" etag="UDjGppbSRivOII49-YrU" version="22.1.16" type="github">
2
- <diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
3
- <mxGraphModel dx="2074" dy="1057" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
4
- <root>
5
- <mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
6
- <mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
7
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--0" value="BotServer" style="swimlane;fontStyle=2;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=0;strokeWidth=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
8
- <mxGeometry x="220" y="120" width="160" height="138" as="geometry">
9
- <mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
10
- </mxGeometry>
11
- </mxCell>
12
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--1" value="Name" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--0" vertex="1">
13
- <mxGeometry y="26" width="160" height="26" as="geometry" />
14
- </mxCell>
15
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--2" value="Phone Number" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rounded=0;shadow=0;html=0;" parent="zkfFHV4jXpPFQw0GAbJ--0" vertex="1">
16
- <mxGeometry y="52" width="160" height="26" as="geometry" />
17
- </mxCell>
18
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--3" value="Email Address" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rounded=0;shadow=0;html=0;" parent="zkfFHV4jXpPFQw0GAbJ--0" vertex="1">
19
- <mxGeometry y="78" width="160" height="26" as="geometry" />
20
- </mxCell>
21
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--4" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--0" vertex="1">
22
- <mxGeometry y="104" width="160" height="8" as="geometry" />
23
- </mxCell>
24
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--5" value="Purchase Parking Pass" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--0" vertex="1">
25
- <mxGeometry y="112" width="160" height="26" as="geometry" />
26
- </mxCell>
27
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--6" value="Activity" style="swimlane;fontStyle=0;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=0;strokeWidth=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
28
- <mxGeometry x="120" y="360" width="160" height="138" as="geometry">
29
- <mxRectangle x="130" y="380" width="160" height="26" as="alternateBounds" />
30
- </mxGeometry>
31
- </mxCell>
32
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--7" value="Student Number" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--6" vertex="1">
33
- <mxGeometry y="26" width="160" height="26" as="geometry" />
34
- </mxCell>
35
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--8" value="Average Mark" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rounded=0;shadow=0;html=0;" parent="zkfFHV4jXpPFQw0GAbJ--6" vertex="1">
36
- <mxGeometry y="52" width="160" height="26" as="geometry" />
37
- </mxCell>
38
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--9" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--6" vertex="1">
39
- <mxGeometry y="78" width="160" height="8" as="geometry" />
40
- </mxCell>
41
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--10" value="Is Eligible To Enroll" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontStyle=4" parent="zkfFHV4jXpPFQw0GAbJ--6" vertex="1">
42
- <mxGeometry y="86" width="160" height="26" as="geometry" />
43
- </mxCell>
44
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--11" value="Get Seminars Taken" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--6" vertex="1">
45
- <mxGeometry y="112" width="160" height="26" as="geometry" />
46
- </mxCell>
47
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--12" value="" style="endArrow=block;endSize=10;endFill=0;shadow=0;strokeWidth=1;rounded=0;edgeStyle=elbowEdgeStyle;elbow=vertical;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="zkfFHV4jXpPFQw0GAbJ--6" target="zkfFHV4jXpPFQw0GAbJ--0" edge="1">
48
- <mxGeometry width="160" relative="1" as="geometry">
49
- <mxPoint x="200" y="203" as="sourcePoint" />
50
- <mxPoint x="200" y="203" as="targetPoint" />
51
- </mxGeometry>
52
- </mxCell>
53
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--13" value="Object" style="swimlane;fontStyle=0;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=0;strokeWidth=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
54
- <mxGeometry x="330" y="360" width="160" height="70" as="geometry">
55
- <mxRectangle x="340" y="380" width="170" height="26" as="alternateBounds" />
56
- </mxGeometry>
57
- </mxCell>
58
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--14" value="Salary" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--13" vertex="1">
59
- <mxGeometry y="26" width="160" height="26" as="geometry" />
60
- </mxCell>
61
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--15" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--13" vertex="1">
62
- <mxGeometry y="52" width="160" height="8" as="geometry" />
63
- </mxCell>
64
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--16" value="" style="endArrow=block;endSize=10;endFill=0;shadow=0;strokeWidth=1;rounded=0;edgeStyle=elbowEdgeStyle;elbow=vertical;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="zkfFHV4jXpPFQw0GAbJ--13" target="zkfFHV4jXpPFQw0GAbJ--0" edge="1">
65
- <mxGeometry width="160" relative="1" as="geometry">
66
- <mxPoint x="210" y="373" as="sourcePoint" />
67
- <mxPoint x="310" y="271" as="targetPoint" />
68
- </mxGeometry>
69
- </mxCell>
70
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--17" value="Bot" style="swimlane;fontStyle=0;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=0;strokeWidth=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
71
- <mxGeometry x="508" y="120" width="160" height="216" as="geometry">
72
- <mxRectangle x="550" y="140" width="160" height="26" as="alternateBounds" />
73
- </mxGeometry>
74
- </mxCell>
75
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--23" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--17" vertex="1">
76
- <mxGeometry y="26" width="160" height="8" as="geometry" />
77
- </mxCell>
78
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--24" value="+ powerUp(object)" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--17" vertex="1">
79
- <mxGeometry y="34" width="160" height="26" as="geometry" />
80
- </mxCell>
81
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--25" value="+ powerDown(object)" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" parent="zkfFHV4jXpPFQw0GAbJ--17" vertex="1">
82
- <mxGeometry y="60" width="160" height="26" as="geometry" />
83
- </mxCell>
84
- <mxCell id="dP12apakX7S5GaSoqi7g-0" value="+ onReply(object)" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="zkfFHV4jXpPFQw0GAbJ--17">
85
- <mxGeometry y="86" width="160" height="26" as="geometry" />
86
- </mxCell>
87
- <mxCell id="dP12apakX7S5GaSoqi7g-1" value="+ onMention(object)" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;" vertex="1" parent="zkfFHV4jXpPFQw0GAbJ--17">
88
- <mxGeometry y="112" width="160" height="26" as="geometry" />
89
- </mxCell>
90
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--26" value="" style="endArrow=open;shadow=0;strokeWidth=1;rounded=0;endFill=1;edgeStyle=elbowEdgeStyle;elbow=vertical;" parent="WIyWlLk6GJQsqaUBKTNV-1" source="zkfFHV4jXpPFQw0GAbJ--0" target="zkfFHV4jXpPFQw0GAbJ--17" edge="1">
91
- <mxGeometry x="0.5" y="41" relative="1" as="geometry">
92
- <mxPoint x="380" y="192" as="sourcePoint" />
93
- <mxPoint x="540" y="192" as="targetPoint" />
94
- <mxPoint x="-40" y="32" as="offset" />
95
- </mxGeometry>
96
- </mxCell>
97
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--27" value="1" style="resizable=0;align=left;verticalAlign=bottom;labelBackgroundColor=none;fontSize=12;" parent="zkfFHV4jXpPFQw0GAbJ--26" connectable="0" vertex="1">
98
- <mxGeometry x="-1" relative="1" as="geometry">
99
- <mxPoint y="4" as="offset" />
100
- </mxGeometry>
101
- </mxCell>
102
- <mxCell id="zkfFHV4jXpPFQw0GAbJ--28" value="0.." style="resizable=0;align=right;verticalAlign=bottom;labelBackgroundColor=none;fontSize=12;" parent="zkfFHV4jXpPFQw0GAbJ--26" connectable="0" vertex="1">
103
- <mxGeometry x="1" relative="1" as="geometry">
104
- <mxPoint x="-7" y="4" as="offset" />
105
- </mxGeometry>
106
- </mxCell>
107
- </root>
108
- </mxGraphModel>
109
- </diagram>
110
- </mxfile>