@shipfox/api-secrets 5.0.0 → 7.1.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -15
- package/dist/index.js.map +1 -1
- package/dist/presentation/inter-module.d.ts +4 -0
- package/dist/presentation/inter-module.d.ts.map +1 -0
- package/dist/presentation/inter-module.js +73 -0
- package/dist/presentation/inter-module.js.map +1 -0
- package/dist/presentation/routes/auth.d.ts +14 -10
- package/dist/presentation/routes/auth.d.ts.map +1 -1
- package/dist/presentation/routes/auth.js +27 -11
- package/dist/presentation/routes/auth.js.map +1 -1
- package/dist/presentation/routes/batch-secrets.d.ts +2 -1
- package/dist/presentation/routes/batch-secrets.d.ts.map +1 -1
- package/dist/presentation/routes/batch-secrets.js +35 -34
- package/dist/presentation/routes/batch-secrets.js.map +1 -1
- package/dist/presentation/routes/batch-variables.d.ts +2 -1
- package/dist/presentation/routes/batch-variables.d.ts.map +1 -1
- package/dist/presentation/routes/batch-variables.js +35 -34
- package/dist/presentation/routes/batch-variables.js.map +1 -1
- package/dist/presentation/routes/delete-secret.d.ts +2 -1
- package/dist/presentation/routes/delete-secret.d.ts.map +1 -1
- package/dist/presentation/routes/delete-secret.js +33 -32
- package/dist/presentation/routes/delete-secret.js.map +1 -1
- package/dist/presentation/routes/delete-variable.d.ts +2 -1
- package/dist/presentation/routes/delete-variable.d.ts.map +1 -1
- package/dist/presentation/routes/delete-variable.js +33 -32
- package/dist/presentation/routes/delete-variable.js.map +1 -1
- package/dist/presentation/routes/errors.d.ts.map +1 -1
- package/dist/presentation/routes/errors.js +0 -6
- package/dist/presentation/routes/errors.js.map +1 -1
- package/dist/presentation/routes/get-variable.d.ts +2 -1
- package/dist/presentation/routes/get-variable.d.ts.map +1 -1
- package/dist/presentation/routes/get-variable.js +34 -33
- package/dist/presentation/routes/get-variable.js.map +1 -1
- package/dist/presentation/routes/index.d.ts +2 -1
- package/dist/presentation/routes/index.d.ts.map +1 -1
- package/dist/presentation/routes/index.js +21 -17
- package/dist/presentation/routes/index.js.map +1 -1
- package/dist/presentation/routes/list-secrets.d.ts +2 -1
- package/dist/presentation/routes/list-secrets.d.ts.map +1 -1
- package/dist/presentation/routes/list-secrets.js +40 -39
- package/dist/presentation/routes/list-secrets.js.map +1 -1
- package/dist/presentation/routes/list-variables.d.ts +2 -1
- package/dist/presentation/routes/list-variables.d.ts.map +1 -1
- package/dist/presentation/routes/list-variables.js +40 -39
- package/dist/presentation/routes/list-variables.js.map +1 -1
- package/dist/presentation/routes/put-secret.d.ts +2 -1
- package/dist/presentation/routes/put-secret.d.ts.map +1 -1
- package/dist/presentation/routes/put-secret.js +43 -42
- package/dist/presentation/routes/put-secret.js.map +1 -1
- package/dist/presentation/routes/put-variable.d.ts +2 -1
- package/dist/presentation/routes/put-variable.d.ts.map +1 -1
- package/dist/presentation/routes/put-variable.js +43 -42
- package/dist/presentation/routes/put-variable.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +11 -19
- package/src/index.ts +16 -5
- package/src/presentation/inter-module.test.ts +32 -0
- package/src/presentation/inter-module.ts +78 -0
- package/src/presentation/routes/auth.ts +65 -19
- package/src/presentation/routes/batch-secrets.ts +26 -24
- package/src/presentation/routes/batch-variables.ts +26 -24
- package/src/presentation/routes/delete-secret.ts +21 -19
- package/src/presentation/routes/delete-variable.ts +21 -19
- package/src/presentation/routes/errors.ts +0 -5
- package/src/presentation/routes/get-variable.ts +21 -19
- package/src/presentation/routes/index.ts +22 -17
- package/src/presentation/routes/list-secrets.ts +33 -31
- package/src/presentation/routes/list-variables.ts +33 -31
- package/src/presentation/routes/management.test.ts +32 -18
- package/src/presentation/routes/put-secret.ts +28 -26
- package/src/presentation/routes/put-variable.ts +28 -26
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -2,39 +2,40 @@ import { secretKeySchema, secretScopeQuerySchema } from '@shipfox/api-secrets-dt
|
|
|
2
2
|
import { defineRoute } from '@shipfox/node-fastify';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { deleteManagedSecret } from '#core/index.js';
|
|
5
|
-
import { requireManagementWrite } from './auth.js';
|
|
6
5
|
import { translateManagementError } from './errors.js';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export function deleteSecretRoute(accessControl) {
|
|
7
|
+
return defineRoute({
|
|
8
|
+
method: 'DELETE',
|
|
9
|
+
path: '/secrets/:key',
|
|
10
|
+
description: 'Delete a user-managed secret.',
|
|
11
|
+
schema: {
|
|
12
|
+
params: z.object({
|
|
13
|
+
workspaceId: z.string().uuid(),
|
|
14
|
+
key: secretKeySchema
|
|
15
|
+
}),
|
|
16
|
+
querystring: secretScopeQuerySchema,
|
|
17
|
+
response: {
|
|
18
|
+
204: z.void()
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
errorHandler: translateManagementError,
|
|
22
|
+
handler: async (request, reply)=>{
|
|
23
|
+
const { workspaceId, key } = request.params;
|
|
24
|
+
const { project_id: projectId } = request.query;
|
|
25
|
+
const access = await accessControl.requireManagementWrite({
|
|
26
|
+
request,
|
|
27
|
+
workspaceId,
|
|
28
|
+
projectId
|
|
29
|
+
});
|
|
30
|
+
await deleteManagedSecret({
|
|
31
|
+
workspaceId,
|
|
32
|
+
projectId,
|
|
33
|
+
key,
|
|
34
|
+
actorId: access.userId
|
|
35
|
+
});
|
|
36
|
+
return reply.status(204).send();
|
|
19
37
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
handler: async (request, reply)=>{
|
|
23
|
-
const { workspaceId, key } = request.params;
|
|
24
|
-
const { project_id: projectId } = request.query;
|
|
25
|
-
const access = await requireManagementWrite({
|
|
26
|
-
request,
|
|
27
|
-
workspaceId,
|
|
28
|
-
projectId
|
|
29
|
-
});
|
|
30
|
-
await deleteManagedSecret({
|
|
31
|
-
workspaceId,
|
|
32
|
-
projectId,
|
|
33
|
-
key,
|
|
34
|
-
actorId: access.userId
|
|
35
|
-
});
|
|
36
|
-
return reply.status(204).send();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
39
40
|
|
|
40
41
|
//# sourceMappingURL=delete-secret.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/delete-secret.ts"],"sourcesContent":["import {secretKeySchema, secretScopeQuerySchema} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {deleteManagedSecret} from '#core/index.js';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/delete-secret.ts"],"sourcesContent":["import {secretKeySchema, secretScopeQuerySchema} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {deleteManagedSecret} from '#core/index.js';\nimport type {ManagementAccessHelpers} from './auth.js';\nimport {translateManagementError} from './errors.js';\n\nexport function deleteSecretRoute(accessControl: ManagementAccessHelpers) {\n return defineRoute({\n method: 'DELETE',\n path: '/secrets/:key',\n description: 'Delete a user-managed secret.',\n schema: {\n params: z.object({workspaceId: z.string().uuid(), key: secretKeySchema}),\n querystring: secretScopeQuerySchema,\n response: {204: z.void()},\n },\n errorHandler: translateManagementError,\n handler: async (request, reply) => {\n const {workspaceId, key} = request.params;\n const {project_id: projectId} = request.query;\n const access = await accessControl.requireManagementWrite({request, workspaceId, projectId});\n\n await deleteManagedSecret({workspaceId, projectId, key, actorId: access.userId});\n return reply.status(204).send();\n },\n });\n}\n"],"names":["secretKeySchema","secretScopeQuerySchema","defineRoute","z","deleteManagedSecret","translateManagementError","deleteSecretRoute","accessControl","method","path","description","schema","params","object","workspaceId","string","uuid","key","querystring","response","void","errorHandler","handler","request","reply","project_id","projectId","query","access","requireManagementWrite","actorId","userId","status","send"],"mappings":"AAAA,SAAQA,eAAe,EAAEC,sBAAsB,QAAO,2BAA2B;AACjF,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,mBAAmB,QAAO,iBAAiB;AAEnD,SAAQC,wBAAwB,QAAO,cAAc;AAErD,OAAO,SAASC,kBAAkBC,aAAsC;IACtE,OAAOL,YAAY;QACjBM,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQT,EAAEU,MAAM,CAAC;gBAACC,aAAaX,EAAEY,MAAM,GAAGC,IAAI;gBAAIC,KAAKjB;YAAe;YACtEkB,aAAajB;YACbkB,UAAU;gBAAC,KAAKhB,EAAEiB,IAAI;YAAE;QAC1B;QACAC,cAAchB;QACdiB,SAAS,OAAOC,SAASC;YACvB,MAAM,EAACV,WAAW,EAAEG,GAAG,EAAC,GAAGM,QAAQX,MAAM;YACzC,MAAM,EAACa,YAAYC,SAAS,EAAC,GAAGH,QAAQI,KAAK;YAC7C,MAAMC,SAAS,MAAMrB,cAAcsB,sBAAsB,CAAC;gBAACN;gBAAST;gBAAaY;YAAS;YAE1F,MAAMtB,oBAAoB;gBAACU;gBAAaY;gBAAWT;gBAAKa,SAASF,OAAOG,MAAM;YAAA;YAC9E,OAAOP,MAAMQ,MAAM,CAAC,KAAKC,IAAI;QAC/B;IACF;AACF"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ManagementAccessHelpers } from './auth.js';
|
|
2
|
+
export declare function deleteVariableRoute(accessControl: ManagementAccessHelpers): import("@shipfox/node-fastify").RouteDefinition;
|
|
2
3
|
//# sourceMappingURL=delete-variable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-variable.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/delete-variable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-variable.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/delete-variable.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAGvD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,uBAAuB,mDAoBzE"}
|
|
@@ -2,39 +2,40 @@ import { secretKeySchema, secretScopeQuerySchema } from '@shipfox/api-secrets-dt
|
|
|
2
2
|
import { defineRoute } from '@shipfox/node-fastify';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { deleteManagedVariable } from '#core/index.js';
|
|
5
|
-
import { requireManagementWrite } from './auth.js';
|
|
6
5
|
import { translateManagementError } from './errors.js';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
export function deleteVariableRoute(accessControl) {
|
|
7
|
+
return defineRoute({
|
|
8
|
+
method: 'DELETE',
|
|
9
|
+
path: '/variables/:key',
|
|
10
|
+
description: 'Delete a user-managed variable.',
|
|
11
|
+
schema: {
|
|
12
|
+
params: z.object({
|
|
13
|
+
workspaceId: z.string().uuid(),
|
|
14
|
+
key: secretKeySchema
|
|
15
|
+
}),
|
|
16
|
+
querystring: secretScopeQuerySchema,
|
|
17
|
+
response: {
|
|
18
|
+
204: z.void()
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
errorHandler: translateManagementError,
|
|
22
|
+
handler: async (request, reply)=>{
|
|
23
|
+
const { workspaceId, key } = request.params;
|
|
24
|
+
const { project_id: projectId } = request.query;
|
|
25
|
+
const access = await accessControl.requireManagementWrite({
|
|
26
|
+
request,
|
|
27
|
+
workspaceId,
|
|
28
|
+
projectId
|
|
29
|
+
});
|
|
30
|
+
await deleteManagedVariable({
|
|
31
|
+
workspaceId,
|
|
32
|
+
projectId,
|
|
33
|
+
key,
|
|
34
|
+
actorId: access.userId
|
|
35
|
+
});
|
|
36
|
+
return reply.status(204).send();
|
|
19
37
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
handler: async (request, reply)=>{
|
|
23
|
-
const { workspaceId, key } = request.params;
|
|
24
|
-
const { project_id: projectId } = request.query;
|
|
25
|
-
const access = await requireManagementWrite({
|
|
26
|
-
request,
|
|
27
|
-
workspaceId,
|
|
28
|
-
projectId
|
|
29
|
-
});
|
|
30
|
-
await deleteManagedVariable({
|
|
31
|
-
workspaceId,
|
|
32
|
-
projectId,
|
|
33
|
-
key,
|
|
34
|
-
actorId: access.userId
|
|
35
|
-
});
|
|
36
|
-
return reply.status(204).send();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
39
40
|
|
|
40
41
|
//# sourceMappingURL=delete-variable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/delete-variable.ts"],"sourcesContent":["import {secretKeySchema, secretScopeQuerySchema} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {deleteManagedVariable} from '#core/index.js';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/delete-variable.ts"],"sourcesContent":["import {secretKeySchema, secretScopeQuerySchema} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {deleteManagedVariable} from '#core/index.js';\nimport type {ManagementAccessHelpers} from './auth.js';\nimport {translateManagementError} from './errors.js';\n\nexport function deleteVariableRoute(accessControl: ManagementAccessHelpers) {\n return defineRoute({\n method: 'DELETE',\n path: '/variables/:key',\n description: 'Delete a user-managed variable.',\n schema: {\n params: z.object({workspaceId: z.string().uuid(), key: secretKeySchema}),\n querystring: secretScopeQuerySchema,\n response: {204: z.void()},\n },\n errorHandler: translateManagementError,\n handler: async (request, reply) => {\n const {workspaceId, key} = request.params;\n const {project_id: projectId} = request.query;\n const access = await accessControl.requireManagementWrite({request, workspaceId, projectId});\n\n await deleteManagedVariable({workspaceId, projectId, key, actorId: access.userId});\n return reply.status(204).send();\n },\n });\n}\n"],"names":["secretKeySchema","secretScopeQuerySchema","defineRoute","z","deleteManagedVariable","translateManagementError","deleteVariableRoute","accessControl","method","path","description","schema","params","object","workspaceId","string","uuid","key","querystring","response","void","errorHandler","handler","request","reply","project_id","projectId","query","access","requireManagementWrite","actorId","userId","status","send"],"mappings":"AAAA,SAAQA,eAAe,EAAEC,sBAAsB,QAAO,2BAA2B;AACjF,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,qBAAqB,QAAO,iBAAiB;AAErD,SAAQC,wBAAwB,QAAO,cAAc;AAErD,OAAO,SAASC,oBAAoBC,aAAsC;IACxE,OAAOL,YAAY;QACjBM,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQT,EAAEU,MAAM,CAAC;gBAACC,aAAaX,EAAEY,MAAM,GAAGC,IAAI;gBAAIC,KAAKjB;YAAe;YACtEkB,aAAajB;YACbkB,UAAU;gBAAC,KAAKhB,EAAEiB,IAAI;YAAE;QAC1B;QACAC,cAAchB;QACdiB,SAAS,OAAOC,SAASC;YACvB,MAAM,EAACV,WAAW,EAAEG,GAAG,EAAC,GAAGM,QAAQX,MAAM;YACzC,MAAM,EAACa,YAAYC,SAAS,EAAC,GAAGH,QAAQI,KAAK;YAC7C,MAAMC,SAAS,MAAMrB,cAAcsB,sBAAsB,CAAC;gBAACN;gBAAST;gBAAaY;YAAS;YAE1F,MAAMtB,sBAAsB;gBAACU;gBAAaY;gBAAWT;gBAAKa,SAASF,OAAOG,MAAM;YAAA;YAChF,OAAOP,MAAMQ,MAAM,CAAC,KAAKC,IAAI;QAC/B;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/errors.ts"],"names":[],"mappings":"AAaA,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CA4C9D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ProjectNotFoundError } from '@shipfox/api-projects';
|
|
2
1
|
import { ClientError } from '@shipfox/node-fastify';
|
|
3
2
|
import { NamespaceValidationError, SecretBatchDuplicateKeyError, SecretBatchScopeMismatchError, SecretKeyValidationError, SecretNotFoundError, SecretValueTooLargeError, UnknownSecretStoreError, VariableNotFoundError, WorkspaceSecretCapExceededError } from '#core/errors.js';
|
|
4
3
|
export function translateManagementError(error) {
|
|
@@ -62,11 +61,6 @@ export function translateManagementError(error) {
|
|
|
62
61
|
status: 400
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
|
-
if (error instanceof ProjectNotFoundError) {
|
|
66
|
-
throw new ClientError('Project not found', 'project-not-found', {
|
|
67
|
-
status: 404
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
64
|
throw error;
|
|
71
65
|
}
|
|
72
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/errors.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/errors.ts"],"sourcesContent":["import {ClientError} from '@shipfox/node-fastify';\nimport {\n NamespaceValidationError,\n SecretBatchDuplicateKeyError,\n SecretBatchScopeMismatchError,\n SecretKeyValidationError,\n SecretNotFoundError,\n SecretValueTooLargeError,\n UnknownSecretStoreError,\n VariableNotFoundError,\n WorkspaceSecretCapExceededError,\n} from '#core/errors.js';\n\nexport function translateManagementError(error: unknown): never {\n if (error instanceof SecretKeyValidationError) {\n throw new ClientError('Invalid secret key', 'invalid-key', {\n status: 400,\n details: {key: error.key},\n });\n }\n if (error instanceof NamespaceValidationError) {\n throw new ClientError('Invalid namespace', 'invalid-namespace', {\n status: 400,\n details: {namespace: error.namespace},\n });\n }\n if (error instanceof SecretValueTooLargeError) {\n throw new ClientError(error.message, 'value-too-large', {\n status: 413,\n details: {max_bytes: error.maxBytes},\n });\n }\n if (error instanceof WorkspaceSecretCapExceededError) {\n throw new ClientError('Workspace secret cap exceeded', 'workspace-secret-cap-exceeded', {\n status: 409,\n details: {cap: error.cap},\n });\n }\n if (error instanceof SecretBatchScopeMismatchError) {\n throw new ClientError(error.message, 'batch-scope-mismatch', {status: 400});\n }\n if (error instanceof SecretBatchDuplicateKeyError) {\n throw new ClientError('Duplicate batch key', 'duplicate-key', {\n status: 400,\n details: {key: error.key},\n });\n }\n if (error instanceof SecretNotFoundError) {\n throw new ClientError('Secret not found', 'secret-not-found', {status: 404});\n }\n if (error instanceof VariableNotFoundError) {\n throw new ClientError('Variable not found', 'variable-not-found', {status: 404});\n }\n if (error instanceof UnknownSecretStoreError) {\n throw new ClientError('Unknown secret store', 'unknown-secret-store', {status: 400});\n }\n throw error;\n}\n"],"names":["ClientError","NamespaceValidationError","SecretBatchDuplicateKeyError","SecretBatchScopeMismatchError","SecretKeyValidationError","SecretNotFoundError","SecretValueTooLargeError","UnknownSecretStoreError","VariableNotFoundError","WorkspaceSecretCapExceededError","translateManagementError","error","status","details","key","namespace","message","max_bytes","maxBytes","cap"],"mappings":"AAAA,SAAQA,WAAW,QAAO,wBAAwB;AAClD,SACEC,wBAAwB,EACxBC,4BAA4B,EAC5BC,6BAA6B,EAC7BC,wBAAwB,EACxBC,mBAAmB,EACnBC,wBAAwB,EACxBC,uBAAuB,EACvBC,qBAAqB,EACrBC,+BAA+B,QAC1B,kBAAkB;AAEzB,OAAO,SAASC,yBAAyBC,KAAc;IACrD,IAAIA,iBAAiBP,0BAA0B;QAC7C,MAAM,IAAIJ,YAAY,sBAAsB,eAAe;YACzDY,QAAQ;YACRC,SAAS;gBAACC,KAAKH,MAAMG,GAAG;YAAA;QAC1B;IACF;IACA,IAAIH,iBAAiBV,0BAA0B;QAC7C,MAAM,IAAID,YAAY,qBAAqB,qBAAqB;YAC9DY,QAAQ;YACRC,SAAS;gBAACE,WAAWJ,MAAMI,SAAS;YAAA;QACtC;IACF;IACA,IAAIJ,iBAAiBL,0BAA0B;QAC7C,MAAM,IAAIN,YAAYW,MAAMK,OAAO,EAAE,mBAAmB;YACtDJ,QAAQ;YACRC,SAAS;gBAACI,WAAWN,MAAMO,QAAQ;YAAA;QACrC;IACF;IACA,IAAIP,iBAAiBF,iCAAiC;QACpD,MAAM,IAAIT,YAAY,iCAAiC,iCAAiC;YACtFY,QAAQ;YACRC,SAAS;gBAACM,KAAKR,MAAMQ,GAAG;YAAA;QAC1B;IACF;IACA,IAAIR,iBAAiBR,+BAA+B;QAClD,MAAM,IAAIH,YAAYW,MAAMK,OAAO,EAAE,wBAAwB;YAACJ,QAAQ;QAAG;IAC3E;IACA,IAAID,iBAAiBT,8BAA8B;QACjD,MAAM,IAAIF,YAAY,uBAAuB,iBAAiB;YAC5DY,QAAQ;YACRC,SAAS;gBAACC,KAAKH,MAAMG,GAAG;YAAA;QAC1B;IACF;IACA,IAAIH,iBAAiBN,qBAAqB;QACxC,MAAM,IAAIL,YAAY,oBAAoB,oBAAoB;YAACY,QAAQ;QAAG;IAC5E;IACA,IAAID,iBAAiBH,uBAAuB;QAC1C,MAAM,IAAIR,YAAY,sBAAsB,sBAAsB;YAACY,QAAQ;QAAG;IAChF;IACA,IAAID,iBAAiBJ,yBAAyB;QAC5C,MAAM,IAAIP,YAAY,wBAAwB,wBAAwB;YAACY,QAAQ;QAAG;IACpF;IACA,MAAMD;AACR"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ManagementAccessHelpers } from './auth.js';
|
|
2
|
+
export declare function getVariableRoute(accessControl: ManagementAccessHelpers): import("@shipfox/node-fastify").RouteDefinition;
|
|
2
3
|
//# sourceMappingURL=get-variable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-variable.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-variable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-variable.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-variable.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAGvD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,mDAqBtE"}
|
|
@@ -3,40 +3,41 @@ import { defineRoute } from '@shipfox/node-fastify';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { getManagedVariable } from '#core/index.js';
|
|
5
5
|
import { toVariableDto } from '#presentation/dto/index.js';
|
|
6
|
-
import { requireManagementRead } from './auth.js';
|
|
7
6
|
import { translateManagementError } from './errors.js';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
export function getVariableRoute(accessControl) {
|
|
8
|
+
return defineRoute({
|
|
9
|
+
method: 'GET',
|
|
10
|
+
path: '/variables/:key',
|
|
11
|
+
description: 'Read a user-managed variable.',
|
|
12
|
+
schema: {
|
|
13
|
+
params: z.object({
|
|
14
|
+
workspaceId: z.string().uuid(),
|
|
15
|
+
key: secretKeySchema
|
|
16
|
+
}),
|
|
17
|
+
querystring: secretScopeQuerySchema,
|
|
18
|
+
response: {
|
|
19
|
+
200: getVariableResponseSchema
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
errorHandler: translateManagementError,
|
|
23
|
+
handler: async (request)=>{
|
|
24
|
+
const { workspaceId, key } = request.params;
|
|
25
|
+
const { project_id: projectId } = request.query;
|
|
26
|
+
await accessControl.requireManagementRead({
|
|
27
|
+
request,
|
|
28
|
+
workspaceId,
|
|
29
|
+
projectId
|
|
30
|
+
});
|
|
31
|
+
const variable = await getManagedVariable({
|
|
32
|
+
workspaceId,
|
|
33
|
+
projectId,
|
|
34
|
+
key
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
variable: toVariableDto(variable)
|
|
38
|
+
};
|
|
20
39
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
handler: async (request)=>{
|
|
24
|
-
const { workspaceId, key } = request.params;
|
|
25
|
-
const { project_id: projectId } = request.query;
|
|
26
|
-
await requireManagementRead({
|
|
27
|
-
request,
|
|
28
|
-
workspaceId,
|
|
29
|
-
projectId
|
|
30
|
-
});
|
|
31
|
-
const variable = await getManagedVariable({
|
|
32
|
-
workspaceId,
|
|
33
|
-
projectId,
|
|
34
|
-
key
|
|
35
|
-
});
|
|
36
|
-
return {
|
|
37
|
-
variable: toVariableDto(variable)
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
41
42
|
|
|
42
43
|
//# sourceMappingURL=get-variable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/get-variable.ts"],"sourcesContent":["import {\n getVariableResponseSchema,\n secretKeySchema,\n secretScopeQuerySchema,\n} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {getManagedVariable} from '#core/index.js';\nimport {toVariableDto} from '#presentation/dto/index.js';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/get-variable.ts"],"sourcesContent":["import {\n getVariableResponseSchema,\n secretKeySchema,\n secretScopeQuerySchema,\n} from '@shipfox/api-secrets-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {getManagedVariable} from '#core/index.js';\nimport {toVariableDto} from '#presentation/dto/index.js';\nimport type {ManagementAccessHelpers} from './auth.js';\nimport {translateManagementError} from './errors.js';\n\nexport function getVariableRoute(accessControl: ManagementAccessHelpers) {\n return defineRoute({\n method: 'GET',\n path: '/variables/:key',\n description: 'Read a user-managed variable.',\n schema: {\n params: z.object({workspaceId: z.string().uuid(), key: secretKeySchema}),\n querystring: secretScopeQuerySchema,\n response: {200: getVariableResponseSchema},\n },\n errorHandler: translateManagementError,\n handler: async (request) => {\n const {workspaceId, key} = request.params;\n const {project_id: projectId} = request.query;\n\n await accessControl.requireManagementRead({request, workspaceId, projectId});\n const variable = await getManagedVariable({workspaceId, projectId, key});\n\n return {variable: toVariableDto(variable)};\n },\n });\n}\n"],"names":["getVariableResponseSchema","secretKeySchema","secretScopeQuerySchema","defineRoute","z","getManagedVariable","toVariableDto","translateManagementError","getVariableRoute","accessControl","method","path","description","schema","params","object","workspaceId","string","uuid","key","querystring","response","errorHandler","handler","request","project_id","projectId","query","requireManagementRead","variable"],"mappings":"AAAA,SACEA,yBAAyB,EACzBC,eAAe,EACfC,sBAAsB,QACjB,2BAA2B;AAClC,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,kBAAkB,QAAO,iBAAiB;AAClD,SAAQC,aAAa,QAAO,6BAA6B;AAEzD,SAAQC,wBAAwB,QAAO,cAAc;AAErD,OAAO,SAASC,iBAAiBC,aAAsC;IACrE,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQV,EAAEW,MAAM,CAAC;gBAACC,aAAaZ,EAAEa,MAAM,GAAGC,IAAI;gBAAIC,KAAKlB;YAAe;YACtEmB,aAAalB;YACbmB,UAAU;gBAAC,KAAKrB;YAAyB;QAC3C;QACAsB,cAAcf;QACdgB,SAAS,OAAOC;YACd,MAAM,EAACR,WAAW,EAAEG,GAAG,EAAC,GAAGK,QAAQV,MAAM;YACzC,MAAM,EAACW,YAAYC,SAAS,EAAC,GAAGF,QAAQG,KAAK;YAE7C,MAAMlB,cAAcmB,qBAAqB,CAAC;gBAACJ;gBAASR;gBAAaU;YAAS;YAC1E,MAAMG,WAAW,MAAMxB,mBAAmB;gBAACW;gBAAaU;gBAAWP;YAAG;YAEtE,OAAO;gBAACU,UAAUvB,cAAcuB;YAAS;QAC3C;IACF;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
|
|
1
2
|
import type { RouteGroup } from '@shipfox/node-fastify';
|
|
2
|
-
export declare
|
|
3
|
+
export declare function createSecretsRoutes(projects: ProjectsModuleClient): RouteGroup[];
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAYtD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,UAAU,EAAE,CAmBhF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AUTH_USER } from '@shipfox/api-auth-context';
|
|
2
|
+
import { createManagementAccess } from './auth.js';
|
|
2
3
|
import { batchSecretsRoute } from './batch-secrets.js';
|
|
3
4
|
import { batchVariablesRoute } from './batch-variables.js';
|
|
4
5
|
import { deleteSecretRoute } from './delete-secret.js';
|
|
@@ -8,22 +9,25 @@ import { listSecretsRoute } from './list-secrets.js';
|
|
|
8
9
|
import { listVariablesRoute } from './list-variables.js';
|
|
9
10
|
import { putSecretRoute } from './put-secret.js';
|
|
10
11
|
import { putVariableRoute } from './put-variable.js';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]
|
|
12
|
+
export function createSecretsRoutes(projects) {
|
|
13
|
+
const access = createManagementAccess(projects);
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
prefix: '/workspaces/:workspaceId',
|
|
17
|
+
auth: AUTH_USER,
|
|
18
|
+
routes: [
|
|
19
|
+
listSecretsRoute(access),
|
|
20
|
+
putSecretRoute(access),
|
|
21
|
+
batchSecretsRoute(access),
|
|
22
|
+
deleteSecretRoute(access),
|
|
23
|
+
listVariablesRoute(access),
|
|
24
|
+
getVariableRoute(access),
|
|
25
|
+
putVariableRoute(access),
|
|
26
|
+
batchVariablesRoute(access),
|
|
27
|
+
deleteVariableRoute(access)
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
28
32
|
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import {AUTH_USER} from '@shipfox/api-auth-context';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {batchSecretsRoute} from './batch-secrets.js';\nimport {batchVariablesRoute} from './batch-variables.js';\nimport {deleteSecretRoute} from './delete-secret.js';\nimport {deleteVariableRoute} from './delete-variable.js';\nimport {getVariableRoute} from './get-variable.js';\nimport {listSecretsRoute} from './list-secrets.js';\nimport {listVariablesRoute} from './list-variables.js';\nimport {putSecretRoute} from './put-secret.js';\nimport {putVariableRoute} from './put-variable.js';\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import {AUTH_USER} from '@shipfox/api-auth-context';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createManagementAccess} from './auth.js';\nimport {batchSecretsRoute} from './batch-secrets.js';\nimport {batchVariablesRoute} from './batch-variables.js';\nimport {deleteSecretRoute} from './delete-secret.js';\nimport {deleteVariableRoute} from './delete-variable.js';\nimport {getVariableRoute} from './get-variable.js';\nimport {listSecretsRoute} from './list-secrets.js';\nimport {listVariablesRoute} from './list-variables.js';\nimport {putSecretRoute} from './put-secret.js';\nimport {putVariableRoute} from './put-variable.js';\n\nexport function createSecretsRoutes(projects: ProjectsModuleClient): RouteGroup[] {\n const access = createManagementAccess(projects);\n return [\n {\n prefix: '/workspaces/:workspaceId',\n auth: AUTH_USER,\n routes: [\n listSecretsRoute(access),\n putSecretRoute(access),\n batchSecretsRoute(access),\n deleteSecretRoute(access),\n listVariablesRoute(access),\n getVariableRoute(access),\n putVariableRoute(access),\n batchVariablesRoute(access),\n deleteVariableRoute(access),\n ],\n },\n ];\n}\n"],"names":["AUTH_USER","createManagementAccess","batchSecretsRoute","batchVariablesRoute","deleteSecretRoute","deleteVariableRoute","getVariableRoute","listSecretsRoute","listVariablesRoute","putSecretRoute","putVariableRoute","createSecretsRoutes","projects","access","prefix","auth","routes"],"mappings":"AAAA,SAAQA,SAAS,QAAO,4BAA4B;AAGpD,SAAQC,sBAAsB,QAAO,YAAY;AACjD,SAAQC,iBAAiB,QAAO,qBAAqB;AACrD,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,iBAAiB,QAAO,qBAAqB;AACrD,SAAQC,mBAAmB,QAAO,uBAAuB;AACzD,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,gBAAgB,QAAO,oBAAoB;AACnD,SAAQC,kBAAkB,QAAO,sBAAsB;AACvD,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,SAAQC,gBAAgB,QAAO,oBAAoB;AAEnD,OAAO,SAASC,oBAAoBC,QAA8B;IAChE,MAAMC,SAASZ,uBAAuBW;IACtC,OAAO;QACL;YACEE,QAAQ;YACRC,MAAMf;YACNgB,QAAQ;gBACNT,iBAAiBM;gBACjBJ,eAAeI;gBACfX,kBAAkBW;gBAClBT,kBAAkBS;gBAClBL,mBAAmBK;gBACnBP,iBAAiBO;gBACjBH,iBAAiBG;gBACjBV,oBAAoBU;gBACpBR,oBAAoBQ;aACrB;QACH;KACD;AACH"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ManagementAccessHelpers } from './auth.js';
|
|
2
|
+
export declare function listSecretsRoute(accessControl: ManagementAccessHelpers): import("@shipfox/node-fastify").RouteDefinition;
|
|
2
3
|
//# sourceMappingURL=list-secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-secrets.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-secrets.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-secrets.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAIvD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,mDAiCtE"}
|
|
@@ -3,48 +3,49 @@ import { ClientError, defineRoute } from '@shipfox/node-fastify';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { listManagedSecrets } from '#core/index.js';
|
|
5
5
|
import { toSecretDto } from '#presentation/dto/index.js';
|
|
6
|
-
import { requireManagementRead } from './auth.js';
|
|
7
6
|
import { decodeManagementCursor, encodeManagementCursor } from './cursor.js';
|
|
8
7
|
import { translateManagementError } from './errors.js';
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
export function listSecretsRoute(accessControl) {
|
|
9
|
+
return defineRoute({
|
|
10
|
+
method: 'GET',
|
|
11
|
+
path: '/secrets',
|
|
12
|
+
description: 'List user-managed secrets for a workspace or project scope.',
|
|
13
|
+
schema: {
|
|
14
|
+
params: z.object({
|
|
15
|
+
workspaceId: z.string().uuid()
|
|
16
|
+
}),
|
|
17
|
+
querystring: listSecretsQuerySchema,
|
|
18
|
+
response: {
|
|
19
|
+
200: listSecretsResponseSchema
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
errorHandler: translateManagementError,
|
|
23
|
+
handler: async (request)=>{
|
|
24
|
+
const { workspaceId } = request.params;
|
|
25
|
+
const { project_id: projectId, limit, cursor } = request.query;
|
|
26
|
+
const decodedCursor = decodeManagementCursor(cursor);
|
|
27
|
+
if (cursor && !decodedCursor) {
|
|
28
|
+
throw new ClientError('Invalid cursor', 'invalid-cursor', {
|
|
29
|
+
status: 400
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
await accessControl.requireManagementRead({
|
|
33
|
+
request,
|
|
34
|
+
workspaceId,
|
|
35
|
+
projectId
|
|
36
|
+
});
|
|
37
|
+
const result = await listManagedSecrets({
|
|
38
|
+
workspaceId,
|
|
39
|
+
projectId,
|
|
40
|
+
limit,
|
|
41
|
+
cursor: decodedCursor ?? undefined
|
|
30
42
|
});
|
|
43
|
+
return {
|
|
44
|
+
secrets: result.secrets.map(toSecretDto),
|
|
45
|
+
next_cursor: result.nextCursor ? encodeManagementCursor(result.nextCursor) : null
|
|
46
|
+
};
|
|
31
47
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
workspaceId,
|
|
35
|
-
projectId
|
|
36
|
-
});
|
|
37
|
-
const result = await listManagedSecrets({
|
|
38
|
-
workspaceId,
|
|
39
|
-
projectId,
|
|
40
|
-
limit,
|
|
41
|
-
cursor: decodedCursor ?? undefined
|
|
42
|
-
});
|
|
43
|
-
return {
|
|
44
|
-
secrets: result.secrets.map(toSecretDto),
|
|
45
|
-
next_cursor: result.nextCursor ? encodeManagementCursor(result.nextCursor) : null
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
49
50
|
|
|
50
51
|
//# sourceMappingURL=list-secrets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/list-secrets.ts"],"sourcesContent":["import {listSecretsQuerySchema, listSecretsResponseSchema} from '@shipfox/api-secrets-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {listManagedSecrets} from '#core/index.js';\nimport {toSecretDto} from '#presentation/dto/index.js';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/list-secrets.ts"],"sourcesContent":["import {listSecretsQuerySchema, listSecretsResponseSchema} from '@shipfox/api-secrets-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {listManagedSecrets} from '#core/index.js';\nimport {toSecretDto} from '#presentation/dto/index.js';\nimport type {ManagementAccessHelpers} from './auth.js';\nimport {decodeManagementCursor, encodeManagementCursor} from './cursor.js';\nimport {translateManagementError} from './errors.js';\n\nexport function listSecretsRoute(accessControl: ManagementAccessHelpers) {\n return defineRoute({\n method: 'GET',\n path: '/secrets',\n description: 'List user-managed secrets for a workspace or project scope.',\n schema: {\n params: z.object({workspaceId: z.string().uuid()}),\n querystring: listSecretsQuerySchema,\n response: {200: listSecretsResponseSchema},\n },\n errorHandler: translateManagementError,\n handler: async (request) => {\n const {workspaceId} = request.params;\n const {project_id: projectId, limit, cursor} = request.query;\n const decodedCursor = decodeManagementCursor(cursor);\n if (cursor && !decodedCursor) {\n throw new ClientError('Invalid cursor', 'invalid-cursor', {status: 400});\n }\n\n await accessControl.requireManagementRead({request, workspaceId, projectId});\n const result = await listManagedSecrets({\n workspaceId,\n projectId,\n limit,\n cursor: decodedCursor ?? undefined,\n });\n\n return {\n secrets: result.secrets.map(toSecretDto),\n next_cursor: result.nextCursor ? encodeManagementCursor(result.nextCursor) : null,\n };\n },\n });\n}\n"],"names":["listSecretsQuerySchema","listSecretsResponseSchema","ClientError","defineRoute","z","listManagedSecrets","toSecretDto","decodeManagementCursor","encodeManagementCursor","translateManagementError","listSecretsRoute","accessControl","method","path","description","schema","params","object","workspaceId","string","uuid","querystring","response","errorHandler","handler","request","project_id","projectId","limit","cursor","query","decodedCursor","status","requireManagementRead","result","undefined","secrets","map","next_cursor","nextCursor"],"mappings":"AAAA,SAAQA,sBAAsB,EAAEC,yBAAyB,QAAO,2BAA2B;AAC3F,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,kBAAkB,QAAO,iBAAiB;AAClD,SAAQC,WAAW,QAAO,6BAA6B;AAEvD,SAAQC,sBAAsB,EAAEC,sBAAsB,QAAO,cAAc;AAC3E,SAAQC,wBAAwB,QAAO,cAAc;AAErD,OAAO,SAASC,iBAAiBC,aAAsC;IACrE,OAAOR,YAAY;QACjBS,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQZ,EAAEa,MAAM,CAAC;gBAACC,aAAad,EAAEe,MAAM,GAAGC,IAAI;YAAE;YAChDC,aAAarB;YACbsB,UAAU;gBAAC,KAAKrB;YAAyB;QAC3C;QACAsB,cAAcd;QACde,SAAS,OAAOC;YACd,MAAM,EAACP,WAAW,EAAC,GAAGO,QAAQT,MAAM;YACpC,MAAM,EAACU,YAAYC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAC,GAAGJ,QAAQK,KAAK;YAC5D,MAAMC,gBAAgBxB,uBAAuBsB;YAC7C,IAAIA,UAAU,CAACE,eAAe;gBAC5B,MAAM,IAAI7B,YAAY,kBAAkB,kBAAkB;oBAAC8B,QAAQ;gBAAG;YACxE;YAEA,MAAMrB,cAAcsB,qBAAqB,CAAC;gBAACR;gBAASP;gBAAaS;YAAS;YAC1E,MAAMO,SAAS,MAAM7B,mBAAmB;gBACtCa;gBACAS;gBACAC;gBACAC,QAAQE,iBAAiBI;YAC3B;YAEA,OAAO;gBACLC,SAASF,OAAOE,OAAO,CAACC,GAAG,CAAC/B;gBAC5BgC,aAAaJ,OAAOK,UAAU,GAAG/B,uBAAuB0B,OAAOK,UAAU,IAAI;YAC/E;QACF;IACF;AACF"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ManagementAccessHelpers } from './auth.js';
|
|
2
|
+
export declare function listVariablesRoute(accessControl: ManagementAccessHelpers): import("@shipfox/node-fastify").RouteDefinition;
|
|
2
3
|
//# sourceMappingURL=list-variables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-variables.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-variables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-variables.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-variables.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,WAAW,CAAC;AAIvD,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,uBAAuB,mDAiCxE"}
|