Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate CLI to use fabric #47

Merged
merged 23 commits into from
Sep 30, 2024
Merged

Migrate CLI to use fabric #47

merged 23 commits into from
Sep 30, 2024

Conversation

paulobressan
Copy link
Member

Close #44

falcucci and others added 23 commits August 1, 2024 22:03
- add `dmtri` as a dependency with `main` branch
- add `tonic` as a dependency
- update `context` `namespace` field
- update `context` `auth` field
- update `cloud` `default` implementation
- update `cloud` definition
- update `operator` definition
- modify `existing` project output
- use `proto` namespace in `project.rs`
- update `projectoption` struct
- modify projects retrieval in `define_project`
- add `rpc` module
- add `rpc/auth/mod.rs`
- add `rpc/projects/mod.rs`
- add `rpc/auth/interceptor` function
- add `rpc/projects/find_projects` function
- update the `namespace` field in `extract_context_data` function to use `cli.context.as_ref().unwrap().project.namespace` instead of `cli.context.as_ref().unwrap().namespace.name`
- add `debug` trait to the `config` struct
- change the `context` struct to use `project` instead of `namespace` field
- update the `context` struct constructor to use `project` instead of `namespace`
- remove the `namespace` struct and replace it with the `project` struct
- add debugging prints in the `load_config` function
- change the `run` function in `manual.rs` to use `project.namespace` instead of `namespace`
- update the `import_context` function to print the `project.namespace`
- update the `import_context` function to use `project` struct instead of `namespace` struct
- update the `display` implementation in `contextoption` to use `x.project.namespace` instead of `x.namespace.namespace`
- change the `import_context` function to use `project.namespace` instead of `project.name`
- update the context print statements in the `run` function
- replace the `parse_project_ref` function in `project.rs` with a `todo!()` placeholder
- update the `define_project` function in `project.rs` to use `parse_project_ref` with two arguments
- update the lambda function inside `define_project` to handle `project` struct with
- rename `src/core.rs` to `src/context.rs`
- update references from `core` to `context`
- remove `serde::deserialize` and `serde::serialize` implementations from `src/init/project.rs`
- create `src/rpc` module
- move `src/rpc/auth` to `src/rpc/projects/mod.rs`
- add `get_base_url` function to `src/rpc/mod.rs`
- rename `init` folder to `src/init`
- add a new function `ephemeral` with an additional `access_token` parameter in `context`
- add a new field `id` to `project` struct
- add a new field `access_token` to `auth` struct
- change the parameters in `api_key` method of `auth`
- remove a debug print statement in `load_config` function
- add a new parameter `access_token` in `infer_context` function
- add a new function `extract_context_data` in `init/mod.rs`
- change parameters in `run` function in `init/manual.rs`
- add a new field `id` to `args` struct in `init/mod.rs`
- add a new parameter `access_token` in `import_context` function in `init/project.rs`
- add a new function `parse_project_ref` and change its parameters in `project.rs`
- change the function name `find_projects` to `find_all` in `rpc/projects/mod.rs`
- add a new function `find` in `rpc/resources/mod.rs`
- remove the file `src/rpc/resource/mod.rs` and add a new file `src/rpc/resources/mod.rs`
- add new function `extract_context_data` in the `create.rs` file
- add new function `pretty_print_ports_table` in the `create.rs` file
- comment out parts of code related to `kind_options` and `options` in the `create.rs` file
- add new function `create` in the `resources/mod.rs` file
…ntly

- update the code to use the `kinds` variable instead of calling the `map` function on `kind_options`
- update the code to pass `&kind` instead of `kind` when calling the `api::get_public` function
- update the code to use the `network_options` variable when calling the `inquire::select` constructor
- update the code to use the `payload_network` variable when calling the `options.get_network_versions` function
- update the code to use the `network_versions` variable when checking if it is empty
- update the code to pass `&payload_network` and `&selected_version` when calling the `options.find_version_label_by_number` function
- update the code to use the `tier_options` variable when calling the `inquire::select` constructor
- update the code to pass `&selected_tier` when calling the `options.find_tier_key_by_value` function
- update the code to print the `selected_network`, `selected_version`, and `selected_tier` variables instead of the commented out lines in `println!` statements
- change the code to pass `&kind` when calling the `rpc::resources::create` function
- update api key creation to use the new `rpc` module
- update the project id in the `import_context` function
- add new `create_secret` function in the `rpc/projects` module
- change `networks` and `tiers` from `indexmap` to `vec`
- simplify `find_network_key_by_value` and `find_tier_key_by_value` functions
- use `hashmap<string, portoptions>` in `create.rs` instead of `vec<resource>`
- refactor `account.rs` file, removed functions `get`, `create_api_key`, `create_project`
- simplify code in `mod.rs`, removed function `create_port`
- remove unused function references in `context.rs`
- clean up imports in `project.rs` file
- update `create.rs` file, removed `resource` import, simplified code
- simplify `auth/mod.rs`, removed `status` import
- update the `pretty_print_ports_table` import in `create.rs`
- remove an unnecessary import in `delete.rs`
- update the `tonic` dependency to include additional features
- modify the `nodeportinstance` struct in `src/api/mod.rs` to include a new field `kind`
- refactor the `get_tiers` method in `portoptions` to return values using `.values()` and `.cloned()`
- revise the `find_tier_key_by_value` method in `portoptions` to use `find_map` with a closure
- update the `run` function in `src/ports/create.rs` to correctly access the `kind` value
- update the `run` function in `src/ports/create.rs` to correctly access the `network_options` value
- update the `run` function in `src/ports/create.rs` to correctly access the `network_versions` value
- update the `run` function in `src/ports/create.rs` to correctly access the `tier_options` value
- refactor the `delete.rs` file in `src/ports/delete.rs` to use the `rpc` module instead of `api`
- update the `pretty_print_ports_table` function in `src/ports/format.rs` to print the `spec` field of the port
- implement the `delete` function in `rpc/resources/mod.rs` to use new parameters and interactions.
- update `lib/index.js` to include initializing `api_key` and `project_id` from `extract_context_data`
- remove unnecessary log statements from `ports/delete.rs`
- change `rpc::resources::delete` to take `api_key` and `project_id` arguments in `ports/delete.rs`
- add `secret`, `projectid`, and `credential` enum types in `rpc/auth/mod.rs`
- modify `interceptor` function in `rpc/auth/mod.rs` to use `credential` enum instead of `access_token`
- replace `auth::interceptor` calls with `auth::credential` creation in `rpc/projects/mod.rs`
- replace `auth::interceptor` calls with `auth::credential` creation in `rpc/resources/mod.rs`
- update `rpc/resources::delete` to take `project_id` and `id` instead of `id` and `kind`
- update the `infer_context` function in `context.rs` to remove the `access_token` return value
- update the `run` function in `create.rs`, `delete.rs`, and `list.rs` to replace the `access_token` usage with `api_key`
- update the `find` and `create` functions in `resources/mod.rs` to use the `project_id` and `api_key` instead of `access_token`
…unctions

- update `ephemeral` method signature to exclude `access_token` parameter
- adjust `auth` struct by removing `access_token` field and updating `api_key` method
- refactor `infer_context` function to handle `access_token` separately
- modify `manual.rs` to remove `access_token` parameter in `run` function
- update `args` struct and `run` function in `mod.rs` to exclude `access_token`
- remove `access_token` from `args` struct and `main` function in `main.rs`
- change the enum variants from `postgresport`, `httpport`, and `nodeport` to `postgres`, `http`, and `node` respectively in `src/api/mod.rs`
- change the function call from `find_all` to `find` in `src/init/project.rs`
- refactor the match statements in `pretty_print_port` function in `src/ports/format.rs` to match the new enum variants
- change the enum variants from `nodeport` to `node` in `src/ports/tunnel.rs`
- change the function name from `find_all` to `find` in `src/rpc/projects/mod.rs`
- delete the `delete_port` function from the api module
- add `portinfolist` struct with optional fields
- change variable name `_payload_tier` to `payload_tier`
- add `serde_json` import
- update payload specification for resource creation in `src/ports/create.rs`
- update header content for pretty printed ports table in `src/ports/format.rs`
- deserialize `port.spec` to `portinfolist` for printing
- modify `spec` fields added to printed table rows in `src/ports/format.rs`
- update `spec` parameter in `rpc::resources::create` in `src/rpc/resources/mod.rs`
- change the `pretty print ports table` function to match a different header
- remove unnecessary code comments
- add more functionality to the `run` function in `show.rs`
- update the base url in the `src/rpc/mod.rs` file
- add a new `find_by_id` function in the `src/rpc/resources/mod.rs` file
- revise the `knownfield` enum in the `src/utils.rs` file
- remove the `async fn get_public<t>` function from `src/api/mod.rs`
- modify `async fn get<t>` function in `src/api/mod.rs`
- update the `portinfolist` struct by adding an `auth_token` field and a `port` field
- remove the async function `get` and the function `extract_context_data`
- modify the `nodeoption` struct to use a `resource` instead of a `portinfo`
- modify the `define_socket_path` function to use `portinfolist` instead of `portinfo`
- update the `define_port` function to return a `resource` instead of a `portinfo` and change the logic for retrieving available ports
- parse the `spec` field in the `run` function as `portinfolist` instead of `instance` and make use of the `auth_token` field from the `spec` object
- modify the `hostname` variable assignment to use the `auth_token` from the `spec` object in the `run` function
- update the `socket_path` definition to use the `spec` object in the `run` function
@paulobressan paulobressan merged commit 356a0d4 into main Sep 30, 2024
1 check passed
@paulobressan paulobressan deleted the feat/rpc-calls branch September 30, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate CLI to use fabric
2 participants