@shipfox/api-server 3.0.0 → 4.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
@@ -2,7 +2,7 @@
2
2
  "name": "@shipfox/api-server",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "3.0.0",
5
+ "version": "4.0.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -41,23 +41,23 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@shipfox/annotations": "3.0.0",
45
- "@shipfox/api-agent": "3.0.0",
46
- "@shipfox/api-auth": "3.0.0",
47
- "@shipfox/api-definitions": "3.0.0",
48
- "@shipfox/api-dispatcher": "3.0.0",
49
- "@shipfox/api-integration-core": "3.0.0",
50
- "@shipfox/api-logs": "3.0.0",
51
- "@shipfox/api-projects": "3.0.0",
52
- "@shipfox/api-runners": "3.0.0",
53
- "@shipfox/api-secrets": "3.0.0",
54
- "@shipfox/api-triggers": "3.0.0",
55
- "@shipfox/api-workflows": "3.0.0",
56
- "@shipfox/api-workspaces": "3.0.0",
44
+ "@shipfox/annotations": "4.0.0",
45
+ "@shipfox/api-agent": "4.0.0",
46
+ "@shipfox/api-auth": "4.0.0",
47
+ "@shipfox/api-definitions": "4.0.0",
48
+ "@shipfox/api-dispatcher": "4.0.0",
49
+ "@shipfox/api-integration-core": "4.0.0",
50
+ "@shipfox/api-logs": "4.0.0",
51
+ "@shipfox/api-projects": "4.0.0",
52
+ "@shipfox/api-runners": "4.0.0",
53
+ "@shipfox/api-secrets": "4.0.0",
54
+ "@shipfox/api-triggers": "4.0.0",
55
+ "@shipfox/api-workflows": "4.0.0",
56
+ "@shipfox/api-workspaces": "4.0.0",
57
57
  "@shipfox/config": "1.2.1",
58
58
  "@shipfox/node-error-monitoring": "0.1.2",
59
59
  "@shipfox/node-fastify": "0.2.2",
60
- "@shipfox/node-module": "0.3.0",
60
+ "@shipfox/node-module": "0.3.1",
61
61
  "@shipfox/node-opentelemetry": "0.5.1",
62
62
  "@shipfox/node-postgres": "0.4.1"
63
63
  },
@@ -96,7 +96,7 @@ describe('defaultModules', () => {
96
96
  ]);
97
97
  });
98
98
 
99
- it('uses the leased-step loader and namespaced Linear secrets', async () => {
99
+ it('uses the leased-step loader and namespaced provider secrets', async () => {
100
100
  await defaultModules();
101
101
 
102
102
  expect(mocks.createIntegrationsContext).toHaveBeenCalledWith({
@@ -107,6 +107,11 @@ describe('defaultModules', () => {
107
107
  getSecret: expect.any(Function),
108
108
  setSecrets: expect.any(Function),
109
109
  },
110
+ slack: {
111
+ deleteSecrets: expect.any(Function),
112
+ getSecret: expect.any(Function),
113
+ setSecrets: expect.any(Function),
114
+ },
110
115
  },
111
116
  agentTools: {loadLeasedAgentStep: mocks.loadRunningLeasedStep},
112
117
  });
@@ -118,11 +123,19 @@ describe('defaultModules', () => {
118
123
  getSecret: (params: {namespace: string}) => unknown;
119
124
  setSecrets: (params: {namespace: string}) => unknown;
120
125
  };
126
+ slack: {
127
+ deleteSecrets: (params: {namespace: string}) => unknown;
128
+ getSecret: (params: {namespace: string}) => unknown;
129
+ setSecrets: (params: {namespace: string}) => unknown;
130
+ };
121
131
  };
122
132
  };
123
133
  integrationsOptions.secrets.linear.getSecret({namespace: 'workspace'});
124
134
  integrationsOptions.secrets.linear.setSecrets({namespace: 'workspace'});
125
135
  integrationsOptions.secrets.linear.deleteSecrets({namespace: 'workspace'});
136
+ integrationsOptions.secrets.slack.getSecret({namespace: 'workspace'});
137
+ integrationsOptions.secrets.slack.setSecrets({namespace: 'workspace'});
138
+ integrationsOptions.secrets.slack.deleteSecrets({namespace: 'workspace'});
126
139
 
127
140
  expect(mocks.getSecret).toHaveBeenCalledWith({
128
141
  namespace: 'system/integrations/linear/workspace',
@@ -133,5 +146,14 @@ describe('defaultModules', () => {
133
146
  expect(mocks.deleteSecrets).toHaveBeenCalledWith({
134
147
  namespace: 'system/integrations/linear/workspace',
135
148
  });
149
+ expect(mocks.getSecret).toHaveBeenCalledWith({
150
+ namespace: 'system/integrations/slack/workspace',
151
+ });
152
+ expect(mocks.setSecrets).toHaveBeenCalledWith({
153
+ namespace: 'system/integrations/slack/workspace',
154
+ });
155
+ expect(mocks.deleteSecrets).toHaveBeenCalledWith({
156
+ namespace: 'system/integrations/slack/workspace',
157
+ });
136
158
  });
137
159
  });
package/src/modules.ts CHANGED
@@ -45,6 +45,23 @@ export async function defaultModules(): Promise<ShipfoxModule[]> {
45
45
  namespace: `system/integrations/linear/${params.namespace}`,
46
46
  }),
47
47
  },
48
+ slack: {
49
+ getSecret: (params) =>
50
+ getSecret({
51
+ ...params,
52
+ namespace: `system/integrations/slack/${params.namespace}`,
53
+ }),
54
+ setSecrets: (params) =>
55
+ setSecrets({
56
+ ...params,
57
+ namespace: `system/integrations/slack/${params.namespace}`,
58
+ }),
59
+ deleteSecrets: (params) =>
60
+ deleteSecrets({
61
+ ...params,
62
+ namespace: `system/integrations/slack/${params.namespace}`,
63
+ }),
64
+ },
48
65
  },
49
66
  agentTools: {loadLeasedAgentStep: loadRunningLeasedStep},
50
67
  });