From 59e428002b3b9bb88908da6ffa81605de7d2b3dd Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Wed, 6 Nov 2024 22:09:41 +0530 Subject: [PATCH 1/5] chore(ci): Add script to validate schema package --- .github/workflows/validate-schema.yaml | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/validate-schema.yaml diff --git a/.github/workflows/validate-schema.yaml b/.github/workflows/validate-schema.yaml new file mode 100644 index 00000000..2b8d8e30 --- /dev/null +++ b/.github/workflows/validate-schema.yaml @@ -0,0 +1,66 @@ +name: Validate Schema + +on: + push: + branches: + - '!develop' + - '!main' + paths: ['packages/schema/**', '.github/workflows/validate-schema.yml'] + pull_request: + paths: ['packages/schema/**', '.github/workflows/validate-schema.yml'] + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate Schema + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.2.0 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:schema + + - name: Build + run: | + pnpm run build:schema + + - name: Test + run: | + pnpm run test:schema + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: schema From 5b27e32cc76b24a3f7f4f99ee0917456ecba05ad Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Wed, 6 Nov 2024 22:39:18 +0530 Subject: [PATCH 2/5] chore: Update test coverage settings --- .github/workflows/validate-api-client.yaml | 1 + .github/workflows/validate-api.yaml | 2 +- .github/workflows/validate-schema.yaml | 1 + apps/api/jest.e2e-config.ts | 4 +++- apps/api/package.json | 2 +- codecov.yml | 18 ++++++++++++++++++ packages/api-client/jest.config.ts | 6 ++++-- packages/schema/jest.config.ts | 6 ++++-- 8 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/validate-api-client.yaml b/.github/workflows/validate-api-client.yaml index 796504a3..4497cd9d 100644 --- a/.github/workflows/validate-api-client.yaml +++ b/.github/workflows/validate-api-client.yaml @@ -66,3 +66,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: api-client + files: /coverage/packages/api-client/coverage-final.json diff --git a/.github/workflows/validate-api.yaml b/.github/workflows/validate-api.yaml index bf7fd7c2..bd251221 100644 --- a/.github/workflows/validate-api.yaml +++ b/.github/workflows/validate-api.yaml @@ -67,4 +67,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: api-e2e-tests - files: /coverage-e2e/api/coverage-final.json + files: /coverage/apps/api/coverage-final.json diff --git a/.github/workflows/validate-schema.yaml b/.github/workflows/validate-schema.yaml index 2b8d8e30..62cd38b3 100644 --- a/.github/workflows/validate-schema.yaml +++ b/.github/workflows/validate-schema.yaml @@ -64,3 +64,4 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: flags: schema + files: /coverage/packages/schema/coverage-final.json diff --git a/apps/api/jest.e2e-config.ts b/apps/api/jest.e2e-config.ts index 74bee29e..f576eb72 100644 --- a/apps/api/jest.e2e-config.ts +++ b/apps/api/jest.e2e-config.ts @@ -11,5 +11,7 @@ export default { '^@/(.*)$': '/src/$1' }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/apps/api' + coverageDirectory: '../../coverage/apps/api', + coverageReporters: ['json'], + collectCoverage: true } diff --git a/apps/api/package.json b/apps/api/package.json index b6ab1bfb..4c0002a6 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -17,7 +17,7 @@ "db:reset": "pnpm dlx dotenv-cli -e ../../.env -- pnpm dlx prisma migrate reset --force --schema=src/prisma/schema.prisma", "sourcemaps": "sentry-cli sourcemaps inject ./dist && sentry-cli sourcemaps upload ./dist || echo 'Failed to upload source maps to Sentry'", "e2e:prepare": "cd ../../ && docker compose down && docker compose -f docker-compose-test.yml up -d && sleep 3 && cd apps/api && pnpm db:generate-types && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' pnpm run db:deploy-migrations", - "e2e": "pnpm run e2e:prepare && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' jest --runInBand --config=jest.e2e-config.ts --coverage --coverageDirectory=../../coverage-e2e/api --coverageReporters=json && pnpm run e2e:teardown", + "e2e": "pnpm run e2e:prepare && cross-env NODE_ENV='e2e' DATABASE_URL='postgresql://prisma:prisma@localhost:5432/tests' jest --runInBand --config=jest.e2e-config.ts && pnpm run e2e:teardown", "e2e:teardown": "cd ../../ && docker compose -f docker-compose-test.yml down", "unit": "pnpm db:generate-types && jest --config=jest.config.ts" }, diff --git a/codecov.yml b/codecov.yml index 3d2ddb06..f3f97c65 100644 --- a/codecov.yml +++ b/codecov.yml @@ -34,3 +34,21 @@ flag_management: target: 85% - type: patch target: 98% + - name: api-client + paths: + - packages/api-client/ + carryforward: true + statuses: + - type: project + target: 80% + - type: patch + target: 98% + - name: schema + paths: + - packages/schema/ + carryforward: true + statuses: + - type: project + target: 80% + - type: patch + target: 98% diff --git a/packages/api-client/jest.config.ts b/packages/api-client/jest.config.ts index 8d90756d..bf8187eb 100644 --- a/packages/api-client/jest.config.ts +++ b/packages/api-client/jest.config.ts @@ -7,14 +7,16 @@ const config: Config = { '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }] }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/packages/api-client', globalSetup: './tests/config/setup.ts', globalTeardown: './tests/config/teardown.ts', preset: 'ts-jest', testEnvironment: 'node', moduleNameMapper: { '^@api-client/(.*)$': '/src/$1' - } + }, + coverageDirectory: '../../coverage/packages/api-client', + coverageReporters: ['json'], + collectCoverage: true } export default config diff --git a/packages/schema/jest.config.ts b/packages/schema/jest.config.ts index bd7c0402..91e96af7 100644 --- a/packages/schema/jest.config.ts +++ b/packages/schema/jest.config.ts @@ -7,12 +7,14 @@ const config: Config = { '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }] }, moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../coverage/packages/schema', preset: 'ts-jest', testEnvironment: 'node', moduleNameMapper: { '^@/(.*)$': '/src/$1' - } + }, + coverageDirectory: '../../coverage/packages/schema', + coverageReporters: ['json'], + collectCoverage: true } export default config From a998ae4cf02ebdbcab941805c6805ed8ed379919 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Wed, 6 Nov 2024 22:47:53 +0530 Subject: [PATCH 3/5] chore: Fixed codecov client version --- .github/workflows/validate-api-client.yaml | 1 + .github/workflows/validate-api.yaml | 1 + .github/workflows/validate-schema.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/validate-api-client.yaml b/.github/workflows/validate-api-client.yaml index 4497cd9d..4d336299 100644 --- a/.github/workflows/validate-api-client.yaml +++ b/.github/workflows/validate-api-client.yaml @@ -64,6 +64,7 @@ jobs: uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + version: 'v0.1.15' with: flags: api-client files: /coverage/packages/api-client/coverage-final.json diff --git a/.github/workflows/validate-api.yaml b/.github/workflows/validate-api.yaml index bd251221..ae187a18 100644 --- a/.github/workflows/validate-api.yaml +++ b/.github/workflows/validate-api.yaml @@ -65,6 +65,7 @@ jobs: uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + version: 'v0.1.15' with: flags: api-e2e-tests files: /coverage/apps/api/coverage-final.json diff --git a/.github/workflows/validate-schema.yaml b/.github/workflows/validate-schema.yaml index 62cd38b3..e46b437c 100644 --- a/.github/workflows/validate-schema.yaml +++ b/.github/workflows/validate-schema.yaml @@ -62,6 +62,7 @@ jobs: uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + version: 'v0.1.15' with: flags: schema files: /coverage/packages/schema/coverage-final.json From 7c8ee5dba4d1e066b4060af1ff74e6dbab20d03a Mon Sep 17 00:00:00 2001 From: Muntasir Mallik <73852736+muntaxir4@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:37:29 +0530 Subject: [PATCH 4/5] refactor(api-client, schema): Add workspace's schemas and types in @keyshade/schema (#520) --- packages/api-client/package.json | 4 +- .../api-client/src/controllers/workspace.ts | 4 +- .../api-client/src/types/workspace.types.d.ts | 118 ----- packages/schema/package.json | 10 +- packages/schema/src/api-key.ts | 2 +- packages/schema/src/index.ts | 10 +- packages/schema/src/integration.ts | 2 +- packages/schema/src/pagination/pagination.ts | 46 ++ .../schema/src/pagination/pagination.types.ts | 17 + packages/schema/src/project.ts | 2 +- packages/schema/src/secret.ts | 2 +- packages/schema/src/workspace-role.ts | 2 +- packages/schema/src/workspace.ts | 14 - packages/schema/src/workspace/workspace.ts | 149 ++++++ .../schema/src/workspace/workspace.types.ts | 62 +++ packages/schema/tests/api-key.spec.ts | 4 +- packages/schema/tests/environment.spec.ts | 4 +- packages/schema/tests/integration.spec.ts | 4 +- packages/schema/tests/pagination.spec.ts | 194 ++++++++ packages/schema/tests/project.spec.ts | 4 +- packages/schema/tests/secret.spec.ts | 4 +- packages/schema/tests/variable.spec.ts | 4 +- packages/schema/tests/workspace-role.spec.ts | 4 +- packages/schema/tests/workspace.spec.ts | 428 ++++++++++++++++-- packages/schema/tsconfig.json | 3 +- pnpm-lock.yaml | 393 ++++++++++------ 26 files changed, 1170 insertions(+), 320 deletions(-) delete mode 100644 packages/api-client/src/types/workspace.types.d.ts create mode 100644 packages/schema/src/pagination/pagination.ts create mode 100644 packages/schema/src/pagination/pagination.types.ts delete mode 100644 packages/schema/src/workspace.ts create mode 100644 packages/schema/src/workspace/workspace.ts create mode 100644 packages/schema/src/workspace/workspace.types.ts create mode 100644 packages/schema/tests/pagination.spec.ts diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 2cea5708..a4685e26 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -14,5 +14,7 @@ "lint": "eslint \"{src,tests}/**/*.ts\" --fix", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"" }, - "dependencies": {} + "dependencies": { + "@keyshade/schema": "workspace:*" + } } diff --git a/packages/api-client/src/controllers/workspace.ts b/packages/api-client/src/controllers/workspace.ts index dbb46a29..e98913d4 100644 --- a/packages/api-client/src/controllers/workspace.ts +++ b/packages/api-client/src/controllers/workspace.ts @@ -1,7 +1,7 @@ import { APIClient } from '@api-client/core/client' import { parsePaginationUrl } from '@api-client/core/pagination-parser' import { parseResponse } from '@api-client/core/response-parser' -import { ClientResponse } from '@api-client/types/index.types' +import { ClientResponse } from '@keyshade/schema' import { CreateWorkspaceRequest, CreateWorkspaceResponse, @@ -17,7 +17,7 @@ import { GlobalSearchResponse, UpdateWorkspaceRequest, UpdateWorkspaceResponse -} from '@api-client/types/workspace.types' +} from '@keyshade/schema' export default class WorkspaceController { private apiClient: APIClient diff --git a/packages/api-client/src/types/workspace.types.d.ts b/packages/api-client/src/types/workspace.types.d.ts deleted file mode 100644 index 8737417f..00000000 --- a/packages/api-client/src/types/workspace.types.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { PageRequest, PageResponse } from './index.types' - -export interface Workspace { - id: string - name: string - slug: string - icon: string - isFreeTier: boolean - createdAt: string - updatedAt: string - ownerId: string - isDefault: boolean - lastUpdatedBy: string -} - -export interface CreateWorkspaceRequest { - name: string - icon?: string -} - -export interface CreateWorkspaceResponse extends Workspace {} - -export interface UpdateWorkspaceRequest - extends Partial { - workspaceSlug: string -} - -export interface UpdateWorkspaceResponse extends Workspace {} - -export interface DeleteWorkspaceRequest { - workspaceSlug: string -} - -export interface DeleteWorkspaceResponse {} - -export interface GetWorkspaceRequest { - workspaceSlug: string -} - -export interface GetWorkspaceResponse extends Workspace {} - -export interface GetAllWorkspacesOfUserRequest extends PageRequest {} - -export interface GetAllWorkspacesOfUserResponse - extends PageResponse {} - -export interface ExportDataRequest { - workspaceSlug: string -} - -export interface ExportDataResponse { - name: string - icon: string - workspaceRoles: { - name: string - description: string - colorCode: string - hasAdminAuthority: boolean - authorities: string[] - }[] - projects: { - name: string - description: string - publicKey: string - privateKey: string - storePrivateKey: boolean - accessLevel: 'GLOBAL' | 'PRIVATE' | 'INTERNAL' - environments: { - name: string - description: string - }[] - secrets: { - name: string - note: string - rotateAt: string - versions: { - value: string - version: number - }[] - }[] - variables: { - name: string - note: string - versions: { - value: string - version: number - }[] - }[] - }[] -} - -export interface GlobalSearchRequest { - workspaceSlug: string - search: string -} - -export interface GlobalSearchResponse { - projects: { - slug: string - name: string - description: string - }[] - environments: { - slug: string - name: string - description: string - }[] - secrets: { - slug: string - name: string - note: string - }[] - variables: { - slug: string - name: string - note: string - }[] -} diff --git a/packages/schema/package.json b/packages/schema/package.json index 2a5dc5e1..6118fc31 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -4,6 +4,12 @@ "main": "dist/src/index.js", "description": "This package holds the schemas that other applications can use to validate the input data.", "private": true, + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "default": "./dist/src/index.js" + } + }, "scripts": { "build": "tsc && tsc-alias", "watch": "tsc -w", @@ -13,5 +19,7 @@ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "test": "jest" }, - "dependencies": {} + "dependencies": { + "zod": "^3.23.6" + } } diff --git a/packages/schema/src/api-key.ts b/packages/schema/src/api-key.ts index 8034fc08..0fa14982 100644 --- a/packages/schema/src/api-key.ts +++ b/packages/schema/src/api-key.ts @@ -1,5 +1,5 @@ import z from 'zod' -import { expiresAfterEnum } from './enums' +import { expiresAfterEnum } from '@/enums' export const CreateApiKeySchema = z.object({ name: z.string(), diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index 876aff32..55dd6912 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -1,10 +1,18 @@ +//Export all Schemas and types + +export * from './pagination/pagination' +export * from './pagination/pagination.types' + export * from './api-key' export * from './environment' export * from './integration' export * from './project' export * from './secret' export * from './variable' -export * from './workspace' + +export * from './workspace/workspace' +export * from './workspace/workspace.types' + export * from './workspace-role' export * from './enums' diff --git a/packages/schema/src/integration.ts b/packages/schema/src/integration.ts index f44378f1..b3af0c0e 100644 --- a/packages/schema/src/integration.ts +++ b/packages/schema/src/integration.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { eventTypeEnum, integrationTypeEnum } from './enums' +import { eventTypeEnum, integrationTypeEnum } from '@/enums' export const CreateIntegrationSchema = z.object({ name: z.string(), diff --git a/packages/schema/src/pagination/pagination.ts b/packages/schema/src/pagination/pagination.ts new file mode 100644 index 00000000..797d9485 --- /dev/null +++ b/packages/schema/src/pagination/pagination.ts @@ -0,0 +1,46 @@ +import { z } from 'zod' + +export const PageRequestSchema = z.object({ + page: z.number().optional(), + limit: z.number().optional(), + sort: z.string().optional(), + order: z.string().optional(), + search: z.string().optional() +}) + +export const PageResponseSchema = (itemSchema: z.ZodType) => + z.object({ + items: z.array(itemSchema), + metadata: z.object({ + page: z.number(), + perPage: z.number(), + pageCount: z.number(), + totalCount: z.number(), + links: z.object({ + self: z.string(), + first: z.string(), + previous: z.string().nullable(), + next: z.string().nullable(), + last: z.string() + }) + }) + }) + +export const ResponseErrorSchema = z.object({ + message: z.string(), + error: z.string(), + statusCode: z.number() +}) + +export const ClientResponseSchema = (dataSchema: z.ZodType) => + z + .object({ + success: z.boolean(), + error: ResponseErrorSchema.nullable(), + data: dataSchema.nullable() + }) + .refine((obj) => + obj.success + ? obj.data !== null && obj.error == null + : obj.data == null && obj.error !== null + ) diff --git a/packages/schema/src/pagination/pagination.types.ts b/packages/schema/src/pagination/pagination.types.ts new file mode 100644 index 00000000..1f9514fb --- /dev/null +++ b/packages/schema/src/pagination/pagination.types.ts @@ -0,0 +1,17 @@ +import { z } from 'zod' +import { + ClientResponseSchema, + PageRequestSchema, + PageResponseSchema, + ResponseErrorSchema +} from './pagination' + +export type PageRequest = z.infer + +export type PageResponse = z.infer>> + +export type ResponseError = z.infer + +export type ClientResponse = z.infer< + ReturnType> +> diff --git a/packages/schema/src/project.ts b/packages/schema/src/project.ts index 2710af2b..c53afc9b 100644 --- a/packages/schema/src/project.ts +++ b/packages/schema/src/project.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { projectAccessLevelEnum } from './enums' +import { projectAccessLevelEnum } from '@/enums' import { CreateEnvironmentSchema } from './environment' export const CreateProjectSchema = z.object({ diff --git a/packages/schema/src/secret.ts b/packages/schema/src/secret.ts index c3ad04ce..4c15dfdc 100644 --- a/packages/schema/src/secret.ts +++ b/packages/schema/src/secret.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { rotateAfterEnum } from './enums' +import { rotateAfterEnum } from '@/enums' export const CreateSecretSchema = z.object({ name: z.string(), diff --git a/packages/schema/src/workspace-role.ts b/packages/schema/src/workspace-role.ts index 358dbdc2..fabf873b 100644 --- a/packages/schema/src/workspace-role.ts +++ b/packages/schema/src/workspace-role.ts @@ -1,5 +1,5 @@ import { z } from 'zod' -import { authorityEnum } from './enums' +import { authorityEnum } from '@/enums' export const CreateWorkspaceRoleSchema = z.object({ name: z.string(), diff --git a/packages/schema/src/workspace.ts b/packages/schema/src/workspace.ts deleted file mode 100644 index 7164eee5..00000000 --- a/packages/schema/src/workspace.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { z } from 'zod' - -export const CreateWorkspaceSchema = z.object({ - name: z.string(), - icon: z.string().optional(), - isDefault: z.boolean().optional() -}) - -export const UpdateWorkspaceSchema = CreateWorkspaceSchema.partial() - -export const InviteMemberSchema = z.object({ - email: z.string(), - roleIds: z.array(z.string()).optional() -}) diff --git a/packages/schema/src/workspace/workspace.ts b/packages/schema/src/workspace/workspace.ts new file mode 100644 index 00000000..d5df2cf6 --- /dev/null +++ b/packages/schema/src/workspace/workspace.ts @@ -0,0 +1,149 @@ +import { z } from 'zod' +import { PageRequestSchema, PageResponseSchema } from '@/pagination/pagination' +import { projectAccessLevelEnum, rotateAfterEnum } from '@/enums' + +export const InviteMemberSchema = z.object({ + email: z.string(), + roleSlugs: z.array(z.string()).optional() +}) + +//Request and Response types +export const WorkspaceSchema = z.object({ + id: z.string(), + name: z.string(), + slug: z.string(), + icon: z.string(), + isFreeTier: z.boolean(), + createdAt: z.string(), + updatedAt: z.string(), + ownerId: z.string(), + isDefault: z.boolean(), + lastUpdatedBy: z.string() +}) + +export const CreateWorkspaceRequestSchema = z.object({ + name: z.string(), + icon: z.string().optional(), + isDefault: z.boolean().optional() +}) + +export const CreateWorkspaceResponseSchema = WorkspaceSchema + +export const UpdateWorkspaceRequestSchema = + CreateWorkspaceRequestSchema.partial().extend({ + workspaceSlug: z.string() + }) + +export const UpdateWorkspaceResponseSchema = WorkspaceSchema + +export const DeleteWorkspaceRequestSchema = z.object({ + workspaceSlug: z.string() +}) + +export const DeleteWorkspaceResponseSchema = z.never() + +export const GetWorkspaceRequestSchema = z.object({ + workspaceSlug: z.string() +}) + +export const GetWorkspaceResponseSchema = WorkspaceSchema + +export const GetAllWorkspacesOfUserRequestSchema = PageRequestSchema + +export const GetAllWorkspacesOfUserResponseSchema = + PageResponseSchema(WorkspaceSchema) + +export const ExportDataRequestSchema = z.object({ + workspaceSlug: z.string() +}) + +export const ExportDataResponseSchema = z.object({ + name: z.string(), + icon: z.string(), + workspaceRoles: z.array( + z.object({ + name: z.string(), + description: z.string(), + colorCode: z.string(), + hasAdminAuthority: z.boolean(), + authorities: z.array(z.string()) + }) + ), + projects: z.array( + z.object({ + name: z.string(), + description: z.string(), + publicKey: z.string(), + privateKey: z.string(), + storePrivateKey: z.boolean(), + accessLevel: projectAccessLevelEnum, + environments: z.array( + z.object({ + name: z.string(), + description: z.string() + }) + ), + secrets: z.array( + z.object({ + name: z.string(), + note: z.string(), + rotateAt: rotateAfterEnum, + versions: z.array( + z.object({ + value: z.string(), + version: z.number() + }) + ) + }) + ), + variables: z.array( + z.object({ + name: z.string(), + note: z.string(), + versions: z.array( + z.object({ + value: z.string(), + version: z.number() + }) + ) + }) + ) + }) + ) +}) + +export const GlobalSearchRequestSchema = z.object({ + workspaceSlug: z.string(), + search: z.string() +}) + +export const GlobalSearchResponseSchema = z.object({ + projects: z.array( + z.object({ + slug: z.string(), + name: z.string(), + description: z.string() + }) + ), + environments: z.array( + z.object({ + slug: z.string(), + name: z.string(), + description: z.string() + }) + ), + secrets: z.array( + z.object({ + slug: z.string(), + name: z.string(), + note: z.string() + }) + ), + variables: z.array( + z.object({ + slug: z.string(), + name: z.string(), + note: z.string() + }) + ) +}) diff --git a/packages/schema/src/workspace/workspace.types.ts b/packages/schema/src/workspace/workspace.types.ts new file mode 100644 index 00000000..71cb4336 --- /dev/null +++ b/packages/schema/src/workspace/workspace.types.ts @@ -0,0 +1,62 @@ +import { z } from 'zod' +import { + WorkspaceSchema, + CreateWorkspaceRequestSchema, + CreateWorkspaceResponseSchema, + UpdateWorkspaceRequestSchema, + UpdateWorkspaceResponseSchema, + DeleteWorkspaceRequestSchema, + DeleteWorkspaceResponseSchema, + GetWorkspaceRequestSchema, + GetWorkspaceResponseSchema, + GetAllWorkspacesOfUserResponseSchema, + ExportDataRequestSchema, + ExportDataResponseSchema, + GlobalSearchRequestSchema, + GlobalSearchResponseSchema +} from './workspace' +import { PageRequestSchema } from '..' + +export type Workspace = z.infer + +export type CreateWorkspaceRequest = z.infer< + typeof CreateWorkspaceRequestSchema +> + +export type CreateWorkspaceResponse = z.infer< + typeof CreateWorkspaceResponseSchema +> + +export type UpdateWorkspaceRequest = z.infer< + typeof UpdateWorkspaceRequestSchema +> + +export type UpdateWorkspaceResponse = z.infer< + typeof UpdateWorkspaceResponseSchema +> + +export type DeleteWorkspaceRequest = z.infer< + typeof DeleteWorkspaceRequestSchema +> + +export type DeleteWorkspaceResponse = z.infer< + typeof DeleteWorkspaceResponseSchema +> + +export type GetWorkspaceRequest = z.infer + +export type GetWorkspaceResponse = z.infer + +export type GetAllWorkspacesOfUserRequest = z.infer + +export type GetAllWorkspacesOfUserResponse = z.infer< + typeof GetAllWorkspacesOfUserResponseSchema +> + +export type ExportDataRequest = z.infer + +export type ExportDataResponse = z.infer + +export type GlobalSearchRequest = z.infer + +export type GlobalSearchResponse = z.infer diff --git a/packages/schema/tests/api-key.spec.ts b/packages/schema/tests/api-key.spec.ts index 91c1f58b..0191d092 100644 --- a/packages/schema/tests/api-key.spec.ts +++ b/packages/schema/tests/api-key.spec.ts @@ -16,13 +16,13 @@ describe('API Key Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should not validate if required values are not specified', () => { const result = CreateApiKeySchema.safeParse({}) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) }) diff --git a/packages/schema/tests/environment.spec.ts b/packages/schema/tests/environment.spec.ts index 75ff31f1..0adbb494 100644 --- a/packages/schema/tests/environment.spec.ts +++ b/packages/schema/tests/environment.spec.ts @@ -15,13 +15,13 @@ describe('Environment Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) it('should not validate if required values are not specified', () => { const result = CreateEnvironmentSchema.safeParse({}) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) }) diff --git a/packages/schema/tests/integration.spec.ts b/packages/schema/tests/integration.spec.ts index 63a63768..9d47730b 100644 --- a/packages/schema/tests/integration.spec.ts +++ b/packages/schema/tests/integration.spec.ts @@ -31,7 +31,7 @@ describe('Integration Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should not validate if required values are not specified', () => { @@ -40,7 +40,7 @@ describe('Integration Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should validate with optional fields omitted', () => { diff --git a/packages/schema/tests/pagination.spec.ts b/packages/schema/tests/pagination.spec.ts new file mode 100644 index 00000000..e206a97a --- /dev/null +++ b/packages/schema/tests/pagination.spec.ts @@ -0,0 +1,194 @@ +import { z } from 'zod' +import { + PageRequestSchema, + PageResponseSchema, + ResponseErrorSchema, + ClientResponseSchema +} from '@/pagination/pagination' + +describe('Pagination Schema Tests', () => { + // Tests for PageRequestSchema + it('should validate a valid PageRequestSchema', () => { + const result = PageRequestSchema.safeParse({ + page: 1, + limit: 10 + }) + + expect(result.success).toBe(true) + }) + + it('should not validate an invalid PageRequestSchema with incorrect types', () => { + const result = PageRequestSchema.safeParse({ + page: 'one' // should be a number + }) + + expect(result.success).toBe(false) + }) + + // Tests for PageResponseSchema + const itemSchema = z.object({ + id: z.string(), + name: z.string() + }) + + it('should validate a valid PageResponseSchema', () => { + const result = PageResponseSchema(itemSchema).safeParse({ + items: [{ id: '123', name: 'Test' }], + metadata: { + page: 1, + perPage: 10, + pageCount: 1, + totalCount: 1, + links: { + self: 'http://example.com/page/1', + first: 'http://example.com/page/1', + previous: null, + next: null, + last: 'http://example.com/page/1' + } + } + }) + + expect(result.success).toBe(true) + }) + + it('should not validate an invalid PageResponseSchema with incorrect items type', () => { + const result = PageResponseSchema(itemSchema).safeParse({ + items: 'not-an-array', // should be an array + metadata: { + page: 1, + perPage: 10, + pageCount: 1, + totalCount: 1, + links: { + self: 'http://example.com/page/1', + first: 'http://example.com/page/1', + previous: null, + next: null, + last: 'http://example.com/page/1' + } + } + }) + + expect(result.success).toBe(false) + }) + + it('should not validate an invalid PageResponseSchema with missing metadata fields', () => { + const result = PageResponseSchema(itemSchema).safeParse({ + items: [{ id: '123', name: 'Test' }], + metadata: { + page: 1, + perPage: 10, + pageCount: 1, + // totalCount is missing + links: { + self: 'http://example.com/page/1', + first: 'http://example.com/page/1', + previous: null, + next: null, + last: 'http://example.com/page/1' + } + } + }) + + expect(result.success).toBe(false) + }) + + // Tests for ResponseErrorSchema + it('should validate a valid ResponseErrorSchema', () => { + const result = ResponseErrorSchema.safeParse({ + message: 'An error occurred', + error: 'ERROR_CODE', + statusCode: 400 + }) + + expect(result.success).toBe(true) + }) + + it('should not validate an invalid ResponseErrorSchema with missing fields', () => { + const result = ResponseErrorSchema.safeParse({ + message: 'An error occurred', + error: 'ERROR_CODE' + }) + + expect(result.success).toBe(false) + }) + + // Tests for ClientResponseSchema + const dataSchema = z.object({ + id: z.string(), + name: z.string() + }) + + it('should validate when success is true and data is present', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: true, + error: null, + data: { id: '123', name: 'Test' } + }) + + expect(result.success).toBe(true) + }) + + it('should validate when success is false and error is present', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: false, + error: { + message: 'An error occurred', + error: 'ERROR_CODE', + statusCode: 400 + }, + data: null + }) + + expect(result.success).toBe(true) + }) + + it('should not validate when success is true and data is null', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: true, + error: null, + data: null + }) + + expect(result.success).toBe(false) + }) + + it('should not validate when success is false and error is null', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: false, + error: null, + data: null + }) + + expect(result.success).toBe(false) + }) + + it('should not validate when success is true and error is present', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: true, + error: { + message: 'An error occurred', + error: 'ERROR_CODE', + statusCode: 400 + }, + data: { id: '123', name: 'Test' } + }) + + expect(result.success).toBe(false) + }) + + it('should not validate when success is false and data is present', () => { + const result = ClientResponseSchema(dataSchema).safeParse({ + success: false, + error: { + message: 'An error occurred', + error: 'ERROR_CODE', + statusCode: 400 + }, + data: { id: '123', name: 'Test' } + }) + + expect(result.success).toBe(false) + }) +}) diff --git a/packages/schema/tests/project.spec.ts b/packages/schema/tests/project.spec.ts index 9b662081..42815628 100644 --- a/packages/schema/tests/project.spec.ts +++ b/packages/schema/tests/project.spec.ts @@ -19,7 +19,7 @@ describe('Project Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should validate if only required fields are specified for CreateProjectSchema', () => { @@ -63,6 +63,6 @@ describe('Project Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) }) diff --git a/packages/schema/tests/secret.spec.ts b/packages/schema/tests/secret.spec.ts index 9dcebed0..e0652523 100644 --- a/packages/schema/tests/secret.spec.ts +++ b/packages/schema/tests/secret.spec.ts @@ -27,7 +27,7 @@ describe('Secret Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should not validate if invalid types are specified for CreateSecretSchema', () => { @@ -37,7 +37,7 @@ describe('Secret Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should validate if optional fields are omitted for CreateSecretSchema', () => { diff --git a/packages/schema/tests/variable.spec.ts b/packages/schema/tests/variable.spec.ts index 059f45f8..feeb23bc 100644 --- a/packages/schema/tests/variable.spec.ts +++ b/packages/schema/tests/variable.spec.ts @@ -25,7 +25,7 @@ describe('Variable Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) it('should not validate if invalid types are specified for CreateVariableSchema', () => { @@ -35,7 +35,7 @@ describe('Variable Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should validate if optional fields are omitted for CreateVariableSchema', () => { diff --git a/packages/schema/tests/workspace-role.spec.ts b/packages/schema/tests/workspace-role.spec.ts index 41eb897a..7a3becce 100644 --- a/packages/schema/tests/workspace-role.spec.ts +++ b/packages/schema/tests/workspace-role.spec.ts @@ -34,7 +34,7 @@ describe('Workspace Role Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) it('should not validate if invalid types are specified for CreateWorkspaceRoleSchema', () => { @@ -44,7 +44,7 @@ describe('Workspace Role Schema Tests', () => { }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) it('should validate if all optional fields are provided for CreateWorkspaceRoleSchema', () => { diff --git a/packages/schema/tests/workspace.spec.ts b/packages/schema/tests/workspace.spec.ts index 561ea431..556552e5 100644 --- a/packages/schema/tests/workspace.spec.ts +++ b/packages/schema/tests/workspace.spec.ts @@ -1,83 +1,451 @@ -import { CreateWorkspaceSchema, InviteMemberSchema } from '@/workspace' +import { + InviteMemberSchema, + CreateWorkspaceRequestSchema, + UpdateWorkspaceRequestSchema, + DeleteWorkspaceRequestSchema, + GetWorkspaceRequestSchema, + ExportDataRequestSchema, + GlobalSearchRequestSchema, + CreateWorkspaceResponseSchema, + UpdateWorkspaceResponseSchema, + DeleteWorkspaceResponseSchema, + GetWorkspaceResponseSchema, + ExportDataResponseSchema, + GetAllWorkspacesOfUserResponseSchema, + GlobalSearchResponseSchema, + GetAllWorkspacesOfUserRequestSchema +} from '@/workspace/workspace' describe('Workspace Schema Tests', () => { - it('should validate if proper input is specified for CreateWorkspaceSchema', () => { - const result = CreateWorkspaceSchema.safeParse({ + it('should validate if proper input is specified for InviteMemberSchema', () => { + const result = InviteMemberSchema.safeParse({ + email: 'test@example.com', + roleSlugs: ['role1', 'role2'] + }) + + expect(result.success).toBe(true) + }) + + it('should validate if only required fields are specified for InviteMemberSchema', () => { + const result = InviteMemberSchema.safeParse({ + email: 'test@example.com' + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if required fields are missing for InviteMemberSchema', () => { + const result = InviteMemberSchema.safeParse({ + roleSlugs: ['role1'] + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(1) + }) + + it('should not validate if invalid types are specified for InviteMemberSchema', () => { + const result = InviteMemberSchema.safeParse({ + email: 123, + roleSlugs: 'invalid_role' + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(2) + }) + + it('should not validate if roleIds are specified instead of roleSlugs for InviteMemberSchema', () => { + const result = InviteMemberSchema.safeParse({ + roleIds: ['role1', 'role2'] //should be roleSlugs + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(1) + }) + + it('should validate if proper input is specified for CreateWorkspaceRequestSchema', () => { + const result = CreateWorkspaceRequestSchema.safeParse({ name: 'Workspace Test', - isDefault: true + icon: 'icon.png' }) expect(result.success).toBe(true) }) - it('should validate if only required fields are specified for CreateWorkspaceSchema', () => { - const result = CreateWorkspaceSchema.safeParse({ + it('should validate if only required fields are specified for CreateWorkspaceRequestSchema', () => { + const result = CreateWorkspaceRequestSchema.safeParse({ name: 'Workspace Test' }) expect(result.success).toBe(true) }) - it('should validate if optional fields are omitted for CreateWorkspaceSchema', () => { - const result = CreateWorkspaceSchema.safeParse({ + it('should validate if optional fields are omitted for CreateWorkspaceRequestSchema', () => { + const result = CreateWorkspaceRequestSchema.safeParse({ name: 'Workspace Test' }) expect(result.success).toBe(true) }) - it('should not validate if required fields are missing for CreateWorkspaceSchema', () => { - const result = CreateWorkspaceSchema.safeParse({ + it('should not validate if required fields are missing for CreateWorkspaceRequestSchema', () => { + const result = CreateWorkspaceRequestSchema.safeParse({ isDefault: true }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(1) }) - it('should not validate if invalid types are specified for CreateWorkspaceSchema', () => { - const result = CreateWorkspaceSchema.safeParse({ + it('should not validate if invalid types are specified for CreateWorkspaceRequestSchema', () => { + const result = CreateWorkspaceRequestSchema.safeParse({ name: 123, isDefault: 'true' }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues).toHaveLength(2) }) - it('should validate if proper input is specified for InviteMemberSchema', () => { - const result = InviteMemberSchema.safeParse({ - email: 'test@example.com', - roleIds: ['role1', 'role2'] + it('should validate with proper input for CreateWorkspaceResponseSchema', () => { + const result = CreateWorkspaceResponseSchema.safeParse({ + id: 'workspace-id', + name: 'Workspace Test', + slug: 'workspace-slug', + icon: 'icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-01T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' }) expect(result.success).toBe(true) }) - it('should validate if only required fields are specified for InviteMemberSchema', () => { - const result = InviteMemberSchema.safeParse({ - email: 'test@example.com' + it('should not validate if required fields are missing for CreateWorkspaceResponseSchema', () => { + const result = CreateWorkspaceResponseSchema.safeParse({ + id: 'workspace-id', + name: 'Workspace Test', + // slug is missing + icon: 'icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-01T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(1) + expect(result.error?.issues[0].path).toEqual(['slug']) + }) + + it('should validate if proper input is specified for UpdateWorkspaceRequestSchema', () => { + const result = UpdateWorkspaceRequestSchema.safeParse({ + name: 'Updated Workspace Test', + icon: 'new-icon.png', + workspaceSlug: 'workspace-slug' }) expect(result.success).toBe(true) }) - it('should not validate if required fields are missing for InviteMemberSchema', () => { - const result = InviteMemberSchema.safeParse({ - roleIds: ['role1'] + it('should validate if only required fields are specified for UpdateWorkspaceRequestSchema', () => { + const result = UpdateWorkspaceRequestSchema.safeParse({ + workspaceSlug: 'workspace-slug' + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if invalid types are provided for UpdateWorkspaceRequestSchema', () => { + const result = UpdateWorkspaceRequestSchema.safeParse({ + name: 123 // should be a string }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(1) + expect(result.error?.issues).toHaveLength(2) + expect(result.error?.issues[0].path).toEqual(['name']) + expect(result.error?.issues[1].path).toEqual(['workspaceSlug']) }) - it('should not validate if invalid types are specified for InviteMemberSchema', () => { - const result = InviteMemberSchema.safeParse({ - email: 123, - roleIds: 'invalid_role' + it('should validate with proper input for UpdateWorkspaceResponseSchema', () => { + const result = UpdateWorkspaceResponseSchema.safeParse({ + id: 'workspace-id', + name: 'Updated Workspace', + slug: 'workspace-slug', + icon: 'new-icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-02T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if required fields are missing for UpdateWorkspaceResponseSchema', () => { + const result = UpdateWorkspaceResponseSchema.safeParse({ + id: 'workspace-id', + name: 'Updated Workspace', + // slug is missing + icon: 'new-icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-02T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(1) + expect(result.error?.issues[0].path).toEqual(['slug']) + }) + + it('should validate if proper input is specified for DeleteWorkspaceRequestSchema', () => { + const result = DeleteWorkspaceRequestSchema.safeParse({ + workspaceSlug: 'workspace-slug' + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if unexpected fields are provided for DeleteWorkspaceResponseSchema', () => { + const result = DeleteWorkspaceResponseSchema.safeParse({ + unexpectedField: 'value' + }) + + expect(result.success).toBe(false) + expect(result.error?.issues).toHaveLength(1) + }) + + it('should validate if proper input is specified for GetWorkspaceRequestSchema', () => { + const result = GetWorkspaceRequestSchema.safeParse({ + workspaceSlug: 'workspace-slug' + }) + + expect(result.success).toBe(true) + }) + + it('should validate with proper input for GetWorkspaceResponseSchema', () => { + const result = GetWorkspaceResponseSchema.safeParse({ + id: 'workspace-id', + name: 'Workspace Test', + slug: 'workspace-slug', + icon: 'icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-01T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' + }) + + expect(result.success).toBe(true) + }) + + it('should validate when correct page and limit are provided for GetAllWorkspacesOfUserRequestSchema', () => { + const result = GetAllWorkspacesOfUserRequestSchema.safeParse({ + page: 1, + limit: 10 + }) + + expect(result.success).toBe(true) + }) + + it('should validate with proper input for GetAllWorkspacesOfUserResponseSchema', () => { + const result = GetAllWorkspacesOfUserResponseSchema.safeParse({ + items: [ + { + id: 'workspace-id', + name: 'Workspace Test', + slug: 'workspace-slug', + icon: 'icon.png', + isFreeTier: true, + createdAt: '2024-10-01T00:00:00Z', + updatedAt: '2024-10-01T00:00:00Z', + ownerId: 'owner-id', + isDefault: false, + lastUpdatedBy: 'user-id' + } + ], + metadata: { + page: 1, + perPage: 10, + pageCount: 1, + totalCount: 1, + links: { + self: 'http://example.com/page/1', + first: 'http://example.com/page/1', + previous: null, + next: null, + last: 'http://example.com/page/1' + } + } + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if items are not an array in GetAllWorkspacesOfUserResponseSchema', () => { + const result = GetAllWorkspacesOfUserResponseSchema.safeParse({ + items: 'not-an-array', + total: 1, + page: 1, + limit: 10 + }) + + expect(result.success).toBe(false) + expect(result.error?.issues[0].path).toEqual(['items']) + }) + + it('should validate if proper input is specified for ExportDataRequestSchema', () => { + const result = ExportDataRequestSchema.safeParse({ + workspaceSlug: 'workspace-slug' + }) + + expect(result.success).toBe(true) + }) + + it('should validate with proper input for ExportDataResponseSchema', () => { + const result = ExportDataResponseSchema.safeParse({ + name: 'Workspace Test', + icon: 'icon.png', + workspaceRoles: [ + { + name: 'Admin', + description: 'Administrator role', + colorCode: '#FF0000', + hasAdminAuthority: true, + authorities: ['ALL'] + } + ], + projects: [ + { + name: 'Project A', + description: 'Description of Project A', + publicKey: 'public-key', + privateKey: 'private-key', + storePrivateKey: true, + accessLevel: 'GLOBAL', + environments: [ + { + name: 'Development', + description: 'Development Environment' + } + ], + secrets: [ + { + name: 'API_KEY', + note: 'API Key for external service', + rotateAt: '720', + versions: [ + { + value: 'secret-value', + version: 1 + } + ] + } + ], + variables: [ + { + name: 'ENV_VAR', + note: 'Environment Variable', + versions: [ + { + value: 'variable-value', + version: 1 + } + ] + } + ] + } + ] + }) + + expect(result.success).toBe(true) + }) + + it('should not validate if required fields are missing in ExportDataResponseSchema', () => { + const result = ExportDataResponseSchema.safeParse({ + // name is missing + icon: 'icon.png', + workspaceRoles: [], + projects: [] + }) + + expect(result.success).toBe(false) + expect(result.error?.issues[0].path).toEqual(['name']) + }) + + it('should validate if proper input is specified for GlobalSearchRequestSchema', () => { + const result = GlobalSearchRequestSchema.safeParse({ + workspaceSlug: 'workspace-slug', + search: 'search-term' + }) + + expect(result.success).toBe(true) + }) + + it('should validate with proper input for GlobalSearchResponseSchema', () => { + const result = GlobalSearchResponseSchema.safeParse({ + projects: [ + { + slug: 'project-slug', + name: 'Project Name', + description: 'Project Description' + } + ], + environments: [ + { + slug: 'environment-slug', + name: 'Environment Name', + description: 'Environment Description' + } + ], + secrets: [ + { + slug: 'secret-slug', + name: 'Secret Name', + note: 'Secret Note' + } + ], + variables: [ + { + slug: 'variable-slug', + name: 'Variable Name', + note: 'Variable Note' + } + ] + }) + + expect(result.success).toBe(true) + }) + + it('should not validate when required fields are missing for GlobalSearchResponseSchema', () => { + const result = GlobalSearchResponseSchema.safeParse({ + projects: [ + { + slug: 'project-slug', + name: 'Project Name' + // description is missing + } + ], + environments: [], + secrets: [], + variables: [] }) expect(result.success).toBe(false) - expect(result.error.issues).toHaveLength(2) + expect(result.error?.issues[0]?.path).toEqual([ + 'projects', + 0, + 'description' + ]) }) }) diff --git a/packages/schema/tsconfig.json b/packages/schema/tsconfig.json index 139d8bf4..43cc6568 100644 --- a/packages/schema/tsconfig.json +++ b/packages/schema/tsconfig.json @@ -6,7 +6,8 @@ "@/*": ["./src/*"] }, "outDir": "dist", - "plugins": [{ "transform": "typescript-transform-paths" }] + "plugins": [{ "transform": "typescript-transform-paths" }], + "strictNullChecks": true }, "tsc-alias": { "resolveFullPaths": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eeb528a6..de14d3eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,7 +64,7 @@ importers: version: 2.5.2 ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2) + version: 10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2) tsc-alias: specifier: ^1.8.10 version: 1.8.10 @@ -83,7 +83,7 @@ importers: version: 2.36.1 '@sentry/webpack-plugin': specifier: ^2.14.2 - version: 2.22.4(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + version: 2.22.4(webpack@5.94.0(@swc/core@1.7.26)) '@types/jest': specifier: ^29.5.2 version: 29.5.13 @@ -113,7 +113,7 @@ importers: version: 9.1.6 jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) prettier: specifier: ^3.0.0 version: 3.3.3 @@ -122,7 +122,7 @@ importers: version: 0.5.14(prettier@3.3.3) ts-jest: specifier: ^29.1.0 - version: 29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.6.2) + version: 29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.6.2) tsconfig: specifier: workspace:* version: link:packages/tsconfig @@ -219,7 +219,7 @@ importers: devDependencies: '@nestjs/cli': specifier: ^10.0.0 - version: 10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26(@swc/helpers@0.5.2))(chokidar@3.6.0))(@swc/core@1.7.26(@swc/helpers@0.5.2)) + version: 10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26)(chokidar@3.6.0))(@swc/core@1.7.26) '@nestjs/schematics': specifier: ^10.0.0 version: 10.1.4(chokidar@3.6.0)(typescript@5.3.3) @@ -255,10 +255,10 @@ importers: version: 7.4.2 jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) jest-mock-extended: specifier: ^3.0.5 - version: 3.0.7(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.3.3) + version: 3.0.7(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)))(typescript@5.3.3) prettier: specifier: ^3.0.0 version: 3.3.3 @@ -276,10 +276,10 @@ importers: version: 6.3.4 ts-jest: specifier: ^29.1.0 - version: 29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.3.3) + version: 29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)))(typescript@5.3.3) ts-loader: specifier: ^9.4.3 - version: 9.5.1(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + version: 9.5.1(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)) apps/cli: dependencies: @@ -349,7 +349,7 @@ importers: version: 43.0.1(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint-plugin-n@16.6.2(eslint@8.57.1))(eslint-plugin-promise@6.6.0(eslint@8.57.1))(eslint@8.57.1)(typescript@5.6.2) tsup: specifier: ^8.1.2 - version: 8.2.4(@swc/core@1.7.26(@swc/helpers@0.5.2))(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) + version: 8.2.4(@swc/core@1.7.26)(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) apps/platform: dependencies: @@ -460,7 +460,7 @@ importers: version: 2.5.2 tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2))) + version: 1.0.7(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2))) zod: specifier: ^3.23.8 version: 3.23.8 @@ -473,7 +473,7 @@ importers: version: 8.1.0(typescript@5.6.2) '@tailwindcss/forms': specifier: ^0.5.7 - version: 0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2))) + version: 0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2))) '@types/dayjs-precise-range': specifier: ^1.0.5 version: 1.0.5 @@ -497,7 +497,7 @@ importers: version: 8.4.47 tailwindcss: specifier: ^3.3.3 - version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig @@ -506,13 +506,13 @@ importers: dependencies: '@mdx-js/loader': specifier: ^3.0.1 - version: 3.0.1(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + version: 3.0.1(webpack@5.94.0(@swc/core@1.7.26)) '@mdx-js/react': specifier: ^3.0.1 version: 3.0.1(@types/react@18.3.6)(react@18.3.1) '@next/mdx': specifier: ^14.2.3 - version: 14.2.11(@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))))(@mdx-js/react@3.0.1(@types/react@18.3.6)(react@18.3.1)) + version: 14.2.11(@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26)))(@mdx-js/react@3.0.1(@types/react@18.3.6)(react@18.3.1)) '@tsparticles/engine': specifier: ^3.3.0 version: 3.5.0 @@ -564,7 +564,7 @@ importers: version: 8.1.0(typescript@5.6.2) '@tailwindcss/forms': specifier: ^0.5.7 - version: 0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2))) + version: 0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2))) '@types/react': specifier: ^18.0.22 version: 18.3.6 @@ -582,18 +582,22 @@ importers: version: 8.4.47 tailwindcss: specifier: ^3.3.3 - version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + version: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) tsconfig: specifier: workspace:* version: link:../../packages/tsconfig - packages/api-client: {} + packages/api-client: + dependencies: + '@keyshade/schema': + specifier: workspace:* + version: link:../schema packages/eslint-config-custom: devDependencies: '@vercel/style-guide': specifier: ^5.0.0 - version: 5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(prettier@3.3.3)(typescript@4.9.5) + version: 5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(prettier@3.3.3)(typescript@4.9.5) eslint-config-turbo: specifier: ^1.10.12 version: 1.13.4(eslint@8.57.1) @@ -601,7 +605,11 @@ importers: specifier: ^4.5.3 version: 4.9.5 - packages/schema: {} + packages/schema: + dependencies: + zod: + specifier: ^3.23.6 + version: 3.23.8 packages/secret-scan: dependencies: @@ -626,10 +634,10 @@ importers: version: 43.0.1(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1)(typescript@5.6.2))(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint@8.57.1))(eslint-plugin-n@16.6.2(eslint@8.57.1))(eslint-plugin-promise@6.6.0(eslint@8.57.1))(eslint@8.57.1)(typescript@5.6.2) jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + version: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) tsup: specifier: ^8.1.2 - version: 8.2.4(@swc/core@1.7.26(@swc/helpers@0.5.2))(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) + version: 8.2.4(@swc/core@1.7.26)(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) typescript: specifier: ^5.5.3 version: 5.6.2 @@ -9187,7 +9195,7 @@ snapshots: '@babel/traverse': 7.25.6 '@babel/types': 7.25.6 convert-source-map: 2.0.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -9253,7 +9261,7 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-compilation-targets': 7.25.2 '@babel/helper-plugin-utils': 7.24.8 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -10008,7 +10016,7 @@ snapshots: '@babel/parser': 7.25.6 '@babel/template': 7.25.0 '@babel/types': 7.25.6 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -10126,7 +10134,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.2 @@ -10192,7 +10200,7 @@ snapshots: '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -10304,7 +10312,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2))': + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -10318,7 +10326,42 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-resolve-dependencies: 29.7.0 + jest-runner: 29.7.0 + jest-runtime: 29.7.0 + jest-snapshot: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + jest-watcher: 29.7.0 + micromatch: 4.0.8 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + - ts-node + + '@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2))': + dependencies: + '@jest/console': 29.7.0 + '@jest/reporters': 29.7.0 + '@jest/test-result': 29.7.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 20.16.5 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.9.0 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-changed-files: 29.7.0 + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -10490,11 +10533,11 @@ snapshots: '@lukeed/csprng@1.1.0': {} - '@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)))': + '@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26))': dependencies: '@mdx-js/mdx': 3.0.1 source-map: 0.7.4 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) transitivePeerDependencies: - supports-color @@ -10554,7 +10597,7 @@ snapshots: got: 11.8.6 os-filter-obj: 2.0.0 - '@nestjs/cli@10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26(@swc/helpers@0.5.2))(chokidar@3.6.0))(@swc/core@1.7.26(@swc/helpers@0.5.2))': + '@nestjs/cli@10.4.5(@swc/cli@0.4.0(@swc/core@1.7.26)(chokidar@3.6.0))(@swc/core@1.7.26)': dependencies: '@angular-devkit/core': 17.3.8(chokidar@3.6.0) '@angular-devkit/schematics': 17.3.8(chokidar@3.6.0) @@ -10564,7 +10607,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.5 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)) glob: 10.4.2 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -10573,7 +10616,7 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) webpack-node-externals: 3.0.0 optionalDependencies: '@swc/cli': 0.4.0(@swc/core@1.7.26(@swc/helpers@0.5.2))(chokidar@3.6.0) @@ -10739,11 +10782,11 @@ snapshots: dependencies: glob: 7.1.7 - '@next/mdx@14.2.11(@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))))(@mdx-js/react@3.0.1(@types/react@18.3.6)(react@18.3.1))': + '@next/mdx@14.2.11(@mdx-js/loader@3.0.1(webpack@5.94.0(@swc/core@1.7.26)))(@mdx-js/react@3.0.1(@types/react@18.3.6)(react@18.3.1))': dependencies: source-map: 0.7.4 optionalDependencies: - '@mdx-js/loader': 3.0.1(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + '@mdx-js/loader': 3.0.1(webpack@5.94.0(@swc/core@1.7.26)) '@mdx-js/react': 3.0.1(@types/react@18.3.6)(react@18.3.1) '@next/swc-darwin-arm64@13.5.6': @@ -11612,7 +11655,7 @@ snapshots: conventional-changelog-angular: 7.0.0 conventional-commits-filter: 4.0.0 conventional-commits-parser: 5.0.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) import-from-esm: 1.3.4 lodash-es: 4.17.21 micromatch: 4.0.8 @@ -11626,7 +11669,7 @@ snapshots: conventional-changelog-writer: 8.0.0 conventional-commits-filter: 5.0.0 conventional-commits-parser: 6.0.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) import-from-esm: 1.3.4 lodash-es: 4.17.21 micromatch: 4.0.8 @@ -11642,7 +11685,7 @@ snapshots: dependencies: '@semantic-release/error': 3.0.0 aggregate-error: 3.1.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) dir-glob: 3.0.1 execa: 5.1.1 lodash: 4.17.21 @@ -11660,7 +11703,7 @@ snapshots: '@octokit/plugin-throttling': 9.3.1(@octokit/core@6.1.2) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) dir-glob: 3.0.1 globby: 14.0.2 http-proxy-agent: 7.0.2 @@ -11697,7 +11740,7 @@ snapshots: conventional-changelog-writer: 8.0.0 conventional-commits-filter: 5.0.0 conventional-commits-parser: 6.0.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) get-stream: 7.0.1 import-from-esm: 1.3.4 into-stream: 7.0.0 @@ -11800,12 +11843,12 @@ snapshots: dependencies: '@sentry/types': 7.119.0 - '@sentry/webpack-plugin@2.22.4(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)))': + '@sentry/webpack-plugin@2.22.4(webpack@5.94.0(@swc/core@1.7.26))': dependencies: '@sentry/bundler-plugin-core': 2.22.4 unplugin: 1.0.1 uuid: 9.0.1 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) transitivePeerDependencies: - encoding - supports-color @@ -11830,7 +11873,7 @@ snapshots: '@socket.io/redis-adapter@8.3.0(socket.io-adapter@2.5.5)': dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) notepack.io: 3.0.1 socket.io-adapter: 2.5.5 uid2: 1.0.0 @@ -12048,10 +12091,10 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tailwindcss/forms@0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))': + '@tailwindcss/forms@0.5.9(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))': dependencies: mini-svg-data-uri: 1.4.4 - tailwindcss: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + tailwindcss: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) '@tanstack/react-table@8.20.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: @@ -12473,7 +12516,7 @@ snapshots: '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@4.9.5) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@4.9.5) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 @@ -12493,7 +12536,7 @@ snapshots: '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.6.2) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.2) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 graphemer: 1.4.0 ignore: 5.3.2 @@ -12511,7 +12554,7 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@4.9.5) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 optionalDependencies: typescript: 4.9.5 @@ -12524,7 +12567,7 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.2) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 optionalDependencies: typescript: 5.6.2 @@ -12545,7 +12588,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@4.9.5) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@4.9.5) - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 ts-api-utils: 1.3.0(typescript@4.9.5) optionalDependencies: @@ -12557,7 +12600,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.6.2) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.6.2) - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) eslint: 8.57.1 ts-api-utils: 1.3.0(typescript@5.6.2) optionalDependencies: @@ -12573,7 +12616,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.3 @@ -12587,7 +12630,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -12602,7 +12645,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -12668,7 +12711,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vercel/style-guide@5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(prettier@3.3.3)(typescript@4.9.5)': + '@vercel/style-guide@5.2.0(@next/eslint-plugin-next@13.5.6)(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(prettier@3.3.3)(typescript@4.9.5)': dependencies: '@babel/core': 7.25.2 '@babel/eslint-parser': 7.25.1(@babel/core@7.25.2)(eslint@8.57.1) @@ -12679,10 +12722,10 @@ snapshots: eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1)) eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.1) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1) - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1) - eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5))(eslint@8.57.1) + eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5))(eslint@8.57.1) eslint-plugin-react: 7.36.1(eslint@8.57.1) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) eslint-plugin-testing-library: 6.3.0(eslint@8.57.1)(typescript@4.9.5) @@ -12818,13 +12861,13 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color agent-base@7.1.1: dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -13657,13 +13700,28 @@ snapshots: sha.js: 2.4.11 optional: true - create-jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + create-jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)): + dependencies: + '@jest/types': 29.6.3 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.11 + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + jest-util: 29.7.0 + prompts: 2.4.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + create-jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -13757,10 +13815,6 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.3.7: - dependencies: - ms: 2.1.3 - debug@4.3.7(supports-color@5.5.0): dependencies: ms: 2.1.3 @@ -13986,7 +14040,7 @@ snapshots: engine.io-client@6.5.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) engine.io-parser: 5.2.3 ws: 8.17.1 xmlhttprequest-ssl: 2.0.0 @@ -14006,7 +14060,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) engine.io-parser: 5.2.3 ws: 8.17.1 transitivePeerDependencies: @@ -14222,7 +14276,7 @@ snapshots: eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1)): dependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) eslint-import-resolver-node@0.3.9: dependencies: @@ -14235,16 +14289,16 @@ snapshots: eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) enhanced-resolve: 5.17.1 eslint: 8.57.1 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.11.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node @@ -14262,16 +14316,6 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.11.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint@8.57.1): - dependencies: - debug: 3.2.7 - optionalDependencies: - '@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@4.9.5) - eslint: 8.57.1 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-plugin-import@2.30.0)(eslint@8.57.1) - transitivePeerDependencies: - - supports-color - eslint-module-utils@2.11.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): dependencies: debug: 3.2.7 @@ -14301,7 +14345,7 @@ snapshots: eslint: 8.57.1 ignore: 5.3.2 - eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -14357,13 +14401,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5): + eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5): dependencies: '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@4.9.5) eslint: 8.57.1 optionalDependencies: '@typescript-eslint/eslint-plugin': 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5) - jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) transitivePeerDependencies: - supports-color - typescript @@ -14413,11 +14457,11 @@ snapshots: resolve: 1.22.8 semver: 6.3.1 - eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5))(eslint@8.57.1): + eslint-plugin-playwright@0.16.0(eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5))(eslint@8.57.1): dependencies: eslint: 8.57.1 optionalDependencies: - eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5) + eslint-plugin-jest: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(typescript@4.9.5))(eslint@8.57.1)(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@4.9.5) eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.3.3): dependencies: @@ -14528,7 +14572,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -14922,7 +14966,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))): + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)): dependencies: '@babel/code-frame': 7.24.7 chalk: 4.1.2 @@ -14937,7 +14981,7 @@ snapshots: semver: 7.6.3 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) form-data@4.0.0: dependencies: @@ -15330,7 +15374,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -15342,14 +15386,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.5: dependencies: agent-base: 7.1.1 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -15380,7 +15424,7 @@ snapshots: import-from-esm@1.3.4: dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) import-meta-resolve: 4.1.0 transitivePeerDependencies: - supports-color @@ -15675,7 +15719,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) istanbul-lib-coverage: 3.2.2 source-map: 0.6.1 transitivePeerDependencies: @@ -15749,16 +15793,35 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + jest-cli@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + '@jest/test-result': 29.7.0 + '@jest/types': 29.6.3 + chalk: 4.1.2 + create-jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + exit: 0.1.2 + import-local: 3.2.0 + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + jest-util: 29.7.0 + jest-validate: 29.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest-cli@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + create-jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest-config: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -15768,7 +15831,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + jest-config@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)): dependencies: '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 @@ -15794,7 +15857,38 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 20.16.5 - ts-node: 10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2) + ts-node: 10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3) + transitivePeerDependencies: + - babel-plugin-macros + - supports-color + + jest-config@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): + dependencies: + '@babel/core': 7.25.2 + '@jest/test-sequencer': 29.7.0 + '@jest/types': 29.6.3 + babel-jest: 29.7.0(@babel/core@7.25.2) + chalk: 4.1.2 + ci-info: 3.9.0 + deepmerge: 4.3.1 + glob: 7.2.3 + graceful-fs: 4.2.11 + jest-circus: 29.7.0 + jest-environment-node: 29.7.0 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.7.0 + jest-runner: 29.7.0 + jest-util: 29.7.0 + jest-validate: 29.7.0 + micromatch: 4.0.8 + parse-json: 5.2.0 + pretty-format: 29.7.0 + slash: 3.0.0 + strip-json-comments: 3.1.1 + optionalDependencies: + '@types/node': 20.16.5 + ts-node: 10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -15869,9 +15963,9 @@ snapshots: slash: 3.0.0 stack-utils: 2.0.6 - jest-mock-extended@3.0.7(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.3.3): + jest-mock-extended@3.0.7(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)))(typescript@5.3.3): dependencies: - jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) ts-essentials: 10.0.2(typescript@5.3.3) typescript: 5.3.3 @@ -16026,12 +16120,24 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)): + dependencies: + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + '@jest/types': 29.6.3 + import-local: 3.2.0 + jest-cli: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - supports-color + - ts-node + + jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + '@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest-cli: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -16618,7 +16724,7 @@ snapshots: micromark@4.0.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.1 @@ -17256,13 +17362,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.47 - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): dependencies: lilconfig: 3.1.2 yaml: 2.5.1 optionalDependencies: postcss: 8.4.47 - ts-node: 10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2) + ts-node: 10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2) postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(yaml@2.5.1): dependencies: @@ -17786,7 +17892,7 @@ snapshots: '@semantic-release/release-notes-generator': 14.0.1(semantic-release@24.1.1(typescript@5.6.2)) aggregate-error: 5.0.0 cosmiconfig: 9.0.0(typescript@5.6.2) - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) env-ci: 11.1.0 execa: 9.3.1 figures: 6.1.0 @@ -17967,7 +18073,7 @@ snapshots: socket.io-adapter@2.5.5: dependencies: - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) ws: 8.17.1 transitivePeerDependencies: - bufferutil @@ -17977,7 +18083,7 @@ snapshots: socket.io-client@4.7.5: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) engine.io-client: 6.5.4 socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -17988,7 +18094,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -17997,7 +18103,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) engine.io: 6.5.5 socket.io-adapter: 2.5.5 socket.io-parser: 4.2.4 @@ -18254,7 +18360,7 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 2.1.2 @@ -18314,11 +18420,11 @@ snapshots: tailwind-merge@2.5.2: {} - tailwindcss-animate@1.0.7(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2))): dependencies: - tailwindcss: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + tailwindcss: 3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) - tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)): + tailwindcss@3.4.11(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -18337,7 +18443,7 @@ snapshots: postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) postcss-nested: 6.2.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 resolve: 1.22.8 @@ -18356,14 +18462,14 @@ snapshots: type-fest: 2.19.0 unique-string: 3.0.0 - terser-webpack-plugin@5.3.10(@swc/core@1.7.26(@swc/helpers@0.5.2))(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))): + terser-webpack-plugin@5.3.10(@swc/core@1.7.26)(webpack@5.94.0(@swc/core@1.7.26)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.32.0 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) optionalDependencies: '@swc/core': 1.7.26(@swc/helpers@0.5.2) @@ -18466,12 +18572,12 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-jest@29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.3.3): + ts-jest@29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)))(typescript@5.3.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -18485,12 +18591,12 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.2) - ts-jest@29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.6.2): + ts-jest@29.2.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)))(typescript@5.6.2): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2)) + jest: 29.7.0(@types/node@20.16.5)(ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -18504,7 +18610,7 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.2) - ts-loader@9.5.1(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))): + ts-loader@9.5.1(typescript@5.3.3)(webpack@5.94.0(@swc/core@1.7.26)): dependencies: chalk: 4.1.2 enhanced-resolve: 5.17.1 @@ -18512,9 +18618,30 @@ snapshots: semver: 7.6.3 source-map: 0.7.4 typescript: 5.3.3 - webpack: 5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)) + webpack: 5.94.0(@swc/core@1.7.26) + + ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.3.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.16.5 + acorn: 8.12.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.3.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.2) + optional: true - ts-node@10.9.2(@swc/core@1.7.26(@swc/helpers@0.5.2))(@types/node@20.16.5)(typescript@5.6.2): + ts-node@10.9.2(@swc/core@1.7.26)(@types/node@20.16.5)(typescript@5.6.2): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 @@ -18566,13 +18693,13 @@ snapshots: tslib@2.7.0: {} - tsup@8.2.4(@swc/core@1.7.26(@swc/helpers@0.5.2))(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1): + tsup@8.2.4(@swc/core@1.7.26)(jiti@1.21.6)(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1): dependencies: bundle-require: 5.0.0(esbuild@0.23.1) cac: 6.7.14 chokidar: 3.6.0 consola: 3.2.3 - debug: 4.3.7 + debug: 4.3.7(supports-color@8.1.1) esbuild: 0.23.1 execa: 5.1.1 globby: 11.1.0 @@ -18909,7 +19036,7 @@ snapshots: webpack-virtual-modules@0.6.2: {} - webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2)): + webpack@5.94.0(@swc/core@1.7.26): dependencies: '@types/estree': 1.0.5 '@webassemblyjs/ast': 1.12.1 @@ -18931,7 +19058,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(@swc/core@1.7.26(@swc/helpers@0.5.2))(webpack@5.94.0(@swc/core@1.7.26(@swc/helpers@0.5.2))) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.26)(webpack@5.94.0(@swc/core@1.7.26)) watchpack: 2.4.2 webpack-sources: 3.2.3 transitivePeerDependencies: From 1793d925f248b175ea2115eb8926f4de26d670e5 Mon Sep 17 00:00:00 2001 From: Rajdip Bhattacharya Date: Sun, 10 Nov 2024 22:05:25 +0530 Subject: [PATCH 5/5] docs: Migrate to Bruno (#525) --- .../Can access live updates.bru | 36 ++++++++ .../Api Key Controller/Create API key.bru | 43 +++++++++ .../Api Key Controller/Delete API key.bru | 25 +++++ .../Api Key Controller/Get API key.bru | 25 +++++ .../Api Key Controller/Get API keys.bru | 21 +++++ .../Api Key Controller/Update API key.bru | 49 ++++++++++ api-collection/Api Key Controller/bruno.json | 6 ++ .../Api Key Controller/collection.bru | 7 ++ .../Auth Controller/GitHub auth.bru | 15 +++ .../Auth Controller/GitLab auth.bru | 15 +++ .../Auth Controller/Google auth.bru | 15 +++ api-collection/Auth Controller/Send OTP.bru | 25 +++++ .../Auth Controller/Validate OTP.bru | 22 +++++ api-collection/Auth Controller/bruno.json | 9 ++ api-collection/Auth Controller/collection.bru | 7 ++ .../Create environment.bru | 37 ++++++++ .../Delete environment.bru | 19 ++++ .../Get all environments of project.bru | 25 +++++ .../Get environment by slug.bru | 25 +++++ .../Update environment.bru | 37 ++++++++ .../Environment Controller/bruno.json | 9 ++ .../Environment Controller/collection.bru | 7 ++ .../Event Controller/Get all events.bru | 24 +++++ api-collection/Event Controller/bruno.json | 9 ++ .../Event Controller/collection.bru | 7 ++ .../Create integration.bru | 46 ++++++++++ .../Delete integration.bru | 25 +++++ .../Get all integrations of workspace.bru | 25 +++++ .../Get integration by slug.bru | 25 +++++ .../Update integration.bru | 45 +++++++++ .../Integration Controller/bruno.json | 9 ++ .../Integration Controller/collection.bru | 7 ++ api-collection/Misc/Health Checkup.bru | 22 +++++ api-collection/Misc/bruno.json | 9 ++ api-collection/Misc/collection.bru | 7 ++ .../Project Controller/Create project.bru | 92 +++++++++++++++++++ .../Project Controller/Delete project.bru | 25 +++++ .../Project Controller/Fork project.bru | 39 ++++++++ .../Get all forks of project.bru | 19 ++++ .../Get all projects of workspace.bru | 19 ++++ .../Get project by slug.bru | 19 ++++ .../Project Controller/Sync fork.bru | 35 +++++++ .../Project Controller/Unlink fork parent.bru | 25 +++++ .../Project Controller/Update project.bru | 45 +++++++++ api-collection/Project Controller/bruno.json | 9 ++ .../Project Controller/collection.bru | 7 ++ .../Secret Controller/Create secret.bru | 51 ++++++++++ .../Secret Controller/Delete secret.bru | 25 +++++ .../Fetch all by project and environment.bru | 26 ++++++ .../Get all revisions of secret.bru | 20 ++++ .../Get all secrets of project.bru | 29 ++++++ .../Secret Controller/Rollback secret.bru | 30 ++++++ .../Secret Controller/Update secret.bru | 45 +++++++++ api-collection/Secret Controller/bruno.json | 9 ++ .../Secret Controller/collection.bru | 7 ++ .../User Controller/Delete self.bru | 17 ++++ api-collection/User Controller/Get self.bru | 17 ++++ .../Resend email change OTP.bru | 17 ++++ .../User Controller/Update self.bru | 32 +++++++ .../Validate email change OTP.bru | 21 +++++ api-collection/User Controller/bruno.json | 9 ++ api-collection/User Controller/collection.bru | 7 ++ .../Variable Controller/Create variable.bru | 50 ++++++++++ .../Variable Controller/Delete variable.bru | 23 +++++ .../Fetch all by project and environment.bru | 26 ++++++ .../Get all revisions of variable.bru | 20 ++++ .../Get all variables of project.bru | 19 ++++ .../Variable Controller/Rollback variable.bru | 24 +++++ .../Variable Controller/Update variable.bru | 44 +++++++++ api-collection/Variable Controller/bruno.json | 9 ++ .../Variable Controller/collection.bru | 7 ++ .../Workspace Controller/Create workspace.bru | 34 +++++++ .../Workspace Controller/Delete workspace.bru | 25 +++++ .../Workspace Controller/Export data.bru | 35 +++++++ .../Get all workspace of user.bru | 21 +++++ .../Workspace Controller/Get workspace.bru | 25 +++++ .../Workspace Controller/Global search.bru | 28 ++++++ .../Workspace Controller/Update workspace.bru | 38 ++++++++ .../Workspace Controller/bruno.json | 9 ++ .../Workspace Controller/collection.bru | 7 ++ .../Accept invitation.bru | 15 +++ .../Cancel invitation.bru | 16 ++++ .../Check if user is member of workspace.bru | 22 +++++ .../Decline invitation to workspace.bru | 21 +++++ .../Get all members of workspace.bru | 21 +++++ .../Invite users to workspace.bru | 40 ++++++++ .../Leave workspace.bru | 21 +++++ .../Remove users from workspace.bru | 15 +++ .../Transfer ownership of workspace.bru | 16 ++++ .../Update member role in workspace.bru | 30 ++++++ .../bruno.json | 9 ++ .../collection.bru | 7 ++ .../Check workspace role exists.bru | 26 ++++++ .../Create workspace role.bru | 43 +++++++++ .../Delete workspace role.bru | 25 +++++ .../Get all workspace roles of workspace.bru | 25 +++++ .../Get workspace role.bru | 25 +++++ .../Update workspace role.bru | 40 ++++++++ .../Workspace Role Controller/bruno.json | 9 ++ .../Workspace Role Controller/collection.bru | 7 ++ api-collection/bruno.json | 9 ++ api-collection/environments/Development.bru | 3 + api-collection/environments/Stage.bru | 3 + apps/api/src/app/app.module.ts | 3 +- apps/api/src/provider/minio.provider.ts | 3 + apps/api/src/workspace/workspace.e2e.spec.ts | 3 +- apps/web/src/components/hero/index.tsx | 14 +-- .../running-things-locally/api-testing.md | 16 +++- package.json | 4 - packages/schema/package-lock.json | 13 ++- 110 files changed, 2362 insertions(+), 21 deletions(-) create mode 100644 api-collection/Api Key Controller/Can access live updates.bru create mode 100644 api-collection/Api Key Controller/Create API key.bru create mode 100644 api-collection/Api Key Controller/Delete API key.bru create mode 100644 api-collection/Api Key Controller/Get API key.bru create mode 100644 api-collection/Api Key Controller/Get API keys.bru create mode 100644 api-collection/Api Key Controller/Update API key.bru create mode 100644 api-collection/Api Key Controller/bruno.json create mode 100644 api-collection/Api Key Controller/collection.bru create mode 100644 api-collection/Auth Controller/GitHub auth.bru create mode 100644 api-collection/Auth Controller/GitLab auth.bru create mode 100644 api-collection/Auth Controller/Google auth.bru create mode 100644 api-collection/Auth Controller/Send OTP.bru create mode 100644 api-collection/Auth Controller/Validate OTP.bru create mode 100644 api-collection/Auth Controller/bruno.json create mode 100644 api-collection/Auth Controller/collection.bru create mode 100644 api-collection/Environment Controller/Create environment.bru create mode 100644 api-collection/Environment Controller/Delete environment.bru create mode 100644 api-collection/Environment Controller/Get all environments of project.bru create mode 100644 api-collection/Environment Controller/Get environment by slug.bru create mode 100644 api-collection/Environment Controller/Update environment.bru create mode 100644 api-collection/Environment Controller/bruno.json create mode 100644 api-collection/Environment Controller/collection.bru create mode 100644 api-collection/Event Controller/Get all events.bru create mode 100644 api-collection/Event Controller/bruno.json create mode 100644 api-collection/Event Controller/collection.bru create mode 100644 api-collection/Integration Controller/Create integration.bru create mode 100644 api-collection/Integration Controller/Delete integration.bru create mode 100644 api-collection/Integration Controller/Get all integrations of workspace.bru create mode 100644 api-collection/Integration Controller/Get integration by slug.bru create mode 100644 api-collection/Integration Controller/Update integration.bru create mode 100644 api-collection/Integration Controller/bruno.json create mode 100644 api-collection/Integration Controller/collection.bru create mode 100644 api-collection/Misc/Health Checkup.bru create mode 100644 api-collection/Misc/bruno.json create mode 100644 api-collection/Misc/collection.bru create mode 100644 api-collection/Project Controller/Create project.bru create mode 100644 api-collection/Project Controller/Delete project.bru create mode 100644 api-collection/Project Controller/Fork project.bru create mode 100644 api-collection/Project Controller/Get all forks of project.bru create mode 100644 api-collection/Project Controller/Get all projects of workspace.bru create mode 100644 api-collection/Project Controller/Get project by slug.bru create mode 100644 api-collection/Project Controller/Sync fork.bru create mode 100644 api-collection/Project Controller/Unlink fork parent.bru create mode 100644 api-collection/Project Controller/Update project.bru create mode 100644 api-collection/Project Controller/bruno.json create mode 100644 api-collection/Project Controller/collection.bru create mode 100644 api-collection/Secret Controller/Create secret.bru create mode 100644 api-collection/Secret Controller/Delete secret.bru create mode 100644 api-collection/Secret Controller/Fetch all by project and environment.bru create mode 100644 api-collection/Secret Controller/Get all revisions of secret.bru create mode 100644 api-collection/Secret Controller/Get all secrets of project.bru create mode 100644 api-collection/Secret Controller/Rollback secret.bru create mode 100644 api-collection/Secret Controller/Update secret.bru create mode 100644 api-collection/Secret Controller/bruno.json create mode 100644 api-collection/Secret Controller/collection.bru create mode 100644 api-collection/User Controller/Delete self.bru create mode 100644 api-collection/User Controller/Get self.bru create mode 100644 api-collection/User Controller/Resend email change OTP.bru create mode 100644 api-collection/User Controller/Update self.bru create mode 100644 api-collection/User Controller/Validate email change OTP.bru create mode 100644 api-collection/User Controller/bruno.json create mode 100644 api-collection/User Controller/collection.bru create mode 100644 api-collection/Variable Controller/Create variable.bru create mode 100644 api-collection/Variable Controller/Delete variable.bru create mode 100644 api-collection/Variable Controller/Fetch all by project and environment.bru create mode 100644 api-collection/Variable Controller/Get all revisions of variable.bru create mode 100644 api-collection/Variable Controller/Get all variables of project.bru create mode 100644 api-collection/Variable Controller/Rollback variable.bru create mode 100644 api-collection/Variable Controller/Update variable.bru create mode 100644 api-collection/Variable Controller/bruno.json create mode 100644 api-collection/Variable Controller/collection.bru create mode 100644 api-collection/Workspace Controller/Create workspace.bru create mode 100644 api-collection/Workspace Controller/Delete workspace.bru create mode 100644 api-collection/Workspace Controller/Export data.bru create mode 100644 api-collection/Workspace Controller/Get all workspace of user.bru create mode 100644 api-collection/Workspace Controller/Get workspace.bru create mode 100644 api-collection/Workspace Controller/Global search.bru create mode 100644 api-collection/Workspace Controller/Update workspace.bru create mode 100644 api-collection/Workspace Controller/bruno.json create mode 100644 api-collection/Workspace Controller/collection.bru create mode 100644 api-collection/Workspace Membership Controller/Accept invitation.bru create mode 100644 api-collection/Workspace Membership Controller/Cancel invitation.bru create mode 100644 api-collection/Workspace Membership Controller/Check if user is member of workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Decline invitation to workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Get all members of workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Invite users to workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Leave workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Remove users from workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Transfer ownership of workspace.bru create mode 100644 api-collection/Workspace Membership Controller/Update member role in workspace.bru create mode 100644 api-collection/Workspace Membership Controller/bruno.json create mode 100644 api-collection/Workspace Membership Controller/collection.bru create mode 100644 api-collection/Workspace Role Controller/Check workspace role exists.bru create mode 100644 api-collection/Workspace Role Controller/Create workspace role.bru create mode 100644 api-collection/Workspace Role Controller/Delete workspace role.bru create mode 100644 api-collection/Workspace Role Controller/Get all workspace roles of workspace.bru create mode 100644 api-collection/Workspace Role Controller/Get workspace role.bru create mode 100644 api-collection/Workspace Role Controller/Update workspace role.bru create mode 100644 api-collection/Workspace Role Controller/bruno.json create mode 100644 api-collection/Workspace Role Controller/collection.bru create mode 100644 api-collection/bruno.json create mode 100644 api-collection/environments/Development.bru create mode 100644 api-collection/environments/Stage.bru 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

)) @@ -28,12 +28,14 @@ function Hero(): React.JSX.Element { } const dataInStorage: string | null = localStorage.getItem('waitlistData') - const emailsInWaitlist: string[] = dataInStorage ? (JSON.parse(dataInStorage) as string[]) : [] - + const emailsInWaitlist: string[] = dataInStorage + ? (JSON.parse(dataInStorage) as string[]) + : [] + // actual logic where we are checking if this email is already in waitlisted users or not if (emailsInWaitlist.includes(email)) { toast.custom(() => ( -
+

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

- - )) + )) emailsInWaitlist.push(email) localStorage.setItem('waitlistData', JSON.stringify(emailsInWaitlist)) setEmail('') - } catch (error) { // eslint-disable-next-line no-console -- chill console.error(error) diff --git a/docs/contributing-to-keyshade/running-things-locally/api-testing.md b/docs/contributing-to-keyshade/running-things-locally/api-testing.md index 48b7a29d..c5ccbe37 100644 --- a/docs/contributing-to-keyshade/running-things-locally/api-testing.md +++ b/docs/contributing-to-keyshade/running-things-locally/api-testing.md @@ -1,15 +1,21 @@ --- -description: API testing using Postman +description: API testing using Bruno --- # API Testing -We use Postman to test our APIs. All of our endpoints are tested using Postman and we maintain a detailed documentation of every endpoint in our Postman collection. You can find the workspace in [here](https://www.postman.com/keyshade/workspace/keyshade/api/a31bdb66-69e3-469b-afb4-f2051385e634?action=share&creator=32733901) +We use Bruno to test our APIs. All of our endpoints are tested using Bruno and we maintain a detailed documentation of every endpoint in our Postman collection. You can find the it in [here](../../../api-collection/). -We maintain an API named [`keyshade API`](https://www.postman.com/keyshade/workspace/keyshade/api/a31bdb66-69e3-469b-afb4-f2051385e634?action=share&creator=32733901) in our Postman workspace. This API contains all the endpoints that we have in our application. This is where you can find all the collections which you can use to develop/test our APIs +Although we recommend to use Bruno, you can always import the collections into your favorite tool. ## Getting started -- For starters, make sure you have Postman installed on your system. If not, you can download it from [here](https://www.postman.com/downloads/) -- Once you have Postman installed, you can go to the API link mentioned above. +- For starters, make sure you have Bruno installed on your system. If not, you can download it from [here](https://www.usebruno.com/downloads) +- Once you have Postman installed, open it up. +- Click on `Import Collection` +- Point to the [`api-collection`](../../../api-collection/) folder - For every collection in the API, the requests hold one or more examples that you can use to test the API. You can also find the schema of the request itself. + +## Making changes to the API + +Whenever you make a change to the API that adds / removes / updates one or more requests, you are required to update the corresponding collection in the [api-collection](../../../api-collection/) folder. Since the collections are tracked in the branch, we expect you to make all the changes in the same branch which you are working on. diff --git a/package.json b/package.json index cd0d5c89..73f909ea 100644 --- a/package.json +++ b/package.json @@ -59,10 +59,6 @@ { "type": "test", "hidden": true - }, - { - "type": "postman", - "hidden": true } ] } diff --git a/packages/schema/package-lock.json b/packages/schema/package-lock.json index 489e37fa..8027314f 100644 --- a/packages/schema/package-lock.json +++ b/packages/schema/package-lock.json @@ -6,7 +6,18 @@ "packages": { "": { "name": "@keyshade/schema", - "version": "1.0.0" + "version": "1.0.0", + "dependencies": { + "zod": "^3.23.6" + } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } }