Skip to content
Open

Dev #78

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a2a1281
feat(storage): update storage requests to work with collection and ch…
thibaud-perrin Apr 30, 2025
404f6c6
Merge pull request #74 from DigitalKin-ai/feature/storage-db
thibaud-perrin Apr 30, 2025
3f58ca5
feat(setup): add list setups method in setup service
bbbouvier Apr 28, 2025
dd23175
Merge pull request #73 from DigitalKin-ai/feature/list-setups
thibaud-perrin May 6, 2025
078aef8
feat(cost): change to cost_type and add filter
GuillaumeSachet Apr 18, 2025
2fa41e3
Merge pull request #75 from DigitalKin-ai/feature/cost
thibaud-perrin May 6, 2025
ee377b9
fix(cost): name is not unique dans getcost returns a list
GuillaumeSachet May 7, 2025
e5710ce
Merge pull request #76 from DigitalKin-ai/fix/cost
thibaud-perrin May 7, 2025
1ad1993
feat(setup-lifecycle): add config rpc
xaviave May 23, 2025
6e4cbd2
Merge pull request #77 from DigitalKin-ai/feature/101-setup-lifecycle
xaviave May 27, 2025
2032e6d
refactor(filesystem): replace data.proto with filesystem.proto and en…
GuillaumeSachet Jun 3, 2025
ae4a6c0
Merge pull request #80 from DigitalKin-ai/feature/update-filesystem
thibaud-perrin Jun 3, 2025
500b638
refactor(filesystem): update UpdateFileRequest message to replace 'na…
GuillaumeSachet Jun 4, 2025
8ad09c0
Merge pull request #82 from DigitalKin-ai/refactor/filesystem
GuillaumeSachet Jun 4, 2025
3be2b26
refactor(filesystem): remove ListFiles RPC and update file messages f…
GuillaumeSachet Jun 4, 2025
8f1371a
Merge pull request #83 from DigitalKin-ai/fix/filesystem
digitalkin-dev Jun 4, 2025
7006925
refactor(filesystem): rename 'id' to 'file_id' in File message and up…
GuillaumeSachet Jun 5, 2025
e983853
Merge pull request #84 from DigitalKin-ai/refactor/filesystem
GuillaumeSachet Jun 5, 2025
796038f
refactor(filesystem): rename 'storage_url' to 'storage_uri' and add '…
bbbouvier Jul 11, 2025
fd784a8
Merge pull request #85 from DigitalKin-ai/feat/file-url
thibaud-perrin Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Usage

### Generate clients with [buf](https://buf.build/):
### Generate clients with [buf](https://buf.build/)

Ensure [buf](https://buf.build/docs/installation) and [protoc](https://grpc.io/docs/protoc-installation/) are installed on your system.

```sh
buf dep update ./proto
```

#### Rust (tonic):
#### Rust (tonic)

##### Dependencies:
##### Dependencies

Install "protoc-gen-\*" with cargo.

Expand All @@ -22,7 +22,7 @@ cargo install protoc-gen-prost-crate
cargo install protoc-gen-tonic
```

##### Generate:
##### Generate

```sh
buf generate proto --template proto/buf.gen.rust.yaml
Expand All @@ -32,17 +32,17 @@ buf generate proto --template proto/buf.gen.rust.yaml

Outputs will be in out/ directory.

#### Typescript in Browser:
#### Typescript in Browser

##### Dependencies:
##### Dependencies

Install "protoc-gen-\*" with npm.

```sh
npm install -g ts-proto
```

##### Generate:
##### Generate

```sh
buf generate proto --template proto/buf.gen.ts.yaml
Expand All @@ -54,15 +54,15 @@ Outputs will be in services/ directory.

### Proto linter

#### Dependencies:
#### Dependencies

Install protolint with npx.

```sh
npx protolint
```

#### Lint:
#### Lint

```sh
protolint lint proto
Expand All @@ -79,8 +79,11 @@ When using "vscode-proto3" extention in VS Code, add the following to the '.vsco
}
}
```

## Optionals

how to select only specific proto, use `--path` args

```sh
buf generate proto --template service-apis/proto/buf.gen.py.yaml -o gen --path service-apis/proto/digitalkin/kin --path service-apis/proto/google
```
```
74 changes: 41 additions & 33 deletions proto/digitalkin/cost/v1/cost.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ message Cost {
double cost = 1 [(buf.validate.field).required = true];
// mission_id: Mission ID linked to the cost
string mission_id = 2 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
// name: Name of the cost (unique by mission_id)
// name: Name of the cost
string name = 3 [(buf.validate.field).required = true];
// type: Type of the cost
CostType type = 4 [(buf.validate.field).required = true];
// cost_type: Type of the cost
CostType cost_type = 4 [(buf.validate.field).required = true];
// unit: Unit of the cost
string unit = 5 [(buf.validate.field).required = true];
// rate: Rate of the cost
double rate = 6 [(buf.validate.field).required = true];
// setup_version_id: Setup version ID linked to the cost
string setup_version_id = 7 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "setup_versions:"];
// quantity: Quantity of the cost
double quantity = 8 [(buf.validate.field).required = true];
}

// AddCostRequest: Request to add a cost
Expand All @@ -54,56 +60,58 @@ message AddCostRequest {
double cost = 1 [(buf.validate.field).required = true];
// mission_id: Mission ID linked to the cost
string mission_id = 2 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
// name: Name of the cost (unique by mission_id)
// name: Name of the cost
string name = 3 [(buf.validate.field).required = true];
// type: Type of the cost
CostType type = 4 [(buf.validate.field).required = true];
// cost_type: Type of the cost
CostType cost_type = 4 [(buf.validate.field).required = true];
// unit: Unit of the cost
string unit = 5 [(buf.validate.field).required = true];
// rate: Rate of the cost
double rate = 6 [(buf.validate.field).required = true];
// setup_version_id: Setup version ID linked to the cost
string setup_version_id = 7 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "setup_versions:"];
// quantity: Quantity of the cost
double quantity = 8 [(buf.validate.field).required = true];
}

// AddCostResponse: Response to added cost
message AddCostResponse {
// success: Success of the operation
bool success = 1 [(buf.validate.field).required = true];
}

// GetCostsByMissionRequest: Request to get costs by mission
message GetCostsByMissionRequest {
// mission_id: Mission ID linked to the cost
string mission_id = 1 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
}

// GetCostsByMissionResponse: Response to get costs by mission
message GetCostsByMissionResponse {
// costs: Costs
repeated Cost costs = 1 [(buf.validate.field).required = true];
// CostFilter: Filter criteria for costs
message CostFilter {
// names: Filter costs by one or more names
repeated string names = 1;

// cost_types: Filter costs by cost types
repeated CostType cost_types = 2;
}

// GetCostsByNameRequest: Request to get costs by name
message GetCostsByNameRequest {
// GetCostsRequest: Request to get multiple costs
message GetCostsRequest {
// mission_id: Mission ID linked to the cost
string mission_id = 1 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
// name: Name of the cost (unique by mission_id)
string name = 2 [(buf.validate.field).required = true];
// filter: Filter criteria for costs
CostFilter filter = 2;
}

// GetCostsByNameResponse: Response to get costs by name
message GetCostsByNameResponse {
// costs: Costs
repeated Cost costs = 1 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
// GetCostsResponse: Response to get multiple costs
message GetCostsResponse {
// costs: List of cost
repeated Cost costs = 1 [(buf.validate.field).required = true];
}

// GetCostsByTypeRequest: Request to get costs by type
message GetCostsByTypeRequest {
// GetCostRequest: Request to get cost by name
message GetCostRequest {
// mission_id: Mission ID linked to the cost
string mission_id = 1 [(buf.validate.field).required = true, (buf.validate.field).string.prefix = "missions:"];
// type: Type of the cost
CostType type = 2 [(buf.validate.field).required = true];
// name: Name of the cost
string name = 2 [(buf.validate.field).required = true];
}

// GetCostsByTypeResponse: Response to get costs by type
message GetCostsByTypeResponse {
// costs: Costs
// GetCostResponse: Response to get cost by name
message GetCostResponse {
// costs: List of cost
repeated Cost costs = 1 [(buf.validate.field).required = true];
}
}
11 changes: 4 additions & 7 deletions proto/digitalkin/cost/v1/cost_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ service CostService {
// AddCost: Add a cost
rpc AddCost (AddCostRequest) returns (AddCostResponse);

// GetCostsByMission: Get a cost by Mission ID
rpc GetCostsByMission (GetCostsByMissionRequest) returns (GetCostsByMissionResponse);
// GetCost: Get a cost
rpc GetCost (GetCostRequest) returns (GetCostResponse);

// GetCostsByName: Get costs by name
rpc GetCostsByName (GetCostsByNameRequest) returns (GetCostsByNameResponse);

// GetCostsByType: Get costs by type
rpc GetCostsByType (GetCostsByTypeRequest) returns (GetCostsByTypeResponse);
// GetCosts: Get all costs with filters
rpc GetCosts (GetCostsRequest) returns (GetCostsResponse);
}
123 changes: 0 additions & 123 deletions proto/digitalkin/filesystem/v1/data.proto

This file was deleted.

Loading