@boboddy/sdk 0.0.9-alpha → 0.0.10-alpha

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 (83) hide show
  1. package/dist/apps/api/src/http/routes/authenticated.d.ts +7 -3
  2. package/dist/apps/api/src/http/routes/feedback-requests.d.ts +2 -0
  3. package/dist/apps/api/src/http/routes/linear-pipeline-definitions.d.ts +2 -0
  4. package/dist/apps/api/src/http/routes/linear-pipeline-executions.d.ts +2 -0
  5. package/dist/apps/api/src/http/routes/project-context-entries.d.ts +2 -0
  6. package/dist/apps/api/src/http/routes/projects.d.ts +2 -0
  7. package/dist/apps/api/src/http/routes/step-definition-templates.d.ts +2 -0
  8. package/dist/apps/api/src/http/routes/step-definitions.d.ts +2 -0
  9. package/dist/apps/api/src/http/routes/step-execution-route-helpers.d.ts +54 -4
  10. package/dist/apps/api/src/http/routes/step-executions.d.ts +2 -0
  11. package/dist/apps/api/src/http/routes/work-items.d.ts +2 -0
  12. package/dist/packages/core/src/access/authorization/application/{authorization-service.d.ts → user-authorization-service.d.ts} +2 -2
  13. package/dist/packages/core/src/access/authorization/infra/project-authorization-service.d.ts +6 -4
  14. package/dist/packages/core/src/agent-sessions/project-runtime-session/application/create-project-runtime-session.d.ts +6 -4
  15. package/dist/packages/core/src/agent-sessions/project-runtime-session/application/get-project-runtime-session.d.ts +6 -4
  16. package/dist/packages/core/src/agent-sessions/project-runtime-session/application/list-project-runtime-sessions.d.ts +6 -4
  17. package/dist/packages/core/src/agent-sessions/project-runtime-session/application/stop-project-runtime-session.d.ts +6 -4
  18. package/dist/packages/core/src/agent-sessions/runtime-command/application/complete-claimed-runtime-command.d.ts +3 -1
  19. package/dist/packages/core/src/agent-sessions/runtime-command/application/create-runtime-command.d.ts +6 -4
  20. package/dist/packages/core/src/agent-sessions/runtime-command/application/fail-claimed-runtime-command.d.ts +3 -1
  21. package/dist/packages/core/src/agent-sessions/runtime-command/application/interrupt-claimed-runtime-command.d.ts +3 -1
  22. package/dist/packages/core/src/agent-sessions/runtime-command/application/run-runtime-command-locally.d.ts +5 -4
  23. package/dist/packages/core/src/agent-sessions/runtime-service/application/create-runtime-service.d.ts +6 -4
  24. package/dist/packages/core/src/agent-sessions/runtime-service/application/get-runtime-service.d.ts +6 -4
  25. package/dist/packages/core/src/agent-sessions/runtime-service/application/start-runtime-service-locally.d.ts +6 -4
  26. package/dist/packages/core/src/agent-sessions/runtime-service/application/stop-runtime-service.d.ts +7 -5
  27. package/dist/packages/core/src/lib/di.d.ts +5 -4
  28. package/dist/packages/core/src/lib/errors.d.ts +1 -0
  29. package/dist/packages/core/src/lib/result.d.ts +15 -0
  30. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/add-linear-pipeline-step-definition.d.ts +6 -2
  31. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/archive-linear-pipeline-definition.d.ts +6 -2
  32. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/create-linear-pipeline-definition.d.ts +3 -1
  33. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/get-linear-pipeline-definition.d.ts +6 -2
  34. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/list-linear-pipeline-definitions.d.ts +3 -1
  35. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/remove-linear-pipeline-step-definition.d.ts +6 -2
  36. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/set-linear-pipeline-step-advancement-policy-definition.d.ts +6 -2
  37. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/update-linear-pipeline-definition.d.ts +6 -2
  38. package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/update-linear-pipeline-step-definition.d.ts +6 -2
  39. package/dist/packages/core/src/pipeline-definitions/step-definition/application/archive-step-definition.d.ts +6 -2
  40. package/dist/packages/core/src/pipeline-definitions/step-definition/application/create-step-definition.d.ts +3 -1
  41. package/dist/packages/core/src/pipeline-definitions/step-definition/application/get-step-definition.d.ts +6 -2
  42. package/dist/packages/core/src/pipeline-definitions/step-definition/application/list-step-definitions.d.ts +3 -1
  43. package/dist/packages/core/src/pipeline-definitions/step-definition/application/update-step-definition.d.ts +6 -2
  44. package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/get-step-definition-template.d.ts +3 -1
  45. package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/instantiate-step-definition-template.d.ts +6 -2
  46. package/dist/packages/core/src/pipeline-executions/feedback-request/application/decline-feedback-request.d.ts +2 -3
  47. package/dist/packages/core/src/pipeline-executions/feedback-request/application/list-feedback-requests-by-step-signal.d.ts +2 -3
  48. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/accept-linear-pipeline-step-run.d.ts +6 -2
  49. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/apply-linear-pipeline-step-result-and-advance.d.ts +6 -2
  50. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/cancel-linear-pipeline-execution.d.ts +6 -2
  51. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/create-linear-pipeline-execution.d.ts +6 -2
  52. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/create-linear-pipeline-step-run-attempt.d.ts +6 -2
  53. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/get-linear-pipeline-execution.d.ts +6 -2
  54. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/list-linear-pipeline-executions-by-definition.d.ts +5 -1
  55. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/list-linear-pipeline-executions.d.ts +3 -1
  56. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/mark-linear-pipeline-step-run-attempt-running.d.ts +6 -2
  57. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/queue-first-linear-pipeline-step-run.d.ts +6 -2
  58. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/retrigger-linear-pipeline-step-run.d.ts +6 -2
  59. package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/start-linear-pipeline-execution.d.ts +6 -2
  60. package/dist/packages/core/src/pipeline-executions/step-execution/application/add-step-execution-result.d.ts +6 -2
  61. package/dist/packages/core/src/pipeline-executions/step-execution/application/claim-step-executions.d.ts +3 -1
  62. package/dist/packages/core/src/pipeline-executions/step-execution/application/complete-claimed-step-execution.d.ts +8 -4
  63. package/dist/packages/core/src/pipeline-executions/step-execution/application/create-step-execution.d.ts +3 -1
  64. package/dist/packages/core/src/pipeline-executions/step-execution/application/extract-step-execution-signals.d.ts +6 -2
  65. package/dist/packages/core/src/pipeline-executions/step-execution/application/get-step-execution-worker-context.d.ts +6 -2
  66. package/dist/packages/core/src/pipeline-executions/step-execution/application/get-step-execution.d.ts +6 -2
  67. package/dist/packages/core/src/pipeline-executions/step-execution/application/heartbeat-step-execution-claim.d.ts +6 -2
  68. package/dist/packages/core/src/pipeline-executions/step-execution/application/list-step-executions-by-project.d.ts +3 -1
  69. package/dist/packages/core/src/pipeline-executions/step-execution/application/mark-step-execution-running.d.ts +6 -2
  70. package/dist/packages/core/src/projects/project/application/create-project.d.ts +3 -3
  71. package/dist/packages/core/src/projects/project/application/get-project.d.ts +6 -4
  72. package/dist/packages/core/src/projects/project/application/list-projects.d.ts +3 -3
  73. package/dist/packages/core/src/projects/project/application/update-project-membership.d.ts +6 -4
  74. package/dist/packages/core/src/projects/project-context/application/create-project-context-entry.d.ts +2 -4
  75. package/dist/packages/core/src/projects/project-context/application/delete-project-context-entry.d.ts +5 -4
  76. package/dist/packages/core/src/projects/project-context/application/list-project-context-entries.d.ts +2 -3
  77. package/dist/packages/core/src/work-items/work-item/application/create-work-item.d.ts +6 -6
  78. package/dist/packages/core/src/work-items/work-item/application/delete-work-items.d.ts +6 -6
  79. package/dist/packages/core/src/work-items/work-item/application/get-work-items.d.ts +6 -6
  80. package/dist/packages/core/src/work-items/work-item/application/list-work-items-by-project.d.ts +6 -4
  81. package/dist/packages/core/src/work-items/work-item/application/upsert-work-item.d.ts +2 -4
  82. package/package.json +1 -2
  83. package/dist/apps/api/src/http/project-permission-handler.d.ts +0 -18
@@ -1,12 +1,14 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
2
  import type { InMemoryDomainEventDispatcher } from "@boboddy/core/lib/domain-events/in-memory-domain-event-dispatcher";
3
3
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
5
  import type { LinearPipelineExecutionRepo } from "@boboddy/core/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-repo";
5
6
  import { type ClaimStepExecutionsInput, type StepExecutionClaimContract } from "../contracts/step-execution-contracts";
6
7
  import type { StepExecutionRepo } from "./step-execution-repo";
7
8
  import type { StepDefinitionRepo } from "@boboddy/core/pipeline-definitions/step-definition/application/step-definition-repo";
8
9
  import type { LinearPipelineDefinitionRepo } from "@boboddy/core/pipeline-definitions/pipeline-definition/application/linear-pipeline-definition-repo";
9
- export declare const claimStepExecutions: (input: ClaimStepExecutionsInput, { stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
10
+ export declare const claimStepExecutions: (input: ClaimStepExecutionsInput, { userAuthz, stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
11
+ userAuthz: UserAuthorizationService;
10
12
  stepExecutionRepo: StepExecutionRepo;
11
13
  stepDefinitionRepo: StepDefinitionRepo;
12
14
  linearPipelineDefinitionRepo: LinearPipelineDefinitionRepo;
@@ -1,12 +1,16 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
2
4
  import type { InMemoryDomainEventDispatcher } from "@boboddy/core/lib/domain-events/in-memory-domain-event-dispatcher";
3
5
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
6
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
7
  import type { LinearPipelineDefinitionRepo } from "@boboddy/core/pipeline-definitions/pipeline-definition/application/linear-pipeline-definition-repo";
5
8
  import type { LinearPipelineExecutionRepo } from "@boboddy/core/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-repo";
6
9
  import type { StepDefinitionRepo } from "@boboddy/core/pipeline-definitions/step-definition/application/step-definition-repo";
7
10
  import { type CompleteClaimedStepExecutionInput, type GetStepExecutionInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
8
11
  import type { StepExecutionRepo } from "./step-execution-repo";
9
- export declare const completeClaimedStepExecution: (stepExecutionIdInput: GetStepExecutionInput, input: CompleteClaimedStepExecutionInput, { stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
12
+ export declare const completeClaimedStepExecution: (stepExecutionIdInput: GetStepExecutionInput, input: CompleteClaimedStepExecutionInput, { userAuthz, stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
13
+ userAuthz: UserAuthorizationService;
10
14
  stepExecutionRepo: StepExecutionRepo;
11
15
  stepDefinitionRepo: StepDefinitionRepo;
12
16
  linearPipelineDefinitionRepo: LinearPipelineDefinitionRepo;
@@ -14,7 +18,7 @@ export declare const completeClaimedStepExecution: (stepExecutionIdInput: GetSte
14
18
  timeProvider: TimeProvider;
15
19
  domainEventDispatcher?: InMemoryDomainEventDispatcher;
16
20
  dbExecutor?: DbExecutor | undefined;
17
- }) => Promise<StepExecutionContract>;
21
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
18
22
  export declare const failTimedOutStepExecution: (stepExecutionIdInput: GetStepExecutionInput, { stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
19
23
  stepExecutionRepo: StepExecutionRepo;
20
24
  stepDefinitionRepo: StepDefinitionRepo;
@@ -23,7 +27,7 @@ export declare const failTimedOutStepExecution: (stepExecutionIdInput: GetStepEx
23
27
  timeProvider: TimeProvider;
24
28
  domainEventDispatcher?: InMemoryDomainEventDispatcher;
25
29
  dbExecutor?: DbExecutor | undefined;
26
- }) => Promise<StepExecutionContract>;
30
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
27
31
  export declare const failAbandonedStepExecution: (stepExecutionIdInput: GetStepExecutionInput, { stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
28
32
  stepExecutionRepo: StepExecutionRepo;
29
33
  stepDefinitionRepo: StepDefinitionRepo;
@@ -32,4 +36,4 @@ export declare const failAbandonedStepExecution: (stepExecutionIdInput: GetStepE
32
36
  timeProvider: TimeProvider;
33
37
  domainEventDispatcher?: InMemoryDomainEventDispatcher;
34
38
  dbExecutor?: DbExecutor | undefined;
35
- }) => Promise<StepExecutionContract>;
39
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
@@ -1,8 +1,10 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
2
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
3
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
4
  import { type CreateStepExecutionInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
4
5
  import type { StepExecutionRepo } from "./step-execution-repo";
5
- export declare const createStepExecution: (input: CreateStepExecutionInput, { stepExecutionRepo, timeProvider, dbExecutor, }: {
6
+ export declare const createStepExecution: (input: CreateStepExecutionInput, { userAuthz, stepExecutionRepo, timeProvider, dbExecutor, }: {
7
+ userAuthz: UserAuthorizationService;
6
8
  stepExecutionRepo: StepExecutionRepo;
7
9
  timeProvider: TimeProvider;
8
10
  dbExecutor?: DbExecutor | undefined;
@@ -1,13 +1,17 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import { CoreValidationError, ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
2
4
  import type { InMemoryDomainEventDispatcher } from "@boboddy/core/lib/domain-events/in-memory-domain-event-dispatcher";
3
5
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
6
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
7
  import type { StepDefinitionRepo } from "@boboddy/core/pipeline-definitions/step-definition/application/step-definition-repo";
5
8
  import { type GetStepExecutionResultInput, type StepSignalContract } from "../contracts/step-execution-contracts";
6
9
  import type { StepExecutionRepo } from "./step-execution-repo";
7
- export declare const extractStepExecutionSignals: (input: GetStepExecutionResultInput, { stepDefinitionRepo, stepExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
10
+ export declare const extractStepExecutionSignals: (input: GetStepExecutionResultInput, { userAuthz, stepDefinitionRepo, stepExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
11
+ userAuthz?: UserAuthorizationService;
8
12
  stepDefinitionRepo: StepDefinitionRepo;
9
13
  stepExecutionRepo: StepExecutionRepo;
10
14
  timeProvider: TimeProvider;
11
15
  domainEventDispatcher?: InMemoryDomainEventDispatcher;
12
16
  dbExecutor?: DbExecutor | undefined;
13
- }) => Promise<StepSignalContract[]>;
17
+ }) => Promise<Result<StepSignalContract[], ResourceNotFoundError | CoreValidationError>>;
@@ -1,13 +1,17 @@
1
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
1
2
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
2
5
  import type { ProjectRepo } from "@boboddy/core/projects/project/application/project-repo";
3
6
  import type { StepDefinitionRepo } from "@boboddy/core/pipeline-definitions/step-definition/application/step-definition-repo";
4
7
  import type { ProjectContextEntryRepo } from "@boboddy/core/projects/project-context/application/project-context-entry-repo";
5
8
  import { type GetStepExecutionInput, type GetStepExecutionWorkerContextInput, type StepExecutionWorkerContextContract } from "../contracts/step-execution-contracts";
6
9
  import type { StepExecutionRepo } from "./step-execution-repo";
7
- export declare const getStepExecutionWorkerContext: (stepExecutionIdInput: GetStepExecutionInput, input: GetStepExecutionWorkerContextInput, { projectRepo, stepExecutionRepo, stepDefinitionRepo, projectContextEntryRepo, timeProvider, }: {
10
+ export declare const getStepExecutionWorkerContext: (stepExecutionIdInput: GetStepExecutionInput, input: GetStepExecutionWorkerContextInput, { userAuthz, projectRepo, stepExecutionRepo, stepDefinitionRepo, projectContextEntryRepo, timeProvider, }: {
11
+ userAuthz: UserAuthorizationService;
8
12
  projectRepo: ProjectRepo;
9
13
  stepExecutionRepo: StepExecutionRepo;
10
14
  stepDefinitionRepo: StepDefinitionRepo;
11
15
  projectContextEntryRepo: ProjectContextEntryRepo;
12
16
  timeProvider: TimeProvider;
13
- }) => Promise<StepExecutionWorkerContextContract>;
17
+ }) => Promise<Result<StepExecutionWorkerContextContract, ResourceNotFoundError>>;
@@ -1,9 +1,13 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
2
5
  import { type GetStepExecutionInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
3
6
  import type { StepExecutionRepo } from "./step-execution-repo";
4
7
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
5
- export declare const getStepExecution: (input: GetStepExecutionInput, { stepExecutionRepo, timeProvider, dbExecutor, }: {
8
+ export declare const getStepExecution: (input: GetStepExecutionInput, { userAuthz, stepExecutionRepo, timeProvider, dbExecutor, }: {
9
+ userAuthz: UserAuthorizationService;
6
10
  stepExecutionRepo: StepExecutionRepo;
7
11
  timeProvider: TimeProvider;
8
12
  dbExecutor?: DbExecutor | undefined;
9
- }) => Promise<StepExecutionContract>;
13
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
@@ -1,12 +1,16 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
2
4
  import type { InMemoryDomainEventDispatcher } from "@boboddy/core/lib/domain-events/in-memory-domain-event-dispatcher";
3
5
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
6
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
7
  import type { LinearPipelineDefinitionRepo } from "@boboddy/core/pipeline-definitions/pipeline-definition/application/linear-pipeline-definition-repo";
5
8
  import type { LinearPipelineExecutionRepo } from "@boboddy/core/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-repo";
6
9
  import type { StepDefinitionRepo } from "@boboddy/core/pipeline-definitions/step-definition/application/step-definition-repo";
7
10
  import { type GetStepExecutionInput, type StepExecutionClaimCommandInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
8
11
  import type { StepExecutionRepo } from "./step-execution-repo";
9
- export declare const heartbeatStepExecutionClaim: (stepExecutionIdInput: GetStepExecutionInput, input: StepExecutionClaimCommandInput, { stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
12
+ export declare const heartbeatStepExecutionClaim: (stepExecutionIdInput: GetStepExecutionInput, input: StepExecutionClaimCommandInput, { userAuthz, stepExecutionRepo, stepDefinitionRepo, linearPipelineDefinitionRepo, linearPipelineExecutionRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
13
+ userAuthz: UserAuthorizationService;
10
14
  stepExecutionRepo: StepExecutionRepo;
11
15
  stepDefinitionRepo: StepDefinitionRepo;
12
16
  linearPipelineDefinitionRepo: LinearPipelineDefinitionRepo;
@@ -14,4 +18,4 @@ export declare const heartbeatStepExecutionClaim: (stepExecutionIdInput: GetStep
14
18
  timeProvider: TimeProvider;
15
19
  domainEventDispatcher?: InMemoryDomainEventDispatcher;
16
20
  dbExecutor?: DbExecutor | undefined;
17
- }) => Promise<StepExecutionContract>;
21
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
@@ -1,8 +1,10 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
2
3
  import { type ListStepExecutionsByProjectIdInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
3
4
  import type { StepExecutionRepo } from "./step-execution-repo";
4
5
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
5
- export declare const listStepExecutionsByProjectId: (input: ListStepExecutionsByProjectIdInput, { stepExecutionRepo, timeProvider, dbExecutor, }: {
6
+ export declare const listStepExecutionsByProjectId: (input: ListStepExecutionsByProjectIdInput, { userAuthz, stepExecutionRepo, timeProvider, dbExecutor, }: {
7
+ userAuthz: UserAuthorizationService;
6
8
  stepExecutionRepo: StepExecutionRepo;
7
9
  timeProvider: TimeProvider;
8
10
  dbExecutor?: DbExecutor | undefined;
@@ -1,9 +1,13 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
2
3
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
4
+ import { Result } from "@boboddy/core/lib/result";
5
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
6
  import { type GetStepExecutionInput, type StepExecutionContract } from "../contracts/step-execution-contracts";
4
7
  import type { StepExecutionRepo } from "./step-execution-repo";
5
- export declare const markStepExecutionRunning: (input: GetStepExecutionInput, { stepExecutionRepo, timeProvider, dbExecutor, }: {
8
+ export declare const markStepExecutionRunning: (input: GetStepExecutionInput, { userAuthz, stepExecutionRepo, timeProvider, dbExecutor, }: {
9
+ userAuthz: UserAuthorizationService;
6
10
  stepExecutionRepo: StepExecutionRepo;
7
11
  timeProvider: TimeProvider;
8
12
  dbExecutor?: DbExecutor | undefined;
9
- }) => Promise<StepExecutionContract>;
13
+ }) => Promise<Result<StepExecutionContract, ResourceNotFoundError>>;
@@ -1,11 +1,11 @@
1
- import { type UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
1
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
2
2
  import type { InMemoryDomainEventDispatcher } from "@boboddy/core/lib/domain-events/in-memory-domain-event-dispatcher";
3
3
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
4
4
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
5
5
  import type { ProjectRepo } from "./project-repo";
6
6
  import { type CreateProjectInput, type ProjectContract } from "../contracts/project-contracts";
7
- export declare const createProject: (input: CreateProjectInput, { userId, projectRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
8
- userId: UuidV7;
7
+ export declare const createProject: (input: CreateProjectInput, { userAuthz, projectRepo, timeProvider, domainEventDispatcher, dbExecutor, }: {
8
+ userAuthz: UserAuthorizationService;
9
9
  projectRepo: ProjectRepo;
10
10
  timeProvider: TimeProvider;
11
11
  domainEventDispatcher?: InMemoryDomainEventDispatcher | undefined;
@@ -1,9 +1,11 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import { type UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
5
  import type { ProjectRepo } from "./project-repo";
4
6
  import { type GetProjectInput, type ProjectContract } from "../contracts/project-contracts";
5
- export declare const getProject: (input: GetProjectInput, { userId, projectRepo, dbExecutor, }: {
6
- userId: UuidV7;
7
+ export declare const getProject: (input: GetProjectInput, { userAuthz, projectRepo, dbExecutor, }: {
8
+ userAuthz: UserAuthorizationService;
7
9
  projectRepo: ProjectRepo;
8
10
  dbExecutor?: DbExecutor | undefined;
9
- }) => Promise<ProjectContract>;
11
+ }) => Promise<Result<ProjectContract, ResourceNotFoundError>>;
@@ -1,9 +1,9 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
3
  import type { ProjectRepo } from "./project-repo";
4
4
  import type { ProjectContract } from "../contracts/project-contracts";
5
- export declare const listProjects: ({ userId, projectRepo, dbExecutor, }: {
6
- userId: UuidV7;
5
+ export declare const listProjects: ({ userAuthz, projectRepo, dbExecutor, }: {
6
+ userAuthz: UserAuthorizationService;
7
7
  projectRepo: ProjectRepo;
8
8
  dbExecutor?: DbExecutor | undefined;
9
9
  }) => Promise<ProjectContract[]>;
@@ -1,11 +1,13 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
4
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
5
+ import { Result } from "@boboddy/core/lib/result";
4
6
  import type { ProjectRepo } from "./project-repo";
5
7
  import { type ProjectContract, type UpdateProjectMembershipInput } from "../contracts/project-contracts";
6
- export declare const updateProjectMembership: (input: UpdateProjectMembershipInput, { actorUserId, projectRepo, timeProvider, dbExecutor, }: {
7
- actorUserId: UuidV7;
8
+ export declare const updateProjectMembership: (input: UpdateProjectMembershipInput, { userAuthz, projectRepo, timeProvider, dbExecutor, }: {
9
+ userAuthz: UserAuthorizationService;
8
10
  projectRepo: ProjectRepo;
9
11
  timeProvider: TimeProvider;
10
12
  dbExecutor?: DbExecutor | undefined;
11
- }) => Promise<ProjectContract>;
13
+ }) => Promise<Result<ProjectContract, ResourceNotFoundError>>;
@@ -1,11 +1,9 @@
1
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
1
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
3
  import { type CreateProjectContextEntryInput, type ProjectContextEntryContract } from "../contracts/project-context-entry-contracts";
5
4
  import type { ProjectContextEntryRepo } from "./project-context-entry-repo";
6
5
  type CreateProjectContextEntryDeps = {
7
- userId: UuidV7;
8
- authz: AuthorizationService;
6
+ userAuthz: UserAuthorizationService;
9
7
  projectContextEntryRepo: ProjectContextEntryRepo;
10
8
  timeProvider: TimeProvider;
11
9
  };
@@ -1,10 +1,11 @@
1
1
  import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
5
  import type { ProjectContextEntryRepo } from "./project-context-entry-repo";
4
6
  type DeleteProjectContextEntryDeps = {
5
- userId: UuidV7;
6
- authz: AuthorizationService;
7
+ userAuthz: UserAuthorizationService;
7
8
  projectContextEntryRepo: ProjectContextEntryRepo;
8
9
  };
9
- export declare const deleteProjectContextEntry: (id: UuidV7, projectId: UuidV7, deps: DeleteProjectContextEntryDeps) => Promise<void>;
10
+ export declare const deleteProjectContextEntry: (id: UuidV7, projectId: UuidV7, deps: DeleteProjectContextEntryDeps) => Promise<Result<void, ResourceNotFoundError>>;
10
11
  export {};
@@ -1,11 +1,10 @@
1
1
  import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
2
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
3
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
4
  import { type ProjectContextEntryContract } from "../contracts/project-context-entry-contracts";
5
5
  import type { ProjectContextEntryRepo } from "./project-context-entry-repo";
6
6
  type ListProjectContextEntriesDeps = {
7
- userId: UuidV7;
8
- authz: AuthorizationService;
7
+ userAuthz: UserAuthorizationService;
9
8
  projectContextEntryRepo: ProjectContextEntryRepo;
10
9
  timeProvider: TimeProvider;
11
10
  };
@@ -1,16 +1,16 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import { ResourceConflictError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
5
  import { type WorkItemContract, type UpsertWorkItemInput, type UpsertWorkItemsInput } from "../contracts/work-item-contracts";
5
6
  import type { WorkItemRepo } from "./work-item-repo";
6
7
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
7
8
  type CreateWorkItemsDeps = {
8
- userId: UuidV7;
9
- authz: AuthorizationService;
9
+ userAuthz: UserAuthorizationService;
10
10
  workItemRepo: WorkItemRepo;
11
11
  timeProvider: TimeProvider;
12
12
  dbExecutor?: DbExecutor | undefined;
13
13
  };
14
- export declare const createWorkItems: (input: UpsertWorkItemsInput, deps: CreateWorkItemsDeps) => Promise<WorkItemContract[]>;
15
- export declare const createWorkItem: (input: UpsertWorkItemInput, deps: CreateWorkItemsDeps) => Promise<WorkItemContract>;
14
+ export declare const createWorkItems: (input: UpsertWorkItemsInput, deps: CreateWorkItemsDeps) => Promise<Result<WorkItemContract[], ResourceConflictError>>;
15
+ export declare const createWorkItem: (input: UpsertWorkItemInput, deps: CreateWorkItemsDeps) => Promise<Result<WorkItemContract, ResourceConflictError>>;
16
16
  export {};
@@ -1,14 +1,14 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
5
  import type { WorkItemRepo } from "./work-item-repo";
5
6
  import { type DeleteWorkItemInput, type DeleteWorkItemsInput } from "../contracts/work-item-contracts";
6
7
  type DeleteWorkItemsDeps = {
7
- userId: UuidV7;
8
- authz: AuthorizationService;
8
+ userAuthz: UserAuthorizationService;
9
9
  workItemRepo: WorkItemRepo;
10
10
  dbExecutor?: DbExecutor;
11
11
  };
12
- export declare const deleteWorkItems: (input: DeleteWorkItemsInput, deps: DeleteWorkItemsDeps) => Promise<number>;
13
- export declare const deleteWorkItem: (input: DeleteWorkItemInput, deps: DeleteWorkItemsDeps) => Promise<number>;
12
+ export declare const deleteWorkItems: (input: DeleteWorkItemsInput, deps: DeleteWorkItemsDeps) => Promise<Result<number, ResourceNotFoundError>>;
13
+ export declare const deleteWorkItem: (input: DeleteWorkItemInput, deps: DeleteWorkItemsDeps) => Promise<Result<number, ResourceNotFoundError>>;
14
14
  export {};
@@ -1,14 +1,14 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import { ResourceNotFoundError } from "@boboddy/core/lib/errors";
3
+ import { Result } from "@boboddy/core/lib/result";
4
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
5
  import type { WorkItemRepo } from "./work-item-repo";
5
6
  import { type GetWorkItemInput, type GetWorkItemsInput, type WorkItemContract } from "../contracts/work-item-contracts";
6
7
  type GetWorkItemsDeps = {
7
- userId: UuidV7;
8
- authz: AuthorizationService;
8
+ userAuthz: UserAuthorizationService;
9
9
  workItemRepo: WorkItemRepo;
10
10
  dbExecutor?: DbExecutor;
11
11
  };
12
- export declare const getWorkItems: (input: GetWorkItemsInput, deps: GetWorkItemsDeps) => Promise<WorkItemContract[]>;
13
- export declare const getWorkItem: (input: GetWorkItemInput, deps: GetWorkItemsDeps) => Promise<WorkItemContract>;
12
+ export declare const getWorkItems: (input: GetWorkItemsInput, deps: GetWorkItemsDeps) => Promise<Result<WorkItemContract[], ResourceNotFoundError>>;
13
+ export declare const getWorkItem: (input: GetWorkItemInput, deps: GetWorkItemsDeps) => Promise<Result<WorkItemContract, ResourceNotFoundError>>;
14
14
  export {};
@@ -1,11 +1,13 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import { type UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
3
+ import { Result } from "@boboddy/core/lib/result";
3
4
  import type { WorkItemRepo } from "./work-item-repo";
4
5
  import type { ProjectRepo } from "@boboddy/core/projects/project/application/project-repo";
5
6
  import type { WorkItemContract } from "../contracts/work-item-contracts";
6
- export declare const listWorkItemsByProject: (input: string, { userId, projectRepo, workItemRepo, dbExecutor, }: {
7
- userId: UuidV7;
7
+ import type { ResourceNotFoundError } from "@boboddy/core/lib/errors";
8
+ export declare const listWorkItemsByProject: (input: string, { userAuthz, projectRepo, workItemRepo, dbExecutor, }: {
9
+ userAuthz: UserAuthorizationService;
8
10
  projectRepo: ProjectRepo;
9
11
  workItemRepo: WorkItemRepo;
10
12
  dbExecutor?: DbExecutor;
11
- }) => Promise<WorkItemContract[]>;
13
+ }) => Promise<Result<WorkItemContract[], ResourceNotFoundError>>;
@@ -1,12 +1,10 @@
1
1
  import type { DbExecutor } from "@boboddy/core/lib/db/db-executor";
2
- import type { UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
3
- import type { AuthorizationService } from "@boboddy/core/access/authorization/application/authorization-service";
2
+ import type { UserAuthorizationService } from "@boboddy/core/access/authorization/application/user-authorization-service";
4
3
  import { type WorkItemContract, type UpsertWorkItemInput, type UpsertWorkItemsInput } from "../contracts/work-item-contracts";
5
4
  import type { WorkItemRepo } from "./work-item-repo";
6
5
  import type { TimeProvider } from "@boboddy/core/lib/time-provider";
7
6
  type UpsertWorkItemsDeps = {
8
- userId: UuidV7;
9
- authz: AuthorizationService;
7
+ userAuthz: UserAuthorizationService;
10
8
  workItemRepo: WorkItemRepo;
11
9
  timeProvider: TimeProvider;
12
10
  dbExecutor?: DbExecutor | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@boboddy/sdk",
4
- "version": "0.0.9-alpha",
4
+ "version": "0.0.10-alpha",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -39,7 +39,6 @@
39
39
  "typecheck": "tsc -p tsconfig.json --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@boboddy/core": "workspace:*",
43
42
  "@elysiajs/eden": "^1.4.9"
44
43
  },
45
44
  "peerDependencies": {
@@ -1,18 +0,0 @@
1
- import { type UuidV7 } from "@boboddy/core/common/contracts/uuid-v7";
2
- import type { AppContext } from "@boboddy/core/lib/di";
3
- import type { ProjectPermission } from "@boboddy/core/projects/project/domain/project-permission";
4
- type MaybePromise<T> = T | Promise<T>;
5
- type AuthenticatedContext = {
6
- auth: {
7
- userId: UuidV7;
8
- };
9
- body?: unknown;
10
- params?: unknown;
11
- query?: unknown;
12
- };
13
- type ProjectPermissionDeclaration<TContext> = {
14
- permission: ProjectPermission;
15
- projectId: (context: TContext) => MaybePromise<UuidV7 | string | readonly (UuidV7 | string)[]>;
16
- };
17
- export declare const withProjectPermission: <TContext extends AuthenticatedContext, TResult>(appContext: AppContext, declaration: ProjectPermissionDeclaration<TContext>, handler: (context: TContext) => MaybePromise<TResult>) => (context: TContext) => Promise<TResult>;
18
- export {};