diff --git a/api-collection/Api Key Controller/Can access live updates.bru b/api-collection/Api Key Controller/Can access live updates.bru new file mode 100644 index 00000000..f6606e2e --- /dev/null +++ b/api-collection/Api Key Controller/Can access live updates.bru @@ -0,0 +1,36 @@ +meta { + name: Can access live updates + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/api-key/access/live-updates + body: none + auth: apikey +} + +auth:apikey { + key: x-keyshade-token + value: {{vault:API_KEY}} + placement: header +} + +docs { + ## Description + + This endpoint is specific to the keyshade CLI. In order for `keyshade run` to be successful, it needs to check that the API key has access to the following authorities or not: + + - `READ_WORKSPACE` + + - `READ_PROJECT` + + - `READ_ENVIRONMENT` + + - `READ_SECRET` + + - `READ_VARIABLE` + + + If this is satisfied, the client can proceed. +} diff --git a/api-collection/Api Key Controller/Create API key.bru b/api-collection/Api Key Controller/Create API key.bru new file mode 100644 index 00000000..2e39b13a --- /dev/null +++ b/api-collection/Api Key Controller/Create API key.bru @@ -0,0 +1,43 @@ +meta { + name: Create API key + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/api-key + body: json + auth: bearer +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "My key", + "authorities": [ + "READ_API_KEY", + "READ_WORKSPACE", + "READ_PROJECT", + "READ_ENVIRONMENT", + "READ_VARIABLE", + "READ_SECRET" + ] + } +} + +docs { + ## Description + + Allows users to create an API key that allows them to access keyshade API using any REST client. + + ### Request Body + + - `name`: The name of the API key + + - `expiresAfter`: (Optional) The amount of time after which the API key will expire. Defaults to \`never\`. Accepts: `'24' | '168' | '720' | '8760'`. Durations are in hours. + + - `authorities`: (Optional) An array of authorities that are allowed for this API key. Defaults to \`\[\]\` +} diff --git a/api-collection/Api Key Controller/Delete API key.bru b/api-collection/Api Key Controller/Delete API key.bru new file mode 100644 index 00000000..1ef5b5f4 --- /dev/null +++ b/api-collection/Api Key Controller/Delete API key.bru @@ -0,0 +1,25 @@ +meta { + name: Delete API key + type: http + seq: 6 +} + +delete { + url: {{BASE_URL}}/api/api-key/:api_key_slug + body: none + auth: bearer +} + +params:path { + api_key_slug: my-key-zxvie +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes an API key +} diff --git a/api-collection/Api Key Controller/Get API key.bru b/api-collection/Api Key Controller/Get API key.bru new file mode 100644 index 00000000..c71c6d47 --- /dev/null +++ b/api-collection/Api Key Controller/Get API key.bru @@ -0,0 +1,25 @@ +meta { + name: Get API key + type: http + seq: 3 +} + +get { + url: {{BASE_URL}}/api/api-key/:api_key_slug + body: none + auth: bearer +} + +params:path { + api_key_slug: my-key-zxvies +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetch an API key by its slug. +} diff --git a/api-collection/Api Key Controller/Get API keys.bru b/api-collection/Api Key Controller/Get API keys.bru new file mode 100644 index 00000000..b7ac5195 --- /dev/null +++ b/api-collection/Api Key Controller/Get API keys.bru @@ -0,0 +1,21 @@ +meta { + name: Get API keys + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/api-key + body: none + auth: bearer +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all the API keys +} diff --git a/api-collection/Api Key Controller/Update API key.bru b/api-collection/Api Key Controller/Update API key.bru new file mode 100644 index 00000000..fb3140a5 --- /dev/null +++ b/api-collection/Api Key Controller/Update API key.bru @@ -0,0 +1,49 @@ +meta { + name: Update API key + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/api-key/:api_key_slug + body: json + auth: bearer +} + +params:path { + api_key_slug: my-key-2 +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "authorities": [ + "READ_API_KEY", + "READ_WORKSPACE", + "READ_PROJECT", + "READ_ENVIRONMENT", + "READ_VARIABLE", + "READ_SECRET", + "CREATE_WORKSPACE", + "UPDATE_WORKSPACE", + "DELETE_WORKSPACE", + "WORKSPACE_ADMIN" + ] + } +} + +docs { + ## Description + + Allows users to update an API key. + + ### Request Body + + - `name`: (Optional) The name of the API key. Note that, changing the name would also change the slug of the api key. + + - `expiresAfter`: (Optional) The amount of time after which the API key will expire. Defaults to \`never\`. Accepts: `'24' | '168' | '720' | '8760'`. Durations are in hours. + - `authorities`: (Optional) An array of authorities that are allowed for this API key. Defaults to \`\[\]\` +} diff --git a/api-collection/Api Key Controller/bruno.json b/api-collection/Api Key Controller/bruno.json new file mode 100644 index 00000000..33ebab58 --- /dev/null +++ b/api-collection/Api Key Controller/bruno.json @@ -0,0 +1,6 @@ +{ + "version": "1", + "name": "Api Key Controller", + "type": "collection", + "ignore": ["node_modules", ".git"] +} diff --git a/api-collection/Api Key Controller/collection.bru b/api-collection/Api Key Controller/collection.bru new file mode 100644 index 00000000..310c2040 --- /dev/null +++ b/api-collection/Api Key Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Api Kei Controller +} + +auth { + mode: none +} diff --git a/api-collection/Auth Controller/GitHub auth.bru b/api-collection/Auth Controller/GitHub auth.bru new file mode 100644 index 00000000..dec6084a --- /dev/null +++ b/api-collection/Auth Controller/GitHub auth.bru @@ -0,0 +1,15 @@ +meta { + name: GitHub auth + type: http + seq: 3 +} + +get { + url: {{BASE_URL}}/api/auth/github + body: none + auth: none +} + +docs { + This endpoint validates Github OAuth. If the OAuth is valid, it returns a valid token along with the user details +} diff --git a/api-collection/Auth Controller/GitLab auth.bru b/api-collection/Auth Controller/GitLab auth.bru new file mode 100644 index 00000000..7a8ad189 --- /dev/null +++ b/api-collection/Auth Controller/GitLab auth.bru @@ -0,0 +1,15 @@ +meta { + name: GitLab auth + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/auth/gitlab + body: none + auth: none +} + +docs { + This endpoint validates GitLab OAuth. If the OAuth is valid, it returns a valid token along with the user details +} diff --git a/api-collection/Auth Controller/Google auth.bru b/api-collection/Auth Controller/Google auth.bru new file mode 100644 index 00000000..ae771043 --- /dev/null +++ b/api-collection/Auth Controller/Google auth.bru @@ -0,0 +1,15 @@ +meta { + name: Google auth + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/auth/google + body: none + auth: none +} + +docs { + This endpoint validates Google OAuth. If the OAuth is valid, it returns a valid token along with the user details +} diff --git a/api-collection/Auth Controller/Send OTP.bru b/api-collection/Auth Controller/Send OTP.bru new file mode 100644 index 00000000..4cc5c8f2 --- /dev/null +++ b/api-collection/Auth Controller/Send OTP.bru @@ -0,0 +1,25 @@ +meta { + name: Send OTP + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/auth/send-otp/:email + body: none + auth: none +} + +params:query { + ~: +} + +params:path { + email: rajdip@keyshade.xyz +} + +docs { + ## Description + + This endpoint sends OTPs to an email address. The OTP can then be used to generate valid tokens +} diff --git a/api-collection/Auth Controller/Validate OTP.bru b/api-collection/Auth Controller/Validate OTP.bru new file mode 100644 index 00000000..bfb7da61 --- /dev/null +++ b/api-collection/Auth Controller/Validate OTP.bru @@ -0,0 +1,22 @@ +meta { + name: Validate OTP + type: http + seq: 2 +} + +post { + url: {{BASE_URL}}/api/auth/validate-otp?email=rajdip@keyshade.xyz&otp=774626 + body: none + auth: none +} + +params:query { + email: rajdip@keyshade.xyz + otp: 774626 +} + +docs { + ## Description + + This endpoint validates OTPs. If the OTP is valid, it returns a valid token along with the user details +} diff --git a/api-collection/Auth Controller/bruno.json b/api-collection/Auth Controller/bruno.json new file mode 100644 index 00000000..b096bf3b --- /dev/null +++ b/api-collection/Auth Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Auth Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Auth Controller/collection.bru b/api-collection/Auth Controller/collection.bru new file mode 100644 index 00000000..8f21b1fa --- /dev/null +++ b/api-collection/Auth Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Auth Controller +} + +auth { + mode: none +} diff --git a/api-collection/Environment Controller/Create environment.bru b/api-collection/Environment Controller/Create environment.bru new file mode 100644 index 00000000..dd99fb79 --- /dev/null +++ b/api-collection/Environment Controller/Create environment.bru @@ -0,0 +1,37 @@ +meta { + name: Create environment + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/environment/:project_slug + body: json + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Alpha" + } +} + +docs { + ## Description + + Creates an environment under a particular project. + + ### Request Body + + - `name`: The name of the environment. Should be unique in the project. + + - `description`: (Optional) An optional description about the environment. +} diff --git a/api-collection/Environment Controller/Delete environment.bru b/api-collection/Environment Controller/Delete environment.bru new file mode 100644 index 00000000..d93bd356 --- /dev/null +++ b/api-collection/Environment Controller/Delete environment.bru @@ -0,0 +1,19 @@ +meta { + name: Delete environment + type: http + seq: 5 +} + +delete { + url: {{BASE_URL}}/api/environment/:environment_slug + body: none + auth: bearer +} + +params:path { + environment_slug: +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Environment Controller/Get all environments of project.bru b/api-collection/Environment Controller/Get all environments of project.bru new file mode 100644 index 00000000..344d5fda --- /dev/null +++ b/api-collection/Environment Controller/Get all environments of project.bru @@ -0,0 +1,25 @@ +meta { + name: Get all environments of project + type: http + seq: 3 +} + +get { + url: {{BASE_URL}}/api/environment/all/:project_slug + body: none + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all the environments of a project. +} diff --git a/api-collection/Environment Controller/Get environment by slug.bru b/api-collection/Environment Controller/Get environment by slug.bru new file mode 100644 index 00000000..577c85e7 --- /dev/null +++ b/api-collection/Environment Controller/Get environment by slug.bru @@ -0,0 +1,25 @@ +meta { + name: Get environment by slug + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/environment/:environment_slug + body: none + auth: bearer +} + +params:path { + environment_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches a single environment by its ID. +} diff --git a/api-collection/Environment Controller/Update environment.bru b/api-collection/Environment Controller/Update environment.bru new file mode 100644 index 00000000..a14ee546 --- /dev/null +++ b/api-collection/Environment Controller/Update environment.bru @@ -0,0 +1,37 @@ +meta { + name: Update environment + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/environment/:environment_slug + body: json + auth: bearer +} + +params:path { + environment_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Beta" + } +} + +docs { + ## Description + + Creates an environment under a particular project. + + ### Request Body + + - `name`: (Optional) The name of the environment. Should be unique in the project. + + - `description`: (Optional) An optional description about the environment. +} diff --git a/api-collection/Environment Controller/bruno.json b/api-collection/Environment Controller/bruno.json new file mode 100644 index 00000000..9e89d3bc --- /dev/null +++ b/api-collection/Environment Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Environment Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Environment Controller/collection.bru b/api-collection/Environment Controller/collection.bru new file mode 100644 index 00000000..d68e9936 --- /dev/null +++ b/api-collection/Environment Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Environment Controller +} + +auth { + mode: none +} diff --git a/api-collection/Event Controller/Get all events.bru b/api-collection/Event Controller/Get all events.bru new file mode 100644 index 00000000..24222fc4 --- /dev/null +++ b/api-collection/Event Controller/Get all events.bru @@ -0,0 +1,24 @@ +meta { + name: Get all events + type: http + seq: 1 +} + +get { + url: {{BASE_URL}}/api/event/:workspace_slug?item_slug=clti9uoo6000c109kw6orwh7u&source=WORKSPACE + body: none + auth: bearer +} + +params:query { + item_slug: clti9uoo6000c109kw6orwh7u + source: WORKSPACE +} + +params:path { + workspace_slug: +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Event Controller/bruno.json b/api-collection/Event Controller/bruno.json new file mode 100644 index 00000000..0a2cfbff --- /dev/null +++ b/api-collection/Event Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Event Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Event Controller/collection.bru b/api-collection/Event Controller/collection.bru new file mode 100644 index 00000000..e26ea6a5 --- /dev/null +++ b/api-collection/Event Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Event Controller +} + +auth { + mode: none +} diff --git a/api-collection/Integration Controller/Create integration.bru b/api-collection/Integration Controller/Create integration.bru new file mode 100644 index 00000000..cf35ad05 --- /dev/null +++ b/api-collection/Integration Controller/Create integration.bru @@ -0,0 +1,46 @@ +meta { + name: Create integration + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/integration/:workspace_slug + body: json + auth: bearer +} + +params:path { + workspace_slug: my-workspace-1lt4d +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Discord second", + "type": "DISCORD", + "notifyOn": ["WORKSPACE_UPDATED"], + "projectSlug": "project-1-uzukc", + "metadata": { + "webhookUrl": "{{vault:WEBHOOK_URL}}" + } + } +} + +docs { + ## Description + + Creates an integration that will be triggered when specific events happen. + + ### Request Body + + - `name`: The name of the integration + - `type`: Integration type. Refer to prisma schema to get the valid types + - `metadata`: Additional key value pairs that the integration might need. This varies with the integration types. + - `notifyOn`: (Optional) Array of events that should trigger this integration. Refer to prisma schema to get the valid types. + - `environmentId`: (Optional) If the integration should be triggered when an event in a specific environment. Can only be specified when `projectId` is specified + - `projectId`: (Optional) If the integration should be triggered when an event occured in a specific project. +} diff --git a/api-collection/Integration Controller/Delete integration.bru b/api-collection/Integration Controller/Delete integration.bru new file mode 100644 index 00000000..cb0c78aa --- /dev/null +++ b/api-collection/Integration Controller/Delete integration.bru @@ -0,0 +1,25 @@ +meta { + name: Delete integration + type: http + seq: 5 +} + +delete { + url: {{BASE_URL}}/api/integration/:integration_slug + body: none + auth: bearer +} + +params:path { + integration_slug: discord-second-ntbqs +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes an existing integration. +} diff --git a/api-collection/Integration Controller/Get all integrations of workspace.bru b/api-collection/Integration Controller/Get all integrations of workspace.bru new file mode 100644 index 00000000..0cc8681e --- /dev/null +++ b/api-collection/Integration Controller/Get all integrations of workspace.bru @@ -0,0 +1,25 @@ +meta { + name: Get all integrations of workspace + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/integration/all/:workspace_slug + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all integrations of a workspace. +} diff --git a/api-collection/Integration Controller/Get integration by slug.bru b/api-collection/Integration Controller/Get integration by slug.bru new file mode 100644 index 00000000..af3c27c9 --- /dev/null +++ b/api-collection/Integration Controller/Get integration by slug.bru @@ -0,0 +1,25 @@ +meta { + name: Get integration by slug + type: http + seq: 3 +} + +get { + url: {{BASE_URL}}/api/integration/:integrationId + body: none + auth: bearer +} + +params:path { + integrationId: clvvb5k5g000aqq6x0g0e55kb +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches an integration by its ID. +} diff --git a/api-collection/Integration Controller/Update integration.bru b/api-collection/Integration Controller/Update integration.bru new file mode 100644 index 00000000..2f0d4c9e --- /dev/null +++ b/api-collection/Integration Controller/Update integration.bru @@ -0,0 +1,45 @@ +meta { + name: Update integration + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/integration/:integration_slug + body: json + auth: bearer +} + +params:path { + integration_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "ABC" + } +} + +docs { + ## Description + + Updates an existing integration. Only specify those values that you would like to change. + + ### Request Body + + - `name`: (Optional) The name of the integration + + - `type`: (Optional) Integration type. Refer to prisma schema to get the valid types + + - `metadata`: (Optional) Additional key value pairs that the integration might need. This varies with the integration types. + + - `notifyOn`: (Optional) Array of events that should trigger this integration. Refer to prisma schema to get the valid types. + + - `environmentId`: (Optional) If the integration should be triggered when an event in a specific environment. Can only be specified when `projectId` is specified + + - `projectId`: (Optional) If the integration should be triggered when an event occured in a specific project. +} diff --git a/api-collection/Integration Controller/bruno.json b/api-collection/Integration Controller/bruno.json new file mode 100644 index 00000000..39a77a9e --- /dev/null +++ b/api-collection/Integration Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Integration Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Integration Controller/collection.bru b/api-collection/Integration Controller/collection.bru new file mode 100644 index 00000000..5fa12b9c --- /dev/null +++ b/api-collection/Integration Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Integration Controller +} + +auth { + mode: none +} diff --git a/api-collection/Misc/Health Checkup.bru b/api-collection/Misc/Health Checkup.bru new file mode 100644 index 00000000..64df7f93 --- /dev/null +++ b/api-collection/Misc/Health Checkup.bru @@ -0,0 +1,22 @@ +meta { + name: Health Checkup + type: http + seq: 1 +} + +get { + url: {{BASE_URL}}/api/health + body: none + auth: none +} + +docs { + This endpoint is used to check if the server is up and running + + **Response:** + + ``` + UP + + ``` +} diff --git a/api-collection/Misc/bruno.json b/api-collection/Misc/bruno.json new file mode 100644 index 00000000..d2d19326 --- /dev/null +++ b/api-collection/Misc/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Misc", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Misc/collection.bru b/api-collection/Misc/collection.bru new file mode 100644 index 00000000..539bc0fa --- /dev/null +++ b/api-collection/Misc/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Misc +} + +auth { + mode: none +} diff --git a/api-collection/Project Controller/Create project.bru b/api-collection/Project Controller/Create project.bru new file mode 100644 index 00000000..a61c39ac --- /dev/null +++ b/api-collection/Project Controller/Create project.bru @@ -0,0 +1,92 @@ +meta { + name: Create project + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/project/:workspace_slug + body: json + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Project 1", + "description": "Dummy project 1", + "storePrivateKey": true, + "environments": [ + { + "name": "Dev", + "description": "Development environment" + }, + { + "name": "Stage", + "description": "Staging environment" + }, + { + "name": "Production", + "description": "Production environment" + } + ] + } +} + +docs { + ## Description + + This endpoint is used to create projects under a certain workspace. + + ## Request + + ### Path variables + + - `workspace_id`: **(Required)** The ID of the workspace under which you want to create the project. You should have `CREATE_PROJECT` authority in this workspace to create a project. + + + ### Request body + + - `name`: **(Required)** The name of the project. Should be unique across the selected workspace. + - `description`: An optional description about the project. + - `storePrivateKey`: Whether to store the private key in the database or not. + - `environments`: An array of environments (see below) that you would like this project to have. + - `accessLevel`: **(Required)** Any of the three - `GLOBAL`, `INTERNAL`, `PRIVATE`. + + + #### Environment + + - `name`: **(Required)** The name of the environment. Should be unique in a project + - `description`: An optional desccription about the environment. + + + ## Response + + ``` json + { + "id": "6976dff6-b320-470c-86c5-eaceaed57625", + "name": "Project 1 - stores private key", + "description": "Dummy project 1", + "createdAt": "2024-05-21T11:14:41.253Z", + "updatedAt": "2024-05-21T11:14:41.253Z", + "publicKey": "040705dac3a3cf36031d4ddb08b084ecdcdfe78f678befe20365942b1005a24a067b83faeb1bda57044640070822a9021309ac5d4006e33058939ecbab7711550f", + "privateKey": "eb108b5ad73f22a82f347444871ccd9372ed93a4e88d66c01fd76f6f23c6527e", + "storePrivateKey": true, + "isDisabled": false, + "accessLevel": "PRIVATE", + "pendingCreation": false, + "isForked": false, + "lastUpdatedById": "clwgaaldo00016gia8n46jtas", + "workspaceId": "36f928f9-bb1e-41fc-a185-8e1099aad3f6", + "forkedFromId": null + } + + ``` +} diff --git a/api-collection/Project Controller/Delete project.bru b/api-collection/Project Controller/Delete project.bru new file mode 100644 index 00000000..18ccc9e8 --- /dev/null +++ b/api-collection/Project Controller/Delete project.bru @@ -0,0 +1,25 @@ +meta { + name: Delete project + type: http + seq: 9 +} + +delete { + url: {{BASE_URL}}/api/project/:project_slug + body: none + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes a specific project by its ID. +} diff --git a/api-collection/Project Controller/Fork project.bru b/api-collection/Project Controller/Fork project.bru new file mode 100644 index 00000000..6e7c7186 --- /dev/null +++ b/api-collection/Project Controller/Fork project.bru @@ -0,0 +1,39 @@ +meta { + name: Fork project + type: http + seq: 2 +} + +post { + url: {{BASE_URL}}/api/project/:project_slug/fork + body: json + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Forked stuff" + } +} + +docs { + ## Description + + Allows you to fork a public project into your account. Note that only projects that have \`accessLevel\` set to \`GLOBAL\` can be forked. + + ### Request Body + + - `workspaceId`: The ID of the workspace to fork the project into. If not specified, defaults to the default workspace of the user. + + - `name`: A custom name for the fork. Defaults to the actual project name. + + - `storePrivateKey`: Boolean field dictating whether to store the private key of the project or not. +} diff --git a/api-collection/Project Controller/Get all forks of project.bru b/api-collection/Project Controller/Get all forks of project.bru new file mode 100644 index 00000000..f68b06aa --- /dev/null +++ b/api-collection/Project Controller/Get all forks of project.bru @@ -0,0 +1,19 @@ +meta { + name: Get all forks of project + type: http + seq: 8 +} + +get { + url: {{BASE_URL}}/api/project/:project_slug/forks + body: none + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Project Controller/Get all projects of workspace.bru b/api-collection/Project Controller/Get all projects of workspace.bru new file mode 100644 index 00000000..2d6d6f73 --- /dev/null +++ b/api-collection/Project Controller/Get all projects of workspace.bru @@ -0,0 +1,19 @@ +meta { + name: Get all projects of workspace + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/project/all/:workspace_slug + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Project Controller/Get project by slug.bru b/api-collection/Project Controller/Get project by slug.bru new file mode 100644 index 00000000..f3e602e2 --- /dev/null +++ b/api-collection/Project Controller/Get project by slug.bru @@ -0,0 +1,19 @@ +meta { + name: Get project by slug + type: http + seq: 7 +} + +get { + url: {{BASE_URL}}/api/project/:project_slug + body: none + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Project Controller/Sync fork.bru b/api-collection/Project Controller/Sync fork.bru new file mode 100644 index 00000000..765cb746 --- /dev/null +++ b/api-collection/Project Controller/Sync fork.bru @@ -0,0 +1,35 @@ +meta { + name: Sync fork + type: http + seq: 5 +} + +put { + url: {{BASE_URL}}/api/project/:project_slug/fork?hardSync=true + body: none + auth: bearer +} + +params:query { + hardSync: true +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Forked projects can be synchronized with their parent project. This will pull down all the new data that has been added to the parent project into the forked project. Syncing will only work if the project was forked, and wasn't unlinked. + + There are two kinds of syncing possible: + + - Soft sync: This will only pull down the new data - secrets, variables and environments from the parent project, and will keep your existing data intact. + + - Hard sync: This is essentially a reset. Do then when you want a fresh copy of the parent project pulled into your fork. This will replace your data with the remote version. +} diff --git a/api-collection/Project Controller/Unlink fork parent.bru b/api-collection/Project Controller/Unlink fork parent.bru new file mode 100644 index 00000000..a2d3761b --- /dev/null +++ b/api-collection/Project Controller/Unlink fork parent.bru @@ -0,0 +1,25 @@ +meta { + name: Unlink fork parent + type: http + seq: 4 +} + +delete { + url: {{BASE_URL}}/api/project/:projectSlug/fork + body: none + auth: bearer +} + +params:path { + projectSlug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Removes a forked project's association to its parent. Doing this will make your forked project similar to a project of its own. You won't be able to use the sync functions. +} diff --git a/api-collection/Project Controller/Update project.bru b/api-collection/Project Controller/Update project.bru new file mode 100644 index 00000000..9efea5de --- /dev/null +++ b/api-collection/Project Controller/Update project.bru @@ -0,0 +1,45 @@ +meta { + name: Update project + type: http + seq: 3 +} + +put { + url: {{BASE_URL}}/api/project/:project_slug + body: json + auth: bearer +} + +params:path { + project_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "test" + } +} + +docs { + ## Description + + This endpoint is used to update a certain project. + + ## Request + + ### Path variables + + - `project_id`: **(Required)** The ID of the project that you want to update + + + ### Request body + + - `name`: The name of the project. Should be unique across the selected workspace. + - `description`: An optional description about the project. + - `storePrivateKey`: Whether to store the private key in the database or not. + - `accessLevel`: Any of the three - `GLOBAL`, `INTERNAL`, `PRIVATE`. +} diff --git a/api-collection/Project Controller/bruno.json b/api-collection/Project Controller/bruno.json new file mode 100644 index 00000000..414d2c98 --- /dev/null +++ b/api-collection/Project Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Project Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Project Controller/collection.bru b/api-collection/Project Controller/collection.bru new file mode 100644 index 00000000..dd1802d6 --- /dev/null +++ b/api-collection/Project Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Project Controller +} + +auth { + mode: none +} diff --git a/api-collection/Secret Controller/Create secret.bru b/api-collection/Secret Controller/Create secret.bru new file mode 100644 index 00000000..1a16f6e3 --- /dev/null +++ b/api-collection/Secret Controller/Create secret.bru @@ -0,0 +1,51 @@ +meta { + name: Create secret + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/secret/:project_slug + body: json + auth: bearer +} + +params:path { + project_slug: project-1-uzukc +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "API_KEY", + "entries": [ + { + "value": "ks_k23mg45kl6k76l", + "environmentSlug": "alpha-l7xvp" + } + ] + } +} + +docs { + ## Description + + This endpoint creates a secret along with optional values in a project. + + ### Request Body + + - `name`: Name of the secret. Must be unique across the project. + - `note`: (Optional) An optional note describing the usage of the secret. + - `rotateAfter`: (Optional) The duration in days after which the value of the secret should be rotated. Accepted values are \`24\`, \`168\`, \`720\`, \`8769\` and \`never\`. Defaults to \`never\`. + - `entries`: An array of values for the secret. + + + #### Entry object + + - `environmentSlug`: The environment under which you would like to add the value. + + - `value`: The string value. +} diff --git a/api-collection/Secret Controller/Delete secret.bru b/api-collection/Secret Controller/Delete secret.bru new file mode 100644 index 00000000..ed3d4622 --- /dev/null +++ b/api-collection/Secret Controller/Delete secret.bru @@ -0,0 +1,25 @@ +meta { + name: Delete secret + type: http + seq: 7 +} + +delete { + url: {{BASE_URL}}/api/secret/:secret_slug + body: none + auth: bearer +} + +params:path { + secret_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes a secret from a project +} diff --git a/api-collection/Secret Controller/Fetch all by project and environment.bru b/api-collection/Secret Controller/Fetch all by project and environment.bru new file mode 100644 index 00000000..6ae539e3 --- /dev/null +++ b/api-collection/Secret Controller/Fetch all by project and environment.bru @@ -0,0 +1,26 @@ +meta { + name: Fetch all by project and environment + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/secret/:project_slug/:environment_slug + body: none + auth: bearer +} + +params:path { + project_slug: + environment_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all the secrets for a particular pair of project and environment. Used by the CLI to prefetch the existing secrets. +} diff --git a/api-collection/Secret Controller/Get all revisions of secret.bru b/api-collection/Secret Controller/Get all revisions of secret.bru new file mode 100644 index 00000000..0e46916d --- /dev/null +++ b/api-collection/Secret Controller/Get all revisions of secret.bru @@ -0,0 +1,20 @@ +meta { + name: Get all revisions of secret + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/secret/:secret_slug/revisions/:environment_slug + body: none + auth: bearer +} + +params:path { + secret_slug: api-key-fpymj + environment_slug: alpha-l7xvp +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Secret Controller/Get all secrets of project.bru b/api-collection/Secret Controller/Get all secrets of project.bru new file mode 100644 index 00000000..48b34d2e --- /dev/null +++ b/api-collection/Secret Controller/Get all secrets of project.bru @@ -0,0 +1,29 @@ +meta { + name: Get all secrets of project + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/secret/:project_slug?decryptValue=true + body: none + auth: bearer +} + +params:query { + decryptValue: true +} + +params:path { + project_slug: project-1-uzukc +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetch all the secrets of a project along with their values across the various environments in the project. +} diff --git a/api-collection/Secret Controller/Rollback secret.bru b/api-collection/Secret Controller/Rollback secret.bru new file mode 100644 index 00000000..0b50d6de --- /dev/null +++ b/api-collection/Secret Controller/Rollback secret.bru @@ -0,0 +1,30 @@ +meta { + name: Rollback secret + type: http + seq: 3 +} + +put { + url: {{BASE_URL}}/api/secret/:secret_slug/rollback/:version?environmentSlug=dev-13eea + body: none + auth: bearer +} + +params:query { + environmentSlug: dev-13eea +} + +params:path { + secret_slug: + version: 1 +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Rolls back a secret version to a specific version. Versions are stored in pair of secret - environment. Rolling back would mean you would want to restore the value of a secret in a particular environment. +} diff --git a/api-collection/Secret Controller/Update secret.bru b/api-collection/Secret Controller/Update secret.bru new file mode 100644 index 00000000..77ecdf44 --- /dev/null +++ b/api-collection/Secret Controller/Update secret.bru @@ -0,0 +1,45 @@ +meta { + name: Update secret + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/secret/:secret_slug + body: json + auth: bearer +} + +params:path { + secret_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "ACCESS_TOKEN" + } +} + +docs { + ## Description + + This endpoint updates an existing secret. + + ### Request Body + + - `name`: (Optional) Name of the secret. Must be unique across the project. + - `note`: (Optional) An optional note describing the usage of the secret. + - `rotateAfter`: (Optional) The duration in days after which the value of the secret should be rotated. Accepted values are \`24\`, \`168\`, \`720\`, \`8769\` and \`never\`. Defaults to \`never\`. + - `entries`: An array of values for the secret. + + + #### Entry object + + - `environmentSlug`: The environment under which you would like to add the value. + + - `value`: The string value. +} diff --git a/api-collection/Secret Controller/bruno.json b/api-collection/Secret Controller/bruno.json new file mode 100644 index 00000000..4e154c84 --- /dev/null +++ b/api-collection/Secret Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Secret Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Secret Controller/collection.bru b/api-collection/Secret Controller/collection.bru new file mode 100644 index 00000000..7f22c825 --- /dev/null +++ b/api-collection/Secret Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Secret Controller +} + +auth { + mode: none +} diff --git a/api-collection/User Controller/Delete self.bru b/api-collection/User Controller/Delete self.bru new file mode 100644 index 00000000..18f677c7 --- /dev/null +++ b/api-collection/User Controller/Delete self.bru @@ -0,0 +1,17 @@ +meta { + name: Delete self + type: http + seq: 3 +} + +delete { + url: {{BASE_URL}}/api/user + body: none + auth: none +} + +docs { + ## Description + + Deletes the account of the currently authenticated user. +} diff --git a/api-collection/User Controller/Get self.bru b/api-collection/User Controller/Get self.bru new file mode 100644 index 00000000..f9031f79 --- /dev/null +++ b/api-collection/User Controller/Get self.bru @@ -0,0 +1,17 @@ +meta { + name: Get self + type: http + seq: 1 +} + +get { + url: {{BASE_URL}}/api/user + body: none + auth: none +} + +docs { + ## Description + + Gets the details of the currently logged in user. +} diff --git a/api-collection/User Controller/Resend email change OTP.bru b/api-collection/User Controller/Resend email change OTP.bru new file mode 100644 index 00000000..59bf8466 --- /dev/null +++ b/api-collection/User Controller/Resend email change OTP.bru @@ -0,0 +1,17 @@ +meta { + name: Resend email change OTP + type: http + seq: 5 +} + +post { + url: {{BASE_URL}}/api/user/resend-email-change-otp + body: none + auth: none +} + +docs { + ## Description + + When an email change request was triggered, this endpoint allows users to re-generate the OTP in case they lost it or it got invalid. This doesn't take any parameters but will infer the change request based upon internal queries and will only resend the OTP if it finds that a request already exists. +} diff --git a/api-collection/User Controller/Update self.bru b/api-collection/User Controller/Update self.bru new file mode 100644 index 00000000..1faba0f9 --- /dev/null +++ b/api-collection/User Controller/Update self.bru @@ -0,0 +1,32 @@ +meta { + name: Update self + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/user + body: json + auth: none +} + +body:json { + { + "isOnboardingFinished": true, + "name": "Raj" + } +} + +docs { + ## Description + + Updates the details of the currently logged in user. Specify only those properties that you want to update. + + ### Request Body + + - `name`: The name of the user. + - `profilePictureUrl`: The URL of the profile picture. + - `isOnboardingFinished`: Set this to true only when you are onboarding the user for the first time. + + - `email`: The new email. +} diff --git a/api-collection/User Controller/Validate email change OTP.bru b/api-collection/User Controller/Validate email change OTP.bru new file mode 100644 index 00000000..f47ddab3 --- /dev/null +++ b/api-collection/User Controller/Validate email change OTP.bru @@ -0,0 +1,21 @@ +meta { + name: Validate email change OTP + type: http + seq: 4 +} + +post { + url: {{BASE_URL}}/api/user/validate-email-change-otp?otp= + body: none + auth: none +} + +params:query { + otp: +} + +docs { + ## Description + + While updating the user, if someone also tries to update their `email`, we send and OTP to their new email address. Upon entering the OTP in this endpoint, the email gets updated successfully. +} diff --git a/api-collection/User Controller/bruno.json b/api-collection/User Controller/bruno.json new file mode 100644 index 00000000..60d6a81b --- /dev/null +++ b/api-collection/User Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "User Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/User Controller/collection.bru b/api-collection/User Controller/collection.bru new file mode 100644 index 00000000..6abba27d --- /dev/null +++ b/api-collection/User Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: User Controller +} + +auth { + mode: none +} diff --git a/api-collection/Variable Controller/Create variable.bru b/api-collection/Variable Controller/Create variable.bru new file mode 100644 index 00000000..1c68f0a3 --- /dev/null +++ b/api-collection/Variable Controller/Create variable.bru @@ -0,0 +1,50 @@ +meta { + name: Create variable + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/variable/:project_slug + body: json + auth: bearer +} + +params:path { + project_slug: project-1-uzukc +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "PORT_NUMBER", + "entries": [ + { + "value": "8080", + "environmentSlug": "alpha-l7xvp" + } + ] + } +} + +docs { + ## Description + + This endpoint is used to create a variable. + + ### Request Body + + - `name`: The name of the variable. Should be unique in the project. + - `note`: (Optional) An optional note regarding the use case of the variable. + - `entries`: (Optional) An optional array of Entries that will contain the actual values of the variable. + + + #### Entry Object: + + - `environmentSlug`: The ID of the environment under which you would like to add the value of the secret to. + + - `value`: The value of the secret. +} diff --git a/api-collection/Variable Controller/Delete variable.bru b/api-collection/Variable Controller/Delete variable.bru new file mode 100644 index 00000000..eafe2369 --- /dev/null +++ b/api-collection/Variable Controller/Delete variable.bru @@ -0,0 +1,23 @@ +meta { + name: Delete variable + type: http + seq: 7 +} + +delete { + url: {{BASE_URL}}/api/variable/:variable_slug + body: none + auth: bearer +} + +params:path { + variable_slug: +} + +auth:bearer { + token: {{JWT}} +} + +docs { + Delete a variable by its ID +} diff --git a/api-collection/Variable Controller/Fetch all by project and environment.bru b/api-collection/Variable Controller/Fetch all by project and environment.bru new file mode 100644 index 00000000..4efd2bb3 --- /dev/null +++ b/api-collection/Variable Controller/Fetch all by project and environment.bru @@ -0,0 +1,26 @@ +meta { + name: Fetch all by project and environment + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/variable/:project_slug/:environment_slug + body: none + auth: bearer +} + +params:path { + project_slug: project-1-uzukc + environment_slug: alpha-l7xvp +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all the variables for a particular pair of project and environment. Used by the CLI to prefetch the existing variables. +} diff --git a/api-collection/Variable Controller/Get all revisions of variable.bru b/api-collection/Variable Controller/Get all revisions of variable.bru new file mode 100644 index 00000000..b7a113dc --- /dev/null +++ b/api-collection/Variable Controller/Get all revisions of variable.bru @@ -0,0 +1,20 @@ +meta { + name: Get all revisions of variable + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/variable/:variable_slug/revisions/:environment_slug + body: none + auth: bearer +} + +params:path { + variable_slug: portnumber-0 + environment_slug: alpha-l7xvp +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Variable Controller/Get all variables of project.bru b/api-collection/Variable Controller/Get all variables of project.bru new file mode 100644 index 00000000..a4ff561b --- /dev/null +++ b/api-collection/Variable Controller/Get all variables of project.bru @@ -0,0 +1,19 @@ +meta { + name: Get all variables of project + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/variable/:project_slug + body: none + auth: bearer +} + +params:path { + project_slug: project-1-uzukc +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Variable Controller/Rollback variable.bru b/api-collection/Variable Controller/Rollback variable.bru new file mode 100644 index 00000000..e31eb6c0 --- /dev/null +++ b/api-collection/Variable Controller/Rollback variable.bru @@ -0,0 +1,24 @@ +meta { + name: Rollback variable + type: http + seq: 3 +} + +put { + url: {{BASE_URL}}/api/variable/:variable_slug/rollback/:version?environment_slug= + body: none + auth: bearer +} + +params:query { + environment_slug: +} + +params:path { + variable_slug: + version: +} + +auth:bearer { + token: {{JWT}} +} diff --git a/api-collection/Variable Controller/Update variable.bru b/api-collection/Variable Controller/Update variable.bru new file mode 100644 index 00000000..717bcf4c --- /dev/null +++ b/api-collection/Variable Controller/Update variable.bru @@ -0,0 +1,44 @@ +meta { + name: Update variable + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/variable/:variable_slug + body: json + auth: bearer +} + +params:path { + variable_slug: +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "PORT_NUMBER" + } +} + +docs { + ## Description + + Update the fields of an existing variable. Set only those values that you would want to update. Note that, setting one or more entries would create a new revision of the variable, and will NOT change the existing value. + + ### Request Body + + - `name`: (Optional) The name of the variable. Should be unique in the project. + - `note`: (Optional) An optional note regarding the use case of the variable. + - `entries`: (Optional) An optional array of Entries that will contain the actual values of the variable. + + + #### Entry Object: + + - `environmentSlug`: The ID of the environment under which you would like to add the value of the secret to. + + - `value`: The value of the secret. +} diff --git a/api-collection/Variable Controller/bruno.json b/api-collection/Variable Controller/bruno.json new file mode 100644 index 00000000..5ab0c0a2 --- /dev/null +++ b/api-collection/Variable Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Variable Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Variable Controller/collection.bru b/api-collection/Variable Controller/collection.bru new file mode 100644 index 00000000..254f94d3 --- /dev/null +++ b/api-collection/Variable Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Variable Controller +} + +auth { + mode: none +} diff --git a/api-collection/Workspace Controller/Create workspace.bru b/api-collection/Workspace Controller/Create workspace.bru new file mode 100644 index 00000000..4c12a113 --- /dev/null +++ b/api-collection/Workspace Controller/Create workspace.bru @@ -0,0 +1,34 @@ +meta { + name: Create workspace + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/workspace + body: json + auth: bearer +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Workspace 1" + } +} + +docs { + ## Description + + Creates a workspace for the current user. + + ### Request Body + + - `name`: The name of the workspace. Must be unique for the user. + - `icon`: (Optional) A icon for the workspace. + + - `isDefault`: (Optional) Sets the current workspace as default. +} diff --git a/api-collection/Workspace Controller/Delete workspace.bru b/api-collection/Workspace Controller/Delete workspace.bru new file mode 100644 index 00000000..42b30856 --- /dev/null +++ b/api-collection/Workspace Controller/Delete workspace.bru @@ -0,0 +1,25 @@ +meta { + name: Delete workspace + type: http + seq: 7 +} + +delete { + url: {{BASE_URL}}/api/workspace/:workspace_slug + body: none + auth: bearer +} + +params:path { + workspace_slug: workspace-1-nr436 +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes a workspace. Any associated entities to the workspace also gets deleted. +} diff --git a/api-collection/Workspace Controller/Export data.bru b/api-collection/Workspace Controller/Export data.bru new file mode 100644 index 00000000..a9ef6ae6 --- /dev/null +++ b/api-collection/Workspace Controller/Export data.bru @@ -0,0 +1,35 @@ +meta { + name: Export data + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/workspace/:workspace_slug/export-data + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Given a workspace, this endpoint extracts these items: + + - roles + + - projects + + - environments + + - secrets + + - variables +} diff --git a/api-collection/Workspace Controller/Get all workspace of user.bru b/api-collection/Workspace Controller/Get all workspace of user.bru new file mode 100644 index 00000000..92791fd3 --- /dev/null +++ b/api-collection/Workspace Controller/Get all workspace of user.bru @@ -0,0 +1,21 @@ +meta { + name: Get all workspace of user + type: http + seq: 3 +} + +get { + url: {{BASE_URL}}/api/workspace + body: none + auth: bearer +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all the workspace that belongs to the user, or the user is a part of. +} diff --git a/api-collection/Workspace Controller/Get workspace.bru b/api-collection/Workspace Controller/Get workspace.bru new file mode 100644 index 00000000..12a8fc83 --- /dev/null +++ b/api-collection/Workspace Controller/Get workspace.bru @@ -0,0 +1,25 @@ +meta { + name: Get workspace + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/workspace/:workspace_slug + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches a workspace by its slug. +} diff --git a/api-collection/Workspace Controller/Global search.bru b/api-collection/Workspace Controller/Global search.bru new file mode 100644 index 00000000..a5a57c24 --- /dev/null +++ b/api-collection/Workspace Controller/Global search.bru @@ -0,0 +1,28 @@ +meta { + name: Global search + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/workspace/:workspace_slug/global-search/:search + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu + search: pro +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Given a workspace, this endpoint is used to search projects, secrets, environments and variables in that workspace. + + Needless to say, access control is imposed by default. A user won't be shown resources that they don't have access to. +} diff --git a/api-collection/Workspace Controller/Update workspace.bru b/api-collection/Workspace Controller/Update workspace.bru new file mode 100644 index 00000000..76496370 --- /dev/null +++ b/api-collection/Workspace Controller/Update workspace.bru @@ -0,0 +1,38 @@ +meta { + name: Update workspace + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/workspace/:workspace_slug + body: json + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "icon": "some icon" + } +} + +docs { + ## Description + + Updates an existing workspace. Only specify those fields that you would want to update. + + ### Request Body + + - `name`: (Optional) The name of the workspace. Must be unique for the user. Note that updating the workspace name will also update its slug. + - `icon`: (Optional) A icon for the workspace. + + - `isDefault`: (Optional) Sets this current workspace as default. +} diff --git a/api-collection/Workspace Controller/bruno.json b/api-collection/Workspace Controller/bruno.json new file mode 100644 index 00000000..1a32e5b0 --- /dev/null +++ b/api-collection/Workspace Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Workspace Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Workspace Controller/collection.bru b/api-collection/Workspace Controller/collection.bru new file mode 100644 index 00000000..5b87a3c8 --- /dev/null +++ b/api-collection/Workspace Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Workspace Controller +} + +auth { + mode: none +} diff --git a/api-collection/Workspace Membership Controller/Accept invitation.bru b/api-collection/Workspace Membership Controller/Accept invitation.bru new file mode 100644 index 00000000..355ef70f --- /dev/null +++ b/api-collection/Workspace Membership Controller/Accept invitation.bru @@ -0,0 +1,15 @@ +meta { + name: Accept invitation + type: http + seq: 2 +} + +post { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/accept-invitation + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} diff --git a/api-collection/Workspace Membership Controller/Cancel invitation.bru b/api-collection/Workspace Membership Controller/Cancel invitation.bru new file mode 100644 index 00000000..fafeeff3 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Cancel invitation.bru @@ -0,0 +1,16 @@ +meta { + name: Cancel invitation + type: http + seq: 9 +} + +delete { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/cancel-invitation/:user_email + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli + user_email: agentR47@gmail.com +} diff --git a/api-collection/Workspace Membership Controller/Check if user is member of workspace.bru b/api-collection/Workspace Membership Controller/Check if user is member of workspace.bru new file mode 100644 index 00000000..41a97783 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Check if user is member of workspace.bru @@ -0,0 +1,22 @@ +meta { + name: Check if user is member of workspace + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/is-member/:user_email + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli + user_email: rajdip@keyshade.abc +} + +docs { + ## Description + + Check if a user is a member of the workspace or not +} diff --git a/api-collection/Workspace Membership Controller/Decline invitation to workspace.bru b/api-collection/Workspace Membership Controller/Decline invitation to workspace.bru new file mode 100644 index 00000000..469042f7 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Decline invitation to workspace.bru @@ -0,0 +1,21 @@ +meta { + name: Decline invitation to workspace + type: http + seq: 10 +} + +delete { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/decline-invitation + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} + +docs { + ## Description + + As a user, declines the invitation to join a workspace sent t you. +} diff --git a/api-collection/Workspace Membership Controller/Get all members of workspace.bru b/api-collection/Workspace Membership Controller/Get all members of workspace.bru new file mode 100644 index 00000000..50142a55 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Get all members of workspace.bru @@ -0,0 +1,21 @@ +meta { + name: Get all members of workspace + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/members + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} + +docs { + ## Description + + Fetches all the members of a workspace. +} diff --git a/api-collection/Workspace Membership Controller/Invite users to workspace.bru b/api-collection/Workspace Membership Controller/Invite users to workspace.bru new file mode 100644 index 00000000..ef26705f --- /dev/null +++ b/api-collection/Workspace Membership Controller/Invite users to workspace.bru @@ -0,0 +1,40 @@ +meta { + name: Invite users to workspace + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/invite-users + body: json + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} + +body:json { + [ + { + "email": "agentR47@gmail.com", + "roleSlugs": [ + "writepermission-7mpho", + "readonly-p7ne5" + ] + } + ] +} + +docs { + ## Description + + Invite one or more users to the workspace. + + ### Request Body + + The endpoint accepts an array of objects that have these fields: + + - `email`: The email of the user you want to invite. If the user doesn't exist with us, and account for them is created on their behalf. + - `roleSlugs`: Slugs of the roles that you want to assign to this user. +} diff --git a/api-collection/Workspace Membership Controller/Leave workspace.bru b/api-collection/Workspace Membership Controller/Leave workspace.bru new file mode 100644 index 00000000..3d10b62d --- /dev/null +++ b/api-collection/Workspace Membership Controller/Leave workspace.bru @@ -0,0 +1,21 @@ +meta { + name: Leave workspace + type: http + seq: 8 +} + +delete { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/leave + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} + +docs { + ## Description + + Leave the workspace +} diff --git a/api-collection/Workspace Membership Controller/Remove users from workspace.bru b/api-collection/Workspace Membership Controller/Remove users from workspace.bru new file mode 100644 index 00000000..b4272c56 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Remove users from workspace.bru @@ -0,0 +1,15 @@ +meta { + name: Remove users from workspace + type: http + seq: 7 +} + +delete { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/remove-users + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli +} diff --git a/api-collection/Workspace Membership Controller/Transfer ownership of workspace.bru b/api-collection/Workspace Membership Controller/Transfer ownership of workspace.bru new file mode 100644 index 00000000..2e80a8a3 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Transfer ownership of workspace.bru @@ -0,0 +1,16 @@ +meta { + name: Transfer ownership of workspace + type: http + seq: 4 +} + +put { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/transfer-ownership/:user_email + body: none + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli + user_email: agentR47@gmail.com +} diff --git a/api-collection/Workspace Membership Controller/Update member role in workspace.bru b/api-collection/Workspace Membership Controller/Update member role in workspace.bru new file mode 100644 index 00000000..e7a0e939 --- /dev/null +++ b/api-collection/Workspace Membership Controller/Update member role in workspace.bru @@ -0,0 +1,30 @@ +meta { + name: Update member role in workspace + type: http + seq: 3 +} + +put { + url: {{BASE_URL}}/api/workspace-membership/:workspace_slug/update-member-role/:user_email + body: json + auth: none +} + +params:path { + workspace_slug: workspace-1-cahli + user_email: agentR47@gmail.com +} + +body:json { + ["readonly-p7ne5"] +} + +docs { + ## Description + + Updates the roles associated with a member in a workspace. + + ### Request Body + + The request body accepts a list of role slugs that you would like the user to have present. +} diff --git a/api-collection/Workspace Membership Controller/bruno.json b/api-collection/Workspace Membership Controller/bruno.json new file mode 100644 index 00000000..88e2a027 --- /dev/null +++ b/api-collection/Workspace Membership Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Workspace Membership Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Workspace Membership Controller/collection.bru b/api-collection/Workspace Membership Controller/collection.bru new file mode 100644 index 00000000..4480d577 --- /dev/null +++ b/api-collection/Workspace Membership Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Workspace Membership Controller +} + +auth { + mode: none +} diff --git a/api-collection/Workspace Role Controller/Check workspace role exists.bru b/api-collection/Workspace Role Controller/Check workspace role exists.bru new file mode 100644 index 00000000..8ba6bd7c --- /dev/null +++ b/api-collection/Workspace Role Controller/Check workspace role exists.bru @@ -0,0 +1,26 @@ +meta { + name: Check workspace role exists + type: http + seq: 6 +} + +get { + url: {{BASE_URL}}/api/workspace-role/:workspace_slug/exists/:workspace_role_name + body: none + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu + workspace_role_name: Admins +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Checks if a workspace role with the same name exists or not. +} diff --git a/api-collection/Workspace Role Controller/Create workspace role.bru b/api-collection/Workspace Role Controller/Create workspace role.bru new file mode 100644 index 00000000..de18bc0f --- /dev/null +++ b/api-collection/Workspace Role Controller/Create workspace role.bru @@ -0,0 +1,43 @@ +meta { + name: Create workspace role + type: http + seq: 1 +} + +post { + url: {{BASE_URL}}/api/workspace-role/:workspace_slug + body: json + auth: bearer +} + +params:path { + workspace_slug: new-workspace-7dbgu +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "ReadOnly", + "colorCode": "abcdef", + "authorities": [ + "READ_WORKSPACE" + ] + } +} + +docs { + ## Description + + Creates a workspace role in a workspace. + + ### Request Body + + - `name`: Unique name for the role + - `description`: (Optional) A description about the role + - `colorCode`: (Optional) A hex color code for the role + - `authorities`: (Optional) An array of allowed `Authorities`. Refer prisma schema. + - `projectSlugs`: (Optional) An array of project slugs to associate to this role. Associating projects to a role will apply all the authorities in the role to the project aswell. +} diff --git a/api-collection/Workspace Role Controller/Delete workspace role.bru b/api-collection/Workspace Role Controller/Delete workspace role.bru new file mode 100644 index 00000000..47cafbad --- /dev/null +++ b/api-collection/Workspace Role Controller/Delete workspace role.bru @@ -0,0 +1,25 @@ +meta { + name: Delete workspace role + type: http + seq: 3 +} + +delete { + url: {{BASE_URL}}/api/workspace-role/:workspace_role_slug + body: none + auth: bearer +} + +params:path { + workspace_role_slug: readonly-4oje7 +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Deletes a workspace role. +} diff --git a/api-collection/Workspace Role Controller/Get all workspace roles of workspace.bru b/api-collection/Workspace Role Controller/Get all workspace roles of workspace.bru new file mode 100644 index 00000000..a8dc1f49 --- /dev/null +++ b/api-collection/Workspace Role Controller/Get all workspace roles of workspace.bru @@ -0,0 +1,25 @@ +meta { + name: Get all workspace roles of workspace + type: http + seq: 4 +} + +get { + url: {{BASE_URL}}/api/workspace-role/:workspace_slug/all + body: none + auth: bearer +} + +params:path { + workspace_slug: workspace-1-cahli +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches all roles in a workspace. +} diff --git a/api-collection/Workspace Role Controller/Get workspace role.bru b/api-collection/Workspace Role Controller/Get workspace role.bru new file mode 100644 index 00000000..b9b81f8d --- /dev/null +++ b/api-collection/Workspace Role Controller/Get workspace role.bru @@ -0,0 +1,25 @@ +meta { + name: Get workspace role + type: http + seq: 5 +} + +get { + url: {{BASE_URL}}/api/workspace-role/:workspace_role_id + body: none + auth: bearer +} + +params:path { + workspace_role_id: clz7zj39w000010jers7joyk2 +} + +auth:bearer { + token: {{JWT}} +} + +docs { + ## Description + + Fetches a single role by its slug. +} diff --git a/api-collection/Workspace Role Controller/Update workspace role.bru b/api-collection/Workspace Role Controller/Update workspace role.bru new file mode 100644 index 00000000..8ea24ced --- /dev/null +++ b/api-collection/Workspace Role Controller/Update workspace role.bru @@ -0,0 +1,40 @@ +meta { + name: Update workspace role + type: http + seq: 2 +} + +put { + url: {{BASE_URL}}/api/workspace-role/:workspace_role_slug + body: json + auth: bearer +} + +params:path { + workspace_role_slug: readonly-4oje7 +} + +auth:bearer { + token: {{JWT}} +} + +body:json { + { + "name": "Read Only" + } +} + +docs { + ## Description + + Updates an existing role. Specify only those fields that you want to update. + + ### Request Body + + - `name`: (Optional) Unique name for the role. Note that updating the name will also update its slug. + + - `description`: (Optional) A description about the role + - `colorCode`: (Optional) A hex color code for the role + - `authorities`: (Optional) An array of allowed `Authorities`. Refer prisma schema. + - `projectIds`: (Optional) An array of project IDs to associate to this role. Associating projects to a role will apply all the authorities in the role to the project aswell. +} diff --git a/api-collection/Workspace Role Controller/bruno.json b/api-collection/Workspace Role Controller/bruno.json new file mode 100644 index 00000000..40cd5069 --- /dev/null +++ b/api-collection/Workspace Role Controller/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "Workspace Role Controller", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/Workspace Role Controller/collection.bru b/api-collection/Workspace Role Controller/collection.bru new file mode 100644 index 00000000..aa103587 --- /dev/null +++ b/api-collection/Workspace Role Controller/collection.bru @@ -0,0 +1,7 @@ +meta { + name: Workspace Role Controller +} + +auth { + mode: none +} diff --git a/api-collection/bruno.json b/api-collection/bruno.json new file mode 100644 index 00000000..fa9b3077 --- /dev/null +++ b/api-collection/bruno.json @@ -0,0 +1,9 @@ +{ + "version": "1", + "name": "keyshade-api-collection", + "type": "collection", + "ignore": [ + "node_modules", + ".git" + ] +} \ No newline at end of file diff --git a/api-collection/environments/Development.bru b/api-collection/environments/Development.bru new file mode 100644 index 00000000..6c085d37 --- /dev/null +++ b/api-collection/environments/Development.bru @@ -0,0 +1,3 @@ +vars { + BASE_URL: http://localhost:4200 +} diff --git a/api-collection/environments/Stage.bru b/api-collection/environments/Stage.bru new file mode 100644 index 00000000..321aebe7 --- /dev/null +++ b/api-collection/environments/Stage.bru @@ -0,0 +1,3 @@ +vars { + BASE_URL: https://stage.api.keyshade.xyz +} diff --git a/apps/api/src/app/app.module.ts b/apps/api/src/app/app.module.ts index 5e73d2b7..da4b5184 100644 --- a/apps/api/src/app/app.module.ts +++ b/apps/api/src/app/app.module.ts @@ -1,6 +1,6 @@ import { Module } from '@nestjs/common' import { AppController } from './app.controller' -import { ConfigModule, ConfigService } from '@nestjs/config' +import { ConfigModule } from '@nestjs/config' import { PassportModule } from '@nestjs/passport' import { AuthModule } from '@/auth/auth.module' import { PrismaModule } from '@/prisma/prisma.module' @@ -25,7 +25,6 @@ import { IntegrationModule } from '@/integration/integration.module' import { FeedbackModule } from '@/feedback/feedback.module' import { CacheModule } from '@/cache/cache.module' import { WorkspaceMembershipModule } from '@/workspace-membership/workspace-membership.module' -import { seconds, ThrottlerGuard, ThrottlerModule } from '@nestjs/throttler' @Module({ controllers: [AppController], diff --git a/apps/api/src/provider/minio.provider.ts b/apps/api/src/provider/minio.provider.ts index 6c87f0a9..6847b0b6 100644 --- a/apps/api/src/provider/minio.provider.ts +++ b/apps/api/src/provider/minio.provider.ts @@ -70,6 +70,7 @@ export const MinioProvider: Provider = { isServiceLoaded = true } + // eslint-disable-next-line @typescript-eslint/no-unused-vars async function uploadFile(file) { if (!isServiceLoaded) { throw new InternalServerErrorException('Minio Client has not loaded') @@ -91,6 +92,7 @@ export const MinioProvider: Provider = { return fileName } + // eslint-disable-next-line @typescript-eslint/no-unused-vars async function getFileUrl(fileName: string) { if (!isServiceLoaded) { throw new InternalServerErrorException('Minio Client has not loaded') @@ -106,6 +108,7 @@ export const MinioProvider: Provider = { } } + // eslint-disable-next-line @typescript-eslint/no-unused-vars async function deleteFile(fileName: string) { if (!isServiceLoaded) { throw new InternalServerErrorException('Minio Client has not loaded') diff --git a/apps/api/src/workspace/workspace.e2e.spec.ts b/apps/api/src/workspace/workspace.e2e.spec.ts index a9ff2154..5eba8c47 100644 --- a/apps/api/src/workspace/workspace.e2e.spec.ts +++ b/apps/api/src/workspace/workspace.e2e.spec.ts @@ -72,7 +72,7 @@ describe('Workspace Controller Tests', () => { let variableService: VariableService let workspaceRoleService: WorkspaceRoleService - let user1: User, user2: User, user3: User + let user1: User, user2: User let workspace1: Workspace, workspace2: Workspace let adminRole: WorkspaceRole, memberRole: WorkspaceRole @@ -141,7 +141,6 @@ describe('Workspace Controller Tests', () => { user1 = createUser1 user2 = createUser2 - user3 = createUser3 memberRole = await prisma.workspaceRole.create({ data: { diff --git a/apps/web/src/components/hero/index.tsx b/apps/web/src/components/hero/index.tsx index ca45f4e1..179b1ec9 100644 --- a/apps/web/src/components/hero/index.tsx +++ b/apps/web/src/components/hero/index.tsx @@ -20,7 +20,7 @@ function Hero(): React.JSX.Element { if (!result.success) { toast.custom(() => ( -
Please enter a valid email address
You have been already added to the waitlist. We will notify you once we launch. @@ -60,13 +62,11 @@ function Hero(): React.JSX.Element { launch