@shipfox/annotations 10.2.0 → 12.0.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/annotations",
3
3
  "license": "MIT",
4
- "version": "10.2.0",
4
+ "version": "12.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -20,14 +20,14 @@
20
20
  "dependencies": {
21
21
  "drizzle-orm": "^0.45.2",
22
22
  "zod": "^4.4.3",
23
- "@shipfox/annotations-dto": "9.0.2",
24
- "@shipfox/api-auth-context": "10.2.0",
23
+ "@shipfox/annotations-dto": "12.0.0",
24
+ "@shipfox/api-auth-context": "12.0.0",
25
25
  "@shipfox/config": "1.2.4",
26
- "@shipfox/inter-module": "0.2.2",
27
- "@shipfox/node-drizzle": "0.3.4",
28
- "@shipfox/node-fastify": "0.4.0",
29
- "@shipfox/node-module": "1.0.4",
30
- "@shipfox/node-postgres": "0.4.4"
26
+ "@shipfox/inter-module": "0.2.3",
27
+ "@shipfox/node-drizzle": "0.3.5",
28
+ "@shipfox/node-fastify": "0.4.1",
29
+ "@shipfox/node-module": "1.0.5",
30
+ "@shipfox/node-postgres": "0.5.0"
31
31
  },
32
32
  "imports": {
33
33
  "#*": "./dist/*"
@@ -16,7 +16,13 @@ const fakeUserAuth: AuthMethod = {
16
16
  const memberships = rawWorkspaceIds
17
17
  .split(',')
18
18
  .filter((workspaceId) => workspaceId.length > 0)
19
- .map((workspaceId) => ({workspaceId, role: 'admin' as const}));
19
+ .map((value) => {
20
+ const [workspaceId, status] = value.split('|');
21
+ if (!workspaceId) throw new Error('missing test workspace id');
22
+ const workspaceStatus: 'active' | 'suspended' | 'deleted' =
23
+ status === 'suspended' ? 'suspended' : status === 'deleted' ? 'deleted' : 'active';
24
+ return {workspaceId, role: 'admin' as const, workspaceStatus};
25
+ });
20
26
 
21
27
  setUserContext(
22
28
  request,
@@ -144,6 +150,24 @@ describe('GET /annotations', () => {
144
150
  expect(res.json()).toEqual({annotations: [], has_more: false, next_cursor: null});
145
151
  });
146
152
 
153
+ it('does not return annotations for suspended membership claims', async () => {
154
+ const workspaceId = crypto.randomUUID();
155
+ const workflowRunId = crypto.randomUUID();
156
+ await annotationFactory.create({workspaceId, workflowRunId});
157
+
158
+ const res = await app.inject({
159
+ method: 'GET',
160
+ url: readUrl({workflowRunId, attempt: 1}),
161
+ headers: {
162
+ authorization: 'Bearer user',
163
+ 'x-test-workspaces': `${workspaceId}|suspended`,
164
+ },
165
+ });
166
+
167
+ expect(res.statusCode).toBe(200);
168
+ expect(res.json()).toEqual({annotations: [], has_more: false, next_cursor: null});
169
+ });
170
+
147
171
  it('returns an empty list when the job execution filter has no matches', async () => {
148
172
  const workspaceId = crypto.randomUUID();
149
173
  const workflowRunId = crypto.randomUUID();
@@ -29,7 +29,9 @@ export const readAnnotationsRoute = defineRoute({
29
29
  throw new ClientError('Invalid cursor', 'invalid-cursor', {status: 400});
30
30
  }
31
31
 
32
- const workspaceIds = user.memberships.map((membership) => membership.workspaceId);
32
+ const workspaceIds = user.memberships
33
+ .filter((membership) => membership.workspaceStatus === 'active')
34
+ .map((membership) => membership.workspaceId);
33
35
  const result = await listAnnotationsForRunAttempt({
34
36
  workflowRunId,
35
37
  workflowRunAttempt: attempt,