Skip to content

The open alternative to Salesforce, designed for AI.

OAuth Client — Unified ApplicationRegistration, OAuth server, and frontend (#18267)

Félix Malfait012d819557e0
diff --git a/npm-app-distribution-plan.md b/npm-app-distribution-plan.md
new file mode 100644
index 00000000000..246a466df7c
--- /dev/null
+++ b/npm-app-distribution-plan.md
@@ -0,0 +1,283 @@
+# npm-Based App Distribution for Twenty
+
+*Technical Design Document -- February 2026*
+
+## Overview
+
+Add npm registry support for distributing Twenty apps (public and private), with per-AppRegistration registry overrides, direct tarball upload as escape hatch, and version upgrade detection.
+
+## Assumptions
+
+- The marketplace install flow (currently a TODO in the resolver and frontend) will be implemented separately. This plan provides the infrastructure that install flow will call into.
+- The existing `app:dev` flow (individual file uploads via CLI) remains unchanged.
+- The existing GitHub-based marketplace discovery remains as a curated fallback.
+
+## Architecture
+
+```
+ Developer
+ / | \
+ npm publish | twenty app:push
+ / | \
+ npmjs.com Private Reg Server REST Upload
+ | | |
+ v v v
+ [Discovery Layer] [Direct Upload]
+ npm search API |
+ GitHub curated list |
+ | |
+ v |
+ MarketplaceService |
+ (sourcePackage in DTO) |
+ | |
+ v v
+ AppPackageResolverService <--------+
+ .npmrc generation
+ yarn add / tarball extract
+ |
+ v
+ ApplicationSyncService (existing)
+ WorkspaceMigrationRunnerService
+ |
+ v
+ AppRegistration + Application entities
+```
+
+## Phase 1: Entity and Config Changes
+
+### 1a. Extend AppRegistrationEntity
+
+Add four columns to `application-registration.entity.ts`:
+
+- **`sourcePackage`** (text, nullable) -- npm package name, e.g. `"twenty-app-fireflies"` or `"@myorg/twenty-app-crm"`. Null for tarball-only or OAuth-only apps.
+- **`tarballFileId`** (uuid, nullable) -- FK to a FileEntity storing a directly-uploaded `.tar.gz`. Null when the app comes from npm.
+- **`registryUrl`** (text, nullable) -- per-registration npm registry override. Null means "use the server default `APP_REGISTRY_URL`." This is how a single server can pull public apps from npmjs.com while pulling `@mycompany/*` apps from GitHub Packages.
+- **`latestAvailableVersion`** (text, nullable) -- cached latest version from the registry, updated periodically. Compared against `Application.version` to surface upgrade availability.
+
+**Source resolution priority:**
+
+1. `sourcePackage` is set → resolve from npm via `yarn add`
+2. `tarballFileId` is set → extract from file storage
+3. Neither → OAuth-only app, no server-side code
+
+### 1b. Extend ApplicationEntity.sourceType
+
+Widen the `sourceType` union from `'local'` to `'local' | 'npm' | 'tarball'`:
+
+- `'local'` -- existing behavior (CLI `app:dev`, individual file uploads, workspace-custom)
+- `'npm'` -- installed from an npm registry via `yarn add`
+- `'tarball'` -- installed from a directly-uploaded tarball
+
+This lets the system distinguish how an app was installed, which matters for upgrade logic (npm apps can check the registry for newer versions; tarball apps cannot).
+
+### 1c. Add server-wide config variables
+
+Add a new `APP_REGISTRY_CONFIG` group to ConfigVariablesGroup:
+
+- **`APP_REGISTRY_URL`** (string, default `https://registry.npmjs.org`) -- default npm registry URL
+- **`APP_REGISTRY_TOKEN`** (string, optional, sensitive) -- auth token for the default registry
+
+### 1d. Generate migration
+
+TypeORM migration adding `sourcePackage`, `tarballFileId`, `registryUrl`, `latestAvailableVersion` to `core.applicationRegistration`.
+
+## Phase 2: App Package Resolver Service
+
+### 2a. Create AppPackageResolverService
+
+New service with core method:
+
+```
+resolvePackage(appRegistration, options?: { targetVersion? }) → ResolvedPackage | null
+```
+
+Returns `{ manifestPath, packageJsonPath, filesDir }` or null for OAuth-only apps.
+
+**Resolution logic:**
+
+```
+if sourcePackage:
+ 1. Determine registry: appRegistration.registryUrl ?? APP_REGISTRY_URL
+ 2. Determine auth token for the resolved registry
+ 3. Generate temporary .npmrc in an isolated working directory
+ 4. Run: yarn add <sourcePackage>@<targetVersion ?? latest>
+ 5. Read manifest from node_modules/<sourcePackage>/.twenty/output/manifest.json
+ 6. Return paths
+
+if tarballFileId:
+ 1. Download tarball from FileStorageService
+ 2. Extract to temporary directory
+ 3. Read manifest from extracted files
+ 4. Return paths
+
+else:
+ return null (OAuth-only)
+```
+
+### 2b. Isolated working directories
+
+Each resolution runs in a temporary directory under `{os.tmpdir()}/twenty-app-resolver/{uuid}/`. This avoids contaminating the server's own `node_modules` and isolates apps from each other. Cleaned up after files are copied to storage.
+
+### 2c. .npmrc generation
+
+For scoped packages (`@scope/twenty-app-*`):
+
+```
+@scope:registry=https://npm.pkg.github.com
+//npm.pkg.github.com/:_authToken=TOKEN
+```
+
+For unscoped packages with a non-default registry:
+
+```
+registry=https://my-verdaccio.internal:4873
+//my-verdaccio.internal:4873/:_authToken=TOKEN
+```
+
+### 2d. Post-resolution file transfer
+
+After resolving, copies files into the app's storage path using the existing FileStorageService layout:
+
+```
+{workspaceId}/{applicationUniversalIdentifier}/
+ built-logic-function/...
+ built-front-component/...
+ dependencies/package.json
+ dependencies/yarn.lock
+ public-asset/...
+ source/...
+```
+
+This reuses the same FileFolder enum paths that `app:dev` uses, so downstream ApplicationSyncService works unchanged.
+
+## Phase 3: Marketplace Discovery via npm
+
+### 3a. Update MarketplaceService
+
+Add npm-based discovery alongside the existing GitHub path:
+
+- Query npm search API: `GET {registryUrl}/-/v1/search?text=keywords:twenty-app&size=250`
+- Map each result to MarketplaceAppDTO using package.json metadata
+
+**Merge strategy:**
+
+1. Fetch from npm search API (apps with `keywords: ["twenty-app"]`)
+2. Fetch from GitHub (existing curated list)
+3. Merge by `universalIdentifier` -- GitHub entries override npm entries (allowing curation)
+4. Cache merged result with existing 1-hour TTL
+
+### 3b. Add sourcePackage to MarketplaceAppDTO
+
+The DTO needs a `sourcePackage: string | null` field so the install flow knows which npm package to resolve. For npm-discovered apps, this is the package name. For GitHub-only apps, this is null.
+
+## Phase 4: Version Upgrade Support
+
+### 4a. Create AppUpgradeService
+
+**Periodic version check (npm-sourced apps only):**
+
+- Fetches `{registryUrl}/{sourcePackage}/latest` from the npm registry
+- Stores result in `AppRegistration.latestAvailableVersion`
+- Frontend compares against `Application.version` to show "Update available"
+
+**Upgrade trigger:**
+
+1. Resolve the new version via AppPackageResolverService
+2. Sync via existing ApplicationSyncService (triggers workspace migration for schema changes)
+3. Update Application.version
+
+**Rollback strategy:** If sync fails (e.g., migration validation error), re-resolve the previous version and re-sync. This is possible because npm retains all published versions.
+
+### 4b. Version check scheduling
+
+Lightweight cron or check-on-access pattern. Iterates over AppRegistrations where `sourcePackage IS NOT NULL` and calls `checkForUpdates()`. Frequency: once per hour, matching the existing marketplace cache TTL.
+
+## Phase 5: SDK CLI Commands
+
+### 5a. Finalize `twenty app:build`
+
+Ensure `.twenty/output/` is npm-publishable. The build step generates a `package.json` in the output directory:
+
+```json
+{
+ "name": "twenty-app-fireflies",
+ "version": "1.2.0",
+ "keywords": ["twenty-app"],
+ "twenty": {
+ "universalIdentifier": "a4df0c0f-c65e-44e5-8436-24814182d4ac"
+ },
+ "files": ["manifest.json", "built-logic-function", "built-front-component", "public-asset"]
+}
+```
+
+The developer then publishes with standard `npm publish` -- no custom command needed.
+
+### 5b. `twenty app:pack` (new command)
+
+```
+twenty app:pack [appPath]
+```
+
+- Runs `app:build` if `.twenty/output/` doesn't exist or is stale
+- Uses existing TarballService to create `{name}-{version}.tar.gz`
+- Outputs the file path for manual distribution
+
+### 5c. `twenty app:push` (new command)
+
+```
+twenty app:push [appPath] --server <url> --token <token>
+```
+
+- Runs `app:pack` to produce the tarball
+- Reads universalIdentifier from manifest to find or create the AppRegistration
+- Uploads via `POST /api/app-registrations/upload-tarball`
+- Reports success with the registration ID
+- Reuses `twenty auth:login` credentials if `--server` is not specified
+
+## Phase 6: Server Tarball Upload Endpoint
+
+### 6a. REST controller
+
+```
+POST /api/app-registrations/upload-tarball
+Content-Type: multipart/form-data
+Body: tarball file + optional universalIdentifier
+```
+
+**Validation:**
+
+- Max file size: 50MB
+- Must be a valid `.tar.gz`
+- Extracted contents must contain `manifest.json` with a valid `universalIdentifier`
+- The `universalIdentifier` must not conflict with an existing registration owned by a different user
+
+**Flow:**
+
+1. Extract tarball to temp directory
+2. Validate manifest structure
+3. Find or create AppRegistration by universalIdentifier
+4. Store tarball in FileStorageService under `FileFolder.AppTarball`
+5. Set `tarballFileId` on the AppRegistration
+6. Return the AppRegistration entity
+
+### 6b. Add FileFolder.AppTarball
+
+New enum value `AppTarball = 'app-tarball'` in FileFolder.
+
+## Key Design Decisions
+
+| Decision | Rationale |
+|---|---|
+| Per-AppRegistration registry override | `registryUrl` on the entity allows mixing registries. Public apps from npmjs.com, private from GitHub Packages/Verdaccio. Server-wide `APP_REGISTRY_URL` is the fallback. |
+| npm publish is standard | No custom publish infra. Free versioning, README, `npm audit`, download stats, proven auth model. |
+| Tarball as escape hatch | Air-gapped environments, CI pipelines, one-off installs. Cannot auto-upgrade. |
+| sourceType distinction | `'npm' \| 'tarball' \| 'local'` lets the system know which upgrade path is available. Only npm apps can check for newer versions. |
+| Backward compatible | `app:dev` flow unchanged. GitHub marketplace unchanged. All new fields nullable. |
+| Upgrade rollback | Re-resolve previous version from npm on failure. Safe because npm never deletes published versions. |
+
+## Edge Cases
+
+- **npm unreachable**: Timeout after 30s, throw clear error. App remains at current installed version.
+- **Package name conflicts**: The `universalIdentifier` in the `twenty` field of `package.json` is the source of truth, not the npm package name. Two packages with the same universalIdentifier conflict at the AppRegistration level (unique index).
+- **Scoped vs unscoped packages**: Both work. Scoped packages naturally route to a private registry via `.npmrc` scope mapping.
+- **Multiple workspaces, same server**: AppRegistration is server-level (core schema). Application is workspace-level. One AppRegistration can be installed in multiple workspaces at different versions.
diff --git a/npm-app-distribution-plan.pdf b/npm-app-distribution-plan.pdf
new file mode 100644
index 00000000000..e37caf5d4b2
Binary files /dev/null and b/npm-app-distribution-plan.pdf differ
diff --git a/packages/create-twenty-app/src/utils/__tests__/app-template.spec.ts b/packages/create-twenty-app/src/utils/__tests__/app-template.spec.ts
index 2a0b9a275f7..842d8087568 100644
--- a/packages/create-twenty-app/src/utils/__tests__/app-template.spec.ts
+++ b/packages/create-twenty-app/src/utils/__tests__/app-template.spec.ts
@@ -5,7 +5,6 @@ import * as fs from 'fs-extra';
import { tmpdir } from 'os';
import { join } from 'path';
-// Mock fs-extra's copy function to skip copying base template (not available during tests)
jest.mock('fs-extra', () => {
const actual = jest.requireActual('fs-extra');
return {
@@ -41,7 +40,6 @@ describe('copyBaseApplicationProject', () => {
let testAppDirectory: string;
beforeEach(async () => {
- // Create a unique temp directory for each test
testAppDirectory = join(
tmpdir(),
`test-twenty-app-${Date.now()}-${Math.random().toString(36).slice(2)}`,
@@ -51,7 +49,6 @@ describe('copyBaseApplicationProject', () => {
});
afterEach(async () => {
- // Clean up temp directory after each test
if (testAppDirectory && (await fs.pathExists(testAppDirectory))) {
await fs.remove(testAppDirectory);
}
@@ -66,15 +63,12 @@ describe('copyBaseApplicationProject', () => {
exampleOptions: ALL_EXAMPLES,
});
- // Verify src/ folder exists
const srcAppPath = join(testAppDirectory, 'src');
expect(await fs.pathExists(srcAppPath)).toBe(true);
- // Verify application-config.ts exists in src/
const appConfigPath = join(srcAppPath, APPLICATION_FILE_NAME);
expect(await fs.pathExists(appConfigPath)).toBe(true);
- // Verify default-role.ts exists in src/
const roleConfigPath = join(srcAppPath, 'roles', DEFAULT_ROLE_FILE_NAME);
expect(await fs.pathExists(roleConfigPath)).toBe(true);
});
@@ -143,27 +137,22 @@ describe('copyBaseApplicationProject', () => {
const appConfigPath = join(testAppDirectory, 'src', APPLICATION_FILE_NAME);
const appConfigContent = await fs.readFile(appConfigPath, 'utf8');
- // Verify it uses defineApplication
expect(appConfigContent).toContain(
"import { defineApplication } from 'twenty-sdk'",
);
expect(appConfigContent).toContain('export default defineApplication({');
- // Verify it imports the role identifier
expect(appConfigContent).toContain(
"import { DEFAULT_ROLE_UNIVERSAL_IDENTIFIER } from 'src/roles/default-role'",
);
- // Verify display name and description
expect(appConfigContent).toContain("displayName: 'My Test App'");
expect(appConfigContent).toContain("description: 'A test application'");
- // Verify it has a universalIdentifier (UUID format)
expect(appConfigContent).toMatch(
/universalIdentifier: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'/,
);
- // Verify it references the role
expect(appConfigContent).toContain(
'defaultRoleUniversalIdentifier: DEFAULT_ROLE_UNIVERSAL_IDENTIFIER',
);
@@ -186,29 +175,24 @@ describe('copyBaseApplicationProject', () => {
);
const roleConfigContent = await fs.readFile(roleConfigPath, 'utf8');
- // Verify it uses defineRole
expect(roleConfigContent).toContain(
"import { defineRole } from 'twenty-sdk'",
);
expect(roleConfigContent).toContain('export default defineRole({');
- // Verify it exports the universal identifier constant
expect(roleConfigContent).toContain(
'export const DEFAULT_ROLE_UNIVERSAL_IDENTIFIER',
);
- // Verify role label includes app name
expect(roleConfigContent).toContain(
"label: 'My Test App default function role'",
);
- // Verify default permissions
expect(roleConfigContent).toContain('canReadAllObjectRecords: true');
expect(roleConfigContent).toContain('canUpdateAllObjectRecords: true');
expect(roleConfigContent).toContain('canSoftDeleteAllObjectRecords: true');
expect(roleConfigContent).toContain('canDestroyAllObjectRecords: false');
- // Verify it has a universalIdentifier (UUID format)
expect(roleConfigContent).toMatch(
/universalIdentifier: DEFAULT_ROLE_UNIVERSAL_IDENTIFIER/,
);
@@ -223,7 +207,6 @@ describe('copyBaseApplicationProject', () => {
exampleOptions: ALL_EXAMPLES,
});
- // Verify fs.copy was called with correct destination
expect(fs.copy).toHaveBeenCalledTimes(1);
expect(fs.copy).toHaveBeenCalledWith(
expect.stringContaining('base-application'),
@@ -247,7 +230,6 @@ describe('copyBaseApplicationProject', () => {
});
it('should generate unique UUIDs for each application', async () => {
- // Create first app
const firstAppDir = join(testAppDirectory, 'app1');
await fs.ensureDir(firstAppDir);
await copyBaseApplicationProject({
@@ -258,7 +240,6 @@ describe('copyBaseApplicationProject', () => {
exampleOptions: ALL_EXAMPLES,
});
- // Create second app
const secondAppDir = join(testAppDirectory, 'app2');
await fs.ensureDir(secondAppDir);
await copyBaseApplicationProject({
@@ -269,7 +250,6 @@ describe('copyBaseApplicationProject', () => {
exampleOptions: ALL_EXAMPLES,
});
- // Read both app configs
const firstAppConfig = await fs.readFile(
join(firstAppDir, 'src', APPLICATION_FILE_NAME),
'utf8',
@@ -279,7 +259,6 @@ describe('copyBaseApplicationProject', () => {
'utf8',
);
- // Extract UUIDs using regex
const uuidRegex =
/universalIdentifier: '([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})'/;
const firstUuid = firstAppConfig.match(uuidRegex)?.[1];
@@ -291,7 +270,6 @@ describe('copyBaseApplicationProject', () => {
});
it('should generate unique role UUIDs for each application', async () => {
- // Create first app
const firstAppDir = join(testAppDirectory, 'app1');
await fs.ensureDir(firstAppDir);
await copyBaseApplicationProject({
@@ -302,7 +280,6 @@ describe('copyBaseApplicationProject', () => {
exampleOptions: ALL_EXAMPLES,
});
- // Create second app
const secondAppDir = join(testAppDirectory, 'app2');
await fs.ensureDir(secondAppDir);
await copyBaseApplicationProject({
@@ -323,7 +300,6 @@ describe('copyBaseApplicationProject', () => {
'utf8',
);
- // Extract UUIDs using regex
const uuidRegex =
/DEFAULT_ROLE_UNIVERSAL_IDENTIFIER =\s*'([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})'/;
const firstUuid = firstRoleConfig.match(uuidRegex)?.[1];
@@ -402,7 +378,6 @@ describe('copyBaseApplicationProject', () => {
const srcPath = join(testAppDirectory, 'src');
- // Core files should exist
expect(await fs.pathExists(join(srcPath, APPLICATION_FILE_NAME))).toBe(
true,
);
@@ -422,7 +397,6 @@ describe('copyBaseApplicationProject', () => {
),
).toBe(true);
- // Example files should not exist
expect(
await fs.pathExists(join(srcPath, 'objects', 'example-object.ts')),
).toBe(false);
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 6058b057566..2d1b54f21e6 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -56,8 +56,8 @@ export type AdminAiModelConfig = {
modelId: Scalars['String'];
};
-export type AdminAiModelsOutput = {
- __typename?: 'AdminAIModelsOutput';
+export type AdminAiModels = {
+ __typename?: 'AdminAIModels';
autoEnableNewModels: Scalars['Boolean'];
models: Array<AdminAiModelConfig>;
};
@@ -311,6 +311,42 @@ export type Application = {
yarnLockFileId?: Maybe<Scalars['UUID']>;
};
+export type ApplicationRegistration = {
+ __typename?: 'ApplicationRegistration';
+ author?: Maybe<Scalars['String']>;
+ createdAt: Scalars['DateTime'];
+ description?: Maybe<Scalars['String']>;
+ id: Scalars['UUID'];
+ logoUrl?: Maybe<Scalars['String']>;
+ name: Scalars['String'];
+ oAuthClientId: Scalars['String'];
+ oAuthRedirectUris: Array<Scalars['String']>;
+ oAuthScopes: Array<Scalars['String']>;
+ termsUrl?: Maybe<Scalars['String']>;
+ universalIdentifier: Scalars['String'];
+ updatedAt: Scalars['DateTime'];
+ websiteUrl?: Maybe<Scalars['String']>;
+};
+
+export type ApplicationRegistrationStats = {
+ __typename?: 'ApplicationRegistrationStats';
+ activeInstalls: Scalars['Int'];
+ mostInstalledVersion?: Maybe<Scalars['String']>;
+ versionDistribution: Array<VersionDistributionEntry>;
+};
+
+export type ApplicationRegistrationVariable = {
+ __typename?: 'ApplicationRegistrationVariable';
+ createdAt: Scalars['DateTime'];
+ description: Scalars['String'];
+ id: Scalars['UUID'];
+ isFilled: Scalars['Boolean'];
+ isRequired: Scalars['Boolean'];
+ isSecret: Scalars['Boolean'];
+ key: Scalars['String'];
+ updatedAt: Scalars['DateTime'];
+};
+
export type ApplicationTokenPair = {
__typename?: 'ApplicationTokenPair';
applicationAccessToken: AuthToken;
@@ -367,8 +403,8 @@ export type AuthTokens = {
tokens: AuthTokenPair;
};
-export type AuthorizeAppOutput = {
- __typename?: 'AuthorizeAppOutput';
+export type AuthorizeApp = {
+ __typename?: 'AuthorizeApp';
redirectUrl: Scalars['String'];
};
@@ -396,8 +432,8 @@ export type AvailableWorkspaces = {
availableWorkspacesForSignUp: Array<AvailableWorkspace>;
};
-export type AvailableWorkspacesAndAccessTokensOutput = {
- __typename?: 'AvailableWorkspacesAndAccessTokensOutput';
+export type AvailableWorkspacesAndAccessTokens = {
+ __typename?: 'AvailableWorkspacesAndAccessTokens';
availableWorkspaces: AvailableWorkspaces;
tokens: AuthTokenPair;
};
@@ -442,13 +478,8 @@ export type BarChartConfiguration = {
timezone?: Maybe<Scalars['String']>;
};
-export type BarChartDataInput = {
- configuration: Scalars['JSON'];
- objectMetadataId: Scalars['UUID'];
-};
-
-export type BarChartDataOutput = {
- __typename?: 'BarChartDataOutput';
+export type BarChartData = {
+ __typename?: 'BarChartData';
data: Array<Scalars['JSON']>;
formattedToRawLookup: Scalars['JSON'];
groupMode: BarChartGroupMode;
@@ -463,6 +494,11 @@ export type BarChartDataOutput = {
yAxisLabel: Scalars['String'];
};
+export type BarChartDataInput = {
+ configuration: Scalars['JSON'];
+ objectMetadataId: Scalars['UUID'];
+};
+
/** Display mode for bar charts with secondary grouping */
export enum BarChartGroupMode {
GROUPED = 'GROUPED',
@@ -488,8 +524,8 @@ export type Billing = {
trialPeriods: Array<BillingTrialPeriod>;
};
-export type BillingEndTrialPeriodOutput = {
- __typename?: 'BillingEndTrialPeriodOutput';
+export type BillingEndTrialPeriod = {
+ __typename?: 'BillingEndTrialPeriod';
/** Billing portal URL for payment method update (returned when no payment method exists) */
billingPortalUrl?: Maybe<Scalars['String']>;
/** Boolean that confirms if a payment method was found */
@@ -529,8 +565,8 @@ export type BillingMeteredProduct = BillingProductDto & {
prices?: Maybe<Array<BillingPriceMetered>>;
};
-export type BillingMeteredProductUsageOutput = {
- __typename?: 'BillingMeteredProductUsageOutput';
+export type BillingMeteredProductUsage = {
+ __typename?: 'BillingMeteredProductUsage';
grantedCredits: Scalars['Float'];
periodEnd: Scalars['DateTime'];
periodStart: Scalars['DateTime'];
@@ -541,19 +577,19 @@ export type BillingMeteredProductUsageOutput = {
usedCredits: Scalars['Float'];
};
+export type BillingPlan = {
+ __typename?: 'BillingPlan';
+ licensedProducts: Array<BillingLicensedProduct>;
+ meteredProducts: Array<BillingMeteredProduct>;
+ planKey: BillingPlanKey;
+};
+
/** The different billing plans available */
export enum BillingPlanKey {
ENTERPRISE = 'ENTERPRISE',
PRO = 'PRO'
}
-export type BillingPlanOutput = {
- __typename?: 'BillingPlanOutput';
- licensedProducts: Array<BillingLicensedProduct>;
- meteredProducts: Array<BillingMeteredProduct>;
- planKey: BillingPlanKey;
-};
-
export type BillingPriceLicensed = {
__typename?: 'BillingPriceLicensed';
priceUsageType: BillingUsageType;
@@ -605,14 +641,14 @@ export type BillingProductMetadata = {
productKey: BillingProductKey;
};
-export type BillingSessionOutput = {
- __typename?: 'BillingSessionOutput';
+export type BillingSession = {
+ __typename?: 'BillingSession';
url?: Maybe<Scalars['String']>;
};
export type BillingSubscription = {
__typename?: 'BillingSubscription';
- billingSubscriptionItems?: Maybe<Array<BillingSubscriptionItemDto>>;
+ billingSubscriptionItems?: Maybe<Array<BillingSubscriptionItem>>;
currentPeriodEnd?: Maybe<Scalars['DateTime']>;
id: Scalars['UUID'];
interval?: Maybe<SubscriptionInterval>;
@@ -621,8 +657,8 @@ export type BillingSubscription = {
status: SubscriptionStatus;
};
-export type BillingSubscriptionItemDto = {
- __typename?: 'BillingSubscriptionItemDTO';
+export type BillingSubscriptionItem = {
+ __typename?: 'BillingSubscriptionItem';
billingProduct: BillingProductDto;
hasReachedCurrentPeriodCap: Scalars['Boolean'];
id: Scalars['UUID'];
@@ -649,8 +685,8 @@ export type BillingTrialPeriod = {
isCreditCardRequired: Scalars['Boolean'];
};
-export type BillingUpdateOutput = {
- __typename?: 'BillingUpdateOutput';
+export type BillingUpdate = {
+ __typename?: 'BillingUpdate';
/** All billing subscriptions */
billingSubscriptions: Array<BillingSubscription>;
/** Current billing subscription */
@@ -688,8 +724,8 @@ export type ChannelSyncSuccess = {
success: Scalars['Boolean'];
};
-export type CheckUserExistOutput = {
- __typename?: 'CheckUserExistOutput';
+export type CheckUserExist = {
+ __typename?: 'CheckUserExist';
availableWorkspacesCount: Scalars['Float'];
exists: Scalars['Boolean'];
isEmailVerified: Scalars['Boolean'];
@@ -788,6 +824,11 @@ export enum ConfigVariableType {
STRING = 'STRING'
}
+export type ConfigVariables = {
+ __typename?: 'ConfigVariables';
+ groups: Array<ConfigVariablesGroupData>;
+};
+
export enum ConfigVariablesGroup {
ANALYTICS_CONFIG = 'ANALYTICS_CONFIG',
AWS_SES_SETTINGS = 'AWS_SES_SETTINGS',
@@ -821,11 +862,6 @@ export type ConfigVariablesGroupData = {
variables: Array<ConfigVariable>;
};
-export type ConfigVariablesOutput = {
- __typename?: 'ConfigVariablesOutput';
- groups: Array<ConfigVariablesGroupData>;
-};
-
export type ConnectedImapSmtpCaldavAccount = {
__typename?: 'ConnectedImapSmtpCaldavAccount';
accountOwnerId: Scalars['UUID'];
@@ -994,6 +1030,7 @@ export type CreateAppTokenInput = {
};
export type CreateApplicationInput = {
+ applicationRegistrationId?: InputMaybe<Scalars['String']>;
description?: InputMaybe<Scalars['String']>;
name: Scalars['String'];
sourcePath: Scalars['String'];
@@ -1001,6 +1038,32 @@ export type CreateApplicationInput = {
version: Scalars['String'];
};
+export type CreateApplicationRegistration = {
+ __typename?: 'CreateApplicationRegistration';
+ applicationRegistration: ApplicationRegistration;
+ clientSecret: Scalars['String'];
+};
+
+export type CreateApplicationRegistrationInput = {
+ author?: InputMaybe<Scalars['String']>;
+ description?: InputMaybe<Scalars['String']>;
+ logoUrl?: InputMaybe<Scalars['String']>;
+ name: Scalars['String'];
+ oAuthRedirectUris?: InputMaybe<Array<Scalars['String']>>;
+ oAuthScopes?: InputMaybe<Array<Scalars['String']>>;
+ termsUrl?: InputMaybe<Scalars['String']>;
+ universalIdentifier?: InputMaybe<Scalars['String']>;
+ websiteUrl?: InputMaybe<Scalars['String']>;
+};
+
+export type CreateApplicationRegistrationVariableInput = {
+ applicationRegistrationId: Scalars['String'];
+ description?: InputMaybe<Scalars['String']>;
+ isSecret?: InputMaybe<Scalars['Boolean']>;
+ key: Scalars['String'];
+ value: Scalars['String'];
+};
+
export type CreateApprovedAccessDomainInput = {
domain: Scalars['String'];
email: Scalars['String'];
@@ -1274,17 +1337,17 @@ export type DeleteOneObjectInput = {
id: Scalars['UUID'];
};
-export type DeleteSsoInput = {
+export type DeleteSso = {
+ __typename?: 'DeleteSso';
identityProviderId: Scalars['UUID'];
};
-export type DeleteSsoOutput = {
- __typename?: 'DeleteSsoOutput';
+export type DeleteSsoInput = {
identityProviderId: Scalars['UUID'];
};
-export type DeleteTwoFactorAuthenticationMethodOutput = {
- __typename?: 'DeleteTwoFactorAuthenticationMethodOutput';
+export type DeleteTwoFactorAuthenticationMethod = {
+ __typename?: 'DeleteTwoFactorAuthenticationMethod';
/** Boolean that confirms query was dispatched */
success: Scalars['Boolean'];
};
@@ -1364,18 +1427,18 @@ export type DuplicatedDashboard = {
updatedAt: Scalars['String'];
};
-export type EditSsoInput = {
+export type EditSso = {
+ __typename?: 'EditSso';
id: Scalars['UUID'];
+ issuer: Scalars['String'];
+ name: Scalars['String'];
status: SsoIdentityProviderStatus;
+ type: IdentityProviderType;
};
-export type EditSsoOutput = {
- __typename?: 'EditSsoOutput';
+export type EditSsoInput = {
id: Scalars['UUID'];
- issuer: Scalars['String'];
- name: Scalars['String'];
status: SsoIdentityProviderStatus;
- type: IdentityProviderType;
};
export type EmailAccountConnectionParameters = {
@@ -1384,8 +1447,8 @@ export type EmailAccountConnectionParameters = {
SMTP?: InputMaybe<ConnectionParameters>;
};
-export type EmailPasswordResetLinkOutput = {
- __typename?: 'EmailPasswordResetLinkOutput';
+export type EmailPasswordResetLink = {
+ __typename?: 'EmailPasswordResetLink';
/** Boolean that confirms query was dispatched */
success: Scalars['Boolean'];
};
@@ -1484,13 +1547,6 @@ export type ExecuteOneLogicFunctionInput = {
export type FeatureFlag = {
__typename?: 'FeatureFlag';
- id: Scalars['UUID'];
- key: FeatureFlagKey;
- value: Scalars['Boolean'];
-};
-
-export type FeatureFlagDto = {
- __typename?: 'FeatureFlagDTO';
key: FeatureFlagKey;
value: Scalars['Boolean'];
};
@@ -1680,8 +1736,8 @@ export type FilesConfiguration = {
configurationType: WidgetConfigurationType;
};
-export type FindAvailableSsoidpOutput = {
- __typename?: 'FindAvailableSSOIDPOutput';
+export type FindAvailableSsoidp = {
+ __typename?: 'FindAvailableSSOIDP';
id: Scalars['UUID'];
issuer: Scalars['String'];
name: Scalars['String'];
@@ -1736,18 +1792,18 @@ export type GetApiKeyInput = {
id: Scalars['UUID'];
};
-export type GetAuthorizationUrlForSsoInput = {
- identityProviderId: Scalars['UUID'];
- workspaceInviteHash?: InputMaybe<Scalars['String']>;
-};
-
-export type GetAuthorizationUrlForSsoOutput = {
- __typename?: 'GetAuthorizationUrlForSSOOutput';
+export type GetAuthorizationUrlForSso = {
+ __typename?: 'GetAuthorizationUrlForSSO';
authorizationURL: Scalars['String'];
id: Scalars['UUID'];
type: Scalars['String'];
};
+export type GetAuthorizationUrlForSsoInput = {
+ identityProviderId: Scalars['UUID'];
+ workspaceInviteHash?: InputMaybe<Scalars['String']>;
+};
+
/** Order by options for graph widgets */
export enum GraphOrderBy {
FIELD_ASC = 'FIELD_ASC',
@@ -1806,8 +1862,8 @@ export type ImapSmtpCaldavConnectionSuccess = {
success: Scalars['Boolean'];
};
-export type ImpersonateOutput = {
- __typename?: 'ImpersonateOutput';
+export type Impersonate = {
+ __typename?: 'Impersonate';
loginToken: AuthToken;
workspace: WorkspaceUrlsAndId;
};
@@ -1920,13 +1976,13 @@ export enum InferenceProvider {
XAI = 'XAI'
}
-export type InitiateTwoFactorAuthenticationProvisioningOutput = {
- __typename?: 'InitiateTwoFactorAuthenticationProvisioningOutput';
+export type InitiateTwoFactorAuthenticationProvisioning = {
+ __typename?: 'InitiateTwoFactorAuthenticationProvisioning';
uri: Scalars['String'];
};
-export type InvalidatePasswordOutput = {
- __typename?: 'InvalidatePasswordOutput';
+export type InvalidatePassword = {
+ __typename?: 'InvalidatePassword';
/** Boolean that confirms query was dispatched */
success: Scalars['Boolean'];
};
@@ -1980,13 +2036,8 @@ export type LineChartConfiguration = {
timezone?: Maybe<Scalars['String']>;
};
-export type LineChartDataInput = {
- configuration: Scalars['JSON'];
- objectMetadataId: Scalars['UUID'];
-};
-
-export type LineChartDataOutput = {
- __typename?: 'LineChartDataOutput';
+export type LineChartData = {
+ __typename?: 'LineChartData';
formattedToRawLookup: Scalars['JSON'];
hasTooManyGroups: Scalars['Boolean'];
series: Array<LineChartSeries>;
@@ -1996,6 +2047,11 @@ export type LineChartDataOutput = {
yAxisLabel: Scalars['String'];
};
+export type LineChartDataInput = {
+ configuration: Scalars['JSON'];
+ objectMetadataId: Scalars['UUID'];
+};
+
export type LineChartDataPoint = {
__typename?: 'LineChartDataPoint';
x: Scalars['String'];
@@ -2075,8 +2131,8 @@ export type LogicFunctionLogsInput = {
universalIdentifier?: InputMaybe<Scalars['UUID']>;
};
-export type LoginTokenOutput = {
- __typename?: 'LoginTokenOutput';
+export type LoginToken = {
+ __typename?: 'LoginToken';
loginToken: AuthToken;
};
@@ -2207,14 +2263,16 @@ export type Mutation = {
addQueryToEventStream: Scalars['Boolean'];
assignRoleToAgent: Scalars['Boolean'];
assignRoleToApiKey: Scalars['Boolean'];
- authorizeApp: AuthorizeAppOutput;
- cancelSwitchBillingInterval: BillingUpdateOutput;
- cancelSwitchBillingPlan: BillingUpdateOutput;
- cancelSwitchMeteredPrice: BillingUpdateOutput;
+ authorizeApp: AuthorizeApp;
+ cancelSwitchBillingInterval: BillingUpdate;
+ cancelSwitchBillingPlan: BillingUpdate;
+ cancelSwitchMeteredPrice: BillingUpdate;
checkCustomDomainValidRecords?: Maybe<DomainValidRecords>;
checkPublicDomainValidRecords?: Maybe<DomainValidRecords>;
- checkoutSession: BillingSessionOutput;
+ checkoutSession: BillingSession;
createApiKey: ApiKey;
+ createApplicationRegistration: CreateApplicationRegistration;
+ createApplicationRegistrationVariable: ApplicationRegistrationVariable;
createApprovedAccessDomain: ApprovedAccessDomain;
createChatThread: AgentChatThread;
createCommandMenuItem: CommandMenuItem;
@@ -2234,7 +2292,7 @@ export type Mutation = {
createManyCoreViewFields: Array<CoreViewField>;
createManyCoreViewGroups: Array<CoreViewGroup>;
createNavigationMenuItem: NavigationMenuItem;
- createOIDCIdentityProvider: SetupSsoOutput;
+ createOIDCIdentityProvider: SetupSso;
createObjectEvent: Analytics;
createOneAgent: Agent;
createOneAppToken: AppToken;
@@ -2247,10 +2305,12 @@ export type Mutation = {
createPageLayoutTab: PageLayoutTab;
createPageLayoutWidget: PageLayoutWidget;
createPublicDomain: PublicDomain;
- createSAMLIdentityProvider: SetupSsoOutput;
+ createSAMLIdentityProvider: SetupSso;
createSkill: Skill;
createWebhook: Webhook;
deactivateSkill: Skill;
+ deleteApplicationRegistration: Scalars['Boolean'];
+ deleteApplicationRegistrationVariable: Scalars['Boolean'];
deleteApprovedAccessDomain: Scalars['Boolean'];
deleteCommandMenuItem: CommandMenuItem;
deleteCoreView: Scalars['Boolean'];
@@ -2274,9 +2334,9 @@ export type Mutation = {
deleteOneObject: Object;
deleteOneRole: Scalars['String'];
deletePublicDomain: Scalars['Boolean'];
- deleteSSOIdentityProvider: DeleteSsoOutput;
+ deleteSSOIdentityProvider: DeleteSso;
deleteSkill: Skill;
- deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethodOutput;
+ deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethod;
deleteUser: User;
deleteUserFromWorkspace: UserWorkspace;
deleteWebhook: Webhook;
@@ -2293,50 +2353,53 @@ export type Mutation = {
destroyPageLayoutWidget: Scalars['Boolean'];
disablePostgresProxy: PostgresCredentials;
duplicateDashboard: DuplicatedDashboard;
- editSSOIdentityProvider: EditSsoOutput;
- emailPasswordResetLink: EmailPasswordResetLinkOutput;
+ editSSOIdentityProvider: EditSso;
+ emailPasswordResetLink: EmailPasswordResetLink;
enablePostgresProxy: PostgresCredentials;
- endSubscriptionTrialPeriod: BillingEndTrialPeriodOutput;
+ endSubscriptionTrialPeriod: BillingEndTrialPeriod;
evaluateAgentTurn: AgentTurnEvaluation;
executeOneLogicFunction: LogicFunctionExecutionResult;
generateApiKeyToken: ApiKeyToken;
generateApplicationToken: ApplicationTokenPair;
- generateTransientToken: TransientTokenOutput;
+ generateTransientToken: TransientToken;
getAuthTokensFromLoginToken: AuthTokens;
getAuthTokensFromOTP: AuthTokens;
- getAuthorizationUrlForSSO: GetAuthorizationUrlForSsoOutput;
- getLoginTokenFromCredentials: LoginTokenOutput;
- impersonate: ImpersonateOutput;
- initiateOTPProvisioning: InitiateTwoFactorAuthenticationProvisioningOutput;
- initiateOTPProvisioningForAuthenticatedUser: InitiateTwoFactorAuthenticationProvisioningOutput;
+ getAuthorizationUrlForSSO: GetAuthorizationUrlForSso;
+ getLoginTokenFromCredentials: LoginToken;
+ impersonate: Impersonate;
+ initiateOTPProvisioning: InitiateTwoFactorAuthenticationProvisioning;
+ initiateOTPProvisioningForAuthenticatedUser: InitiateTwoFactorAuthenticationProvisioning;
installApplication: Scalars['Boolean'];
installMarketplaceApp: Scalars['Boolean'];
removeQueryFromEventStream: Scalars['Boolean'];
removeRoleFromAgent: Scalars['Boolean'];
renewApplicationToken: ApplicationTokenPair;
renewToken: AuthTokens;
- resendEmailVerificationToken: ResendEmailVerificationTokenOutput;
- resendWorkspaceInvitation: SendInvitationsOutput;
+ resendEmailVerificationToken: ResendEmailVerificationToken;
+ resendWorkspaceInvitation: SendInvitations;
retryJobs: RetryJobsResponse;
revokeApiKey?: Maybe<ApiKey>;
+ rotateApplicationRegistrationClientSecret: RotateClientSecret;
runEvaluationInput: AgentTurn;
saveImapSmtpCaldavAccount: ImapSmtpCaldavConnectionSuccess;
- sendInvitations: SendInvitationsOutput;
+ sendInvitations: SendInvitations;
setAdminAiModelEnabled: Scalars['Boolean'];
- setMeteredSubscriptionPrice: BillingUpdateOutput;
- signIn: AvailableWorkspacesAndAccessTokensOutput;
- signUp: AvailableWorkspacesAndAccessTokensOutput;
- signUpInNewWorkspace: SignUpOutput;
- signUpInWorkspace: SignUpOutput;
+ setMeteredSubscriptionPrice: BillingUpdate;
+ signIn: AvailableWorkspacesAndAccessTokens;
+ signUp: AvailableWorkspacesAndAccessTokens;
+ signUpInNewWorkspace: SignUp;
+ signUpInWorkspace: SignUp;
skipBookOnboardingStep: OnboardingStepSuccess;
skipSyncEmailOnboardingStep: OnboardingStepSuccess;
startChannelSync: ChannelSyncSuccess;
- switchBillingPlan: BillingUpdateOutput;
- switchSubscriptionInterval: BillingUpdateOutput;
- syncApplication: WorkspaceMigrationDto;
+ switchBillingPlan: BillingUpdate;
+ switchSubscriptionInterval: BillingUpdate;
+ syncApplication: WorkspaceMigration;
trackAnalytics: Analytics;
uninstallApplication: Scalars['Boolean'];
updateApiKey?: Maybe<ApiKey>;
+ updateApplicationRegistration: ApplicationRegistration;
+ updateApplicationRegistrationVariable: ApplicationRegistrationVariable;
updateCommandMenuItem: CommandMenuItem;
updateCoreView: CoreView;
updateCoreViewField: CoreViewField;
@@ -2347,7 +2410,7 @@ export type Mutation = {
updateCoreViewSort: CoreViewSort;
updateDatabaseConfigVariable: Scalars['Boolean'];
updateFrontComponent: FrontComponent;
- updateLabPublicFeatureFlag: FeatureFlagDto;
+ updateLabPublicFeatureFlag: FeatureFlag;
updateNavigationMenuItem: NavigationMenuItem;
updateOneAgent: Agent;
updateOneApplicationVariable: Scalars['Boolean'];
@@ -2359,7 +2422,7 @@ export type Mutation = {
updatePageLayoutTab: PageLayoutTab;
updatePageLayoutWidget: PageLayoutWidget;
updatePageLayoutWithTabsAndWidgets: PageLayout;
- updatePasswordViaResetToken: InvalidatePasswordOutput;
+ updatePasswordViaResetToken: InvalidatePassword;
updateSkill: Skill;
updateUserEmail: Scalars['Boolean'];
updateWebhook: Webhook;
@@ -2384,10 +2447,10 @@ export type Mutation = {
upsertRowLevelPermissionPredicates: UpsertRowLevelPermissionPredicatesResult;
userLookupAdminPanel: UserLookup;
validateApprovedAccessDomain: ApprovedAccessDomain;
- verifyEmailAndGetLoginToken: VerifyEmailAndGetLoginTokenOutput;
- verifyEmailAndGetWorkspaceAgnosticToken: AvailableWorkspacesAndAccessTokensOutput;
+ verifyEmailAndGetLoginToken: VerifyEmailAndGetLoginToken;
+ verifyEmailAndGetWorkspaceAgnosticToken: AvailableWorkspacesAndAccessTokens;
verifyEmailingDomain: EmailingDomain;
- verifyTwoFactorAuthenticationMethodForAuthenticatedUser: VerifyTwoFactorAuthenticationMethodOutput;
+ verifyTwoFactorAuthenticationMethodForAuthenticatedUser: VerifyTwoFactorAuthenticationMethod;
};
@@ -2443,6 +2506,16 @@ export type MutationCreateApiKeyArgs = {
};
+export type MutationCreateApplicationRegistrationArgs = {
+ input: CreateApplicationRegistrationInput;
+};
+
+
+export type MutationCreateApplicationRegistrationVariableArgs = {
+ input: CreateApplicationRegistrationVariableInput;
+};
+
+
export type MutationCreateApprovedAccessDomainArgs = {
input: CreateApprovedAccessDomainInput;
};
@@ -2618,6 +2691,16 @@ export type MutationDeactivateSkillArgs = {
};
+export type MutationDeleteApplicationRegistrationArgs = {
+ id: Scalars['String'];
+};
+
+
+export type MutationDeleteApplicationRegistrationVariableArgs = {
+ id: Scalars['String'];
+};
+
+
export type MutationDeleteApprovedAccessDomainArgs = {
input: DeleteApprovedAccessDomainInput;
};
@@ -2929,6 +3012,11 @@ export type MutationRevokeApiKeyArgs = {
};
+export type MutationRotateApplicationRegistrationClientSecretArgs = {
+ id: Scalars['String'];
+};
+
+
export type MutationRunEvaluationInputArgs = {
agentId: Scalars['UUID'];
input: Scalars['String'];
@@ -3017,6 +3105,16 @@ export type MutationUpdateApiKeyArgs = {
};
+export type MutationUpdateApplicationRegistrationArgs = {
+ input: UpdateApplicationRegistrationInput;
+};
+
+
+export type MutationUpdateApplicationRegistrationVariableArgs = {
+ input: UpdateApplicationRegistrationVariableInput;
+};
+
+
export type MutationUpdateCommandMenuItemArgs = {
input: UpdateCommandMenuItemInput;
};
@@ -3668,6 +3766,16 @@ export type PieChartConfiguration = {
timezone?: Maybe<Scalars['String']>;
};
+export type PieChartData = {
+ __typename?: 'PieChartData';
+ data: Array<PieChartDataItem>;
+ formattedToRawLookup: Scalars['JSON'];
+ hasTooManyGroups: Scalars['Boolean'];
+ showCenterMetric: Scalars['Boolean'];
+ showDataLabels: Scalars['Boolean'];
+ showLegend: Scalars['Boolean'];
+};
+
export type PieChartDataInput = {
configuration: Scalars['JSON'];
objectMetadataId: Scalars['UUID'];
@@ -3679,16 +3787,6 @@ export type PieChartDataItem = {
value: Scalars['Float'];
};
-export type PieChartDataOutput = {
- __typename?: 'PieChartDataOutput';
- data: Array<PieChartDataItem>;
- formattedToRawLookup: Scalars['JSON'];
- hasTooManyGroups: Scalars['Boolean'];
- showCenterMetric: Scalars['Boolean'];
- showDataLabels: Scalars['Boolean'];
- showLegend: Scalars['Boolean'];
-};
-
export type PlaceDetailsResult = {
__typename?: 'PlaceDetailsResult';
city?: Maybe<Scalars['String']>;
@@ -3727,8 +3825,8 @@ export type PublicFeatureFlagMetadata = {
label: Scalars['String'];
};
-export type PublicWorkspaceDataOutput = {
- __typename?: 'PublicWorkspaceDataOutput';
+export type PublicWorkspaceData = {
+ __typename?: 'PublicWorkspaceData';
authBypassProviders?: Maybe<AuthBypassProviders>;
authProviders: AuthProviders;
displayName?: Maybe<Scalars['String']>;
@@ -3742,13 +3840,13 @@ export type Query = {
agentTurns: Array<AgentTurn>;
apiKey?: Maybe<ApiKey>;
apiKeys: Array<ApiKey>;
- barChartData: BarChartDataOutput;
- billingPortalSession: BillingSessionOutput;
+ barChartData: BarChartData;
+ billingPortalSession: BillingSession;
chatMessages: Array<AgentMessage>;
chatThread: AgentChatThread;
chatThreads: Array<AgentChatThread>;
- checkUserExists: CheckUserExistOutput;
- checkWorkspaceInviteHashIsValid: WorkspaceInviteHashValidOutput;
+ checkUserExists: CheckUserExist;
+ checkWorkspaceInviteHashIsValid: WorkspaceInviteHashValid;
commandMenuItem?: Maybe<CommandMenuItem>;
commandMenuItems: Array<CommandMenuItem>;
currentUser: User;
@@ -3756,13 +3854,19 @@ export type Query = {
eventLogs: EventLogQueryResult;
field: Field;
fields: FieldConnection;
+ findApplicationRegistrationByClientId?: Maybe<ApplicationRegistration>;
+ findApplicationRegistrationByUniversalIdentifier?: Maybe<ApplicationRegistration>;
+ findApplicationRegistrationStats: ApplicationRegistrationStats;
+ findApplicationRegistrationVariables: Array<ApplicationRegistrationVariable>;
findManyAgents: Array<Agent>;
+ findManyApplicationRegistrations: Array<ApplicationRegistration>;
findManyApplications: Array<Application>;
findManyLogicFunctions: Array<LogicFunction>;
findManyMarketplaceApps: Array<MarketplaceApp>;
findManyPublicDomains: Array<PublicDomain>;
findOneAgent: Agent;
findOneApplication: Application;
+ findOneApplicationRegistration: ApplicationRegistration;
findOneLogicFunction: LogicFunction;
findWorkspaceFromInviteHash: Workspace;
findWorkspaceInvitations: Array<WorkspaceInvitation>;
@@ -3770,11 +3874,11 @@ export type Query = {
frontComponents: Array<FrontComponent>;
getAISystemPromptPreview: AiSystemPromptPreview;
getAddressDetails: PlaceDetailsResult;
- getAdminAiModels: AdminAiModelsOutput;
+ getAdminAiModels: AdminAiModels;
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
getAutoCompleteAddress: Array<AutocompleteResult>;
getAvailablePackages: Scalars['JSON'];
- getConfigVariablesGrouped: ConfigVariablesOutput;
+ getConfigVariablesGrouped: ConfigVariables;
getConnectedImapSmtpCaldavAccount: ConnectedImapSmtpCaldavAccount;
getCoreView?: Maybe<CoreView>;
getCoreViewField?: Maybe<CoreViewField>;
@@ -3794,7 +3898,7 @@ export type Query = {
getEmailingDomains: Array<EmailingDomain>;
getIndicatorHealthStatus: AdminPanelHealthServiceData;
getLogicFunctionSourceCode?: Maybe<Scalars['String']>;
- getMeteredProductsUsage: Array<BillingMeteredProductUsageOutput>;
+ getMeteredProductsUsage: Array<BillingMeteredProductUsage>;
getPageLayout?: Maybe<PageLayout>;
getPageLayoutTab: PageLayoutTab;
getPageLayoutTabs: Array<PageLayoutTab>;
@@ -3802,27 +3906,27 @@ export type Query = {
getPageLayoutWidgets: Array<PageLayoutWidget>;
getPageLayouts: Array<PageLayout>;
getPostgresCredentials?: Maybe<PostgresCredentials>;
- getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
+ getPublicWorkspaceDataByDomain: PublicWorkspaceData;
getQueueJobs: QueueJobsResponse;
getQueueMetrics: QueueMetricsData;
getRoles: Array<Role>;
- getSSOIdentityProviders: Array<FindAvailableSsoidpOutput>;
+ getSSOIdentityProviders: Array<FindAvailableSsoidp>;
getSystemHealthStatus: SystemHealth;
getToolIndex: Array<ToolIndexEntry>;
getToolInputSchema?: Maybe<Scalars['JSON']>;
index: Index;
indexMetadatas: IndexConnection;
- lineChartData: LineChartDataOutput;
- listPlans: Array<BillingPlanOutput>;
+ lineChartData: LineChartData;
+ listPlans: Array<BillingPlan>;
navigationMenuItem?: Maybe<NavigationMenuItem>;
navigationMenuItems: Array<NavigationMenuItem>;
object: Object;
objectRecordCounts: Array<ObjectRecordCount>;
objects: ObjectConnection;
- pieChartData: PieChartDataOutput;
+ pieChartData: PieChartData;
skill?: Maybe<Skill>;
skills: Array<Skill>;
- validatePasswordResetToken: ValidatePasswordResetTokenOutput;
+ validatePasswordResetToken: ValidatePasswordResetToken;
versionInfo: VersionInfo;
webhook?: Maybe<Webhook>;
webhooks: Array<Webhook>;
@@ -3891,6 +3995,26 @@ export type QueryFieldsArgs = {
};
+export type QueryFindApplicationRegistrationByClientIdArgs = {
+ clientId: Scalars['String'];
+};
+
+
+export type QueryFindApplicationRegistrationByUniversalIdentifierArgs = {
+ universalIdentifier: Scalars['String'];
+};
+
+
+export type QueryFindApplicationRegistrationStatsArgs = {
+ id: Scalars['String'];
+};
+
+
+export type QueryFindApplicationRegistrationVariablesArgs = {
+ applicationRegistrationId: Scalars['String'];
+};
+
+
export type QueryFindOneAgentArgs = {
input: AgentIdInput;
};
@@ -3902,6 +4026,11 @@ export type QueryFindOneApplicationArgs = {
};
+export type QueryFindOneApplicationRegistrationArgs = {
+ id: Scalars['String'];
+};
+
+
export type QueryFindOneLogicFunctionArgs = {
input: LogicFunctionIdInput;
};
@@ -4228,8 +4357,8 @@ export type RemoveQueryFromEventStreamInput = {
queryId: Scalars['String'];
};
-export type ResendEmailVerificationTokenOutput = {
- __typename?: 'ResendEmailVerificationTokenOutput';
+export type ResendEmailVerificationToken = {
+ __typename?: 'ResendEmailVerificationToken';
success: Scalars['Boolean'];
};
@@ -4276,6 +4405,11 @@ export type Role = {
workspaceMembers: Array<WorkspaceMember>;
};
+export type RotateClientSecret = {
+ __typename?: 'RotateClientSecret';
+ clientSecret: Scalars['String'];
+};
+
export type RowLevelPermissionPredicate = {
__typename?: 'RowLevelPermissionPredicate';
fieldMetadataId: Scalars['String'];
@@ -4369,8 +4503,8 @@ export enum SsoIdentityProviderStatus {
Inactive = 'Inactive'
}
-export type SendInvitationsOutput = {
- __typename?: 'SendInvitationsOutput';
+export type SendInvitations = {
+ __typename?: 'SendInvitations';
errors: Array<Scalars['String']>;
result: Array<WorkspaceInvitation>;
/** Boolean that confirms query was dispatched */
@@ -4400,8 +4534,8 @@ export type SetupSamlSsoInput = {
ssoURL: Scalars['String'];
};
-export type SetupSsoOutput = {
- __typename?: 'SetupSsoOutput';
+export type SetupSso = {
+ __typename?: 'SetupSso';
id: Scalars['UUID'];
issuer: Scalars['String'];
name: Scalars['String'];
@@ -4409,8 +4543,8 @@ export type SetupSsoOutput = {
type: IdentityProviderType;
};
-export type SignUpOutput = {
- __typename?: 'SignUpOutput';
+export type SignUp = {
+ __typename?: 'SignUp';
loginToken: AuthToken;
workspace: WorkspaceUrlsAndId;
};
@@ -4530,13 +4664,13 @@ export type ToolIndexEntry = {
objectName?: Maybe<Scalars['String']>;
};
-export type TransientTokenOutput = {
- __typename?: 'TransientTokenOutput';
+export type TransientToken = {
+ __typename?: 'TransientToken';
transientToken: AuthToken;
};
-export type TwoFactorAuthenticationMethodDto = {
- __typename?: 'TwoFactorAuthenticationMethodDTO';
+export type TwoFactorAuthenticationMethodSummary = {
+ __typename?: 'TwoFactorAuthenticationMethodSummary';
status: Scalars['String'];
strategy: Scalars['String'];
twoFactorAuthenticationMethodId: Scalars['UUID'];
@@ -4580,6 +4714,32 @@ export type UpdateApiKeyInput = {
revokedAt?: InputMaybe<Scalars['String']>;
};
+export type UpdateApplicationRegistrationInput = {
+ id: Scalars['String'];
+ update: UpdateApplicationRegistrationPayload;
+};
+
+export type UpdateApplicationRegistrationPayload = {
+ author?: InputMaybe<Scalars['String']>;
+ description?: InputMaybe<Scalars['String']>;
+ logoUrl?: InputMaybe<Scalars['String']>;
+ name?: InputMaybe<Scalars['String']>;
+ oAuthRedirectUris?: InputMaybe<Array<Scalars['String']>>;
+ oAuthScopes?: InputMaybe<Array<Scalars['String']>>;
+ termsUrl?: InputMaybe<Scalars['String']>;
+ websiteUrl?: InputMaybe<Scalars['String']>;
+};
+
+export type UpdateApplicationRegistrationVariableInput = {
+ id: Scalars['String'];
+ update: UpdateApplicationRegistrationVariablePayload;
+};
+
+export type UpdateApplicationRegistrationVariablePayload = {
+ description?: InputMaybe<Scalars['String']>;
+ value?: InputMaybe<Scalars['String']>;
+};
+
export type UpdateCommandMenuItemInput = {
availabilityObjectMetadataId?: InputMaybe<Scalars['UUID']>;
availabilityType?: InputMaybe<CommandMenuItemAvailabilityType>;
@@ -5002,7 +5162,7 @@ export type UserWorkspace = {
objectPermissions?: Maybe<Array<ObjectPermission>>;
objectsPermissions?: Maybe<Array<ObjectPermission>>;
permissionFlags?: Maybe<Array<PermissionFlagType>>;
- twoFactorAuthenticationMethodSummary?: Maybe<Array<TwoFactorAuthenticationMethodDto>>;
+ twoFactorAuthenticationMethodSummary?: Maybe<Array<TwoFactorAuthenticationMethodSummary>>;
updatedAt: Scalars['DateTime'];
user: User;
userId: Scalars['UUID'];
@@ -5013,8 +5173,8 @@ export type ValidateApprovedAccessDomainInput = {
validationToken: Scalars['String'];
};
-export type ValidatePasswordResetTokenOutput = {
- __typename?: 'ValidatePasswordResetTokenOutput';
+export type ValidatePasswordResetToken = {
+ __typename?: 'ValidatePasswordResetToken';
email: Scalars['String'];
hasPassword: Scalars['Boolean'];
id: Scalars['UUID'];
@@ -5028,17 +5188,23 @@ export type VerificationRecord = {
value: Scalars['String'];
};
-export type VerifyEmailAndGetLoginTokenOutput = {
- __typename?: 'VerifyEmailAndGetLoginTokenOutput';
+export type VerifyEmailAndGetLoginToken = {
+ __typename?: 'VerifyEmailAndGetLoginToken';
loginToken: AuthToken;
workspaceUrls: WorkspaceUrls;
};
-export type VerifyTwoFactorAuthenticationMethodOutput = {
- __typename?: 'VerifyTwoFactorAuthenticationMethodOutput';
+export type VerifyTwoFactorAuthenticationMethod = {
+ __typename?: 'VerifyTwoFactorAuthenticationMethod';
success: Scalars['Boolean'];
};
+export type VersionDistributionEntry = {
+ __typename?: 'VersionDistributionEntry';
+ count: Scalars['Int'];
+ version: Scalars['String'];
+};
+
export type VersionInfo = {
__typename?: 'VersionInfo';
currentVersion?: Maybe<Scalars['String']>;
@@ -5214,7 +5380,7 @@ export type Workspace = {
enabledAiModelIds?: Maybe<Array<Scalars['String']>>;
eventLogRetentionDays: Scalars['Float'];
fastModel: Scalars['String'];
- featureFlags?: Maybe<Array<FeatureFlagDto>>;
+ featureFlags?: Maybe<Array<FeatureFlag>>;
hasValidEnterpriseKey: Scalars['Boolean'];
id: Scalars['UUID'];
inviteHash?: Maybe<Scalars['String']>;
@@ -5276,8 +5442,8 @@ export type WorkspaceInvitation = {
id: Scalars['UUID'];
};
-export type WorkspaceInviteHashValidOutput = {
- __typename?: 'WorkspaceInviteHashValidOutput';
+export type WorkspaceInviteHashValid = {
+ __typename?: 'WorkspaceInviteHashValid';
isValid: Scalars['Boolean'];
};
@@ -5322,18 +5488,18 @@ export enum WorkspaceMemberTimeFormatEnum {
SYSTEM = 'SYSTEM'
}
+export type WorkspaceMigration = {
+ __typename?: 'WorkspaceMigration';
+ actions: Scalars['JSON'];
+ applicationUniversalIdentifier: Scalars['String'];
+};
+
export enum WorkspaceMigrationActionType {
create = 'create',
delete = 'delete',
update = 'update'
}
-export type WorkspaceMigrationDto = {
- __typename?: 'WorkspaceMigrationDTO';
- actions: Scalars['JSON'];
- applicationUniversalIdentifier: Scalars['String'];
-};
-
export type WorkspaceMigrationDeleteActionInput = {
metadataName: AllMetadataName;
type: WorkspaceMigrationActionType;
@@ -5569,16 +5735,16 @@ export type AvailableWorkspaceFragmentFragment = { __typename?: 'AvailableWorksp
export type AvailableWorkspacesFragmentFragment = { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> };
-export type AvailableSsoIdentityProvidersFragmentFragment = { __typename?: 'FindAvailableSSOIDPOutput', id: string, issuer: string, name: string, status: SsoIdentityProviderStatus, workspace: { __typename?: 'WorkspaceNameAndId', id: string, displayName?: string | null } };
+export type AvailableSsoIdentityProvidersFragmentFragment = { __typename?: 'FindAvailableSSOIDP', id: string, issuer: string, name: string, status: SsoIdentityProviderStatus, workspace: { __typename?: 'WorkspaceNameAndId', id: string, displayName?: string | null } };
export type AuthorizeAppMutationVariables = Exact<{
clientId: Scalars['String'];
- codeChallenge: Scalars['String'];
+ codeChallenge?: InputMaybe<Scalars['String']>;
redirectUrl: Scalars['String'];
}>;
-export type AuthorizeAppMutation = { __typename?: 'Mutation', authorizeApp: { __typename?: 'AuthorizeAppOutput', redirectUrl: string } };
+export type AuthorizeAppMutation = { __typename?: 'Mutation', authorizeApp: { __typename?: 'AuthorizeApp', redirectUrl: string } };
export type EmailPasswordResetLinkMutationVariables = Exact<{
email: Scalars['String'];
@@ -5586,7 +5752,7 @@ export type EmailPasswordResetLinkMutationVariables = Exact<{
}>;
-export type EmailPasswordResetLinkMutation = { __typename?: 'Mutation', emailPasswordResetLink: { __typename?: 'EmailPasswordResetLinkOutput', success: boolean } };
+export type EmailPasswordResetLinkMutation = { __typename?: 'Mutation', emailPasswordResetLink: { __typename?: 'EmailPasswordResetLink', success: boolean } };
export type GenerateApiKeyTokenMutationVariables = Exact<{
apiKeyId: Scalars['UUID'];
@@ -5599,7 +5765,7 @@ export type GenerateApiKeyTokenMutation = { __typename?: 'Mutation', generateApi
export type GenerateTransientTokenMutationVariables = Exact<{ [key: string]: never; }>;
-export type GenerateTransientTokenMutation = { __typename?: 'Mutation', generateTransientToken: { __typename?: 'TransientTokenOutput', transientToken: { __typename?: 'AuthToken', token: string } } };
+export type GenerateTransientTokenMutation = { __typename?: 'Mutation', generateTransientToken: { __typename?: 'TransientToken', transientToken: { __typename?: 'AuthToken', token: string } } };
export type GetAuthTokensFromLoginTokenMutationVariables = Exact<{
loginToken: Scalars['String'];
@@ -5624,7 +5790,7 @@ export type GetAuthorizationUrlForSsoMutationVariables = Exact<{
}>;
-export type GetAuthorizationUrlForSsoMutation = { __typename?: 'Mutation', getAuthorizationUrlForSSO: { __typename?: 'GetAuthorizationUrlForSSOOutput', id: string, type: string, authorizationURL: string } };
+export type GetAuthorizationUrlForSsoMutation = { __typename?: 'Mutation', getAuthorizationUrlForSSO: { __typename?: 'GetAuthorizationUrlForSSO', id: string, type: string, authorizationURL: string } };
export type GetLoginTokenFromCredentialsMutationVariables = Exact<{
email: Scalars['String'];
@@ -5634,7 +5800,7 @@ export type GetLoginTokenFromCredentialsMutationVariables = Exact<{
}>;
-export type GetLoginTokenFromCredentialsMutation = { __typename?: 'Mutation', getLoginTokenFromCredentials: { __typename?: 'LoginTokenOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
+export type GetLoginTokenFromCredentialsMutation = { __typename?: 'Mutation', getLoginTokenFromCredentials: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
export type ImpersonateMutationVariables = Exact<{
userId: Scalars['UUID'];
@@ -5642,7 +5808,7 @@ export type ImpersonateMutationVariables = Exact<{
}>;
-export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'ImpersonateOutput', workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
+export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Impersonate', workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
export type InitiateOtpProvisioningMutationVariables = Exact<{
loginToken: Scalars['String'];
@@ -5650,12 +5816,12 @@ export type InitiateOtpProvisioningMutationVariables = Exact<{
}>;
-export type InitiateOtpProvisioningMutation = { __typename?: 'Mutation', initiateOTPProvisioning: { __typename?: 'InitiateTwoFactorAuthenticationProvisioningOutput', uri: string } };
+export type InitiateOtpProvisioningMutation = { __typename?: 'Mutation', initiateOTPProvisioning: { __typename?: 'InitiateTwoFactorAuthenticationProvisioning', uri: string } };
export type InitiateOtpProvisioningForAuthenticatedUserMutationVariables = Exact<{ [key: string]: never; }>;
-export type InitiateOtpProvisioningForAuthenticatedUserMutation = { __typename?: 'Mutation', initiateOTPProvisioningForAuthenticatedUser: { __typename?: 'InitiateTwoFactorAuthenticationProvisioningOutput', uri: string } };
+export type InitiateOtpProvisioningForAuthenticatedUserMutation = { __typename?: 'Mutation', initiateOTPProvisioningForAuthenticatedUser: { __typename?: 'InitiateTwoFactorAuthenticationProvisioning', uri: string } };
export type RenewTokenMutationVariables = Exact<{
appToken: Scalars['String'];
@@ -5670,14 +5836,14 @@ export type ResendEmailVerificationTokenMutationVariables = Exact<{
}>;
-export type ResendEmailVerificationTokenMutation = { __typename?: 'Mutation', resendEmailVerificationToken: { __typename?: 'ResendEmailVerificationTokenOutput', success: boolean } };
+export type ResendEmailVerificationTokenMutation = { __typename?: 'Mutation', resendEmailVerificationToken: { __typename?: 'ResendEmailVerificationToken', success: boolean } };
export type DeleteTwoFactorAuthenticationMethodMutationVariables = Exact<{
twoFactorAuthenticationMethodId: Scalars['UUID'];
}>;
-export type DeleteTwoFactorAuthenticationMethodMutation = { __typename?: 'Mutation', deleteTwoFactorAuthenticationMethod: { __typename?: 'DeleteTwoFactorAuthenticationMethodOutput', success: boolean } };
+export type DeleteTwoFactorAuthenticationMethodMutation = { __typename?: 'Mutation', deleteTwoFactorAuthenticationMethod: { __typename?: 'DeleteTwoFactorAuthenticationMethod', success: boolean } };
export type SignInMutationVariables = Exact<{
email: Scalars['String'];
@@ -5686,7 +5852,7 @@ export type SignInMutationVariables = Exact<{
}>;
-export type SignInMutation = { __typename?: 'Mutation', signIn: { __typename?: 'AvailableWorkspacesAndAccessTokensOutput', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
+export type SignInMutation = { __typename?: 'Mutation', signIn: { __typename?: 'AvailableWorkspacesAndAccessTokens', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
export type SignUpMutationVariables = Exact<{
email: Scalars['String'];
@@ -5697,12 +5863,12 @@ export type SignUpMutationVariables = Exact<{
}>;
-export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'AvailableWorkspacesAndAccessTokensOutput', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
+export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'AvailableWorkspacesAndAccessTokens', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
export type SignUpInNewWorkspaceMutationVariables = Exact<{ [key: string]: never; }>;
-export type SignUpInNewWorkspaceMutation = { __typename?: 'Mutation', signUpInNewWorkspace: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
+export type SignUpInNewWorkspaceMutation = { __typename?: 'Mutation', signUpInNewWorkspace: { __typename?: 'SignUp', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
export type SignUpInWorkspaceMutationVariables = Exact<{
email: Scalars['String'];
@@ -5716,7 +5882,7 @@ export type SignUpInWorkspaceMutationVariables = Exact<{
}>;
-export type SignUpInWorkspaceMutation = { __typename?: 'Mutation', signUpInWorkspace: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
+export type SignUpInWorkspaceMutation = { __typename?: 'Mutation', signUpInWorkspace: { __typename?: 'SignUp', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
token: Scalars['String'];
@@ -5724,7 +5890,7 @@ export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
}>;
-export type UpdatePasswordViaResetTokenMutation = { __typename?: 'Mutation', updatePasswordViaResetToken: { __typename?: 'InvalidatePasswordOutput', success: boolean } };
+export type UpdatePasswordViaResetTokenMutation = { __typename?: 'Mutation', updatePasswordViaResetToken: { __typename?: 'InvalidatePassword', success: boolean } };
export type VerifyEmailAndGetLoginTokenMutationVariables = Exact<{
emailVerificationToken: Scalars['String'];
@@ -5734,7 +5900,7 @@ export type VerifyEmailAndGetLoginTokenMutationVariables = Exact<{
}>;
-export type VerifyEmailAndGetLoginTokenMutation = { __typename?: 'Mutation', verifyEmailAndGetLoginToken: { __typename?: 'VerifyEmailAndGetLoginTokenOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } };
+export type VerifyEmailAndGetLoginTokenMutation = { __typename?: 'Mutation', verifyEmailAndGetLoginToken: { __typename?: 'VerifyEmailAndGetLoginToken', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } };
export type VerifyEmailAndGetWorkspaceAgnosticTokenMutationVariables = Exact<{
emailVerificationToken: Scalars['String'];
@@ -5743,7 +5909,7 @@ export type VerifyEmailAndGetWorkspaceAgnosticTokenMutationVariables = Exact<{
}>;
-export type VerifyEmailAndGetWorkspaceAgnosticTokenMutation = { __typename?: 'Mutation', verifyEmailAndGetWorkspaceAgnosticToken: { __typename?: 'AvailableWorkspacesAndAccessTokensOutput', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
+export type VerifyEmailAndGetWorkspaceAgnosticTokenMutation = { __typename?: 'Mutation', verifyEmailAndGetWorkspaceAgnosticToken: { __typename?: 'AvailableWorkspacesAndAccessTokens', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
export type CheckUserExistsQueryVariables = Exact<{
email: Scalars['String'];
@@ -5751,21 +5917,21 @@ export type CheckUserExistsQueryVariables = Exact<{
}>;
-export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'CheckUserExistOutput', exists: boolean, availableWorkspacesCount: number, isEmailVerified: boolean } };
+export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'CheckUserExist', exists: boolean, availableWorkspacesCount: number, isEmailVerified: boolean } };
export type GetPublicWorkspaceDataByDomainQueryVariables = Exact<{
origin: Scalars['String'];
}>;
-export type GetPublicWorkspaceDataByDomainQuery = { __typename?: 'Query', getPublicWorkspaceDataByDomain: { __typename?: 'PublicWorkspaceDataOutput', id: string, logo?: string | null, displayName?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, authProviders: { __typename?: 'AuthProviders', google: boolean, magicLink: boolean, password: boolean, microsoft: boolean, sso: Array<{ __typename?: 'SSOIdentityProvider', id: string, name: string, type: IdentityProviderType, status: SsoIdentityProviderStatus, issuer: string }> }, authBypassProviders?: { __typename?: 'AuthBypassProviders', google: boolean, password: boolean, microsoft: boolean } | null } };
+export type GetPublicWorkspaceDataByDomainQuery = { __typename?: 'Query', getPublicWorkspaceDataByDomain: { __typename?: 'PublicWorkspaceData', id: string, logo?: string | null, displayName?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, authProviders: { __typename?: 'AuthProviders', google: boolean, magicLink: boolean, password: boolean, microsoft: boolean, sso: Array<{ __typename?: 'SSOIdentityProvider', id: string, name: string, type: IdentityProviderType, status: SsoIdentityProviderStatus, issuer: string }> }, authBypassProviders?: { __typename?: 'AuthBypassProviders', google: boolean, password: boolean, microsoft: boolean } | null } };
export type ValidatePasswordResetTokenQueryVariables = Exact<{
token: Scalars['String'];
}>;
-export type ValidatePasswordResetTokenQuery = { __typename?: 'Query', validatePasswordResetToken: { __typename?: 'ValidatePasswordResetTokenOutput', id: string, email: string, hasPassword: boolean } };
+export type ValidatePasswordResetTokenQuery = { __typename?: 'Query', validatePasswordResetToken: { __typename?: 'ValidatePasswordResetToken', id: string, email: string, hasPassword: boolean } };
export type BillingPriceLicensedFragmentFragment = { __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType };
@@ -5778,17 +5944,17 @@ export type BillingSubscriptionSchedulePhaseItemFragmentFragment = { __typename?
export type CancelSwitchBillingIntervalMutationVariables = Exact<{ [key: string]: never; }>;
-export type CancelSwitchBillingIntervalMutation = { __typename?: 'Mutation', cancelSwitchBillingInterval: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type CancelSwitchBillingIntervalMutation = { __typename?: 'Mutation', cancelSwitchBillingInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type CancelSwitchMeteredPriceMutationVariables = Exact<{ [key: string]: never; }>;
-export type CancelSwitchMeteredPriceMutation = { __typename?: 'Mutation', cancelSwitchMeteredPrice: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type CancelSwitchMeteredPriceMutation = { __typename?: 'Mutation', cancelSwitchMeteredPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type CancelSwitchBillingPlanMutationVariables = Exact<{ [key: string]: never; }>;
-export type CancelSwitchBillingPlanMutation = { __typename?: 'Mutation', cancelSwitchBillingPlan: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type CancelSwitchBillingPlanMutation = { __typename?: 'Mutation', cancelSwitchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type CheckoutSessionMutationVariables = Exact<{
recurringInterval: SubscriptionInterval;
@@ -5798,46 +5964,46 @@ export type CheckoutSessionMutationVariables = Exact<{
}>;
-export type CheckoutSessionMutation = { __typename?: 'Mutation', checkoutSession: { __typename?: 'BillingSessionOutput', url?: string | null } };
+export type CheckoutSessionMutation = { __typename?: 'Mutation', checkoutSession: { __typename?: 'BillingSession', url?: string | null } };
export type EndSubscriptionTrialPeriodMutationVariables = Exact<{ [key: string]: never; }>;
-export type EndSubscriptionTrialPeriodMutation = { __typename?: 'Mutation', endSubscriptionTrialPeriod: { __typename?: 'BillingEndTrialPeriodOutput', status?: SubscriptionStatus | null, hasPaymentMethod: boolean, billingPortalUrl?: string | null } };
+export type EndSubscriptionTrialPeriodMutation = { __typename?: 'Mutation', endSubscriptionTrialPeriod: { __typename?: 'BillingEndTrialPeriod', status?: SubscriptionStatus | null, hasPaymentMethod: boolean, billingPortalUrl?: string | null } };
export type SetMeteredSubscriptionPriceMutationVariables = Exact<{
priceId: Scalars['String'];
}>;
-export type SetMeteredSubscriptionPriceMutation = { __typename?: 'Mutation', setMeteredSubscriptionPrice: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type SetMeteredSubscriptionPriceMutation = { __typename?: 'Mutation', setMeteredSubscriptionPrice: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type SwitchBillingPlanMutationVariables = Exact<{ [key: string]: never; }>;
-export type SwitchBillingPlanMutation = { __typename?: 'Mutation', switchBillingPlan: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type SwitchBillingPlanMutation = { __typename?: 'Mutation', switchBillingPlan: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type SwitchSubscriptionIntervalMutationVariables = Exact<{ [key: string]: never; }>;
-export type SwitchSubscriptionIntervalMutation = { __typename?: 'Mutation', switchSubscriptionInterval: { __typename?: 'BillingUpdateOutput', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
+export type SwitchSubscriptionIntervalMutation = { __typename?: 'Mutation', switchSubscriptionInterval: { __typename?: 'BillingUpdate', currentBillingSubscription: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null }, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }> } };
export type BillingPortalSessionQueryVariables = Exact<{
returnUrlPath?: InputMaybe<Scalars['String']>;
}>;
-export type BillingPortalSessionQuery = { __typename?: 'Query', billingPortalSession: { __typename?: 'BillingSessionOutput', url?: string | null } };
+export type BillingPortalSessionQuery = { __typename?: 'Query', billingPortalSession: { __typename?: 'BillingSession', url?: string | null } };
export type GetMeteredProductsUsageQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetMeteredProductsUsageQuery = { __typename?: 'Query', getMeteredProductsUsage: Array<{ __typename?: 'BillingMeteredProductUsageOutput', productKey: BillingProductKey, usedCredits: number, grantedCredits: number, rolloverCredits: number, totalGrantedCredits: number, unitPriceCents: number }> };
+export type GetMeteredProductsUsageQuery = { __typename?: 'Query', getMeteredProductsUsage: Array<{ __typename?: 'BillingMeteredProductUsage', productKey: BillingProductKey, usedCredits: number, grantedCredits: number, rolloverCredits: number, totalGrantedCredits: number, unitPriceCents: number }> };
export type ListPlansQueryVariables = Exact<{ [key: string]: never; }>;
-export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlanOutput', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> };
+export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlan', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> };
export type CommandMenuItemFieldsFragment = { __typename?: 'CommandMenuItem', id: string, workflowVersionId?: string | null, frontComponentId?: string | null, label: string, icon?: string | null, isPinned: boolean, availabilityType: CommandMenuItemAvailabilityType, availabilityObjectMetadataId?: string | null, frontComponent?: { __typename?: 'FrontComponent', id: string, name: string, isHeadless: boolean } | null };
@@ -6105,21 +6271,21 @@ export type BarChartDataQueryVariables = Exact<{
}>;
-export type BarChartDataQuery = { __typename?: 'Query', barChartData: { __typename?: 'BarChartDataOutput', data: Array<any>, indexBy: string, keys: Array<string>, xAxisLabel: string, yAxisLabel: string, showLegend: boolean, showDataLabels: boolean, layout: BarChartLayout, groupMode: BarChartGroupMode, hasTooManyGroups: boolean, formattedToRawLookup: any, series: Array<{ __typename?: 'BarChartSeries', key: string, label: string }> } };
+export type BarChartDataQuery = { __typename?: 'Query', barChartData: { __typename?: 'BarChartData', data: Array<any>, indexBy: string, keys: Array<string>, xAxisLabel: string, yAxisLabel: string, showLegend: boolean, showDataLabels: boolean, layout: BarChartLayout, groupMode: BarChartGroupMode, hasTooManyGroups: boolean, formattedToRawLookup: any, series: Array<{ __typename?: 'BarChartSeries', key: string, label: string }> } };
export type LineChartDataQueryVariables = Exact<{
input: LineChartDataInput;
}>;
-export type LineChartDataQuery = { __typename?: 'Query', lineChartData: { __typename?: 'LineChartDataOutput', xAxisLabel: string, yAxisLabel: string, showLegend: boolean, showDataLabels: boolean, hasTooManyGroups: boolean, formattedToRawLookup: any, series: Array<{ __typename?: 'LineChartSeries', id: string, label: string, data: Array<{ __typename?: 'LineChartDataPoint', x: string, y: number }> }> } };
+export type LineChartDataQuery = { __typename?: 'Query', lineChartData: { __typename?: 'LineChartData', xAxisLabel: string, yAxisLabel: string, showLegend: boolean, showDataLabels: boolean, hasTooManyGroups: boolean, formattedToRawLookup: any, series: Array<{ __typename?: 'LineChartSeries', id: string, label: string, data: Array<{ __typename?: 'LineChartDataPoint', x: string, y: number }> }> } };
export type PieChartDataQueryVariables = Exact<{
input: PieChartDataInput;
}>;
-export type PieChartDataQuery = { __typename?: 'Query', pieChartData: { __typename?: 'PieChartDataOutput', showLegend: boolean, showDataLabels: boolean, showCenterMetric: boolean, hasTooManyGroups: boolean, formattedToRawLookup: any, data: Array<{ __typename?: 'PieChartDataItem', id: string, value: number }> } };
+export type PieChartDataQuery = { __typename?: 'Query', pieChartData: { __typename?: 'PieChartData', showLegend: boolean, showDataLabels: boolean, showCenterMetric: boolean, hasTooManyGroups: boolean, formattedToRawLookup: any, data: Array<{ __typename?: 'PieChartDataItem', id: string, value: number }> } };
export type SaveImapSmtpCaldavAccountMutationVariables = Exact<{
accountOwnerId: Scalars['UUID'];
@@ -6156,7 +6322,7 @@ export type SetAdminAiModelEnabledMutation = { __typename?: 'Mutation', setAdmin
export type GetAdminAiModelsQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetAdminAiModelsQuery = { __typename?: 'Query', getAdminAiModels: { __typename?: 'AdminAIModelsOutput', autoEnableNewModels: boolean, models: Array<{ __typename?: 'AdminAIModelConfig', modelId: string, label: string, modelFamily?: ModelFamily | null, inferenceProvider: InferenceProvider, isAvailable: boolean, isAdminEnabled: boolean, deprecated?: boolean | null, isRecommended?: boolean | null }> } };
+export type GetAdminAiModelsQuery = { __typename?: 'Query', getAdminAiModels: { __typename?: 'AdminAIModels', autoEnableNewModels: boolean, models: Array<{ __typename?: 'AdminAIModelConfig', modelId: string, label: string, modelFamily?: ModelFamily | null, inferenceProvider: InferenceProvider, isAvailable: boolean, isAdminEnabled: boolean, deprecated?: boolean | null, isRecommended?: boolean | null }> } };
export type CreateDatabaseConfigVariableMutationVariables = Exact<{
key: Scalars['String'];
@@ -6184,7 +6350,7 @@ export type UpdateDatabaseConfigVariableMutation = { __typename?: 'Mutation', up
export type GetConfigVariablesGroupedQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetConfigVariablesGroupedQuery = { __typename?: 'Query', getConfigVariablesGrouped: { __typename?: 'ConfigVariablesOutput', groups: Array<{ __typename?: 'ConfigVariablesGroupData', name: ConfigVariablesGroup, description: string, isHiddenOnLoad: boolean, variables: Array<{ __typename?: 'ConfigVariable', name: string, description: string, value?: any | null, isSensitive: boolean, isEnvOnly: boolean, type: ConfigVariableType, options?: any | null, source: ConfigSource }> }> } };
+export type GetConfigVariablesGroupedQuery = { __typename?: 'Query', getConfigVariablesGrouped: { __typename?: 'ConfigVariables', groups: Array<{ __typename?: 'ConfigVariablesGroupData', name: ConfigVariablesGroup, description: string, isHiddenOnLoad: boolean, variables: Array<{ __typename?: 'ConfigVariable', name: string, description: string, value?: any | null, isSensitive: boolean, isEnvOnly: boolean, type: ConfigVariableType, options?: any | null, source: ConfigSource }> }> } };
export type GetDatabaseConfigVariableQueryVariables = Exact<{
key: Scalars['String'];
@@ -6260,6 +6426,69 @@ export type GetSystemHealthStatusQueryVariables = Exact<{ [key: string]: never;
export type GetSystemHealthStatusQuery = { __typename?: 'Query', getSystemHealthStatus: { __typename?: 'SystemHealth', services: Array<{ __typename?: 'SystemHealthService', id: HealthIndicatorId, label: string, status: AdminPanelHealthServiceStatus }> } };
+export type ApplicationRegistrationFragmentFragment = { __typename?: 'ApplicationRegistration', id: string, universalIdentifier: string, name: string, description?: string | null, logoUrl?: string | null, author?: string | null, oAuthClientId: string, oAuthRedirectUris: Array<string>, oAuthScopes: Array<string>, websiteUrl?: string | null, termsUrl?: string | null, createdAt: string, updatedAt: string };
+
+export type DeleteApplicationRegistrationMutationVariables = Exact<{
+ id: Scalars['String'];
+}>;
+
+
+export type DeleteApplicationRegistrationMutation = { __typename?: 'Mutation', deleteApplicationRegistration: boolean };
+
+export type RotateApplicationRegistrationClientSecretMutationVariables = Exact<{
+ id: Scalars['String'];
+}>;
+
+
+export type RotateApplicationRegistrationClientSecretMutation = { __typename?: 'Mutation', rotateApplicationRegistrationClientSecret: { __typename?: 'RotateClientSecret', clientSecret: string } };
+
+export type UpdateApplicationRegistrationMutationVariables = Exact<{
+ input: UpdateApplicationRegistrationInput;
+}>;
+
+
+export type UpdateApplicationRegistrationMutation = { __typename?: 'Mutation', updateApplicationRegistration: { __typename?: 'ApplicationRegistration', id: string, universalIdentifier: string, name: string, description?: string | null, logoUrl?: string | null, author?: string | null, oAuthClientId: string, oAuthRedirectUris: Array<string>, oAuthScopes: Array<string>, websiteUrl?: string | null, termsUrl?: string | null, createdAt: string, updatedAt: string } };
+
+export type UpdateApplicationRegistrationVariableMutationVariables = Exact<{
+ input: UpdateApplicationRegistrationVariableInput;
+}>;
+
+
+export type UpdateApplicationRegistrationVariableMutation = { __typename?: 'Mutation', updateApplicationRegistrationVariable: { __typename?: 'ApplicationRegistrationVariable', id: string, key: string, description: string, isSecret: boolean, isRequired: boolean, isFilled: boolean, createdAt: string, updatedAt: string } };
+
+export type FindApplicationRegistrationByClientIdQueryVariables = Exact<{
+ clientId: Scalars['String'];
+}>;
+
+
+export type FindApplicationRegistrationByClientIdQuery = { __typename?: 'Query', findApplicationRegistrationByClientId?: { __typename?: 'ApplicationRegistration', id: string, name: string, oAuthScopes: Array<string>, websiteUrl?: string | null, logoUrl?: string | null } | null };
+
+export type FindApplicationRegistrationStatsQueryVariables = Exact<{
+ id: Scalars['String'];
+}>;
+
+
+export type FindApplicationRegistrationStatsQuery = { __typename?: 'Query', findApplicationRegistrationStats: { __typename?: 'ApplicationRegistrationStats', activeInstalls: number, mostInstalledVersion?: string | null, versionDistribution: Array<{ __typename?: 'VersionDistributionEntry', version: string, count: number }> } };
+
+export type FindApplicationRegistrationVariablesQueryVariables = Exact<{
+ applicationRegistrationId: Scalars['String'];
+}>;
+
+
+export type FindApplicationRegistrationVariablesQuery = { __typename?: 'Query', findApplicationRegistrationVariables: Array<{ __typename?: 'ApplicationRegistrationVariable', id: string, key: string, description: string, isSecret: boolean, isRequired: boolean, isFilled: boolean, createdAt: string, updatedAt: string }> };
+
+export type FindManyApplicationRegistrationsQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type FindManyApplicationRegistrationsQuery = { __typename?: 'Query', findManyApplicationRegistrations: Array<{ __typename?: 'ApplicationRegistration', id: string, universalIdentifier: string, name: string, description?: string | null, logoUrl?: string | null, author?: string | null, oAuthClientId: string, oAuthRedirectUris: Array<string>, oAuthScopes: Array<string>, websiteUrl?: string | null, termsUrl?: string | null, createdAt: string, updatedAt: string }> };
+
+export type FindOneApplicationRegistrationQueryVariables = Exact<{
+ id: Scalars['String'];
+}>;
+
+
+export type FindOneApplicationRegistrationQuery = { __typename?: 'Query', findOneApplicationRegistration: { __typename?: 'ApplicationRegistration', id: string, universalIdentifier: string, name: string, description?: string | null, logoUrl?: string | null, author?: string | null, oAuthClientId: string, oAuthRedirectUris: Array<string>, oAuthScopes: Array<string>, websiteUrl?: string | null, termsUrl?: string | null, createdAt: string, updatedAt: string } };
+
export type UninstallApplicationMutationVariables = Exact<{
universalIdentifier: Scalars['String'];
}>;
@@ -6403,7 +6632,7 @@ export type UpdateLabPublicFeatureFlagMutationVariables = Exact<{
}>;
-export type UpdateLabPublicFeatureFlagMutation = { __typename?: 'Mutation', updateLabPublicFeatureFlag: { __typename?: 'FeatureFlagDTO', key: FeatureFlagKey, value: boolean } };
+export type UpdateLabPublicFeatureFlagMutation = { __typename?: 'Mutation', updateLabPublicFeatureFlag: { __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean } };
export type UploadWorkspaceMemberProfilePictureMutationVariables = Exact<{
file: Scalars['Upload'];
@@ -6515,14 +6744,14 @@ export type CreateOidcIdentityProviderMutationVariables = Exact<{
}>;
-export type CreateOidcIdentityProviderMutation = { __typename?: 'Mutation', createOIDCIdentityProvider: { __typename?: 'SetupSsoOutput', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
+export type CreateOidcIdentityProviderMutation = { __typename?: 'Mutation', createOIDCIdentityProvider: { __typename?: 'SetupSso', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
export type CreateSamlIdentityProviderMutationVariables = Exact<{
input: SetupSamlSsoInput;
}>;
-export type CreateSamlIdentityProviderMutation = { __typename?: 'Mutation', createSAMLIdentityProvider: { __typename?: 'SetupSsoOutput', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
+export type CreateSamlIdentityProviderMutation = { __typename?: 'Mutation', createSAMLIdentityProvider: { __typename?: 'SetupSso', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
export type DeleteApprovedAccessDomainMutationVariables = Exact<{
input: DeleteApprovedAccessDomainInput;
@@ -6536,14 +6765,14 @@ export type DeleteSsoIdentityProviderMutationVariables = Exact<{
}>;
-export type DeleteSsoIdentityProviderMutation = { __typename?: 'Mutation', deleteSSOIdentityProvider: { __typename?: 'DeleteSsoOutput', identityProviderId: string } };
+export type DeleteSsoIdentityProviderMutation = { __typename?: 'Mutation', deleteSSOIdentityProvider: { __typename?: 'DeleteSso', identityProviderId: string } };
export type EditSsoIdentityProviderMutationVariables = Exact<{
input: EditSsoInput;
}>;
-export type EditSsoIdentityProviderMutation = { __typename?: 'Mutation', editSSOIdentityProvider: { __typename?: 'EditSsoOutput', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
+export type EditSsoIdentityProviderMutation = { __typename?: 'Mutation', editSSOIdentityProvider: { __typename?: 'EditSso', id: string, type: IdentityProviderType, issuer: string, name: string, status: SsoIdentityProviderStatus } };
export type ValidateApprovedAccessDomainMutationVariables = Exact<{
input: ValidateApprovedAccessDomainInput;
@@ -6560,20 +6789,20 @@ export type GetApprovedAccessDomainsQuery = { __typename?: 'Query', getApprovedA
export type GetSsoIdentityProvidersQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetSsoIdentityProvidersQuery = { __typename?: 'Query', getSSOIdentityProviders: Array<{ __typename?: 'FindAvailableSSOIDPOutput', type: IdentityProviderType, id: string, name: string, issuer: string, status: SsoIdentityProviderStatus }> };
+export type GetSsoIdentityProvidersQuery = { __typename?: 'Query', getSSOIdentityProviders: Array<{ __typename?: 'FindAvailableSSOIDP', type: IdentityProviderType, id: string, name: string, issuer: string, status: SsoIdentityProviderStatus }> };
export type VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutationVariables = Exact<{
otp: Scalars['String'];
}>;
-export type VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutation = { __typename?: 'Mutation', verifyTwoFactorAuthenticationMethodForAuthenticatedUser: { __typename?: 'VerifyTwoFactorAuthenticationMethodOutput', success: boolean } };
+export type VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutation = { __typename?: 'Mutation', verifyTwoFactorAuthenticationMethodForAuthenticatedUser: { __typename?: 'VerifyTwoFactorAuthenticationMethod', success: boolean } };
export type BillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> };
-export type CurrentBillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null };
+export type CurrentBillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null };
-export type UserQueryFragmentFragment = { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodDTO', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidEnterpriseKey: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, autoEnableNewAiModels: boolean, disabledAiModelIds?: Array<string> | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlagDTO', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } };
+export type UserQueryFragmentFragment = { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidEnterpriseKey: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, autoEnableNewAiModels: boolean, disabledAiModelIds?: Array<string> | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } };
export type WorkspaceUrlsFragmentFragment = { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null };
@@ -6592,7 +6821,7 @@ export type DeleteUserWorkspaceMutation = { __typename?: 'Mutation', deleteUserF
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodDTO', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidEnterpriseKey: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, autoEnableNewAiModels: boolean, disabledAiModelIds?: Array<string> | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlagDTO', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItemDTO', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } } };
+export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, firstName: string, lastName: string, email: string, hasPassword: boolean, canAccessFullAdminPanel: boolean, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars?: any | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, colorScheme: string, avatarUrl?: string | null, locale?: string | null, userEmail: string, userWorkspaceId?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, calendarStartDay?: number | null, numberFormat?: WorkspaceMemberNumberFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, userWorkspaceId?: string | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, deletedWorkspaceMembers?: Array<{ __typename?: 'DeletedWorkspaceMember', id: string, avatarUrl?: string | null, userEmail: string, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', id: string, permissionFlags?: Array<PermissionFlagType> | null, objectsPermissions?: Array<{ __typename?: 'ObjectPermission', objectMetadataId: string, canReadObjectRecords?: boolean | null, canUpdateObjectRecords?: boolean | null, canSoftDeleteObjectRecords?: boolean | null, canDestroyObjectRecords?: boolean | null, restrictedFields?: any | null, rowLevelPermissionPredicates?: Array<{ __typename?: 'RowLevelPermissionPredicate', id: string, fieldMetadataId: string, objectMetadataId: string, operand: RowLevelPermissionPredicateOperand, subFieldName?: string | null, workspaceMemberFieldMetadataId?: string | null, workspaceMemberSubFieldName?: string | null, rowLevelPermissionPredicateGroupId?: string | null, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, value?: any | null }> | null, rowLevelPermissionPredicateGroups?: Array<{ __typename?: 'RowLevelPermissionPredicateGroup', id: string, parentRowLevelPermissionPredicateGroupId?: string | null, logicalOperator: RowLevelPermissionPredicateGroupLogicalOperator, positionInRowLevelPermissionPredicateGroup?: number | null, roleId: string, objectMetadataId: string }> | null }> | null, twoFactorAuthenticationMethodSummary?: Array<{ __typename?: 'TwoFactorAuthenticationMethodSummary', twoFactorAuthenticationMethodId: string, status: string, strategy: string }> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, isGoogleAuthBypassEnabled: boolean, isMicrosoftAuthBypassEnabled: boolean, isPasswordAuthBypassEnabled: boolean, subdomain: string, customDomain?: string | null, hasValidEnterpriseKey: boolean, isCustomDomainEnabled: boolean, metadataVersion: number, workspaceMembersCount?: number | null, fastModel: string, smartModel: string, aiAdditionalInstructions?: string | null, autoEnableNewAiModels: boolean, disabledAiModelIds?: Array<string> | null, enabledAiModelIds?: Array<string> | null, useRecommendedModels: boolean, isTwoFactorAuthenticationEnforced: boolean, trashRetentionDays: number, eventLogRetentionDays: number, editableProfileFields?: Array<string> | null, workspaceCustomApplication?: { __typename?: 'Application', id: string } | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, interval?: SubscriptionInterval | null, metadata: any, currentPeriodEnd?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }>, billingSubscriptionItems?: Array<{ __typename?: 'BillingSubscriptionItem', id: string, hasReachedCurrentPeriodCap: boolean, quantity?: number | null, stripePriceId: string, billingProduct: { __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } | { __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } } }> | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> }>, billingEntitlements: Array<{ __typename?: 'BillingEntitlement', key: BillingEntitlementKey, value: boolean }>, defaultRole?: { __typename?: 'Role', id: string, label: string, description?: string | null, icon?: string | null, canUpdateAllSettings: boolean, canAccessAllTools: boolean, isEditable: boolean, canReadAllObjectRecords: boolean, canUpdateAllObjectRecords: boolean, canSoftDeleteAllObjectRecords: boolean, canDestroyAllObjectRecords: boolean, canBeAssignedToUsers: boolean, canBeAssignedToAgents: boolean, canBeAssignedToApiKeys: boolean } | null } | null, availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> } } };
export type ViewFieldFragmentFragment = { __typename?: 'CoreViewField', id: string, fieldMetadataId: string, viewId: string, isVisible: boolean, position: number, size: number, aggregateOperation?: AggregateOperations | null, createdAt: string, updatedAt: string, deletedAt?: string | null };
@@ -6932,14 +7161,14 @@ export type ResendWorkspaceInvitationMutationVariables = Exact<{
}>;
-export type ResendWorkspaceInvitationMutation = { __typename?: 'Mutation', resendWorkspaceInvitation: { __typename?: 'SendInvitationsOutput', success: boolean, errors: Array<string>, result: Array<{ __typename?: 'WorkspaceInvitation', id: string, email: string, expiresAt: string }> } };
+export type ResendWorkspaceInvitationMutation = { __typename?: 'Mutation', resendWorkspaceInvitation: { __typename?: 'SendInvitations', success: boolean, errors: Array<string>, result: Array<{ __typename?: 'WorkspaceInvitation', id: string, email: string, expiresAt: string }> } };
export type SendInvitationsMutationVariables = Exact<{
emails: Array<Scalars['String']> | Scalars['String'];
}>;
-export type SendInvitationsMutation = { __typename?: 'Mutation', sendInvitations: { __typename?: 'SendInvitationsOutput', success: boolean, errors: Array<string>, result: Array<{ __typename?: 'WorkspaceInvitation', id: string, email: string, expiresAt: string }> } };
+export type SendInvitationsMutation = { __typename?: 'Mutation', sendInvitations: { __typename?: 'SendInvitations', success: boolean, errors: Array<string>, result: Array<{ __typename?: 'WorkspaceInvitation', id: string, email: string, expiresAt: string }> } };
export type GetWorkspaceInvitationsQueryVariables = Exact<{ [key: string]: never; }>;
@@ -7207,7 +7436,7 @@ export const AuthTokenPairFragmentFragmentDoc = gql`
}
${AuthTokenFragmentFragmentDoc}`;
export const AvailableSsoIdentityProvidersFragmentFragmentDoc = gql`
- fragment AvailableSSOIdentityProvidersFragment on FindAvailableSSOIDPOutput {
+ fragment AvailableSSOIdentityProvidersFragment on FindAvailableSSOIDP {
id
issuer
name
@@ -7588,6 +7817,23 @@ export const NavigationMenuItemQueryFieldsFragmentDoc = gql`
}
}
${NavigationMenuItemFieldsFragmentDoc}`;
+export const ApplicationRegistrationFragmentFragmentDoc = gql`
+ fragment ApplicationRegistrationFragment on ApplicationRegistration {
+ id
+ universalIdentifier
+ name
+ description
+ logoUrl
+ author
+ oAuthClientId
+ oAuthRedirectUris
+ oAuthScopes
+ websiteUrl
+ termsUrl
+ createdAt
+ updatedAt
+}
+ `;
export const ApiKeyFragmentFragmentDoc = gql`
fragment ApiKeyFragment on ApiKey {
id
@@ -9094,7 +9340,7 @@ export type UploadImageMutationHookResult = ReturnType<typeof useUploadImageMuta
export type UploadImageMutationResult = Apollo.MutationResult<UploadImageMutation>;
export type UploadImageMutationOptions = Apollo.BaseMutationOptions<UploadImageMutation, UploadImageMutationVariables>;
export const AuthorizeAppDocument = gql`
- mutation authorizeApp($clientId: String!, $codeChallenge: String!, $redirectUrl: String!) {
+ mutation authorizeApp($clientId: String!, $codeChallenge: String, $redirectUrl: String!) {
authorizeApp(
clientId: $clientId
codeChallenge: $codeChallenge
@@ -12841,6 +13087,335 @@ export function useGetSystemHealthStatusLazyQuery(baseOptions?: Apollo.LazyQuery
export type GetSystemHealthStatusQueryHookResult = ReturnType<typeof useGetSystemHealthStatusQuery>;
export type GetSystemHealthStatusLazyQueryHookResult = ReturnType<typeof useGetSystemHealthStatusLazyQuery>;
export type GetSystemHealthStatusQueryResult = Apollo.QueryResult<GetSystemHealthStatusQuery, GetSystemHealthStatusQueryVariables>;
+export const DeleteApplicationRegistrationDocument = gql`
+ mutation DeleteApplicationRegistration($id: String!) {
+ deleteApplicationRegistration(id: $id)
+}
+ `;
+export type DeleteApplicationRegistrationMutationFn = Apollo.MutationFunction<DeleteApplicationRegistrationMutation, DeleteApplicationRegistrationMutationVariables>;
+
+/**
+ * __useDeleteApplicationRegistrationMutation__
+ *
+ * To run a mutation, you first call `useDeleteApplicationRegistrationMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useDeleteApplicationRegistrationMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [deleteApplicationRegistrationMutation, { data, loading, error }] = useDeleteApplicationRegistrationMutation({
+ * variables: {
+ * id: // value for 'id'
+ * },
+ * });
+ */
+export function useDeleteApplicationRegistrationMutation(baseOptions?: Apollo.MutationHookOptions<DeleteApplicationRegistrationMutation, DeleteApplicationRegistrationMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<DeleteApplicationRegistrationMutation, DeleteApplicationRegistrationMutationVariables>(DeleteApplicationRegistrationDocument, options);
+ }
+export type DeleteApplicationRegistrationMutationHookResult = ReturnType<typeof useDeleteApplicationRegistrationMutation>;
+export type DeleteApplicationRegistrationMutationResult = Apollo.MutationResult<DeleteApplicationRegistrationMutation>;
+export type DeleteApplicationRegistrationMutationOptions = Apollo.BaseMutationOptions<DeleteApplicationRegistrationMutation, DeleteApplicationRegistrationMutationVariables>;
+export const RotateApplicationRegistrationClientSecretDocument = gql`
+ mutation RotateApplicationRegistrationClientSecret($id: String!) {
+ rotateApplicationRegistrationClientSecret(id: $id) {
+ clientSecret
+ }
+}
+ `;
+export type RotateApplicationRegistrationClientSecretMutationFn = Apollo.MutationFunction<RotateApplicationRegistrationClientSecretMutation, RotateApplicationRegistrationClientSecretMutationVariables>;
+
+/**
+ * __useRotateApplicationRegistrationClientSecretMutation__
+ *
+ * To run a mutation, you first call `useRotateApplicationRegistrationClientSecretMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useRotateApplicationRegistrationClientSecretMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [rotateApplicationRegistrationClientSecretMutation, { data, loading, error }] = useRotateApplicationRegistrationClientSecretMutation({
+ * variables: {
+ * id: // value for 'id'
+ * },
+ * });
+ */
+export function useRotateApplicationRegistrationClientSecretMutation(baseOptions?: Apollo.MutationHookOptions<RotateApplicationRegistrationClientSecretMutation, RotateApplicationRegistrationClientSecretMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<RotateApplicationRegistrationClientSecretMutation, RotateApplicationRegistrationClientSecretMutationVariables>(RotateApplicationRegistrationClientSecretDocument, options);
+ }
+export type RotateApplicationRegistrationClientSecretMutationHookResult = ReturnType<typeof useRotateApplicationRegistrationClientSecretMutation>;
+export type RotateApplicationRegistrationClientSecretMutationResult = Apollo.MutationResult<RotateApplicationRegistrationClientSecretMutation>;
+export type RotateApplicationRegistrationClientSecretMutationOptions = Apollo.BaseMutationOptions<RotateApplicationRegistrationClientSecretMutation, RotateApplicationRegistrationClientSecretMutationVariables>;
+export const UpdateApplicationRegistrationDocument = gql`
+ mutation UpdateApplicationRegistration($input: UpdateApplicationRegistrationInput!) {
+ updateApplicationRegistration(input: $input) {
+ ...ApplicationRegistrationFragment
+ }
+}
+ ${ApplicationRegistrationFragmentFragmentDoc}`;
+export type UpdateApplicationRegistrationMutationFn = Apollo.MutationFunction<UpdateApplicationRegistrationMutation, UpdateApplicationRegistrationMutationVariables>;
+
+/**
+ * __useUpdateApplicationRegistrationMutation__
+ *
+ * To run a mutation, you first call `useUpdateApplicationRegistrationMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useUpdateApplicationRegistrationMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [updateApplicationRegistrationMutation, { data, loading, error }] = useUpdateApplicationRegistrationMutation({
+ * variables: {
+ * input: // value for 'input'
+ * },
+ * });
+ */
+export function useUpdateApplicationRegistrationMutation(baseOptions?: Apollo.MutationHookOptions<UpdateApplicationRegistrationMutation, UpdateApplicationRegistrationMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<UpdateApplicationRegistrationMutation, UpdateApplicationRegistrationMutationVariables>(UpdateApplicationRegistrationDocument, options);
+ }
+export type UpdateApplicationRegistrationMutationHookResult = ReturnType<typeof useUpdateApplicationRegistrationMutation>;
+export type UpdateApplicationRegistrationMutationResult = Apollo.MutationResult<UpdateApplicationRegistrationMutation>;
+export type UpdateApplicationRegistrationMutationOptions = Apollo.BaseMutationOptions<UpdateApplicationRegistrationMutation, UpdateApplicationRegistrationMutationVariables>;
+export const UpdateApplicationRegistrationVariableDocument = gql`
+ mutation UpdateApplicationRegistrationVariable($input: UpdateApplicationRegistrationVariableInput!) {
+ updateApplicationRegistrationVariable(input: $input) {
+ id
+ key
+ description
+ isSecret
+ isRequired
+ isFilled
+ createdAt
+ updatedAt
+ }
+}
+ `;
+export type UpdateApplicationRegistrationVariableMutationFn = Apollo.MutationFunction<UpdateApplicationRegistrationVariableMutation, UpdateApplicationRegistrationVariableMutationVariables>;
+
+/**
+ * __useUpdateApplicationRegistrationVariableMutation__
+ *
+ * To run a mutation, you first call `useUpdateApplicationRegistrationVariableMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useUpdateApplicationRegistrationVariableMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [updateApplicationRegistrationVariableMutation, { data, loading, error }] = useUpdateApplicationRegistrationVariableMutation({
+ * variables: {
+ * input: // value for 'input'
+ * },
+ * });
+ */
+export function useUpdateApplicationRegistrationVariableMutation(baseOptions?: Apollo.MutationHookOptions<UpdateApplicationRegistrationVariableMutation, UpdateApplicationRegistrationVariableMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<UpdateApplicationRegistrationVariableMutation, UpdateApplicationRegistrationVariableMutationVariables>(UpdateApplicationRegistrationVariableDocument, options);
+ }
+export type UpdateApplicationRegistrationVariableMutationHookResult = ReturnType<typeof useUpdateApplicationRegistrationVariableMutation>;
+export type UpdateApplicationRegistrationVariableMutationResult = Apollo.MutationResult<UpdateApplicationRegistrationVariableMutation>;
+export type UpdateApplicationRegistrationVariableMutationOptions = Apollo.BaseMutationOptions<UpdateApplicationRegistrationVariableMutation, UpdateApplicationRegistrationVariableMutationVariables>;
+export const FindApplicationRegistrationByClientIdDocument = gql`
+ query FindApplicationRegistrationByClientId($clientId: String!) {
+ findApplicationRegistrationByClientId(clientId: $clientId) {
+ id
+ name
+ oAuthScopes
+ websiteUrl
+ logoUrl
+ }
+}
+ `;
+
+/**
+ * __useFindApplicationRegistrationByClientIdQuery__
+ *
+ * To run a query within a React component, call `useFindApplicationRegistrationByClientIdQuery` and pass it any options that fit your needs.
+ * When your component renders, `useFindApplicationRegistrationByClientIdQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useFindApplicationRegistrationByClientIdQuery({
+ * variables: {
+ * clientId: // value for 'clientId'
+ * },
+ * });
+ */
+export function useFindApplicationRegistrationByClientIdQuery(baseOptions: Apollo.QueryHookOptions<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>(FindApplicationRegistrationByClientIdDocument, options);
+ }
+export function useFindApplicationRegistrationByClientIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>(FindApplicationRegistrationByClientIdDocument, options);
+ }
+export type FindApplicationRegistrationByClientIdQueryHookResult = ReturnType<typeof useFindApplicationRegistrationByClientIdQuery>;
+export type FindApplicationRegistrationByClientIdLazyQueryHookResult = ReturnType<typeof useFindApplicationRegistrationByClientIdLazyQuery>;
+export type FindApplicationRegistrationByClientIdQueryResult = Apollo.QueryResult<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>;
+export const FindApplicationRegistrationStatsDocument = gql`
+ query FindApplicationRegistrationStats($id: String!) {
+ findApplicationRegistrationStats(id: $id) {
+ activeInstalls
+ mostInstalledVersion
+ versionDistribution {
+ version
+ count
+ }
+ }
+}
+ `;
+
+/**
+ * __useFindApplicationRegistrationStatsQuery__
+ *
+ * To run a query within a React component, call `useFindApplicationRegistrationStatsQuery` and pass it any options that fit your needs.
+ * When your component renders, `useFindApplicationRegistrationStatsQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useFindApplicationRegistrationStatsQuery({
+ * variables: {
+ * id: // value for 'id'
+ * },
+ * });
+ */
+export function useFindApplicationRegistrationStatsQuery(baseOptions: Apollo.QueryHookOptions<FindApplicationRegistrationStatsQuery, FindApplicationRegistrationStatsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<FindApplicationRegistrationStatsQuery, FindApplicationRegistrationStatsQueryVariables>(FindApplicationRegistrationStatsDocument, options);
+ }
+export function useFindApplicationRegistrationStatsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindApplicationRegistrationStatsQuery, FindApplicationRegistrationStatsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<FindApplicationRegistrationStatsQuery, FindApplicationRegistrationStatsQueryVariables>(FindApplicationRegistrationStatsDocument, options);
+ }
+export type FindApplicationRegistrationStatsQueryHookResult = ReturnType<typeof useFindApplicationRegistrationStatsQuery>;
+export type FindApplicationRegistrationStatsLazyQueryHookResult = ReturnType<typeof useFindApplicationRegistrationStatsLazyQuery>;
+export type FindApplicationRegistrationStatsQueryResult = Apollo.QueryResult<FindApplicationRegistrationStatsQuery, FindApplicationRegistrationStatsQueryVariables>;
+export const FindApplicationRegistrationVariablesDocument = gql`
+ query FindApplicationRegistrationVariables($applicationRegistrationId: String!) {
+ findApplicationRegistrationVariables(
+ applicationRegistrationId: $applicationRegistrationId
+ ) {
+ id
+ key
+ description
+ isSecret
+ isRequired
+ isFilled
+ createdAt
+ updatedAt
+ }
+}
+ `;
+
+/**
+ * __useFindApplicationRegistrationVariablesQuery__
+ *
+ * To run a query within a React component, call `useFindApplicationRegistrationVariablesQuery` and pass it any options that fit your needs.
+ * When your component renders, `useFindApplicationRegistrationVariablesQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useFindApplicationRegistrationVariablesQuery({
+ * variables: {
+ * applicationRegistrationId: // value for 'applicationRegistrationId'
+ * },
+ * });
+ */
+export function useFindApplicationRegistrationVariablesQuery(baseOptions: Apollo.QueryHookOptions<FindApplicationRegistrationVariablesQuery, FindApplicationRegistrationVariablesQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<FindApplicationRegistrationVariablesQuery, FindApplicationRegistrationVariablesQueryVariables>(FindApplicationRegistrationVariablesDocument, options);
+ }
+export function useFindApplicationRegistrationVariablesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindApplicationRegistrationVariablesQuery, FindApplicationRegistrationVariablesQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<FindApplicationRegistrationVariablesQuery, FindApplicationRegistrationVariablesQueryVariables>(FindApplicationRegistrationVariablesDocument, options);
+ }
+export type FindApplicationRegistrationVariablesQueryHookResult = ReturnType<typeof useFindApplicationRegistrationVariablesQuery>;
+export type FindApplicationRegistrationVariablesLazyQueryHookResult = ReturnType<typeof useFindApplicationRegistrationVariablesLazyQuery>;
+export type FindApplicationRegistrationVariablesQueryResult = Apollo.QueryResult<FindApplicationRegistrationVariablesQuery, FindApplicationRegistrationVariablesQueryVariables>;
+export const FindManyApplicationRegistrationsDocument = gql`
+ query FindManyApplicationRegistrations {
+ findManyApplicationRegistrations {
+ ...ApplicationRegistrationFragment
+ }
+}
+ ${ApplicationRegistrationFragmentFragmentDoc}`;
+
+/**
+ * __useFindManyApplicationRegistrationsQuery__
+ *
+ * To run a query within a React component, call `useFindManyApplicationRegistrationsQuery` and pass it any options that fit your needs.
+ * When your component renders, `useFindManyApplicationRegistrationsQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useFindManyApplicationRegistrationsQuery({
+ * variables: {
+ * },
+ * });
+ */
+export function useFindManyApplicationRegistrationsQuery(baseOptions?: Apollo.QueryHookOptions<FindManyApplicationRegistrationsQuery, FindManyApplicationRegistrationsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<FindManyApplicationRegistrationsQuery, FindManyApplicationRegistrationsQueryVariables>(FindManyApplicationRegistrationsDocument, options);
+ }
+export function useFindManyApplicationRegistrationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindManyApplicationRegistrationsQuery, FindManyApplicationRegistrationsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<FindManyApplicationRegistrationsQuery, FindManyApplicationRegistrationsQueryVariables>(FindManyApplicationRegistrationsDocument, options);
+ }
+export type FindManyApplicationRegistrationsQueryHookResult = ReturnType<typeof useFindManyApplicationRegistrationsQuery>;
+export type FindManyApplicationRegistrationsLazyQueryHookResult = ReturnType<typeof useFindManyApplicationRegistrationsLazyQuery>;
+export type FindManyApplicationRegistrationsQueryResult = Apollo.QueryResult<FindManyApplicationRegistrationsQuery, FindManyApplicationRegistrationsQueryVariables>;
+export const FindOneApplicationRegistrationDocument = gql`
+ query FindOneApplicationRegistration($id: String!) {
+ findOneApplicationRegistration(id: $id) {
+ ...ApplicationRegistrationFragment
+ }
+}
+ ${ApplicationRegistrationFragmentFragmentDoc}`;
+
+/**
+ * __useFindOneApplicationRegistrationQuery__
+ *
+ * To run a query within a React component, call `useFindOneApplicationRegistrationQuery` and pass it any options that fit your needs.
+ * When your component renders, `useFindOneApplicationRegistrationQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useFindOneApplicationRegistrationQuery({
+ * variables: {
+ * id: // value for 'id'
+ * },
+ * });
+ */
+export function useFindOneApplicationRegistrationQuery(baseOptions: Apollo.QueryHookOptions<FindOneApplicationRegistrationQuery, FindOneApplicationRegistrationQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<FindOneApplicationRegistrationQuery, FindOneApplicationRegistrationQueryVariables>(FindOneApplicationRegistrationDocument, options);
+ }
+export function useFindOneApplicationRegistrationLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<FindOneApplicationRegistrationQuery, FindOneApplicationRegistrationQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<FindOneApplicationRegistrationQuery, FindOneApplicationRegistrationQueryVariables>(FindOneApplicationRegistrationDocument, options);
+ }
+export type FindOneApplicationRegistrationQueryHookResult = ReturnType<typeof useFindOneApplicationRegistrationQuery>;
+export type FindOneApplicationRegistrationLazyQueryHookResult = ReturnType<typeof useFindOneApplicationRegistrationLazyQuery>;
+export type FindOneApplicationRegistrationQueryResult = Apollo.QueryResult<FindOneApplicationRegistrationQuery, FindOneApplicationRegistrationQueryVariables>;
export const UninstallApplicationDocument = gql`
mutation UninstallApplication($universalIdentifier: String!) {
uninstallApplication(universalIdentifier: $universalIdentifier)
diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.ts
index 12520090d58..8b96d778018 100644
--- a/packages/twenty-front/src/generated/graphql.ts
+++ b/packages/twenty-front/src/generated/graphql.ts
@@ -134,10 +134,10 @@ export type Mutation = {
dismissReconnectAccountBanner: Scalars['Boolean'];
duplicateWorkflow: WorkflowVersionDto;
duplicateWorkflowVersionStep: WorkflowVersionStepChanges;
- runWorkflowVersion: RunWorkflowVersionOutput;
+ runWorkflowVersion: RunWorkflowVersion;
stopWorkflowRun: WorkflowRun;
submitFormStep: Scalars['Boolean'];
- testHttpRequest: TestHttpRequestOutput;
+ testHttpRequest: TestHttpRequest;
updateWorkflowRunStep: WorkflowAction;
updateWorkflowVersionPositions: Scalars['Boolean'];
updateWorkflowVersionStep: WorkflowAction;
@@ -306,6 +306,11 @@ export type QuerySearchArgs = {
searchInput: Scalars['String'];
};
+export type RunWorkflowVersion = {
+ __typename?: 'RunWorkflowVersion';
+ workflowRunId: Scalars['UUID'];
+};
+
export type RunWorkflowVersionInput = {
/** Execution result in JSON format */
payload?: InputMaybe<Scalars['JSON']>;
@@ -315,11 +320,6 @@ export type RunWorkflowVersionInput = {
workflowVersionId: Scalars['UUID'];
};
-export type RunWorkflowVersionOutput = {
- __typename?: 'RunWorkflowVersionOutput';
- workflowRunId: Scalars['UUID'];
-};
-
export type SearchRecord = {
__typename?: 'SearchRecord';
imageUrl?: Maybe<Scalars['String']>;
@@ -358,19 +358,8 @@ export type SubmitFormStepInput = {
workflowRunId: Scalars['UUID'];
};
-export type TestHttpRequestInput = {
- /** Request body */
- body?: InputMaybe<Scalars['JSON']>;
- /** HTTP headers */
- headers?: InputMaybe<Scalars['JSON']>;
- /** HTTP method */
- method: Scalars['String'];
- /** URL to make the request to */
- url: Scalars['String'];
-};
-
-export type TestHttpRequestOutput = {
- __typename?: 'TestHttpRequestOutput';
+export type TestHttpRequest = {
+ __typename?: 'TestHttpRequest';
/** Error information */
error?: Maybe<Scalars['JSON']>;
/** Response headers */
@@ -387,6 +376,17 @@ export type TestHttpRequestOutput = {
success: Scalars['Boolean'];
};
+export type TestHttpRequestInput = {
+ /** Request body */
+ body?: InputMaybe<Scalars['JSON']>;
+ /** HTTP headers */
+ headers?: InputMaybe<Scalars['JSON']>;
+ /** HTTP method */
+ method: Scalars['String'];
+ /** URL to make the request to */
+ url: Scalars['String'];
+};
+
export type TimelineCalendarEvent = {
__typename?: 'TimelineCalendarEvent';
conferenceLink: LinksMetadata;
@@ -722,7 +722,7 @@ export type RunWorkflowVersionMutationVariables = Exact<{
}>;
-export type RunWorkflowVersionMutation = { __typename?: 'Mutation', runWorkflowVersion: { __typename?: 'RunWorkflowVersionOutput', workflowRunId: any } };
+export type RunWorkflowVersionMutation = { __typename?: 'Mutation', runWorkflowVersion: { __typename?: 'RunWorkflowVersion', workflowRunId: any } };
export type StopWorkflowRunMutationVariables = Exact<{
workflowRunId: Scalars['UUID'];
@@ -757,7 +757,7 @@ export type TestHttpRequestMutationVariables = Exact<{
}>;
-export type TestHttpRequestMutation = { __typename?: 'Mutation', testHttpRequest: { __typename?: 'TestHttpRequestOutput', success: boolean, message: string, result?: any | null, error?: any | null, status?: number | null, statusText?: string | null, headers?: any | null } };
+export type TestHttpRequestMutation = { __typename?: 'Mutation', testHttpRequest: { __typename?: 'TestHttpRequest', success: boolean, message: string, result?: any | null, error?: any | null, status?: number | null, statusText?: string | null, headers?: any | null } };
export type UpdateWorkflowVersionPositionsMutationVariables = Exact<{
input: UpdateWorkflowVersionPositionsInput;
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index d2e3e73ace9..8a940c97cfa 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -170,6 +170,14 @@ const SettingsAvailableApplicationDetails = lazy(() =>
})),
);
+const SettingsApplicationRegistrationDetails = lazy(() =>
+ import(
+ '~/pages/settings/applications/SettingsApplicationRegistrationDetails'
+ ).then((module) => ({
+ default: module.SettingsApplicationRegistrationDetails,
+ })),
+);
+
const SettingsAgentForm = lazy(() =>
import('~/pages/settings/ai/SettingsAgentForm').then((module) => ({
default: module.SettingsAgentForm,
@@ -622,6 +630,10 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (
path={SettingsPath.AvailableApplicationDetail}
element={<SettingsAvailableApplicationDetails />}
/>
+ <Route
+ path={SettingsPath.ApplicationRegistrationDetail}
+ element={<SettingsApplicationRegistrationDetails />}
+ />
<Route
path={SettingsPath.ApplicationLogicFunctionDetail}
element={<SettingsLogicFunctionDetail />}
diff --git a/packages/twenty-front/src/modules/auth/graphql/fragments/availableSSOIdentityProvidersFragment.ts b/packages/twenty-front/src/modules/auth/graphql/fragments/availableSSOIdentityProvidersFragment.ts
index 45bc6c944cb..3f4926d8bd8 100644
--- a/packages/twenty-front/src/modules/auth/graphql/fragments/availableSSOIdentityProvidersFragment.ts
+++ b/packages/twenty-front/src/modules/auth/graphql/fragments/availableSSOIdentityProvidersFragment.ts
@@ -3,7 +3,7 @@
import { gql } from '@apollo/client';
export const AVAILABLE_SSO_IDENTITY_PROVIDERS_FRAGMENT = gql`
- fragment AvailableSSOIdentityProvidersFragment on FindAvailableSSOIDPOutput {
+ fragment AvailableSSOIdentityProvidersFragment on FindAvailableSSOIDP {
id
issuer
name
diff --git a/packages/twenty-front/src/modules/auth/graphql/mutations/authorizeApp.ts b/packages/twenty-front/src/modules/auth/graphql/mutations/authorizeApp.ts
index df0ae9bbfaf..ab2ec03e299 100644
--- a/packages/twenty-front/src/modules/auth/graphql/mutations/authorizeApp.ts
+++ b/packages/twenty-front/src/modules/auth/graphql/mutations/authorizeApp.ts
@@ -3,7 +3,7 @@ import { gql } from '@apollo/client';
export const AUTHORIZE_APP = gql`
mutation authorizeApp(
$clientId: String!
- $codeChallenge: String!
+ $codeChallenge: String
$redirectUrl: String!
) {
authorizeApp(
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
index 3eaccd59505..492d00a78f6 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useHandleResetPassword.test.ts
@@ -10,7 +10,7 @@ import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
import { SOURCE_LOCALE } from 'twenty-shared/translations';
import {
- type PublicWorkspaceDataOutput,
+ type PublicWorkspaceData,
useEmailPasswordResetLinkMutation,
} from '~/generated-metadata/graphql';
import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
@@ -24,7 +24,7 @@ dynamicActivate(SOURCE_LOCALE);
const renderHooks = () => {
jotaiStore.set(workspacePublicDataState.atom, {
id: 'workspace-id',
- } as PublicWorkspaceDataOutput);
+ } as PublicWorkspaceData);
const { result } = renderHook(() => useHandleResetPassword(), {
wrapper: ({ children }: { children: ReactNode }) =>
diff --git a/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts b/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
index 57b5db6498e..9e16130dc5b 100644
--- a/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
+++ b/packages/twenty-front/src/modules/auth/states/workspacePublicDataState.ts
@@ -1,8 +1,8 @@
-import { type PublicWorkspaceDataOutput } from '~/generated-metadata/graphql';
+import { type PublicWorkspaceData } from '~/generated-metadata/graphql';
import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
export const workspacePublicDataState =
- createAtomState<PublicWorkspaceDataOutput | null>({
+ createAtomState<PublicWorkspaceData | null>({
key: 'workspacePublicDataState',
defaultValue: null,
});
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTableCard.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTableCard.tsx
index 70df572646c..c0041d999f4 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTableCard.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminTableCard.tsx
@@ -4,8 +4,9 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
-import { Card } from 'twenty-ui/layout';
+import { isDefined } from 'twenty-shared/utils';
import { type IconComponent } from 'twenty-ui/display';
+import { Card } from 'twenty-ui/layout';
const StyledCard = styled(Card)`
background-color: ${({ theme }) => theme.background.secondary};
@@ -33,8 +34,10 @@ const StyledTableCellLabel = styled(TableCell)<{
const StyledTableCellValue = styled(TableCell)<{
align?: 'left' | 'center' | 'right';
+ clickable?: boolean;
}>`
color: ${({ theme }) => theme.font.color.primary};
+ cursor: ${({ clickable }) => (clickable ? 'pointer' : 'default')};
height: ${({ theme }) => theme.spacing(6)};
justify-content: ${({ align }) =>
align === 'left'
@@ -48,6 +51,7 @@ type TableItem = {
Icon?: IconComponent;
label: string;
value: string | number | React.ReactNode;
+ onClick?: () => void;
};
type SettingsAdminTableCardProps = {
@@ -82,7 +86,11 @@ export const SettingsAdminTableCard = ({
{item.Icon && <item.Icon size={theme.icon.size.md} />}
<span>{item.label}</span>
</StyledTableCellLabel>
- <StyledTableCellValue align={valueAlign}>
+ <StyledTableCellValue
+ align={valueAlign}
+ onClick={item.onClick}
+ clickable={isDefined(item.onClick)}
+ >
{item.value}
</StyledTableCellValue>
</StyledTableRow>
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/fragments/applicationRegistrationFragment.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/fragments/applicationRegistrationFragment.ts
new file mode 100644
index 00000000000..e9756655e61
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/fragments/applicationRegistrationFragment.ts
@@ -0,0 +1,19 @@
+import { gql } from '@apollo/client';
+
+export const APPLICATION_REGISTRATION_FRAGMENT = gql`
+ fragment ApplicationRegistrationFragment on ApplicationRegistration {
+ id
+ universalIdentifier
+ name
+ description
+ logoUrl
+ author
+ oAuthClientId
+ oAuthRedirectUris
+ oAuthScopes
+ websiteUrl
+ termsUrl
+ createdAt
+ updatedAt
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/deleteApplicationRegistration.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/deleteApplicationRegistration.ts
new file mode 100644
index 00000000000..0e48bbdf271
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/deleteApplicationRegistration.ts
@@ -0,0 +1,7 @@
+import { gql } from '@apollo/client';
+
+export const DELETE_APPLICATION_REGISTRATION = gql`
+ mutation DeleteApplicationRegistration($id: String!) {
+ deleteApplicationRegistration(id: $id)
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/rotateApplicationRegistrationClientSecret.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/rotateApplicationRegistrationClientSecret.ts
new file mode 100644
index 00000000000..658bbecaf4d
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/rotateApplicationRegistrationClientSecret.ts
@@ -0,0 +1,9 @@
+import { gql } from '@apollo/client';
+
+export const ROTATE_APPLICATION_REGISTRATION_CLIENT_SECRET = gql`
+ mutation RotateApplicationRegistrationClientSecret($id: String!) {
+ rotateApplicationRegistrationClientSecret(id: $id) {
+ clientSecret
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistration.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistration.ts
new file mode 100644
index 00000000000..76dee1164e8
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistration.ts
@@ -0,0 +1,14 @@
+import { gql } from '@apollo/client';
+
+import { APPLICATION_REGISTRATION_FRAGMENT } from '@/settings/application-registrations/graphql/fragments/applicationRegistrationFragment';
+
+export const UPDATE_APPLICATION_REGISTRATION = gql`
+ mutation UpdateApplicationRegistration(
+ $input: UpdateApplicationRegistrationInput!
+ ) {
+ updateApplicationRegistration(input: $input) {
+ ...ApplicationRegistrationFragment
+ }
+ }
+ ${APPLICATION_REGISTRATION_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistrationVariable.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistrationVariable.ts
new file mode 100644
index 00000000000..7fe2c960d49
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/mutations/updateApplicationRegistrationVariable.ts
@@ -0,0 +1,18 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_APPLICATION_REGISTRATION_VARIABLE = gql`
+ mutation UpdateApplicationRegistrationVariable(
+ $input: UpdateApplicationRegistrationVariableInput!
+ ) {
+ updateApplicationRegistrationVariable(input: $input) {
+ id
+ key
+ description
+ isSecret
+ isRequired
+ isFilled
+ createdAt
+ updatedAt
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationByClientId.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationByClientId.ts
new file mode 100644
index 00000000000..f125b42c7a0
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationByClientId.ts
@@ -0,0 +1,13 @@
+import { gql } from '@apollo/client';
+
+export const FIND_APPLICATION_REGISTRATION_BY_CLIENT_ID = gql`
+ query FindApplicationRegistrationByClientId($clientId: String!) {
+ findApplicationRegistrationByClientId(clientId: $clientId) {
+ id
+ name
+ oAuthScopes
+ websiteUrl
+ logoUrl
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationStats.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationStats.ts
new file mode 100644
index 00000000000..d84229e1339
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationStats.ts
@@ -0,0 +1,14 @@
+import { gql } from '@apollo/client';
+
+export const FIND_APPLICATION_REGISTRATION_STATS = gql`
+ query FindApplicationRegistrationStats($id: String!) {
+ findApplicationRegistrationStats(id: $id) {
+ activeInstalls
+ mostInstalledVersion
+ versionDistribution {
+ version
+ count
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationVariables.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationVariables.ts
new file mode 100644
index 00000000000..5be591bb89c
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findApplicationRegistrationVariables.ts
@@ -0,0 +1,20 @@
+import { gql } from '@apollo/client';
+
+export const FIND_APPLICATION_REGISTRATION_VARIABLES = gql`
+ query FindApplicationRegistrationVariables(
+ $applicationRegistrationId: String!
+ ) {
+ findApplicationRegistrationVariables(
+ applicationRegistrationId: $applicationRegistrationId
+ ) {
+ id
+ key
+ description
+ isSecret
+ isRequired
+ isFilled
+ createdAt
+ updatedAt
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findManyApplicationRegistrations.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findManyApplicationRegistrations.ts
new file mode 100644
index 00000000000..c86bcaee972
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findManyApplicationRegistrations.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+import { APPLICATION_REGISTRATION_FRAGMENT } from '@/settings/application-registrations/graphql/fragments/applicationRegistrationFragment';
+
+export const FIND_MANY_APPLICATION_REGISTRATIONS = gql`
+ query FindManyApplicationRegistrations {
+ findManyApplicationRegistrations {
+ ...ApplicationRegistrationFragment
+ }
+ }
+ ${APPLICATION_REGISTRATION_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findOneApplicationRegistration.ts b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findOneApplicationRegistration.ts
new file mode 100644
index 00000000000..56856e61f36
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/application-registrations/graphql/queries/findOneApplicationRegistration.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+import { APPLICATION_REGISTRATION_FRAGMENT } from '@/settings/application-registrations/graphql/fragments/applicationRegistrationFragment';
+
+export const FIND_ONE_APPLICATION_REGISTRATION = gql`
+ query FindOneApplicationRegistration($id: String!) {
+ findOneApplicationRegistration(id: $id) {
+ ...ApplicationRegistrationFragment
+ }
+ }
+ ${APPLICATION_REGISTRATION_FRAGMENT}
+`;
diff --git a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
index 51748167305..c3aec543db3 100644
--- a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
+++ b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx
@@ -8,10 +8,10 @@ import { supportChatState } from '@/client-config/states/supportChatState';
import { usePermissionFlagMap } from '@/settings/roles/hooks/usePermissionFlagMap';
import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';
import { type NavigationDrawerItemIndentationLevel } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import {
IconApi,
// IconApps, // TODO: Re-enable when integrations page is ready
@@ -173,7 +173,7 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
// isHidden: !permissionMap[PermissionFlagType.API_KEYS_AND_WEBHOOKS],
// },
{
- label: t`Applications`,
+ label: t`Apps`,
path: SettingsPath.Applications,
Icon: IconPlug,
isHidden:
diff --git a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication.ts b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication.ts
index c0f08e1e85d..3146957a2fc 100644
--- a/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication.ts
+++ b/packages/twenty-front/src/modules/settings/two-factor-authentication/hooks/useCurrentUserWorkspaceTwoFactorAuthentication.ts
@@ -1,7 +1,7 @@
import { currentUserWorkspaceState } from '@/auth/states/currentUserWorkspaceState';
import { useMemo } from 'react';
import {
- type TwoFactorAuthenticationMethodDto,
+ type TwoFactorAuthenticationMethodSummary,
useInitiateOtpProvisioningMutation,
} from '~/generated-metadata/graphql';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
@@ -12,7 +12,7 @@ export const useCurrentUserWorkspaceTwoFactorAuthentication = () => {
useInitiateOtpProvisioningMutation();
const currentUserWorkspaceTwoFactorAuthenticationMethods = useMemo(() => {
- const methods: Record<string, TwoFactorAuthenticationMethodDto> = {};
+ const methods: Record<string, TwoFactorAuthenticationMethodSummary> = {};
(currentUserWorkspace?.twoFactorAuthenticationMethodSummary ?? []).forEach(
(method) => (methods[method.strategy] = method),
diff --git a/packages/twenty-front/src/pages/auth/Authorize.tsx b/packages/twenty-front/src/pages/auth/Authorize.tsx
index e7936770106..4fef494c9f1 100644
--- a/packages/twenty-front/src/pages/auth/Authorize.tsx
+++ b/packages/twenty-front/src/pages/auth/Authorize.tsx
@@ -1,3 +1,4 @@
+import { FIND_APPLICATION_REGISTRATION_BY_CLIENT_ID } from '@/settings/application-registrations/graphql/queries/findApplicationRegistrationByClientId';
import styled from '@emotion/styled';
import { useEffect, useState } from 'react';
import { useSearchParams } from 'react-router-dom';
@@ -5,14 +6,15 @@ import { AppPath } from 'twenty-shared/types';
import { useRedirect } from '@/domain-manager/hooks/useRedirect';
import { Trans, useLingui } from '@lingui/react/macro';
+import { useQuery } from '@apollo/client';
+import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
+import { Avatar } from 'twenty-ui/display';
import { MainButton } from 'twenty-ui/input';
import { UndecoratedLink } from 'twenty-ui/navigation';
import { useAuthorizeAppMutation } from '~/generated-metadata/graphql';
import { useNavigateApp } from '~/hooks/useNavigateApp';
-type App = { id: string; name: string; logo: string };
-
const StyledContainer = styled.div`
display: flex;
align-items: center;
@@ -56,52 +58,85 @@ const StyledButtonContainer = styled.div`
gap: 10px;
width: 100%;
`;
+
+const StyledScopeList = styled.ul`
+ list-style: none;
+ padding: 0;
+ margin: 0 0 ${({ theme }) => theme.spacing(4)} 0;
+ width: 100%;
+`;
+
+const StyledScopeItem = styled.li`
+ color: ${({ theme }) => theme.font.color.secondary};
+ font-size: ${({ theme }) => theme.font.size.md};
+ padding: ${({ theme }) => theme.spacing(1)} 0;
+ border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
+
+ &:last-child {
+ border-bottom: none;
+ }
+`;
+
export const Authorize = () => {
const { t } = useLingui();
const navigate = useNavigateApp();
const [searchParam] = useSearchParams();
const { redirect } = useRedirect();
- //TODO: Replace with db call for registered third party apps
- const [apps] = useState<App[]>([
- {
- id: 'chrome',
- name: 'Chrome Extension',
- logo: 'images/integrations/chrome-icon.svg',
- },
- ]);
- const [app, setApp] = useState<App>();
+
+ const oauthScopeLabels: { [scope: string]: string | undefined } = {
+ api: t`Access workspace data`,
+ profile: t`Read your profile`,
+ };
+
const clientId = searchParam.get('clientId');
const codeChallenge = searchParam.get('codeChallenge');
const redirectUrl = searchParam.get('redirectUrl');
- useEffect(() => {
- const app = apps.find((app) => app.id === clientId);
- if (!isDefined(app)) navigate(AppPath.NotFound);
- else setApp(app);
- //eslint-disable-next-line react-hooks/exhaustive-deps
- }, []);
+ const { data, loading } = useQuery(
+ FIND_APPLICATION_REGISTRATION_BY_CLIENT_ID,
+ {
+ variables: { clientId: clientId ?? '' },
+ skip: !isDefined(clientId),
+ },
+ );
+ const applicationRegistration = data?.findApplicationRegistrationByClientId;
const [authorizeApp] = useAuthorizeAppMutation();
+ const [hasLogoError, setHasLogoError] = useState(false);
+
+ const shouldRedirectToNotFound =
+ !isDefined(clientId) || (!loading && !isDefined(applicationRegistration));
+
+ useEffect(() => {
+ if (shouldRedirectToNotFound) {
+ navigate(AppPath.NotFound);
+ }
+ }, [shouldRedirectToNotFound, navigate]);
+
const handleAuthorize = async () => {
- if (
- isDefined(clientId) &&
- isDefined(codeChallenge) &&
- isDefined(redirectUrl)
- ) {
+ if (isDefined(clientId) && isDefined(redirectUrl)) {
await authorizeApp({
variables: {
clientId,
- codeChallenge,
+ codeChallenge: codeChallenge ?? undefined,
redirectUrl,
},
- onCompleted: (data) => {
- redirect(data.authorizeApp.redirectUrl);
+ onCompleted: (responseData) => {
+ redirect(responseData.authorizeApp.redirectUrl);
},
});
}
};
- const appName = app?.name;
+ if (loading || !applicationRegistration) {
+ return null;
+ }
+
+ const appName = applicationRegistration.name;
+ const appLogoUrl = applicationRegistration.logoUrl;
+ const requestedScopes: string[] = applicationRegistration.oAuthScopes ?? [];
+
+ const showLogoImage = isNonEmptyString(appLogoUrl) && !hasLogoError;
return (
<StyledContainer>
@@ -119,11 +154,36 @@ export const Authorize = () => {
height={60}
width={60}
/>
- <img src={app?.logo} alt="app-icon" height={40} width={40} />
+ {showLogoImage ? (
+ <img
+ src={appLogoUrl}
+ alt={appName}
+ height={40}
+ width={40}
+ style={{ borderRadius: '2px' }}
+ onError={() => setHasLogoError(true)}
+ />
+ ) : (
+ <Avatar
+ size="xl"
+ placeholder={appName}
+ placeholderColorSeed={appName}
+ type="squared"
+ />
+ )}
</StyledAppsContainer>
<StyledText>
<Trans>{appName} wants to access your account</Trans>
</StyledText>
+ {requestedScopes.length > 0 && (
+ <StyledScopeList>
+ {requestedScopes.map((scope) => (
+ <StyledScopeItem key={scope}>
+ {oauthScopeLabels[scope] ?? scope}
+ </StyledScopeItem>
+ ))}
+ </StyledScopeList>
+ )}
<StyledButtonContainer>
<UndecoratedLink to={AppPath.Index}>
<MainButton title={t`Cancel`} variant="secondary" fullWidth />
diff --git a/packages/twenty-front/src/pages/auth/SignInUp.tsx b/packages/twenty-front/src/pages/auth/SignInUp.tsx
index 7f3561bc1e0..e572ad71fb6 100644
--- a/packages/twenty-front/src/pages/auth/SignInUp.tsx
+++ b/packages/twenty-front/src/pages/auth/SignInUp.tsx
@@ -35,7 +35,7 @@ import { useSearchParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
import { Loader } from 'twenty-ui/feedback';
import { AnimatedEaseIn } from 'twenty-ui/utilities';
-import { type PublicWorkspaceDataOutput } from '~/generated-metadata/graphql';
+import { type PublicWorkspaceData } from '~/generated-metadata/graphql';
const StyledLoaderContainer = styled.div`
align-items: center;
@@ -53,7 +53,7 @@ const StandardContent = ({
title,
onClickOnLogo,
}: {
- workspacePublicData: PublicWorkspaceDataOutput | null;
+ workspacePublicData: PublicWorkspaceData | null;
signInUpForm: JSX.Element | null;
signInUpStep: SignInUpStep;
title: string;
diff --git a/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx b/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx
index ad217808eb1..a7732dfdec0 100644
--- a/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx
+++ b/packages/twenty-front/src/pages/auth/__stories__/PasswordReset.stories.tsx
@@ -27,7 +27,7 @@ const buildHandlers = (hasPassword: boolean) => [
HttpResponse.json({
data: {
validatePasswordResetToken: {
- __typename: 'ValidatePasswordResetTokenOutput',
+ __typename: 'ValidatePasswordResetToken',
id: mockedOnboardingUsersData.id,
email: mockedOnboardingUsersData.email,
hasPassword,
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationRegistrationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationRegistrationDetails.tsx
new file mode 100644
index 00000000000..11fa16e1052
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationRegistrationDetails.tsx
@@ -0,0 +1,626 @@
+import { SettingsAdminTableCard } from '@/settings/admin-panel/components/SettingsAdminTableCard';
+import { DELETE_APPLICATION_REGISTRATION } from '@/settings/application-registrations/graphql/mutations/deleteApplicationRegistration';
+import { ROTATE_APPLICATION_REGISTRATION_CLIENT_SECRET } from '@/settings/application-registrations/graphql/mutations/rotateApplicationRegistrationClientSecret';
+import { UPDATE_APPLICATION_REGISTRATION } from '@/settings/application-registrations/graphql/mutations/updateApplicationRegistration';
+import { UPDATE_APPLICATION_REGISTRATION_VARIABLE } from '@/settings/application-registrations/graphql/mutations/updateApplicationRegistrationVariable';
+import { FIND_APPLICATION_REGISTRATION_STATS } from '@/settings/application-registrations/graphql/queries/findApplicationRegistrationStats';
+import { FIND_APPLICATION_REGISTRATION_VARIABLES } from '@/settings/application-registrations/graphql/queries/findApplicationRegistrationVariables';
+import { FIND_MANY_APPLICATION_REGISTRATIONS } from '@/settings/application-registrations/graphql/queries/findManyApplicationRegistrations';
+import { FIND_ONE_APPLICATION_REGISTRATION } from '@/settings/application-registrations/graphql/queries/findOneApplicationRegistration';
+import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { ApiKeyInput } from '@/settings/developers/components/ApiKeyInput';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
+import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
+import { useModal } from '@/ui/layout/modal/hooks/useModal';
+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
+import { useAtomFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomFamilyStateValue';
+import { useMutation, useQuery } from '@apollo/client';
+import styled from '@emotion/styled';
+import { Trans, useLingui } from '@lingui/react/macro';
+import { isNonEmptyString } from '@sniptt/guards';
+import { useState } from 'react';
+import { useParams } from 'react-router-dom';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath, isDefined, isValidUrl } from 'twenty-shared/utils';
+import {
+ H2Title,
+ IconChartBar,
+ IconCheck,
+ IconDownload,
+ IconKey,
+ IconRefresh,
+ IconShield,
+ IconTag,
+ IconTextCaption,
+ IconTrash,
+ IconWorld,
+ Status,
+} from 'twenty-ui/display';
+import { Button } from 'twenty-ui/input';
+import { Section } from 'twenty-ui/layout';
+import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+import { applicationRegistrationClientSecretFamilyState } from '~/pages/settings/applications/states/applicationRegistrationClientSecretFamilyState';
+
+const DELETE_REGISTRATION_MODAL_ID = 'delete-application-registration-modal';
+const ROTATE_SECRET_MODAL_ID = 'rotate-application-registration-secret-modal';
+
+const StyledInputContainer = styled.div`
+ align-items: center;
+ display: flex;
+ flex-direction: row;
+ gap: ${({ theme }) => theme.spacing(2)};
+ width: 100%;
+`;
+
+const StyledRedirectUriRow = styled.div`
+ align-items: center;
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+ padding: ${({ theme }) => theme.spacing(1)} 0;
+`;
+
+const StyledRedirectUriValue = styled.span`
+ color: ${({ theme }) => theme.font.color.primary};
+ font-family: monospace;
+ word-break: break-all;
+`;
+
+const StyledVariableRow = styled.div`
+ align-items: center;
+ border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+ padding: ${({ theme }) => theme.spacing(2)} 0;
+`;
+
+const StyledVariableInfo = styled.div`
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ gap: ${({ theme }) => theme.spacing(0.5)};
+`;
+
+const StyledVariableKey = styled.span`
+ color: ${({ theme }) => theme.font.color.primary};
+ font-family: monospace;
+ font-weight: ${({ theme }) => theme.font.weight.medium};
+`;
+
+const StyledVariableDescription = styled.span`
+ color: ${({ theme }) => theme.font.color.tertiary};
+ font-size: ${({ theme }) => theme.font.size.sm};
+`;
+
+const StyledRotateContainer = styled.div`
+ padding-top: ${({ theme }) => theme.spacing(2)};
+`;
+
+type ServerVariable = {
+ id: string;
+ key: string;
+ description: string;
+ isSecret: boolean;
+ isRequired: boolean;
+ isFilled: boolean;
+};
+
+export const SettingsApplicationRegistrationDetails = () => {
+ const { t } = useLingui();
+ const navigate = useNavigateSettings();
+ const { copyToClipboard } = useCopyToClipboard();
+ const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
+ const { openModal } = useModal();
+ const { applicationRegistrationId = '' } = useParams<{
+ applicationRegistrationId: string;
+ }>();
+
+ const applicationRegistrationClientSecret = useAtomFamilyStateValue(
+ applicationRegistrationClientSecretFamilyState,
+ applicationRegistrationId,
+ );
+
+ const [isLoading, setIsLoading] = useState(false);
+ const [formRedirectUris, setFormRedirectUris] = useState<string[]>([]);
+ const [newRedirectUri, setNewRedirectUri] = useState('');
+ const [hasChanges, setHasChanges] = useState(false);
+ const [rotatedSecret, setRotatedSecret] = useState<string | null>(null);
+
+ const [variableValues, setVariableValues] = useState<Record<string, string>>(
+ {},
+ );
+
+ const { data, loading } = useQuery(FIND_ONE_APPLICATION_REGISTRATION, {
+ variables: { id: applicationRegistrationId },
+ skip: !applicationRegistrationId,
+ onCompleted: (result) => {
+ const foundRegistration = result?.findOneApplicationRegistration;
+
+ if (isDefined(foundRegistration)) {
+ setFormRedirectUris(foundRegistration.oAuthRedirectUris ?? []);
+ }
+ },
+ });
+
+ const { data: variablesData } = useQuery(
+ FIND_APPLICATION_REGISTRATION_VARIABLES,
+ {
+ variables: { applicationRegistrationId },
+ skip: !applicationRegistrationId,
+ },
+ );
+
+ const { data: statsData } = useQuery(FIND_APPLICATION_REGISTRATION_STATS, {
+ variables: { id: applicationRegistrationId },
+ skip: !applicationRegistrationId,
+ });
+
+ const [updateRegistration] = useMutation(UPDATE_APPLICATION_REGISTRATION, {
+ refetchQueries: [
+ FIND_ONE_APPLICATION_REGISTRATION,
+ FIND_MANY_APPLICATION_REGISTRATIONS,
+ ],
+ });
+ const [deleteRegistration] = useMutation(DELETE_APPLICATION_REGISTRATION, {
+ refetchQueries: [FIND_MANY_APPLICATION_REGISTRATIONS],
+ });
+ const [rotateSecret] = useMutation(
+ ROTATE_APPLICATION_REGISTRATION_CLIENT_SECRET,
+ );
+ const [updateVariable] = useMutation(
+ UPDATE_APPLICATION_REGISTRATION_VARIABLE,
+ {
+ refetchQueries: [FIND_APPLICATION_REGISTRATION_VARIABLES],
+ },
+ );
+
+ const registration = data?.findOneApplicationRegistration;
+ const variables: ServerVariable[] =
+ variablesData?.findApplicationRegistrationVariables ?? [];
+
+ if (loading || !registration) {
+ return null;
+ }
+
+ const markDirty = () => setHasChanges(true);
+
+ const handleSave = async () => {
+ setIsLoading(true);
+ try {
+ await updateRegistration({
+ variables: {
+ input: {
+ id: applicationRegistrationId,
+ update: {
+ oAuthRedirectUris: formRedirectUris,
+ },
+ },
+ },
+ });
+ setHasChanges(false);
+ enqueueSuccessSnackBar({ message: t`App updated` });
+ } catch {
+ enqueueErrorSnackBar({ message: t`Error updating app` });
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const handleCancel = () => {
+ setFormRedirectUris(registration.oAuthRedirectUris ?? []);
+ setHasChanges(false);
+ };
+
+ const handleDelete = async () => {
+ setIsLoading(true);
+ try {
+ await deleteRegistration({
+ variables: { id: applicationRegistrationId },
+ });
+ navigate(SettingsPath.Applications);
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Error deleting app`,
+ });
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const handleRotateSecret = async () => {
+ setIsLoading(true);
+ try {
+ const result = await rotateSecret({
+ variables: { id: applicationRegistrationId },
+ });
+ const secret =
+ result.data?.rotateApplicationRegistrationClientSecret?.clientSecret;
+
+ if (isNonEmptyString(secret)) {
+ setRotatedSecret(secret);
+ enqueueSuccessSnackBar({
+ message: t`Client secret rotated. Copy it now — it won't be shown again.`,
+ });
+ }
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Error rotating client secret`,
+ });
+ } finally {
+ setIsLoading(false);
+ }
+ };
+
+ const handleAddRedirectUri = () => {
+ const trimmed = newRedirectUri.trim();
+
+ if (!trimmed) {
+ return;
+ }
+
+ if (!isValidUrl(trimmed)) {
+ enqueueErrorSnackBar({ message: t`Please enter a valid URL` });
+
+ return;
+ }
+
+ if (formRedirectUris.includes(trimmed)) {
+ enqueueErrorSnackBar({ message: t`This redirect URI is already added` });
+
+ return;
+ }
+
+ setFormRedirectUris([...formRedirectUris, trimmed]);
+ setNewRedirectUri('');
+ markDirty();
+ };
+
+ const handleRemoveRedirectUri = (index: number) => {
+ setFormRedirectUris(
+ formRedirectUris.filter((_, uriIndex) => uriIndex !== index),
+ );
+ markDirty();
+ };
+
+ const handleSaveVariableValue = async (variable: ServerVariable) => {
+ const value = variableValues[variable.id];
+ const variableKey = variable.key;
+
+ if (!isNonEmptyString(value)) {
+ return;
+ }
+
+ try {
+ await updateVariable({
+ variables: {
+ input: {
+ id: variable.id,
+ update: {
+ value,
+ },
+ },
+ },
+ });
+ setVariableValues((previous) => {
+ const next = { ...previous };
+
+ delete next[variable.id];
+
+ return next;
+ });
+ enqueueSuccessSnackBar({
+ message: t`Variable ${variableKey} updated`,
+ });
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Error updating variable`,
+ });
+ }
+ };
+
+ const displayedSecret = applicationRegistrationClientSecret ?? rotatedSecret;
+ const confirmationValue = t`yes`;
+
+ const credentialItems = [
+ {
+ Icon: IconKey,
+ label: t`Client ID`,
+ value: registration.oAuthClientId,
+ onClick: () =>
+ copyToClipboard(registration.oAuthClientId, t`Client ID copied`),
+ },
+ {
+ Icon: IconShield,
+ label: t`Scopes`,
+ value: (registration.oAuthScopes ?? []).join(', ') || '—',
+ },
+ ];
+
+ const generalItems = [
+ {
+ Icon: IconTag,
+ label: t`Name`,
+ value: registration.name,
+ },
+ ...(isNonEmptyString(registration.description)
+ ? [
+ {
+ Icon: IconTextCaption,
+ label: t`Description`,
+ value: registration.description,
+ },
+ ]
+ : []),
+ {
+ Icon: IconWorld,
+ label: t`Universal ID`,
+ value: registration.universalIdentifier,
+ onClick: () =>
+ copyToClipboard(
+ registration.universalIdentifier,
+ t`Universal identifier copied`,
+ ),
+ },
+ ];
+
+ const stats = statsData?.findApplicationRegistrationStats;
+ const hasActiveInstalls = (stats?.activeInstalls ?? 0) > 0;
+
+ const versionDistributionLabel =
+ stats?.versionDistribution
+ ?.map(
+ (entry: { version: string; count: number }) =>
+ `${entry.version} (${entry.count})`,
+ )
+ .join(', ') || '—';
+
+ const statsItems = [
+ {
+ Icon: IconDownload,
+ label: t`Active installs`,
+ value: stats?.activeInstalls ?? '—',
+ },
+ {
+ Icon: IconTag,
+ label: t`Most installed version`,
+ value: stats?.mostInstalledVersion ?? '—',
+ },
+ {
+ Icon: IconChartBar,
+ label: t`Distribution`,
+ value: versionDistributionLabel,
+ },
+ ];
+
+ return (
+ <>
+ <SubMenuTopBarContainer
+ title={registration.name}
+ links={[
+ {
+ children: t`Workspace`,
+ href: getSettingsPath(SettingsPath.Workspace),
+ },
+ {
+ children: t`Applications`,
+ href: getSettingsPath(SettingsPath.Applications),
+ },
+ { children: registration.name },
+ ]}
+ actionButton={
+ hasChanges ? (
+ <SaveAndCancelButtons
+ isSaveDisabled={isLoading}
+ onCancel={handleCancel}
+ onSave={handleSave}
+ />
+ ) : undefined
+ }
+ >
+ <SettingsPageContainer>
+ {stats && stats.activeInstalls > 0 && (
+ <Section>
+ <H2Title
+ title={t`Install Stats`}
+ description={t`Usage across all workspaces on this server`}
+ />
+ <SettingsAdminTableCard
+ rounded
+ items={statsItems}
+ gridAutoColumns="3fr 8fr"
+ />
+ </Section>
+ )}
+
+ <Section>
+ <H2Title
+ title={t`General`}
+ description={t`Name and description are managed via your app manifest (CLI)`}
+ />
+ <SettingsAdminTableCard
+ rounded
+ items={generalItems}
+ gridAutoColumns="3fr 8fr"
+ />
+ </Section>
+
+ <Section>
+ <H2Title
+ title={t`OAuth Credentials`}
+ description={t`Credentials and scopes for OAuth authorization flows`}
+ />
+ <SettingsAdminTableCard
+ rounded
+ items={credentialItems}
+ gridAutoColumns="3fr 8fr"
+ />
+ <StyledRotateContainer>
+ <Button
+ Icon={IconRefresh}
+ title={t`Rotate client secret`}
+ variant="secondary"
+ onClick={() => openModal(ROTATE_SECRET_MODAL_ID)}
+ />
+ </StyledRotateContainer>
+ </Section>
+
+ {displayedSecret && (
+ <Section>
+ <H2Title
+ title={t`Client Secret`}
+ description={t`Copy this secret as it will not be visible again`}
+ />
+ <ApiKeyInput apiKey={displayedSecret} />
+ </Section>
+ )}
+
+ <Section>
+ <H2Title
+ title={t`Redirect URIs`}
+ description={t`Allowed redirect URIs for OAuth flows`}
+ />
+ {formRedirectUris.map((uri, index) => (
+ <StyledRedirectUriRow key={`${uri}-${index}`}>
+ <StyledRedirectUriValue>{uri}</StyledRedirectUriValue>
+ <Button
+ Icon={IconTrash}
+ variant="tertiary"
+ size="medium"
+ onClick={() => handleRemoveRedirectUri(index)}
+ />
+ </StyledRedirectUriRow>
+ ))}
+ <StyledInputContainer>
+ <SettingsTextInput
+ instanceId="application-registration-new-redirect-uri"
+ value={newRedirectUri}
+ onChange={setNewRedirectUri}
+ placeholder={t`https://example.com/callback`}
+ fullWidth
+ />
+ <Button
+ title={t`Add`}
+ variant="secondary"
+ size="medium"
+ onClick={handleAddRedirectUri}
+ />
+ </StyledInputContainer>
+ </Section>
+
+ {variables.length > 0 && (
+ <Section>
+ <H2Title
+ title={t`Server Variables`}
+ description={t`Variables declared by the app manifest. Fill in values here — they apply to all workspace installations.`}
+ />
+ {variables.map((variable) => (
+ <StyledVariableRow key={variable.id}>
+ <StyledVariableInfo>
+ <StyledVariableKey>
+ {variable.key}
+ {variable.isRequired && (
+ <span style={{ color: 'red' }}> *</span>
+ )}
+ </StyledVariableKey>
+ {isNonEmptyString(variable.description) && (
+ <StyledVariableDescription>
+ {variable.description}
+ </StyledVariableDescription>
+ )}
+ </StyledVariableInfo>
+ {variable.isFilled &&
+ !isNonEmptyString(variableValues[variable.id]) && (
+ <Status color="green" text={t`Configured`} />
+ )}
+ {!variable.isFilled &&
+ !isNonEmptyString(variableValues[variable.id]) && (
+ <Status
+ color={variable.isRequired ? 'red' : 'gray'}
+ text={variable.isRequired ? t`Required` : t`Not set`}
+ />
+ )}
+ <SettingsTextInput
+ instanceId={`var-${variable.id}`}
+ value={variableValues[variable.id] ?? ''}
+ onChange={(value) =>
+ setVariableValues((previous) => ({
+ ...previous,
+ [variable.id]: value,
+ }))
+ }
+ placeholder={
+ variable.isSecret ? t`Enter secret value` : t`Enter value`
+ }
+ fullWidth
+ />
+ <Button
+ Icon={IconCheck}
+ variant="secondary"
+ size="small"
+ disabled={!isNonEmptyString(variableValues[variable.id])}
+ onClick={() => handleSaveVariableValue(variable)}
+ />
+ </StyledVariableRow>
+ ))}
+ </Section>
+ )}
+
+ <Section>
+ <H2Title
+ title={t`Danger zone`}
+ description={
+ hasActiveInstalls
+ ? t`Uninstall this app from all workspaces before deleting it`
+ : t`Delete this app`
+ }
+ />
+ <Button
+ accent="danger"
+ variant="secondary"
+ title={t`Delete`}
+ Icon={IconTrash}
+ disabled={hasActiveInstalls}
+ onClick={() => openModal(DELETE_REGISTRATION_MODAL_ID)}
+ />
+ </Section>
+ </SettingsPageContainer>
+ </SubMenuTopBarContainer>
+
+ <ConfirmationModal
+ confirmationPlaceholder={confirmationValue}
+ confirmationValue={confirmationValue}
+ modalId={ROTATE_SECRET_MODAL_ID}
+ title={t`Rotate client secret`}
+ subtitle={
+ <Trans>
+ If you rotate this secret, any integration using the current secret
+ will stop working. Please type {`"${confirmationValue}"`} to
+ confirm.
+ </Trans>
+ }
+ onConfirmClick={handleRotateSecret}
+ confirmButtonText={t`Rotate secret`}
+ loading={isLoading}
+ />
+
+ <ConfirmationModal
+ confirmationPlaceholder={confirmationValue}
+ confirmationValue={confirmationValue}
+ modalId={DELETE_REGISTRATION_MODAL_ID}
+ title={t`Delete app`}
+ subtitle={
+ <Trans>
+ Please type {`"${confirmationValue}"`} to confirm you want to delete
+ this app. All workspace installations linked to it will lose their
+ OAuth credentials.
+ </Trans>
+ }
+ onConfirmClick={handleDelete}
+ confirmButtonText={t`Delete`}
+ loading={isLoading}
+ />
+ </>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
index 712db07dda8..e1afaaa1651 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
@@ -1,3 +1,4 @@
+import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
import { TabList } from '@/ui/layout/tab-list/components/TabList';
@@ -10,11 +11,12 @@ import { getSettingsPath } from 'twenty-shared/utils';
import { IconApps, IconCode, IconDownload } from 'twenty-ui/display';
import {
type FeatureFlagKey,
+ PermissionFlagType,
useFindManyApplicationsQuery,
} from '~/generated-metadata/graphql';
import { SettingsApplicationsTable } from '~/pages/settings/applications/components/SettingsApplicationsTable';
import { SettingsApplicationsAvailableTab } from '~/pages/settings/applications/tabs/SettingsApplicationsAvailableTab';
-import { SettingsApplicationsCreateTab } from '~/pages/settings/applications/tabs/SettingsApplicationsCreateTab';
+import { SettingsApplicationsDeveloperTab } from '~/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab';
import { SettingsApplicationsInstalledTab } from '~/pages/settings/applications/tabs/SettingsApplicationsInstalledTab';
const APPLICATIONS_TAB_LIST_ID = 'applications-tab-list';
@@ -22,6 +24,10 @@ const APPLICATIONS_TAB_LIST_ID = 'applications-tab-list';
export const SettingsApplications = () => {
const { t } = useLingui();
+ const hasDeveloperAccess = useHasPermissionFlag(
+ PermissionFlagType.API_KEYS_AND_WEBHOOKS,
+ );
+
const isMarketplaceEnabled = useIsFeatureEnabled(
'IS_MARKETPLACE_ENABLED' as FeatureFlagKey,
);
@@ -51,26 +57,28 @@ export const SettingsApplications = () => {
{applications.length > 0 && (
<SettingsApplicationsTable applications={applications} />
)}
- <SettingsApplicationsCreateTab />
+ {hasDeveloperAccess && <SettingsApplicationsDeveloperTab />}
</SettingsPageContainer>
</SubMenuTopBarContainer>
);
}
const tabs = [
- { id: 'available', title: t`Available`, Icon: IconDownload },
+ { id: 'marketplace', title: t`Marketplace`, Icon: IconDownload },
{ id: 'installed', title: t`Installed`, Icon: IconApps },
- { id: 'create', title: t`Create an app`, Icon: IconCode },
+ ...(hasDeveloperAccess
+ ? [{ id: 'developer', title: t`Developer`, Icon: IconCode }]
+ : []),
];
const renderActiveTabContent = () => {
switch (activeTabId) {
- case 'available':
+ case 'marketplace':
return <SettingsApplicationsAvailableTab />;
case 'installed':
return <SettingsApplicationsInstalledTab />;
- case 'create':
- return <SettingsApplicationsCreateTab />;
+ case 'developer':
+ return <SettingsApplicationsDeveloperTab />;
default:
return <SettingsApplicationsAvailableTab />;
}
diff --git a/packages/twenty-front/src/pages/settings/applications/states/applicationRegistrationClientSecretFamilyState.ts b/packages/twenty-front/src/pages/settings/applications/states/applicationRegistrationClientSecretFamilyState.ts
new file mode 100644
index 00000000000..239879d1af1
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/applications/states/applicationRegistrationClientSecretFamilyState.ts
@@ -0,0 +1,7 @@
+import { createAtomFamilyState } from '@/ui/utilities/state/jotai/utils/createAtomFamilyState';
+
+export const applicationRegistrationClientSecretFamilyState =
+ createAtomFamilyState<string | null, string>({
+ key: 'applicationRegistrationClientSecretState',
+ defaultValue: null,
+ });
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsCreateTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsCreateTab.tsx
deleted file mode 100644
index 11120f29202..00000000000
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsCreateTab.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
-import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';
-import styled from '@emotion/styled';
-import { useLingui } from '@lingui/react/macro';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import {
- CommandBlock,
- H2Title,
- IconCopy,
- IconFileInfo,
-} from 'twenty-ui/display';
-import { Button } from 'twenty-ui/input';
-import { Section } from 'twenty-ui/layout';
-import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
-
-const StyledButtonContainer = styled.div`
- margin: ${({ theme }) => theme.spacing(2)} 0;
-`;
-
-export const SettingsApplicationsCreateTab = () => {
- const { t } = useLingui();
-
- const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
-
- const { copyToClipboard } = useCopyToClipboard();
-
- const commands = [
- // eslint-disable-next-line lingui/no-unlocalized-strings
- 'npx create-twenty-app@latest my-twenty-app',
- // eslint-disable-next-line lingui/no-unlocalized-strings
- 'cd my-twenty-app',
- ];
-
- const button = (
- <Button
- onClick={() => {
- copyToClipboard(commands.join('\n'), t`Commands copied to clipboard`);
- }}
- ariaLabel={t`Copy commands`}
- Icon={IconCopy}
- />
- );
-
- return (
- <Section>
- <H2Title
- title={t`Create an application`}
- description={t`You can either create a private app or share it to others`}
- />
- <CommandBlock commands={commands} button={button} />
- <StyledButtonContainer>
- <Button
- Icon={IconFileInfo}
- title={t`Read documentation`}
- onClick={() =>
- window.open(
- getDocumentationUrl({
- locale: currentWorkspaceMember?.locale,
- path: '/developers/extend/capabilities/apps',
- }),
- '_blank',
- )
- }
- />
- </StyledButtonContainer>
- </Section>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx
new file mode 100644
index 00000000000..4d031443fc0
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx
@@ -0,0 +1,118 @@
+import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { FIND_MANY_APPLICATION_REGISTRATIONS } from '@/settings/application-registrations/graphql/queries/findManyApplicationRegistrations';
+import { SettingsListCard } from '@/settings/components/SettingsListCard';
+import { getDocumentationUrl } from '@/support/utils/getDocumentationUrl';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import styled from '@emotion/styled';
+import { useTheme } from '@emotion/react';
+import { useLingui } from '@lingui/react/macro';
+import { useQuery } from '@apollo/client';
+import { useNavigate } from 'react-router-dom';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+import {
+ CommandBlock,
+ H2Title,
+ IconApps,
+ IconChevronRight,
+ IconCopy,
+ IconFileInfo,
+} from 'twenty-ui/display';
+import { Button } from 'twenty-ui/input';
+import { Section } from 'twenty-ui/layout';
+import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+
+const StyledButtonContainer = styled.div`
+ margin: ${({ theme }) => theme.spacing(2)} 0;
+`;
+
+type ApplicationRegistration = {
+ id: string;
+ name: string;
+ description: string | null;
+};
+
+export const SettingsApplicationsDeveloperTab = () => {
+ const { t } = useLingui();
+ const navigate = useNavigate();
+ const theme = useTheme();
+ const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
+
+ const { copyToClipboard } = useCopyToClipboard();
+
+ const { data, loading } = useQuery(FIND_MANY_APPLICATION_REGISTRATIONS);
+
+ const registrations: ApplicationRegistration[] =
+ data?.findManyApplicationRegistrations ?? [];
+
+ const commands = [
+ // eslint-disable-next-line lingui/no-unlocalized-strings
+ 'npx create-twenty-app@latest my-twenty-app',
+ // eslint-disable-next-line lingui/no-unlocalized-strings
+ 'cd my-twenty-app',
+ ];
+
+ const copyButton = (
+ <Button
+ onClick={() => {
+ copyToClipboard(commands.join('\n'), t`Commands copied to clipboard`);
+ }}
+ ariaLabel={t`Copy commands`}
+ Icon={IconCopy}
+ />
+ );
+
+ return (
+ <>
+ <Section>
+ <H2Title
+ title={t`Create an application`}
+ description={t`You can either create a private app or share it to others`}
+ />
+ <CommandBlock commands={commands} button={copyButton} />
+ <StyledButtonContainer>
+ <Button
+ Icon={IconFileInfo}
+ title={t`Read documentation`}
+ onClick={() =>
+ window.open(
+ getDocumentationUrl({
+ locale: currentWorkspaceMember?.locale,
+ path: '/developers/extend/capabilities/apps',
+ }),
+ '_blank',
+ )
+ }
+ />
+ </StyledButtonContainer>
+ </Section>
+ {registrations.length > 0 && (
+ <Section>
+ <H2Title
+ title={t`My Apps`}
+ description={t`Apps you've created and published`}
+ />
+ <SettingsListCard
+ items={registrations}
+ getItemLabel={(registration) => registration.name}
+ isLoading={loading}
+ RowIcon={IconApps}
+ onRowClick={(registration) => {
+ navigate(
+ getSettingsPath(SettingsPath.ApplicationRegistrationDetail, {
+ applicationRegistrationId: registration.id,
+ }),
+ );
+ }}
+ RowRightComponent={() => (
+ <IconChevronRight
+ size={theme.icon.size.md}
+ stroke={theme.icon.stroke.sm}
+ />
+ )}
+ />
+ </Section>
+ )}
+ </>
+ );
+};
diff --git a/packages/twenty-front/src/testing/mock-data/billing-plans.ts b/packages/twenty-front/src/testing/mock-data/billing-plans.ts
index 40c53b251ba..5dd6fa258f2 100644
--- a/packages/twenty-front/src/testing/mock-data/billing-plans.ts
+++ b/packages/twenty-front/src/testing/mock-data/billing-plans.ts
@@ -3,7 +3,7 @@ import type { ListPlansQueryResult } from '~/generated-metadata/graphql';
export const mockBillingPlans = {
listPlans: [
{
- __typename: 'BillingPlanOutput',
+ __typename: 'BillingPlan',
planKey: 'PRO',
licensedProducts: [
{
@@ -293,7 +293,7 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPlanOutput',
+ __typename: 'BillingPlan',
planKey: 'ENTERPRISE',
licensedProducts: [
{
diff --git a/packages/twenty-front/src/testing/mock-data/publicWorkspaceDataBySubdomain.ts b/packages/twenty-front/src/testing/mock-data/publicWorkspaceDataBySubdomain.ts
index 55ed71f43e1..2c385cd2e21 100644
--- a/packages/twenty-front/src/testing/mock-data/publicWorkspaceDataBySubdomain.ts
+++ b/packages/twenty-front/src/testing/mock-data/publicWorkspaceDataBySubdomain.ts
@@ -2,7 +2,7 @@ import { type GetPublicWorkspaceDataByDomainQuery } from '~/generated-metadata/g
export const mockedPublicWorkspaceDataBySubdomain: GetPublicWorkspaceDataByDomainQuery['getPublicWorkspaceDataByDomain'] =
{
- __typename: 'PublicWorkspaceDataOutput',
+ __typename: 'PublicWorkspaceData',
id: '9870323e-22c3-4d14-9b7f-5bdc84f7d6ee',
logo: 'workspace-logo/original/c88deb49-7636-4560-918d-08c3265ffb20.49?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6Ijk4NzAzMjNlLTIyYzMtNGQxNC05YjdmLTViZGM4NGY3ZDZlZSIsImlhdCI6MTczNjU0MDU0MywiZXhwIjoxNzM2NjI2OTQzfQ.C8cnHu09VGseRbQAMM4nhiO6z4TLG03ntFTvxm53-xg',
displayName: 'Twenty Eng',
diff --git a/packages/twenty-front/src/testing/mock-data/users.ts b/packages/twenty-front/src/testing/mock-data/users.ts
index 5419e1eac1f..521c8350366 100644
--- a/packages/twenty-front/src/testing/mock-data/users.ts
+++ b/packages/twenty-front/src/testing/mock-data/users.ts
@@ -103,7 +103,7 @@ export const mockCurrentWorkspace = {
phases: [],
billingSubscriptionItems: [
{
- __typename: 'BillingSubscriptionItemDTO',
+ __typename: 'BillingSubscriptionItem',
id: '11111111-1111-4111-8111-111111111111',
hasReachedCurrentPeriodCap: false,
quantity: 1,
@@ -116,7 +116,7 @@ export const mockCurrentWorkspace = {
},
},
{
- __typename: 'BillingSubscriptionItemDTO',
+ __typename: 'BillingSubscriptionItem',
id: '11111111-1111-4111-8111-111111111112',
hasReachedCurrentPeriodCap: false,
quantity: null,
@@ -140,7 +140,7 @@ export const mockCurrentWorkspace = {
phases: [],
billingSubscriptionItems: [
{
- __typename: 'BillingSubscriptionItemDTO',
+ __typename: 'BillingSubscriptionItem',
id: '22222222-2222-4222-8222-222222222222',
hasReachedCurrentPeriodCap: false,
quantity: 1,
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/app-dev.integration.spec.ts b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/app-dev.integration.spec.ts
index b5df46e53e5..58e986655fd 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/app-dev.integration.spec.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/app-dev.integration.spec.ts
@@ -10,7 +10,17 @@ describe('rich-app app:dev', () => {
beforeAll(async () => {
const result = await runAppDevInProcess({ appPath: APP_PATH });
- expect(result.success).toBe(true);
+ if (!result.success) {
+ const diagnostics = JSON.stringify(
+ { events: result.events, stepStatuses: result.stepStatuses },
+ null,
+ 2,
+ );
+
+ throw new Error(
+ `app:dev did not produce manifest.json within timeout.\n${diagnostics}`,
+ );
+ }
}, 60000);
defineManifestTests(APP_PATH);
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
index db7d46bd8f4..4aa293b6b39 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/__integration__/app-dev/expected-manifest.ts
@@ -28,6 +28,18 @@ export const EXPECTED_MANIFEST: Manifest = {
value: 'Alex Karp',
},
},
+ serverVariables: {
+ POSTCARD_API_KEY: {
+ description: 'API key for the postcard printing service',
+ isSecret: true,
+ isRequired: true,
+ },
+ POSTCARD_SENDER_NAME: {
+ description: 'Default sender name on postcards',
+ isSecret: false,
+ isRequired: false,
+ },
+ },
description: 'A simple rich app',
displayName: 'Rich App',
defaultRoleUniversalIdentifier: 'b648f87b-1d26-4961-b974-0908fd991061',
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/application.config.ts b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/application.config.ts
index faf14ac37b5..4fba0dfdef2 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/application.config.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/rich-app/application.config.ts
@@ -14,5 +14,17 @@ export default defineApplication({
isSecret: false,
},
},
+ serverVariables: {
+ POSTCARD_API_KEY: {
+ description: 'API key for the postcard printing service',
+ isSecret: true,
+ isRequired: true,
+ },
+ POSTCARD_SENDER_NAME: {
+ description: 'Default sender name on postcards',
+ isSecret: false,
+ isRequired: false,
+ },
+ },
defaultRoleUniversalIdentifier: DEFAULT_ROLE_UNIVERSAL_IDENTIFIER,
});
diff --git a/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts b/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts
index 2a9935f1a36..310e029b347 100644
--- a/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/apps/root-app/__integration__/app-dev/app-dev.integration.spec.ts
@@ -11,7 +11,17 @@ describe('root-app app:dev', () => {
beforeAll(async () => {
const result = await runAppDevInProcess({ appPath: APP_PATH });
- expect(result.success).toBe(true);
+ if (!result.success) {
+ const diagnostics = JSON.stringify(
+ { events: result.events, stepStatuses: result.stepStatuses },
+ null,
+ 2,
+ );
+
+ throw new Error(
+ `app:dev did not produce manifest.json within timeout.\n${diagnostics}`,
+ );
+ }
}, 60000);
defineManifestTests(APP_PATH);
diff --git a/packages/twenty-sdk/src/cli/__tests__/integration/utils/run-app-dev-in-process.util.ts b/packages/twenty-sdk/src/cli/__tests__/integration/utils/run-app-dev-in-process.util.ts
index 56b32904445..08f91a70e6b 100644
--- a/packages/twenty-sdk/src/cli/__tests__/integration/utils/run-app-dev-in-process.util.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/integration/utils/run-app-dev-in-process.util.ts
@@ -5,6 +5,8 @@ import { OUTPUT_DIR } from 'twenty-shared/application';
export type RunAppDevResult = {
success: boolean;
+ events?: { message: string; status: string }[];
+ stepStatuses?: Record<string, string>;
};
export const runAppDevInProcess = async (options: {
@@ -22,7 +24,6 @@ export const runAppDevInProcess = async (options: {
while (Date.now() - startTime < timeout) {
if (await fs.pathExists(manifestPath)) {
- // Small delay to let any pending writes finish
await new Promise((resolve) => setTimeout(resolve, 500));
await command.close();
@@ -31,7 +32,20 @@ export const runAppDevInProcess = async (options: {
await new Promise((resolve) => setTimeout(resolve, 100));
}
+ const state = command.getOrchestrator()?.getState();
+
+ const events = state?.events.map((event) => ({
+ message: event.message,
+ status: event.status,
+ }));
+
+ const stepStatuses = state
+ ? Object.fromEntries(
+ Object.entries(state.steps).map(([key, step]) => [key, step.status]),
+ )
+ : undefined;
+
await command.close();
- return { success: false };
+ return { success: false, events, stepStatuses };
};
diff --git a/packages/twenty-sdk/src/cli/__tests__/integration/utils/setup-app-dev-mocks.ts b/packages/twenty-sdk/src/cli/__tests__/integration/utils/setup-app-dev-mocks.ts
index dfd0d92bf2d..a1d9a708e8b 100644
--- a/packages/twenty-sdk/src/cli/__tests__/integration/utils/setup-app-dev-mocks.ts
+++ b/packages/twenty-sdk/src/cli/__tests__/integration/utils/setup-app-dev-mocks.ts
@@ -26,6 +26,19 @@ const mockApiService = {
},
},
}),
+ findApplicationRegistrationByUniversalIdentifier: vi
+ .fn()
+ .mockResolvedValue({ success: true, data: null }),
+ createApplicationRegistration: vi.fn().mockResolvedValue({
+ success: true,
+ data: {
+ applicationRegistration: {
+ id: 'mock-registration-id',
+ oAuthClientId: 'mock-client-id',
+ },
+ clientSecret: 'mock-client-secret',
+ },
+ }),
syncApplication: vi.fn().mockResolvedValue({ success: true, data: true }),
uploadFile: vi.fn().mockResolvedValue({ success: true, data: true }),
};
@@ -37,6 +50,10 @@ vi.mock('@/cli/utilities/api/api-service', () => ({
createApplication = mockApiService.createApplication;
generateApplicationToken = mockApiService.generateApplicationToken;
renewApplicationToken = mockApiService.renewApplicationToken;
+ findApplicationRegistrationByUniversalIdentifier =
+ mockApiService.findApplicationRegistrationByUniversalIdentifier;
+ createApplicationRegistration =
+ mockApiService.createApplicationRegistration;
syncApplication = mockApiService.syncApplication;
uploadFile = mockApiService.uploadFile;
},
diff --git a/packages/twenty-sdk/src/cli/commands/app/app-dev.ts b/packages/twenty-sdk/src/cli/commands/app/app-dev.ts
index 29eb19c30a2..4c2fba2e2e9 100644
--- a/packages/twenty-sdk/src/cli/commands/app/app-dev.ts
+++ b/packages/twenty-sdk/src/cli/commands/app/app-dev.ts
@@ -17,6 +17,10 @@ export class AppDevCommand {
await this.orchestrator?.close();
}
+ getOrchestrator(): DevModeOrchestrator | null {
+ return this.orchestrator;
+ }
+
async execute(options: AppDevOptions): Promise<void> {
const appPath = options.appPath ?? CURRENT_EXECUTION_DIRECTORY;
diff --git a/packages/twenty-sdk/src/cli/utilities/api/api-service.ts b/packages/twenty-sdk/src/cli/utilities/api/api-service.ts
index dd9424bbaae..9e71ba2db82 100644
--- a/packages/twenty-sdk/src/cli/utilities/api/api-service.ts
+++ b/packages/twenty-sdk/src/cli/utilities/api/api-service.ts
@@ -1,13 +1,13 @@
+import { type ApiResponse } from '@/cli/utilities/api/api-response-type';
import { ConfigService } from '@/cli/utilities/config/config-service';
import axios, { type AxiosInstance, type AxiosResponse } from 'axios';
import chalk from 'chalk';
import * as fs from 'fs';
-import { createClient } from 'graphql-sse';
import { buildClientSchema, getIntrospectionQuery, printSchema } from 'graphql';
+import { createClient } from 'graphql-sse';
import * as path from 'path';
import { type Manifest } from 'twenty-shared/application';
import { type FileFolder } from 'twenty-shared/types';
-import { type ApiResponse } from '@/cli/utilities/api/api-response-type';
import { pascalCase } from 'twenty-shared/utils';
export class ApiService {
@@ -260,8 +260,126 @@ export class ApiService {
}
}
+ async findApplicationRegistrationByUniversalIdentifier(
+ universalIdentifier: string,
+ ): Promise<
+ ApiResponse<{
+ id: string;
+ universalIdentifier: string;
+ name: string;
+ oAuthClientId: string;
+ } | null>
+ > {
+ try {
+ const query = `
+ query FindApplicationRegistrationByUniversalIdentifier($universalIdentifier: String!) {
+ findApplicationRegistrationByUniversalIdentifier(universalIdentifier: $universalIdentifier) {
+ id
+ universalIdentifier
+ name
+ oAuthClientId
+ }
+ }
+ `;
+
+ const response = await this.client.post(
+ '/metadata',
+ {
+ query,
+ variables: { universalIdentifier },
+ },
+ {
+ headers: {
+ 'Content-Type': 'application/json',
+ Accept: '*/*',
+ },
+ },
+ );
+
+ if (response.data.errors) {
+ return {
+ success: false,
+ error: response.data.errors[0],
+ };
+ }
+
+ return {
+ success: true,
+ data: response.data.data
+ .findApplicationRegistrationByUniversalIdentifier,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ error,
+ };
+ }
+ }
+
+ async createApplicationRegistration(input: {
+ name: string;
+ description?: string;
+ universalIdentifier: string;
+ }): Promise<
+ ApiResponse<{
+ applicationRegistration: {
+ id: string;
+ universalIdentifier: string;
+ oAuthClientId: string;
+ };
+ clientSecret: string;
+ }>
+ > {
+ try {
+ const mutation = `
+ mutation CreateApplicationRegistration($input: CreateApplicationRegistrationInput!) {
+ createApplicationRegistration(input: $input) {
+ applicationRegistration {
+ id
+ universalIdentifier
+ oAuthClientId
+ }
+ clientSecret
+ }
+ }
+ `;
+
+ const response = await this.client.post(
+ '/metadata',
+ {
+ query: mutation,
+ variables: { input },
+ },
+ {
+ headers: {
+ 'Content-Type': 'application/json',
+ Accept: '*/*',
+ },
+ },
+ );
+
+ if (response.data.errors) {
+ return {
+ success: false,
+ error: response.data.errors[0],
+ };
+ }
+
+ return {
+ success: true,
+ data: response.data.data.createApplicationRegistration,
+ };
+ } catch (error) {
+ return {
+ success: false,
+ error,
+ };
+ }
+ }
+
async createApplication(
manifest: Manifest,
+ options?: { applicationRegistrationId?: string },
): Promise<ApiResponse<{ id: string; universalIdentifier: string }>> {
try {
const mutation = `
@@ -273,13 +391,19 @@ export class ApiService {
}
`;
+ const input: Record<string, string> = {
+ universalIdentifier: manifest.application.universalIdentifier,
+ name: manifest.application.displayName,
+ version: '0.0.1',
+ sourcePath: 'cli-sync',
+ };
+
+ if (options?.applicationRegistrationId) {
+ input.applicationRegistrationId = options.applicationRegistrationId;
+ }
+
const variables = {
- input: {
- universalIdentifier: manifest.application.universalIdentifier,
- name: manifest.application.displayName,
- version: '0.0.1',
- sourcePath: 'cli-sync',
- },
+ input,
};
const response: AxiosResponse = await this.client.post(
diff --git a/packages/twenty-sdk/src/cli/utilities/config/config-service.ts b/packages/twenty-sdk/src/cli/utilities/config/config-service.ts
index 366c087e9d3..76eed0add8f 100644
--- a/packages/twenty-sdk/src/cli/utilities/config/config-service.ts
+++ b/packages/twenty-sdk/src/cli/utilities/config/config-service.ts
@@ -8,6 +8,8 @@ export type TwentyConfig = {
apiKey?: string;
applicationAccessToken?: string;
applicationRefreshToken?: string;
+ oauthClientId?: string;
+ oauthClientSecret?: string;
};
type PersistedConfig = TwentyConfig & {
diff --git a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
index f5ec1349e7a..5128ecd1057 100644
--- a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
+++ b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/dev-mode-orchestrator.ts
@@ -6,6 +6,7 @@ import { BuildManifestOrchestratorStep } from '@/cli/utilities/dev/orchestrator/
import { CheckServerOrchestratorStep } from '@/cli/utilities/dev/orchestrator/steps/check-server-orchestrator-step';
import { EnsureValidTokensOrchestratorStep } from '@/cli/utilities/dev/orchestrator/steps/ensure-valid-tokens-orchestrator-step';
import { GenerateApiClientOrchestratorStep } from '@/cli/utilities/dev/orchestrator/steps/generate-api-client-orchestrator-step';
+import { RegisterAppOrchestratorStep } from '@/cli/utilities/dev/orchestrator/steps/register-app-orchestrator-step';
import { ResolveApplicationOrchestratorStep } from '@/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step';
import {
StartWatchersOrchestratorStep,
@@ -34,6 +35,7 @@ export class DevModeOrchestrator {
private checkServerStep: CheckServerOrchestratorStep;
private ensureValidTokensStep: EnsureValidTokensOrchestratorStep;
private buildManifestStep: BuildManifestOrchestratorStep;
+ private registerAppStep: RegisterAppOrchestratorStep;
private resolveApplicationStep: ResolveApplicationOrchestratorStep;
private uploadFilesStep: UploadFilesOrchestratorStep;
private generateApiClientStep: GenerateApiClientOrchestratorStep;
@@ -59,6 +61,11 @@ export class DevModeOrchestrator {
configService,
});
this.buildManifestStep = new BuildManifestOrchestratorStep(stepDeps);
+ this.registerAppStep = new RegisterAppOrchestratorStep({
+ ...stepDeps,
+ apiService,
+ configService,
+ });
this.resolveApplicationStep = new ResolveApplicationOrchestratorStep({
...stepDeps,
apiService,
@@ -216,8 +223,12 @@ export class DevModeOrchestrator {
}
private async initializePipeline(manifest: Manifest): Promise<boolean> {
+ const registerResult = await this.registerAppStep.execute({ manifest });
+
const resolveResult = await this.resolveApplicationStep.execute({
manifest,
+ applicationRegistrationId:
+ registerResult.applicationRegistrationId ?? undefined,
});
if (!resolveResult.applicationId) {
diff --git a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/register-app-orchestrator-step.ts b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/register-app-orchestrator-step.ts
new file mode 100644
index 00000000000..1159e21e2ed
--- /dev/null
+++ b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/register-app-orchestrator-step.ts
@@ -0,0 +1,120 @@
+import { type ApiService } from '@/cli/utilities/api/api-service';
+import { type ConfigService } from '@/cli/utilities/config/config-service';
+import { type OrchestratorState } from '@/cli/utilities/dev/orchestrator/dev-mode-orchestrator-state';
+import { type Manifest } from 'twenty-shared/application';
+
+export type RegisterAppOrchestratorStepOutput = {
+ applicationRegistrationId: string | null;
+ clientId: string | null;
+};
+
+export class RegisterAppOrchestratorStep {
+ private apiService: ApiService;
+ private configService: ConfigService;
+ private state: OrchestratorState;
+ private notify: () => void;
+
+ constructor({
+ apiService,
+ configService,
+ state,
+ notify,
+ }: {
+ apiService: ApiService;
+ configService: ConfigService;
+ state: OrchestratorState;
+ notify: () => void;
+ }) {
+ this.apiService = apiService;
+ this.configService = configService;
+ this.state = state;
+ this.notify = notify;
+ }
+
+ async execute(input: {
+ manifest: Manifest;
+ }): Promise<RegisterAppOrchestratorStepOutput> {
+ const universalIdentifier = input.manifest.application.universalIdentifier;
+
+ const findResult =
+ await this.apiService.findApplicationRegistrationByUniversalIdentifier(
+ universalIdentifier,
+ );
+
+ if (!findResult.success) {
+ this.state.applyStepEvents([
+ {
+ message: 'Failed to check app registration',
+ status: 'warning',
+ },
+ ]);
+ this.notify();
+
+ return { applicationRegistrationId: null, clientId: null };
+ }
+
+ if (findResult.data) {
+ this.state.applyStepEvents([
+ {
+ message: `App registration found: ${findResult.data.name}`,
+ status: 'info',
+ },
+ ]);
+ this.notify();
+
+ return {
+ applicationRegistrationId: findResult.data.id,
+ clientId: findResult.data.oAuthClientId,
+ };
+ }
+
+ const createResult = await this.apiService.createApplicationRegistration({
+ name: input.manifest.application.displayName,
+ description: input.manifest.application.description,
+ universalIdentifier,
+ });
+
+ if (!createResult.success || !createResult.data) {
+ this.state.applyStepEvents([
+ {
+ message: 'Failed to create app registration',
+ status: 'warning',
+ },
+ ]);
+ this.notify();
+
+ return { applicationRegistrationId: null, clientId: null };
+ }
+
+ await this.configService.setConfig({
+ oauthClientId: createResult.data.applicationRegistration.oAuthClientId,
+ oauthClientSecret: createResult.data.clientSecret,
+ });
+
+ this.state.applyStepEvents([
+ {
+ message: `App registration created: ${input.manifest.application.displayName}`,
+ status: 'success',
+ },
+ {
+ message: `Client ID: ${createResult.data.applicationRegistration.oAuthClientId}`,
+ status: 'info',
+ },
+ {
+ message: `Client Secret: ${createResult.data.clientSecret}`,
+ status: 'warning',
+ },
+ {
+ message:
+ 'Credentials saved to config. The secret will not be shown again.',
+ status: 'warning',
+ },
+ ]);
+ this.notify();
+
+ return {
+ applicationRegistrationId: createResult.data.applicationRegistration.id,
+ clientId: createResult.data.applicationRegistration.oAuthClientId,
+ };
+ }
+}
diff --git a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step.ts b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step.ts
index 81123c41fa4..1a8dd920f17 100644
--- a/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step.ts
+++ b/packages/twenty-sdk/src/cli/utilities/dev/orchestrator/steps/resolve-application-orchestrator-step.ts
@@ -28,6 +28,7 @@ export class ResolveApplicationOrchestratorStep {
async execute(input: {
manifest: Manifest;
+ applicationRegistrationId?: string;
}): Promise<ResolveApplicationOrchestratorStepOutput> {
const step = this.state.steps.resolveApplication;
@@ -65,6 +66,7 @@ export class ResolveApplicationOrchestratorStep {
const createResult = await this.apiService.createApplication(
input.manifest,
+ { applicationRegistrationId: input.applicationRegistrationId },
);
if (!createResult.success) {
diff --git a/packages/twenty-server/src/database/typeorm/core/migrations/common/1772267875868-create-application-registration.ts b/packages/twenty-server/src/database/typeorm/core/migrations/common/1772267875868-create-application-registration.ts
new file mode 100644
index 00000000000..9ae2cae3ba6
--- /dev/null
+++ b/packages/twenty-server/src/database/typeorm/core/migrations/common/1772267875868-create-application-registration.ts
@@ -0,0 +1,143 @@
+import { type MigrationInterface, type QueryRunner } from 'typeorm';
+
+export class CreateApplicationRegistration1772267875868
+ implements MigrationInterface
+{
+ name = 'CreateApplicationRegistration1772267875868';
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "core"."applicationRegistration" (
+ "id" uuid NOT NULL DEFAULT uuid_generate_v4(),
+ "universalIdentifier" uuid NOT NULL,
+ "name" text NOT NULL,
+ "description" text,
+ "logoUrl" text,
+ "author" text,
+ "oAuthClientId" text NOT NULL,
+ "oAuthClientSecretHash" text,
+ "oAuthRedirectUris" text[] NOT NULL DEFAULT '{}',
+ "oAuthScopes" text[] NOT NULL DEFAULT '{}',
+ "createdByUserId" uuid,
+ "websiteUrl" text,
+ "termsUrl" text,
+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "deletedAt" TIMESTAMP WITH TIME ZONE,
+ CONSTRAINT "PK_application_registration" PRIMARY KEY ("id")
+ )
+ `);
+
+ await queryRunner.query(`
+ CREATE UNIQUE INDEX "IDX_APPLICATION_REGISTRATION_UNIVERSAL_IDENTIFIER_UNIQUE"
+ ON "core"."applicationRegistration" ("universalIdentifier")
+ WHERE "deletedAt" IS NULL
+ `);
+
+ await queryRunner.query(`
+ CREATE UNIQUE INDEX "IDX_APPLICATION_REGISTRATION_OAUTH_CLIENT_ID_UNIQUE"
+ ON "core"."applicationRegistration" ("oAuthClientId")
+ WHERE "deletedAt" IS NULL
+ `);
+
+ await queryRunner.query(`
+ CREATE INDEX "IDX_APPLICATION_REGISTRATION_CREATED_BY_USER_ID"
+ ON "core"."applicationRegistration" ("createdByUserId")
+ `);
+
+ await queryRunner.query(`
+ ALTER TABLE "core"."applicationRegistration"
+ ADD CONSTRAINT "FK_d5aa70ce34f5b8e51e5b0deafc2"
+ FOREIGN KEY ("createdByUserId") REFERENCES "core"."user"("id")
+ ON DELETE SET NULL ON UPDATE NO ACTION
+ `);
+
+ await queryRunner.query(`
+ CREATE TABLE "core"."applicationRegistrationVariable" (
+ "id" uuid NOT NULL DEFAULT uuid_generate_v4(),
+ "key" text NOT NULL,
+ "encryptedValue" text NOT NULL DEFAULT '',
+ "description" text NOT NULL DEFAULT '',
+ "isSecret" boolean NOT NULL DEFAULT true,
+ "isRequired" boolean NOT NULL DEFAULT false,
+ "applicationRegistrationId" uuid NOT NULL,
+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ CONSTRAINT "PK_application_registration_variable" PRIMARY KEY ("id")
+ )
+ `);
+
+ await queryRunner.query(`
+ CREATE INDEX "IDX_APP_REG_VAR_APP_REGISTRATION_ID"
+ ON "core"."applicationRegistrationVariable" ("applicationRegistrationId")
+ `);
+
+ await queryRunner.query(`
+ ALTER TABLE "core"."applicationRegistrationVariable"
+ ADD CONSTRAINT "IDX_APP_REG_VAR_KEY_APP_REGISTRATION_ID_UNIQUE"
+ UNIQUE ("key", "applicationRegistrationId")
+ `);
+
+ await queryRunner.query(`
+ ALTER TABLE "core"."applicationRegistrationVariable"
+ ADD CONSTRAINT "FK_067a6267789011853178a6ab57a"
+ FOREIGN KEY ("applicationRegistrationId") REFERENCES "core"."applicationRegistration"("id")
+ ON DELETE CASCADE ON UPDATE NO ACTION
+ `);
+
+ await queryRunner.query(
+ `ALTER TABLE "core"."application" ADD "applicationRegistrationId" uuid`,
+ );
+
+ await queryRunner.query(`
+ ALTER TABLE "core"."application"
+ ADD CONSTRAINT "FK_ca635da088fa8d5379ed268b55e"
+ FOREIGN KEY ("applicationRegistrationId") REFERENCES "core"."applicationRegistration"("id")
+ ON DELETE SET NULL ON UPDATE NO ACTION
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `ALTER TABLE "core"."application" DROP CONSTRAINT "FK_ca635da088fa8d5379ed268b55e"`,
+ );
+
+ await queryRunner.query(
+ `ALTER TABLE "core"."application" DROP COLUMN "applicationRegistrationId"`,
+ );
+
+ await queryRunner.query(
+ `ALTER TABLE "core"."applicationRegistrationVariable" DROP CONSTRAINT "FK_067a6267789011853178a6ab57a"`,
+ );
+
+ await queryRunner.query(
+ `ALTER TABLE "core"."applicationRegistrationVariable" DROP CONSTRAINT "IDX_APP_REG_VAR_KEY_APP_REGISTRATION_ID_UNIQUE"`,
+ );
+
+ await queryRunner.query(
+ `DROP INDEX "core"."IDX_APP_REG_VAR_APP_REGISTRATION_ID"`,
+ );
+
+ await queryRunner.query(
+ `DROP TABLE "core"."applicationRegistrationVariable"`,
+ );
+
+ await queryRunner.query(
+ `ALTER TABLE "core"."applicationRegistration" DROP CONSTRAINT "FK_d5aa70ce34f5b8e51e5b0deafc2"`,
+ );
+
+ await queryRunner.query(
+ `DROP INDEX "core"."IDX_APPLICATION_REGISTRATION_CREATED_BY_USER_ID"`,
+ );
+
+ await queryRunner.query(
+ `DROP INDEX "core"."IDX_APPLICATION_REGISTRATION_OAUTH_CLIENT_ID_UNIQUE"`,
+ );
+
+ await queryRunner.query(
+ `DROP INDEX "core"."IDX_APPLICATION_REGISTRATION_UNIVERSAL_IDENTIFIER_UNIQUE"`,
+ );
+
+ await queryRunner.query(`DROP TABLE "core"."applicationRegistration"`);
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
index 033e24fb8d0..32050760654 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
@@ -7,9 +7,9 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { AdminPanelHealthService } from 'src/engine/core-modules/admin-panel/admin-panel-health.service';
import { AdminPanelQueueService } from 'src/engine/core-modules/admin-panel/admin-panel-queue.service';
import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
-import { AdminAIModelsOutput } from 'src/engine/core-modules/client-config/client-config.entity';
+import { AdminAIModelsDTO } from 'src/engine/core-modules/client-config/client-config.entity';
import { ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
-import { ConfigVariablesOutput } from 'src/engine/core-modules/admin-panel/dtos/config-variables.output';
+import { ConfigVariablesDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables.dto';
import { DeleteJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/delete-jobs-response.dto';
import { QueueJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-jobs-response.dto';
import { RetryJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/retry-jobs-response.dto';
@@ -95,8 +95,8 @@ export class AdminPanelResolver {
}
@UseGuards(AdminPanelGuard)
- @Query(() => ConfigVariablesOutput)
- async getConfigVariablesGrouped(): Promise<ConfigVariablesOutput> {
+ @Query(() => ConfigVariablesDTO)
+ async getConfigVariablesGrouped(): Promise<ConfigVariablesDTO> {
return this.adminService.getConfigVariablesGrouped();
}
@@ -142,8 +142,8 @@ export class AdminPanelResolver {
}
@UseGuards(AdminPanelGuard)
- @Query(() => AdminAIModelsOutput)
- async getAdminAiModels(): Promise<AdminAIModelsOutput> {
+ @Query(() => AdminAIModelsDTO)
+ async getAdminAiModels(): Promise<AdminAIModelsDTO> {
const models = this.aiModelRegistryService
.getAllModelsWithStatus()
.map(({ modelConfig, isAvailable, isAdminEnabled }) => ({
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
index 101efc08c86..13b7ec84b89 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
@@ -9,7 +9,7 @@ import * as z from 'zod';
import { type ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
import { type ConfigVariablesGroupDataDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
-import { type ConfigVariablesOutput } from 'src/engine/core-modules/admin-panel/dtos/config-variables.output';
+import { type ConfigVariablesDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables.dto';
import { type UserLookup } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.dto';
import { type VersionInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
import {
@@ -112,7 +112,7 @@ export class AdminPanelService {
};
}
- getConfigVariablesGrouped(): ConfigVariablesOutput {
+ getConfigVariablesGrouped(): ConfigVariablesDTO {
const rawEnvVars = this.twentyConfigService.getAll();
const groupedData = new Map<ConfigVariablesGroup, ConfigVariableDTO[]>();
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.dto.ts
similarity index 77%
rename from packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts
rename to packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.dto.ts
index 7977181bc55..130cf8aeabd 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { ConfigVariablesGroupDataDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
-@ObjectType('ConfigVariablesOutput')
-export class ConfigVariablesOutput {
+@ObjectType('ConfigVariables')
+export class ConfigVariablesDTO {
@Field(() => [ConfigVariablesGroupDataDTO])
groups: ConfigVariablesGroupDataDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.dto.ts
similarity index 84%
rename from packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts
rename to packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.dto.ts
index 9076513934e..4ae9f20bc27 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.dto.ts
@@ -3,8 +3,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AuthToken } from 'src/engine/core-modules/auth/dto/auth-token.dto';
import { WorkspaceUrlsAndIdDTO } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
-@ObjectType('ImpersonateOutput')
-export class ImpersonateOutput {
+@ObjectType('Impersonate')
+export class ImpersonateDTO {
@Field(() => AuthToken)
loginToken: AuthToken;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
index 45a4f46fbf4..8dd2b2ad39c 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
+import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag.dto';
import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
@ObjectType('UserInfo')
@@ -42,8 +42,8 @@ class WorkspaceInfoDTO {
@Field(() => [UserInfoDTO])
users: UserInfoDTO[];
- @Field(() => [FeatureFlagEntity])
- featureFlags: FeatureFlagEntity[];
+ @Field(() => [FeatureFlagDTO])
+ featureFlags: FeatureFlagDTO[];
}
@ObjectType('UserLookup')
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/api-key.resolver.ts b/packages/twenty-server/src/engine/core-modules/api-key/api-key.resolver.ts
index 516e3363c8d..7723e960150 100644
--- a/packages/twenty-server/src/engine/core-modules/api-key/api-key.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/api-key/api-key.resolver.ts
@@ -6,10 +6,10 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { ApiKeyEntity } from 'src/engine/core-modules/api-key/api-key.entity';
-import { CreateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/create-api-key.dto';
-import { GetApiKeyInput } from 'src/engine/core-modules/api-key/dtos/get-api-key.dto';
-import { RevokeApiKeyInput } from 'src/engine/core-modules/api-key/dtos/revoke-api-key.dto';
-import { UpdateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/update-api-key.dto';
+import { CreateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/create-api-key.input';
+import { GetApiKeyInput } from 'src/engine/core-modules/api-key/dtos/get-api-key.input';
+import { RevokeApiKeyInput } from 'src/engine/core-modules/api-key/dtos/revoke-api-key.input';
+import { UpdateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/update-api-key.input';
import {
ApiKeyException,
ApiKeyExceptionCode,
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/controllers/api-key.controller.ts b/packages/twenty-server/src/engine/core-modules/api-key/controllers/api-key.controller.ts
index af2c61d3be5..cd0abf4f7d3 100644
--- a/packages/twenty-server/src/engine/core-modules/api-key/controllers/api-key.controller.ts
+++ b/packages/twenty-server/src/engine/core-modules/api-key/controllers/api-key.controller.ts
@@ -15,8 +15,8 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { RestApiExceptionFilter } from 'src/engine/api/rest/rest-api-exception.filter';
import { type ApiKeyEntity } from 'src/engine/core-modules/api-key/api-key.entity';
-import { CreateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/create-api-key.dto';
-import { UpdateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/update-api-key.dto';
+import { CreateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/create-api-key.input';
+import { UpdateApiKeyInput } from 'src/engine/core-modules/api-key/dtos/update-api-key.input';
import { ApiKeyService } from 'src/engine/core-modules/api-key/services/api-key.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/dtos/create-api-key.dto.ts b/packages/twenty-server/src/engine/core-modules/api-key/dtos/create-api-key.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/api-key/dtos/create-api-key.dto.ts
rename to packages/twenty-server/src/engine/core-modules/api-key/dtos/create-api-key.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/dtos/get-api-key.dto.ts b/packages/twenty-server/src/engine/core-modules/api-key/dtos/get-api-key.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/api-key/dtos/get-api-key.dto.ts
rename to packages/twenty-server/src/engine/core-modules/api-key/dtos/get-api-key.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/dtos/revoke-api-key.dto.ts b/packages/twenty-server/src/engine/core-modules/api-key/dtos/revoke-api-key.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/api-key/dtos/revoke-api-key.dto.ts
rename to packages/twenty-server/src/engine/core-modules/api-key/dtos/revoke-api-key.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/api-key/dtos/update-api-key.dto.ts b/packages/twenty-server/src/engine/core-modules/api-key/dtos/update-api-key.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/api-key/dtos/update-api-key.dto.ts
rename to packages/twenty-server/src/engine/core-modules/api-key/dtos/update-api-key.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/app-token/app-token.entity.ts b/packages/twenty-server/src/engine/core-modules/app-token/app-token.entity.ts
index 2025b14c27b..fa5b9460d5d 100644
--- a/packages/twenty-server/src/engine/core-modules/app-token/app-token.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/app-token/app-token.entity.ts
@@ -89,5 +89,5 @@ export class AppTokenEntity {
}
@Column({ nullable: true, type: 'jsonb' })
- context: { email: string } | null;
+ context: { email?: string; redirectUri?: string } | null;
}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/__tests__/oauth-scopes.spec.ts b/packages/twenty-server/src/engine/core-modules/application-registration/__tests__/oauth-scopes.spec.ts
new file mode 100644
index 00000000000..2404de358fa
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/__tests__/oauth-scopes.spec.ts
@@ -0,0 +1,25 @@
+import {
+ ALL_OAUTH_SCOPES,
+ OAUTH_SCOPE_DESCRIPTIONS,
+ OAUTH_SCOPES,
+} from 'src/engine/core-modules/application-registration/constants/oauth-scopes';
+
+describe('OAuth Scopes', () => {
+ it('should have all scopes defined', () => {
+ expect(ALL_OAUTH_SCOPES).toContain('api');
+ expect(ALL_OAUTH_SCOPES).toContain('profile');
+ expect(ALL_OAUTH_SCOPES).toHaveLength(2);
+ });
+
+ it('should have descriptions for all scopes', () => {
+ for (const scope of ALL_OAUTH_SCOPES) {
+ expect(OAUTH_SCOPE_DESCRIPTIONS[scope]).toBeDefined();
+ expect(OAUTH_SCOPE_DESCRIPTIONS[scope].length).toBeGreaterThan(0);
+ }
+ });
+
+ it('should have consistent keys and values', () => {
+ expect(OAUTH_SCOPES.API).toBe('api');
+ expect(OAUTH_SCOPES.PROFILE).toBe('profile');
+ });
+});
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.entity.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.entity.ts
new file mode 100644
index 00000000000..011fadb9188
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.entity.ts
@@ -0,0 +1,74 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { IDField } from '@ptc-org/nestjs-query-graphql';
+import {
+ Column,
+ CreateDateColumn,
+ Entity,
+ Index,
+ JoinColumn,
+ ManyToOne,
+ PrimaryGeneratedColumn,
+ type Relation,
+ Unique,
+ UpdateDateColumn,
+} from 'typeorm';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+
+@Entity({ name: 'applicationRegistrationVariable', schema: 'core' })
+@ObjectType('ApplicationRegistrationVariable')
+@Unique('IDX_APP_REG_VAR_KEY_APP_REGISTRATION_ID_UNIQUE', [
+ 'key',
+ 'applicationRegistrationId',
+])
+@Index('IDX_APP_REG_VAR_APP_REGISTRATION_ID', ['applicationRegistrationId'])
+export class ApplicationRegistrationVariableEntity {
+ @IDField(() => UUIDScalarType)
+ @PrimaryGeneratedColumn('uuid')
+ id: string;
+
+ @Field()
+ @Column({ nullable: false, type: 'text' })
+ key: string;
+
+ @Column({ nullable: false, type: 'text', default: '' })
+ encryptedValue: string;
+
+ @Field()
+ @Column({ nullable: false, type: 'text', default: '' })
+ description: string;
+
+ @Field()
+ @Column({ nullable: false, type: 'boolean', default: true })
+ isSecret: boolean;
+
+ @Field()
+ @Column({ nullable: false, type: 'boolean', default: false })
+ isRequired: boolean;
+
+ @Field()
+ get isFilled(): boolean {
+ return this.encryptedValue !== '';
+ }
+
+ @Column({ nullable: false, type: 'uuid' })
+ applicationRegistrationId: string;
+
+ @ManyToOne(
+ () => ApplicationRegistrationEntity,
+ (applicationRegistration) => applicationRegistration.variables,
+ { onDelete: 'CASCADE', nullable: false },
+ )
+ @JoinColumn({ name: 'applicationRegistrationId' })
+ applicationRegistration: Relation<ApplicationRegistrationEntity>;
+
+ @Field()
+ @CreateDateColumn({ type: 'timestamptz' })
+ createdAt: Date;
+
+ @Field()
+ @UpdateDateColumn({ type: 'timestamptz' })
+ updatedAt: Date;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.service.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.service.ts
new file mode 100644
index 00000000000..fb23be56450
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration-variable.service.ts
@@ -0,0 +1,165 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { type ServerVariables } from 'twenty-shared/application';
+import { isDefined } from 'twenty-shared/utils';
+import { In, Not, type Repository } from 'typeorm';
+
+import { ApplicationRegistrationVariableEntity } from 'src/engine/core-modules/application-registration/application-registration-variable.entity';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+import {
+ ApplicationRegistrationException,
+ ApplicationRegistrationExceptionCode,
+} from 'src/engine/core-modules/application-registration/application-registration.exception';
+import { type CreateApplicationRegistrationVariableInput } from 'src/engine/core-modules/application-registration/dtos/create-application-registration-variable.input';
+import { type UpdateApplicationRegistrationVariableInput } from 'src/engine/core-modules/application-registration/dtos/update-application-registration-variable.input';
+import { SecretEncryptionService } from 'src/engine/core-modules/secret-encryption/secret-encryption.service';
+
+@Injectable()
+export class ApplicationRegistrationVariableService {
+ constructor(
+ @InjectRepository(ApplicationRegistrationVariableEntity)
+ private readonly variableRepository: Repository<ApplicationRegistrationVariableEntity>,
+ @InjectRepository(ApplicationRegistrationEntity)
+ private readonly applicationRegistrationRepository: Repository<ApplicationRegistrationEntity>,
+ private readonly encryptionService: SecretEncryptionService,
+ ) {}
+
+ async findVariables(
+ applicationRegistrationId: string,
+ ): Promise<ApplicationRegistrationVariableEntity[]> {
+ return this.variableRepository.find({
+ where: { applicationRegistrationId },
+ order: { key: 'ASC' },
+ });
+ }
+
+ async createVariable(
+ input: CreateApplicationRegistrationVariableInput,
+ ): Promise<ApplicationRegistrationVariableEntity> {
+ await this.assertRegistrationExists(input.applicationRegistrationId);
+
+ const encryptedValue = this.encryptionService.encrypt(input.value);
+
+ const variable = this.variableRepository.create({
+ applicationRegistrationId: input.applicationRegistrationId,
+ key: input.key,
+ encryptedValue,
+ description: input.description ?? '',
+ isSecret: input.isSecret ?? true,
+ });
+
+ return this.variableRepository.save(variable);
+ }
+
+ async updateVariable(
+ input: UpdateApplicationRegistrationVariableInput,
+ ): Promise<ApplicationRegistrationVariableEntity> {
+ const { id, update } = input;
+
+ const variable = await this.variableRepository.findOne({
+ where: { id },
+ });
+
+ if (!variable) {
+ throw new ApplicationRegistrationException(
+ `Variable with id ${id} not found`,
+ ApplicationRegistrationExceptionCode.VARIABLE_NOT_FOUND,
+ );
+ }
+
+ const updateData: Record<string, unknown> = {};
+
+ if (isDefined(update.value)) {
+ updateData.encryptedValue = this.encryptionService.encrypt(update.value);
+ }
+
+ if (isDefined(update.description)) {
+ updateData.description = update.description;
+ }
+
+ if (Object.keys(updateData).length > 0) {
+ await this.variableRepository.update(id, updateData);
+ }
+
+ return this.variableRepository.findOneOrFail({ where: { id } });
+ }
+
+ async deleteVariable(id: string): Promise<boolean> {
+ const variable = await this.variableRepository.findOne({
+ where: { id },
+ });
+
+ if (!variable) {
+ throw new ApplicationRegistrationException(
+ `Variable with id ${id} not found`,
+ ApplicationRegistrationExceptionCode.VARIABLE_NOT_FOUND,
+ );
+ }
+
+ await this.variableRepository.delete(id);
+
+ return true;
+ }
+
+ // Syncs variable schemas from manifest: creates missing, updates metadata, removes stale
+ async syncVariableSchemas(
+ applicationRegistrationId: string,
+ serverVariables: ServerVariables,
+ ): Promise<void> {
+ const declaredKeys = Object.keys(serverVariables);
+
+ const existingVariables = await this.variableRepository.find({
+ where: { applicationRegistrationId },
+ });
+
+ const existingByKey = new Map(
+ existingVariables.map((variable) => [variable.key, variable]),
+ );
+
+ for (const [key, schema] of Object.entries(serverVariables)) {
+ const existing = existingByKey.get(key);
+
+ if (existing) {
+ await this.variableRepository.update(existing.id, {
+ description: schema.description ?? '',
+ isSecret: schema.isSecret ?? true,
+ isRequired: schema.isRequired ?? false,
+ });
+ } else {
+ await this.variableRepository.save(
+ this.variableRepository.create({
+ applicationRegistrationId,
+ key,
+ encryptedValue: '',
+ description: schema.description ?? '',
+ isSecret: schema.isSecret ?? true,
+ isRequired: schema.isRequired ?? false,
+ }),
+ );
+ }
+ }
+
+ if (declaredKeys.length > 0) {
+ await this.variableRepository.delete({
+ applicationRegistrationId,
+ key: Not(In(declaredKeys)),
+ });
+ } else {
+ await this.variableRepository.delete({ applicationRegistrationId });
+ }
+ }
+
+ private async assertRegistrationExists(id: string): Promise<void> {
+ const registration = await this.applicationRegistrationRepository.findOne({
+ where: { id },
+ });
+
+ if (!registration) {
+ throw new ApplicationRegistrationException(
+ `Application registration with id ${id} not found`,
+ ApplicationRegistrationExceptionCode.APPLICATION_REGISTRATION_NOT_FOUND,
+ );
+ }
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.entity.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.entity.ts
new file mode 100644
index 00000000000..08be4cc1f7c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.entity.ts
@@ -0,0 +1,113 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { IDField } from '@ptc-org/nestjs-query-graphql';
+import {
+ Column,
+ CreateDateColumn,
+ DeleteDateColumn,
+ Entity,
+ Index,
+ JoinColumn,
+ ManyToOne,
+ OneToMany,
+ PrimaryGeneratedColumn,
+ type Relation,
+ UpdateDateColumn,
+} from 'typeorm';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { ApplicationRegistrationVariableEntity } from 'src/engine/core-modules/application-registration/application-registration-variable.entity';
+import { UserEntity } from 'src/engine/core-modules/user/user.entity';
+
+@Entity({ name: 'applicationRegistration', schema: 'core' })
+@ObjectType('ApplicationRegistration')
+@Index(
+ 'IDX_APPLICATION_REGISTRATION_UNIVERSAL_IDENTIFIER_UNIQUE',
+ ['universalIdentifier'],
+ {
+ unique: true,
+ where: '"deletedAt" IS NULL',
+ },
+)
+@Index(
+ 'IDX_APPLICATION_REGISTRATION_OAUTH_CLIENT_ID_UNIQUE',
+ ['oAuthClientId'],
+ {
+ unique: true,
+ where: '"deletedAt" IS NULL',
+ },
+)
+@Index('IDX_APPLICATION_REGISTRATION_CREATED_BY_USER_ID', ['createdByUserId'])
+export class ApplicationRegistrationEntity {
+ @IDField(() => UUIDScalarType)
+ @PrimaryGeneratedColumn('uuid')
+ id: string;
+
+ @Field()
+ @Column({ nullable: false, type: 'uuid' })
+ universalIdentifier: string;
+
+ @Field()
+ @Column({ nullable: false, type: 'text' })
+ name: string;
+
+ @Field(() => String, { nullable: true })
+ @Column({ nullable: true, type: 'text' })
+ description: string | null;
+
+ @Field(() => String, { nullable: true })
+ @Column({ nullable: true, type: 'text' })
+ logoUrl: string | null;
+
+ @Field(() => String, { nullable: true })
+ @Column({ nullable: true, type: 'text' })
+ author: string | null;
+
+ @Field()
+ @Column({ nullable: false, type: 'text' })
+ oAuthClientId: string;
+
+ @Column({ nullable: true, type: 'text' })
+ oAuthClientSecretHash: string | null;
+
+ @Field(() => [String])
+ @Column({ type: 'text', array: true, default: '{}' })
+ oAuthRedirectUris: string[];
+
+ @Field(() => [String])
+ @Column({ type: 'text', array: true, default: '{}' })
+ oAuthScopes: string[];
+
+ @Column({ nullable: true, type: 'uuid' })
+ createdByUserId: string | null;
+
+ @ManyToOne(() => UserEntity, { onDelete: 'SET NULL', nullable: true })
+ @JoinColumn({ name: 'createdByUserId' })
+ createdByUser: Relation<UserEntity> | null;
+
+ @Field(() => String, { nullable: true })
+ @Column({ nullable: true, type: 'text' })
+ websiteUrl: string | null;
+
+ @Field(() => String, { nullable: true })
+ @Column({ nullable: true, type: 'text' })
+ termsUrl: string | null;
+
+ @OneToMany(
+ () => ApplicationRegistrationVariableEntity,
+ (variable) => variable.applicationRegistration,
+ { onDelete: 'CASCADE' },
+ )
+ variables: Relation<ApplicationRegistrationVariableEntity[]>;
+
+ @Field()
+ @CreateDateColumn({ type: 'timestamptz' })
+ createdAt: Date;
+
+ @Field()
+ @UpdateDateColumn({ type: 'timestamptz' })
+ updatedAt: Date;
+
+ @DeleteDateColumn({ type: 'timestamptz' })
+ deletedAt: Date | null;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.exception.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.exception.ts
new file mode 100644
index 00000000000..75ec648468c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.exception.ts
@@ -0,0 +1,45 @@
+import { type MessageDescriptor } from '@lingui/core';
+import { msg } from '@lingui/core/macro';
+import { assertUnreachable } from 'twenty-shared/utils';
+
+import { CustomException } from 'src/utils/custom-exception';
+
+export enum ApplicationRegistrationExceptionCode {
+ APPLICATION_REGISTRATION_NOT_FOUND = 'APPLICATION_REGISTRATION_NOT_FOUND',
+ UNIVERSAL_IDENTIFIER_ALREADY_CLAIMED = 'UNIVERSAL_IDENTIFIER_ALREADY_CLAIMED',
+ INVALID_SCOPE = 'INVALID_SCOPE',
+ INVALID_REDIRECT_URI = 'INVALID_REDIRECT_URI',
+ VARIABLE_NOT_FOUND = 'VARIABLE_NOT_FOUND',
+}
+
+const getExceptionUserFriendlyMessage = (
+ code: ApplicationRegistrationExceptionCode,
+) => {
+ switch (code) {
+ case ApplicationRegistrationExceptionCode.APPLICATION_REGISTRATION_NOT_FOUND:
+ return msg`Application registration not found.`;
+ case ApplicationRegistrationExceptionCode.UNIVERSAL_IDENTIFIER_ALREADY_CLAIMED:
+ return msg`This universal identifier is already claimed by another registration.`;
+ case ApplicationRegistrationExceptionCode.INVALID_SCOPE:
+ return msg`One or more requested scopes are invalid.`;
+ case ApplicationRegistrationExceptionCode.INVALID_REDIRECT_URI:
+ return msg`One or more redirect URIs are invalid.`;
+ case ApplicationRegistrationExceptionCode.VARIABLE_NOT_FOUND:
+ return msg`Application registration variable not found.`;
+ default:
+ assertUnreachable(code);
+ }
+};
+
+export class ApplicationRegistrationException extends CustomException<ApplicationRegistrationExceptionCode> {
+ constructor(
+ message: string,
+ code: ApplicationRegistrationExceptionCode,
+ { userFriendlyMessage }: { userFriendlyMessage?: MessageDescriptor } = {},
+ ) {
+ super(message, code, {
+ userFriendlyMessage:
+ userFriendlyMessage ?? getExceptionUserFriendlyMessage(code),
+ });
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.module.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.module.ts
new file mode 100644
index 00000000000..13bf0c8edd6
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.module.ts
@@ -0,0 +1,46 @@
+import { Module } from '@nestjs/common';
+import { TypeOrmModule } from '@nestjs/typeorm';
+
+import { ApplicationRegistrationVariableEntity } from 'src/engine/core-modules/application-registration/application-registration-variable.entity';
+import { ApplicationRegistrationVariableService } from 'src/engine/core-modules/application-registration/application-registration-variable.service';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+import { ApplicationRegistrationResolver } from 'src/engine/core-modules/application-registration/application-registration.resolver';
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
+import { OAuthDiscoveryController } from 'src/engine/core-modules/application-registration/controllers/oauth-discovery.controller';
+import { OAuthTokenController } from 'src/engine/core-modules/application-registration/controllers/oauth-token.controller';
+import { OAuthService } from 'src/engine/core-modules/application-registration/oauth.service';
+import { AppTokenEntity } from 'src/engine/core-modules/app-token/app-token.entity';
+import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
+import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
+import { TokenModule } from 'src/engine/core-modules/auth/token/token.module';
+import { SecretEncryptionModule } from 'src/engine/core-modules/secret-encryption/secret-encryption.module';
+import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
+import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
+
+@Module({
+ imports: [
+ TypeOrmModule.forFeature([
+ ApplicationRegistrationEntity,
+ ApplicationRegistrationVariableEntity,
+ ApplicationEntity,
+ AppTokenEntity,
+ UserWorkspaceEntity,
+ ]),
+ SecretEncryptionModule,
+ PermissionsModule,
+ TokenModule,
+ ApplicationModule,
+ ],
+ controllers: [OAuthTokenController, OAuthDiscoveryController],
+ providers: [
+ ApplicationRegistrationService,
+ ApplicationRegistrationVariableService,
+ ApplicationRegistrationResolver,
+ OAuthService,
+ ],
+ exports: [
+ ApplicationRegistrationService,
+ ApplicationRegistrationVariableService,
+ ],
+})
+export class ApplicationRegistrationModule {}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.resolver.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.resolver.ts
new file mode 100644
index 00000000000..60506ad0c27
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.resolver.ts
@@ -0,0 +1,181 @@
+import { UseFilters, UseGuards, UsePipes } from '@nestjs/common';
+import { Args, Mutation, Query } from '@nestjs/graphql';
+
+import { PermissionFlagType } from 'twenty-shared/constants';
+
+import { ApplicationRegistrationVariableEntity } from 'src/engine/core-modules/application-registration/application-registration-variable.entity';
+import { ApplicationRegistrationVariableService } from 'src/engine/core-modules/application-registration/application-registration-variable.service';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
+import { ApplicationRegistrationStatsDTO } from 'src/engine/core-modules/application-registration/dtos/application-registration-stats.dto';
+import { CreateApplicationRegistrationInput } from 'src/engine/core-modules/application-registration/dtos/create-application-registration.input';
+import { CreateApplicationRegistrationDTO } from 'src/engine/core-modules/application-registration/dtos/create-application-registration.dto';
+import { CreateApplicationRegistrationVariableInput } from 'src/engine/core-modules/application-registration/dtos/create-application-registration-variable.input';
+import { RotateClientSecretDTO } from 'src/engine/core-modules/application-registration/dtos/rotate-client-secret.dto';
+import { UpdateApplicationRegistrationInput } from 'src/engine/core-modules/application-registration/dtos/update-application-registration.input';
+import { UpdateApplicationRegistrationVariableInput } from 'src/engine/core-modules/application-registration/dtos/update-application-registration-variable.input';
+import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter';
+import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
+import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
+import { UserEntity } from 'src/engine/core-modules/user/user.entity';
+import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
+import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
+import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
+import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';
+import { SettingsPermissionGuard } from 'src/engine/guards/settings-permission.guard';
+import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
+
+@UsePipes(ResolverValidationPipe)
+@MetadataResolver()
+@UseFilters(
+ AuthGraphqlApiExceptionFilter,
+ PreventNestToAutoLogGraphqlErrorsFilter,
+)
+export class ApplicationRegistrationResolver {
+ constructor(
+ private readonly applicationRegistrationService: ApplicationRegistrationService,
+ private readonly applicationRegistrationVariableService: ApplicationRegistrationVariableService,
+ ) {}
+
+ @UseGuards(PublicEndpointGuard, NoPermissionGuard)
+ @Query(() => ApplicationRegistrationEntity, { nullable: true })
+ async findApplicationRegistrationByClientId(
+ @Args('clientId') clientId: string,
+ ): Promise<ApplicationRegistrationEntity | null> {
+ return this.applicationRegistrationService.findOneByClientId(clientId);
+ }
+
+ @UseGuards(WorkspaceAuthGuard, NoPermissionGuard)
+ @Query(() => ApplicationRegistrationEntity, { nullable: true })
+ async findApplicationRegistrationByUniversalIdentifier(
+ @Args('universalIdentifier') universalIdentifier: string,
+ ): Promise<ApplicationRegistrationEntity | null> {
+ return this.applicationRegistrationService.findOneByUniversalIdentifier(
+ universalIdentifier,
+ );
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Query(() => [ApplicationRegistrationEntity])
+ async findManyApplicationRegistrations(): Promise<
+ ApplicationRegistrationEntity[]
+ > {
+ return this.applicationRegistrationService.findMany();
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Query(() => ApplicationRegistrationEntity)
+ async findOneApplicationRegistration(
+ @Args('id') id: string,
+ ): Promise<ApplicationRegistrationEntity> {
+ return this.applicationRegistrationService.findOneById(id);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Query(() => ApplicationRegistrationStatsDTO)
+ async findApplicationRegistrationStats(
+ @Args('id') id: string,
+ ): Promise<ApplicationRegistrationStatsDTO> {
+ return this.applicationRegistrationService.getStats(id);
+ }
+
+ @UseGuards(WorkspaceAuthGuard, NoPermissionGuard)
+ @Mutation(() => CreateApplicationRegistrationDTO)
+ async createApplicationRegistration(
+ @Args('input') input: CreateApplicationRegistrationInput,
+ @AuthUser({ allowUndefined: true }) user: UserEntity | undefined,
+ ): Promise<CreateApplicationRegistrationDTO> {
+ return this.applicationRegistrationService.create(input, user?.id ?? null);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => ApplicationRegistrationEntity)
+ async updateApplicationRegistration(
+ @Args('input') input: UpdateApplicationRegistrationInput,
+ ): Promise<ApplicationRegistrationEntity> {
+ return this.applicationRegistrationService.update(input);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => Boolean)
+ async deleteApplicationRegistration(
+ @Args('id') id: string,
+ ): Promise<boolean> {
+ return this.applicationRegistrationService.delete(id);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => RotateClientSecretDTO)
+ async rotateApplicationRegistrationClientSecret(
+ @Args('id') id: string,
+ ): Promise<RotateClientSecretDTO> {
+ const clientSecret =
+ await this.applicationRegistrationService.rotateClientSecret(id);
+
+ return { clientSecret };
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Query(() => [ApplicationRegistrationVariableEntity])
+ async findApplicationRegistrationVariables(
+ @Args('applicationRegistrationId') applicationRegistrationId: string,
+ ): Promise<ApplicationRegistrationVariableEntity[]> {
+ return this.applicationRegistrationVariableService.findVariables(
+ applicationRegistrationId,
+ );
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => ApplicationRegistrationVariableEntity)
+ async createApplicationRegistrationVariable(
+ @Args('input') input: CreateApplicationRegistrationVariableInput,
+ ): Promise<ApplicationRegistrationVariableEntity> {
+ return this.applicationRegistrationVariableService.createVariable(input);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => ApplicationRegistrationVariableEntity)
+ async updateApplicationRegistrationVariable(
+ @Args('input') input: UpdateApplicationRegistrationVariableInput,
+ ): Promise<ApplicationRegistrationVariableEntity> {
+ return this.applicationRegistrationVariableService.updateVariable(input);
+ }
+
+ @UseGuards(
+ WorkspaceAuthGuard,
+ SettingsPermissionGuard(PermissionFlagType.API_KEYS_AND_WEBHOOKS),
+ )
+ @Mutation(() => Boolean)
+ async deleteApplicationRegistrationVariable(
+ @Args('id') id: string,
+ ): Promise<boolean> {
+ return this.applicationRegistrationVariableService.deleteVariable(id);
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.service.ts b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.service.ts
new file mode 100644
index 00000000000..38df1c7ee04
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/application-registration.service.ts
@@ -0,0 +1,264 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import crypto from 'crypto';
+
+import * as bcrypt from 'bcrypt';
+import { isDefined } from 'twenty-shared/utils';
+import { type Repository } from 'typeorm';
+import { v4 } from 'uuid';
+
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+import {
+ ApplicationRegistrationException,
+ ApplicationRegistrationExceptionCode,
+} from 'src/engine/core-modules/application-registration/application-registration.exception';
+import { ALL_OAUTH_SCOPES } from 'src/engine/core-modules/application-registration/constants/oauth-scopes';
+import { type ApplicationRegistrationStatsDTO } from 'src/engine/core-modules/application-registration/dtos/application-registration-stats.dto';
+import { type CreateApplicationRegistrationInput } from 'src/engine/core-modules/application-registration/dtos/create-application-registration.input';
+import { type UpdateApplicationRegistrationInput } from 'src/engine/core-modules/application-registration/dtos/update-application-registration.input';
+import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
+import { validateRedirectUri } from 'src/engine/core-modules/auth/utils/validate-redirect-uri.util';
+
+const BCRYPT_SALT_ROUNDS = 10;
+
+@Injectable()
+export class ApplicationRegistrationService {
+ constructor(
+ @InjectRepository(ApplicationRegistrationEntity)
+ private readonly applicationRegistrationRepository: Repository<ApplicationRegistrationEntity>,
+ @InjectRepository(ApplicationEntity)
+ private readonly applicationRepository: Repository<ApplicationEntity>,
+ ) {}
+
+ async findMany(): Promise<ApplicationRegistrationEntity[]> {
+ return this.applicationRegistrationRepository.find({
+ order: { createdAt: 'DESC' },
+ });
+ }
+
+ async findOneById(id: string): Promise<ApplicationRegistrationEntity> {
+ const registration = await this.applicationRegistrationRepository.findOne({
+ where: { id },
+ });
+
+ if (!registration) {
+ throw new ApplicationRegistrationException(
+ `Application registration with id ${id} not found`,
+ ApplicationRegistrationExceptionCode.APPLICATION_REGISTRATION_NOT_FOUND,
+ );
+ }
+
+ return registration;
+ }
+
+ async findOneByClientId(
+ clientId: string,
+ ): Promise<ApplicationRegistrationEntity | null> {
+ return this.applicationRegistrationRepository.findOne({
+ where: { oAuthClientId: clientId },
+ });
+ }
+
+ async findOneByUniversalIdentifier(
+ universalIdentifier: string,
+ ): Promise<ApplicationRegistrationEntity | null> {
+ return this.applicationRegistrationRepository.findOne({
+ where: { universalIdentifier },
+ });
+ }
+
+ async create(
+ input: CreateApplicationRegistrationInput,
+ createdByUserId: string | null,
+ ): Promise<{
+ applicationRegistration: ApplicationRegistrationEntity;
+ clientSecret: string;
+ }> {
+ const universalIdentifier = input.universalIdentifier ?? v4();
+
+ const existingByUid =
+ await this.findOneByUniversalIdentifier(universalIdentifier);
+
+ if (existingByUid) {
+ throw new ApplicationRegistrationException(
+ `Universal identifier ${universalIdentifier} is already claimed`,
+ ApplicationRegistrationExceptionCode.UNIVERSAL_IDENTIFIER_ALREADY_CLAIMED,
+ );
+ }
+
+ if (isDefined(input.oAuthRedirectUris)) {
+ this.validateRedirectUris(input.oAuthRedirectUris);
+ }
+
+ if (isDefined(input.oAuthScopes)) {
+ this.validateScopes(input.oAuthScopes);
+ }
+
+ const clientId = v4();
+ const { clientSecret, clientSecretHash } =
+ await this.generateClientSecret();
+
+ const applicationRegistration =
+ this.applicationRegistrationRepository.create({
+ universalIdentifier,
+ name: input.name,
+ description: input.description ?? null,
+ logoUrl: input.logoUrl ?? null,
+ author: input.author ?? null,
+ oAuthClientId: clientId,
+ oAuthClientSecretHash: clientSecretHash,
+ oAuthRedirectUris: input.oAuthRedirectUris ?? [],
+ oAuthScopes: input.oAuthScopes ?? [],
+ createdByUserId,
+ websiteUrl: input.websiteUrl ?? null,
+ termsUrl: input.termsUrl ?? null,
+ });
+
+ const saved = await this.applicationRegistrationRepository.save(
+ applicationRegistration,
+ );
+
+ return { applicationRegistration: saved, clientSecret };
+ }
+
+ async update(
+ input: UpdateApplicationRegistrationInput,
+ ): Promise<ApplicationRegistrationEntity> {
+ const { id, update } = input;
+
+ await this.findOneById(id);
+
+ if (isDefined(update.oAuthRedirectUris)) {
+ this.validateRedirectUris(update.oAuthRedirectUris);
+ }
+
+ if (isDefined(update.oAuthScopes)) {
+ this.validateScopes(update.oAuthScopes);
+ }
+
+ const updateData: Record<string, unknown> = {};
+
+ if (isDefined(update.name)) updateData.name = update.name;
+ if (isDefined(update.description))
+ updateData.description = update.description;
+ if (isDefined(update.logoUrl)) updateData.logoUrl = update.logoUrl;
+ if (isDefined(update.author)) updateData.author = update.author;
+ if (isDefined(update.oAuthRedirectUris))
+ updateData.oAuthRedirectUris = update.oAuthRedirectUris;
+ if (isDefined(update.oAuthScopes))
+ updateData.oAuthScopes = update.oAuthScopes;
+ if (isDefined(update.websiteUrl)) updateData.websiteUrl = update.websiteUrl;
+ if (isDefined(update.termsUrl)) updateData.termsUrl = update.termsUrl;
+
+ if (Object.keys(updateData).length > 0) {
+ await this.applicationRegistrationRepository.update(id, updateData);
+ }
+
+ return this.findOneById(id);
+ }
+
+ async delete(id: string): Promise<boolean> {
+ await this.findOneById(id);
+ await this.applicationRegistrationRepository.softDelete(id);
+
+ return true;
+ }
+
+ async rotateClientSecret(id: string): Promise<string> {
+ await this.findOneById(id);
+
+ const { clientSecret, clientSecretHash } =
+ await this.generateClientSecret();
+
+ await this.applicationRegistrationRepository.update(id, {
+ oAuthClientSecretHash: clientSecretHash,
+ });
+
+ return clientSecret;
+ }
+
+ async verifyClientSecret(
+ registration: ApplicationRegistrationEntity,
+ clientSecret: string,
+ ): Promise<boolean> {
+ if (!registration.oAuthClientSecretHash) {
+ return false;
+ }
+
+ return bcrypt.compare(clientSecret, registration.oAuthClientSecretHash);
+ }
+
+ async getStats(
+ applicationRegistrationId: string,
+ ): Promise<ApplicationRegistrationStatsDTO> {
+ await this.findOneById(applicationRegistrationId);
+
+ const versionDistribution: { version: string; count: number }[] =
+ await this.applicationRepository
+ .createQueryBuilder('application')
+ .select("COALESCE(application.version, 'unknown')", 'version')
+ .addSelect('COUNT(*)::int', 'count')
+ .where(
+ 'application."applicationRegistrationId" = :applicationRegistrationId',
+ { applicationRegistrationId },
+ )
+ .andWhere('application."deletedAt" IS NULL')
+ .groupBy('version')
+ .orderBy('count', 'DESC')
+ .getRawMany();
+
+ const activeInstalls = versionDistribution.reduce(
+ (sum, entry) => sum + entry.count,
+ 0,
+ );
+
+ const mostInstalledVersion = versionDistribution[0]?.version ?? null;
+
+ return {
+ activeInstalls,
+ mostInstalledVersion,
+ versionDistribution,
+ };
+ }
+
+ private async generateClientSecret(): Promise<{
+ clientSecret: string;
+ clientSecretHash: string;
+ }> {
+ const clientSecret = crypto.randomBytes(32).toString('hex');
+ const clientSecretHash = await bcrypt.hash(
+ clientSecret,
+ BCRYPT_SALT_ROUNDS,
+ );
+
+ return { clientSecret, clientSecretHash };
+ }
+
+ private validateRedirectUris(uris: string[]): void {
+ for (const uri of uris) {
+ const result = validateRedirectUri(uri);
+
+ if (!result.valid) {
+ throw new ApplicationRegistrationException(
+ result.reason,
+ ApplicationRegistrationExceptionCode.INVALID_REDIRECT_URI,
+ );
+ }
+ }
+ }
+
+ private validateScopes(scopes: string[]): void {
+ const validScopes: readonly string[] = ALL_OAUTH_SCOPES;
+ const invalidScopes = scopes.filter(
+ (scope) => !validScopes.includes(scope),
+ );
+
+ if (invalidScopes.length > 0) {
+ throw new ApplicationRegistrationException(
+ `Invalid scopes: ${invalidScopes.join(', ')}`,
+ ApplicationRegistrationExceptionCode.INVALID_SCOPE,
+ );
+ }
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/constants/oauth-scopes.ts b/packages/twenty-server/src/engine/core-modules/application-registration/constants/oauth-scopes.ts
new file mode 100644
index 00000000000..474ad8f4be2
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/constants/oauth-scopes.ts
@@ -0,0 +1,16 @@
+// Scopes are a thin consent boundary shown to the user during OAuth authorization.
+// Actual permissions are enforced by the role assigned to the application at the
+// workspace level (object, field, and row-level permissions).
+export const OAUTH_SCOPES = {
+ API: 'api',
+ PROFILE: 'profile',
+} as const;
+
+export type OAuthScope = (typeof OAUTH_SCOPES)[keyof typeof OAUTH_SCOPES];
+
+export const ALL_OAUTH_SCOPES: OAuthScope[] = Object.values(OAUTH_SCOPES);
+
+export const OAUTH_SCOPE_DESCRIPTIONS: Record<OAuthScope, string> = {
+ [OAUTH_SCOPES.API]: 'Access workspace data according to the assigned role',
+ [OAUTH_SCOPES.PROFILE]: "Read the authenticated user's profile",
+};
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-discovery.controller.ts b/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-discovery.controller.ts
new file mode 100644
index 00000000000..4fdcc0e1932
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-discovery.controller.ts
@@ -0,0 +1,32 @@
+import { Controller, Get, UseGuards } from '@nestjs/common';
+
+import { ALL_OAUTH_SCOPES } from 'src/engine/core-modules/application-registration/constants/oauth-scopes';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
+import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';
+
+@Controller('.well-known')
+export class OAuthDiscoveryController {
+ constructor(private readonly twentyConfigService: TwentyConfigService) {}
+
+ @Get('oauth-authorization-server')
+ @UseGuards(PublicEndpointGuard, NoPermissionGuard)
+ getAuthorizationServerMetadata() {
+ const serverUrl = this.twentyConfigService.get('SERVER_URL');
+
+ return {
+ issuer: serverUrl,
+ authorization_endpoint: `${serverUrl}/authorize`,
+ token_endpoint: `${serverUrl}/oauth/token`,
+ scopes_supported: ALL_OAUTH_SCOPES,
+ response_types_supported: ['code'],
+ grant_types_supported: [
+ 'authorization_code',
+ 'client_credentials',
+ 'refresh_token',
+ ],
+ code_challenge_methods_supported: ['S256'],
+ token_endpoint_auth_methods_supported: ['client_secret_post', 'none'],
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-token.controller.ts b/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-token.controller.ts
new file mode 100644
index 00000000000..e6b2f574f97
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/controllers/oauth-token.controller.ts
@@ -0,0 +1,75 @@
+import {
+ Body,
+ Controller,
+ Post,
+ Res,
+ UseFilters,
+ UseGuards,
+ UsePipes,
+ ValidationPipe,
+} from '@nestjs/common';
+
+import { type Response } from 'express';
+
+import { OAuthTokenInput } from 'src/engine/core-modules/application-registration/dtos/oauth-token.input';
+import { OAuthService } from 'src/engine/core-modules/application-registration/oauth.service';
+import { OAuthErrorResponse } from 'src/engine/core-modules/application-registration/types/oauth-error-response.type';
+import { OAuthTokenResponse } from 'src/engine/core-modules/application-registration/types/oauth-token-response.type';
+import { AuthRestApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-rest-api-exception.filter';
+import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
+import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';
+
+@Controller('oauth')
+@UseFilters(AuthRestApiExceptionFilter)
+export class OAuthTokenController {
+ constructor(private readonly oauthService: OAuthService) {}
+
+ @Post('token')
+ @UseGuards(PublicEndpointGuard, NoPermissionGuard)
+ @UsePipes(new ValidationPipe())
+ async token(
+ @Body() body: OAuthTokenInput,
+ @Res({ passthrough: true }) res: Response,
+ ) {
+ let result: OAuthTokenResponse | OAuthErrorResponse;
+
+ switch (body.grant_type) {
+ case 'authorization_code':
+ result = await this.oauthService.exchangeAuthorizationCode({
+ authorizationCode: body.code ?? '',
+ clientId: body.client_id ?? '',
+ clientSecret: body.client_secret,
+ codeVerifier: body.code_verifier,
+ redirectUri: body.redirect_uri ?? '',
+ });
+ break;
+
+ case 'client_credentials':
+ result = await this.oauthService.clientCredentialsGrant({
+ clientId: body.client_id ?? '',
+ clientSecret: body.client_secret ?? '',
+ });
+ break;
+
+ case 'refresh_token':
+ result = await this.oauthService.refreshTokenGrant({
+ refreshToken: body.refresh_token ?? '',
+ clientId: body.client_id ?? '',
+ clientSecret: body.client_secret,
+ });
+ break;
+
+ default:
+ result = {
+ error: 'unsupported_grant_type',
+ error_description:
+ 'The provided grant_type is not supported. Supported values: authorization_code, client_credentials, refresh_token',
+ };
+ break;
+ }
+
+ res.status('error' in result ? 400 : 200);
+
+ return result;
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/application-registration-stats.dto.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/application-registration-stats.dto.ts
new file mode 100644
index 00000000000..0a2098c65d7
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/application-registration-stats.dto.ts
@@ -0,0 +1,22 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('VersionDistributionEntry')
+export class VersionDistributionEntryDTO {
+ @Field(() => String)
+ version: string;
+
+ @Field(() => Int)
+ count: number;
+}
+
+@ObjectType('ApplicationRegistrationStats')
+export class ApplicationRegistrationStatsDTO {
+ @Field(() => Int)
+ activeInstalls: number;
+
+ @Field(() => String, { nullable: true })
+ mostInstalledVersion: string | null;
+
+ @Field(() => [VersionDistributionEntryDTO])
+ versionDistribution: VersionDistributionEntryDTO[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration-variable.input.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration-variable.input.ts
new file mode 100644
index 00000000000..37c6906d4c7
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration-variable.input.ts
@@ -0,0 +1,37 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import {
+ IsBoolean,
+ IsOptional,
+ IsString,
+ IsUUID,
+ MaxLength,
+} from 'class-validator';
+
+@InputType()
+export class CreateApplicationRegistrationVariableInput {
+ @Field()
+ @IsUUID()
+ applicationRegistrationId: string;
+
+ @Field()
+ @IsString()
+ @MaxLength(256)
+ key: string;
+
+ @Field()
+ @IsString()
+ @MaxLength(10000)
+ value: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2000)
+ @IsOptional()
+ description?: string;
+
+ @Field({ nullable: true })
+ @IsBoolean()
+ @IsOptional()
+ isSecret?: boolean;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.dto.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.dto.ts
new file mode 100644
index 00000000000..92ce053b1ab
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.dto.ts
@@ -0,0 +1,12 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+
+@ObjectType('CreateApplicationRegistration')
+export class CreateApplicationRegistrationDTO {
+ @Field(() => ApplicationRegistrationEntity)
+ applicationRegistration: ApplicationRegistrationEntity;
+
+ @Field()
+ clientSecret: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.input.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.input.ts
new file mode 100644
index 00000000000..b5df254383a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/create-application-registration.input.ts
@@ -0,0 +1,69 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import {
+ ArrayMaxSize,
+ IsArray,
+ IsOptional,
+ IsString,
+ IsUUID,
+ MaxLength,
+} from 'class-validator';
+
+@InputType()
+export class CreateApplicationRegistrationInput {
+ @Field()
+ @IsString()
+ @MaxLength(256)
+ name: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2000)
+ @IsOptional()
+ description?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ logoUrl?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ author?: string;
+
+ @Field({ nullable: true })
+ @IsUUID()
+ @IsOptional()
+ universalIdentifier?: string;
+
+ @Field(() => [String], { nullable: true })
+ @IsArray()
+ @ArrayMaxSize(20)
+ @IsString({ each: true })
+ @MaxLength(2048, { each: true })
+ @IsOptional()
+ oAuthRedirectUris?: string[];
+
+ @Field(() => [String], { nullable: true })
+ @IsArray()
+ @ArrayMaxSize(50)
+ @IsString({ each: true })
+ @MaxLength(256, { each: true })
+ @IsOptional()
+ oAuthScopes?: string[];
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ websiteUrl?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ termsUrl?: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/oauth-token.input.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/oauth-token.input.ts
new file mode 100644
index 00000000000..2a7e668c070
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/oauth-token.input.ts
@@ -0,0 +1,37 @@
+import { IsOptional, IsString, MaxLength } from 'class-validator';
+
+export class OAuthTokenInput {
+ @IsString()
+ @MaxLength(50)
+ grant_type: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(512)
+ code?: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(2048)
+ redirect_uri?: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(256)
+ client_id?: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(512)
+ client_secret?: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(512)
+ code_verifier?: string;
+
+ @IsOptional()
+ @IsString()
+ @MaxLength(2048)
+ refresh_token?: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/rotate-client-secret.dto.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/rotate-client-secret.dto.ts
new file mode 100644
index 00000000000..81294350eff
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/rotate-client-secret.dto.ts
@@ -0,0 +1,7 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('RotateClientSecret')
+export class RotateClientSecretDTO {
+ @Field()
+ clientSecret: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration-variable.input.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration-variable.input.ts
new file mode 100644
index 00000000000..c11124f5b7a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration-variable.input.ts
@@ -0,0 +1,39 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { Type } from 'class-transformer';
+import {
+ IsNotEmpty,
+ IsOptional,
+ IsString,
+ IsUUID,
+ MaxLength,
+ ValidateNested,
+} from 'class-validator';
+
+@InputType()
+export class UpdateApplicationRegistrationVariablePayload {
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(10000)
+ @IsOptional()
+ value?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2000)
+ @IsOptional()
+ description?: string;
+}
+
+@InputType()
+export class UpdateApplicationRegistrationVariableInput {
+ @IsNotEmpty()
+ @Field()
+ @IsUUID()
+ id: string;
+
+ @Type(() => UpdateApplicationRegistrationVariablePayload)
+ @ValidateNested()
+ @Field(() => UpdateApplicationRegistrationVariablePayload)
+ update: UpdateApplicationRegistrationVariablePayload;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration.input.ts b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration.input.ts
new file mode 100644
index 00000000000..a8987afc6cb
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/dtos/update-application-registration.input.ts
@@ -0,0 +1,81 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { Type } from 'class-transformer';
+import {
+ ArrayMaxSize,
+ IsArray,
+ IsNotEmpty,
+ IsOptional,
+ IsString,
+ IsUUID,
+ MaxLength,
+ ValidateNested,
+} from 'class-validator';
+
+@InputType()
+export class UpdateApplicationRegistrationPayload {
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ name?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2000)
+ @IsOptional()
+ description?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ logoUrl?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(256)
+ @IsOptional()
+ author?: string;
+
+ @Field(() => [String], { nullable: true })
+ @IsArray()
+ @ArrayMaxSize(20)
+ @IsString({ each: true })
+ @MaxLength(2048, { each: true })
+ @IsOptional()
+ oAuthRedirectUris?: string[];
+
+ @Field(() => [String], { nullable: true })
+ @IsArray()
+ @ArrayMaxSize(50)
+ @IsString({ each: true })
+ @MaxLength(256, { each: true })
+ @IsOptional()
+ oAuthScopes?: string[];
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ websiteUrl?: string;
+
+ @Field({ nullable: true })
+ @IsString()
+ @MaxLength(2048)
+ @IsOptional()
+ termsUrl?: string;
+}
+
+@InputType()
+export class UpdateApplicationRegistrationInput {
+ @IsNotEmpty()
+ @Field()
+ @IsUUID()
+ id: string;
+
+ @Type(() => UpdateApplicationRegistrationPayload)
+ @ValidateNested()
+ @Field(() => UpdateApplicationRegistrationPayload)
+ update: UpdateApplicationRegistrationPayload;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/oauth.service.ts b/packages/twenty-server/src/engine/core-modules/application-registration/oauth.service.ts
new file mode 100644
index 00000000000..117b0859e60
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/oauth.service.ts
@@ -0,0 +1,395 @@
+import { Injectable, Logger } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import crypto from 'crypto';
+
+import ms from 'ms';
+import { IsNull, Repository } from 'typeorm';
+import { base64UrlEncode } from 'twenty-shared/utils';
+
+import {
+ AppTokenEntity,
+ AppTokenType,
+} from 'src/engine/core-modules/app-token/app-token.entity';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
+import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
+import { ApplicationService } from 'src/engine/core-modules/application/services/application.service';
+import { OAuthErrorResponse } from 'src/engine/core-modules/application-registration/types/oauth-error-response.type';
+import { OAuthTokenResponse } from 'src/engine/core-modules/application-registration/types/oauth-token-response.type';
+import { ApplicationTokenService } from 'src/engine/core-modules/auth/token/services/application-token.service';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
+
+@Injectable()
+export class OAuthService {
+ private readonly logger = new Logger(OAuthService.name);
+
+ constructor(
+ @InjectRepository(AppTokenEntity)
+ private readonly appTokenRepository: Repository<AppTokenEntity>,
+ @InjectRepository(ApplicationEntity)
+ private readonly applicationRepository: Repository<ApplicationEntity>,
+ @InjectRepository(UserWorkspaceEntity)
+ private readonly userWorkspaceRepository: Repository<UserWorkspaceEntity>,
+ private readonly applicationTokenService: ApplicationTokenService,
+ private readonly applicationRegistrationService: ApplicationRegistrationService,
+ private readonly applicationService: ApplicationService,
+ private readonly twentyConfigService: TwentyConfigService,
+ ) {}
+
+ async exchangeAuthorizationCode(params: {
+ authorizationCode: string;
+ clientId: string;
+ clientSecret?: string;
+ codeVerifier?: string;
+ redirectUri: string;
+ }): Promise<OAuthTokenResponse | OAuthErrorResponse> {
+ const {
+ authorizationCode,
+ clientId,
+ clientSecret,
+ codeVerifier,
+ redirectUri,
+ } = params;
+
+ if (!authorizationCode) {
+ return this.errorResponse(
+ 'invalid_request',
+ 'Authorization code is required',
+ );
+ }
+
+ const clientValidation = await this.validateClient(clientId);
+
+ if ('error' in clientValidation) {
+ return clientValidation;
+ }
+
+ const applicationRegistration = clientValidation;
+
+ if (clientSecret) {
+ const secretError = await this.validateClientSecret(
+ applicationRegistration,
+ clientSecret,
+ );
+
+ if (secretError) {
+ return secretError;
+ }
+ }
+
+ const authCodeToken = await this.appTokenRepository.findOne({
+ where: {
+ value: authorizationCode,
+ type: AppTokenType.AuthorizationCode,
+ revokedAt: IsNull(),
+ },
+ });
+
+ if (!authCodeToken) {
+ return this.errorResponse(
+ 'invalid_grant',
+ 'Authorization code not found',
+ );
+ }
+
+ if (authCodeToken.expiresAt.getTime() < Date.now()) {
+ return this.errorResponse('invalid_grant', 'Authorization code expired');
+ }
+
+ // RFC 6749 §4.1.3: redirect_uri must match the one used in the authorization request
+ const storedRedirectUri = authCodeToken.context?.redirectUri;
+
+ if (storedRedirectUri) {
+ if (!redirectUri) {
+ return this.errorResponse(
+ 'invalid_request',
+ 'redirect_uri is required',
+ );
+ }
+
+ if (redirectUri !== storedRedirectUri) {
+ return this.errorResponse(
+ 'invalid_grant',
+ 'redirect_uri does not match the one used in the authorization request',
+ );
+ }
+ }
+
+ if (codeVerifier) {
+ const pkceError = await this.validatePkce(codeVerifier, authCodeToken);
+
+ if (pkceError) {
+ return pkceError;
+ }
+ }
+
+ if (!clientSecret && !codeVerifier) {
+ return this.errorResponse(
+ 'invalid_request',
+ 'Either client_secret or code_verifier (PKCE) is required',
+ );
+ }
+
+ await this.appTokenRepository.update(authCodeToken.id, {
+ revokedAt: new Date(),
+ });
+
+ if (!authCodeToken.userId || !authCodeToken.workspaceId) {
+ return this.errorResponse(
+ 'server_error',
+ 'Authorization code is missing user or workspace context',
+ );
+ }
+
+ const application = await this.findOrInstallApplication(
+ applicationRegistration,
+ authCodeToken.workspaceId,
+ );
+
+ const userWorkspace = await this.userWorkspaceRepository.findOne({
+ where: {
+ userId: authCodeToken.userId,
+ workspaceId: authCodeToken.workspaceId,
+ },
+ });
+
+ const { applicationAccessToken, applicationRefreshToken } =
+ await this.applicationTokenService.generateApplicationTokenPair({
+ workspaceId: authCodeToken.workspaceId,
+ applicationId: application.id,
+ userId: authCodeToken.userId,
+ userWorkspaceId: userWorkspace?.id,
+ });
+
+ return {
+ access_token: applicationAccessToken.token,
+ token_type: 'Bearer',
+ expires_in: this.getAccessTokenExpiresInSeconds(),
+ refresh_token: applicationRefreshToken.token,
+ scope: applicationRegistration.oAuthScopes.join(' '),
+ };
+ }
+
+ async clientCredentialsGrant(params: {
+ clientId: string;
+ clientSecret: string;
+ }): Promise<OAuthTokenResponse | OAuthErrorResponse> {
+ const { clientId, clientSecret } = params;
+
+ const clientValidation = await this.validateClient(clientId);
+
+ if ('error' in clientValidation) {
+ return clientValidation;
+ }
+
+ const applicationRegistration = clientValidation;
+
+ const secretError = await this.validateClientSecret(
+ applicationRegistration,
+ clientSecret,
+ );
+
+ if (secretError) {
+ return secretError;
+ }
+
+ const applications = await this.applicationRepository.find({
+ where: { applicationRegistrationId: applicationRegistration.id },
+ });
+
+ if (applications.length === 0) {
+ return this.errorResponse(
+ 'server_error',
+ 'No workspace installation found for this client. Install the app in a workspace first.',
+ );
+ }
+
+ if (applications.length > 1) {
+ return this.errorResponse(
+ 'invalid_request',
+ 'Multiple workspace installations found. Client credentials grant requires exactly one installation.',
+ );
+ }
+
+ const application = applications[0];
+
+ const applicationAccessToken =
+ await this.applicationTokenService.generateApplicationAccessToken({
+ workspaceId: application.workspaceId,
+ applicationId: application.id,
+ });
+
+ return {
+ access_token: applicationAccessToken.token,
+ token_type: 'Bearer',
+ expires_in: this.getAccessTokenExpiresInSeconds(),
+ scope: applicationRegistration.oAuthScopes.join(' '),
+ };
+ }
+
+ async refreshTokenGrant(params: {
+ refreshToken: string;
+ clientId: string;
+ clientSecret?: string;
+ }): Promise<OAuthTokenResponse | OAuthErrorResponse> {
+ const { refreshToken, clientId, clientSecret } = params;
+
+ const clientValidation = await this.validateClient(clientId);
+
+ if ('error' in clientValidation) {
+ return clientValidation;
+ }
+
+ const applicationRegistration = clientValidation;
+
+ if (clientSecret) {
+ const secretError = await this.validateClientSecret(
+ applicationRegistration,
+ clientSecret,
+ );
+
+ if (secretError) {
+ return secretError;
+ }
+ }
+
+ try {
+ const payload =
+ this.applicationTokenService.validateApplicationRefreshToken(
+ refreshToken,
+ );
+
+ const { applicationAccessToken, applicationRefreshToken } =
+ await this.applicationTokenService.renewApplicationTokens(payload);
+
+ return {
+ access_token: applicationAccessToken.token,
+ token_type: 'Bearer',
+ expires_in: this.getAccessTokenExpiresInSeconds(),
+ refresh_token: applicationRefreshToken.token,
+ scope: applicationRegistration.oAuthScopes.join(' '),
+ };
+ } catch (error) {
+ this.logger.error('Refresh token grant failed', error);
+
+ return this.errorResponse(
+ 'invalid_grant',
+ 'Invalid or expired refresh token',
+ );
+ }
+ }
+
+ private async validateClient(
+ clientId: string,
+ ): Promise<ApplicationRegistrationEntity | OAuthErrorResponse> {
+ const applicationRegistration =
+ await this.applicationRegistrationService.findOneByClientId(clientId);
+
+ if (!applicationRegistration) {
+ return this.errorResponse('invalid_client', 'Client not found');
+ }
+
+ return applicationRegistration;
+ }
+
+ private async validateClientSecret(
+ applicationRegistration: ApplicationRegistrationEntity,
+ clientSecret: string,
+ ): Promise<OAuthErrorResponse | null> {
+ const isValid =
+ await this.applicationRegistrationService.verifyClientSecret(
+ applicationRegistration,
+ clientSecret,
+ );
+
+ if (!isValid) {
+ return this.errorResponse('invalid_client', 'Invalid client secret');
+ }
+
+ return null;
+ }
+
+ private async validatePkce(
+ codeVerifier: string,
+ authCodeToken: AppTokenEntity,
+ ): Promise<OAuthErrorResponse | null> {
+ const codeChallenge = base64UrlEncode(
+ crypto.createHash('sha256').update(codeVerifier).digest(),
+ );
+
+ const challengeToken = await this.appTokenRepository.findOne({
+ where: {
+ value: codeChallenge,
+ type: AppTokenType.CodeChallenge,
+ revokedAt: IsNull(),
+ ...(authCodeToken.userId ? { userId: authCodeToken.userId } : {}),
+ },
+ });
+
+ if (!challengeToken) {
+ return this.errorResponse(
+ 'invalid_grant',
+ 'Code verifier does not match the code challenge',
+ );
+ }
+
+ if (challengeToken.expiresAt.getTime() < Date.now()) {
+ return this.errorResponse('invalid_grant', 'Code challenge expired');
+ }
+
+ await this.appTokenRepository.update(challengeToken.id, {
+ revokedAt: new Date(),
+ });
+
+ return null;
+ }
+
+ private async findOrInstallApplication(
+ applicationRegistration: ApplicationRegistrationEntity,
+ workspaceId: string,
+ ): Promise<ApplicationEntity> {
+ const existingApplication = await this.applicationRepository.findOne({
+ where: {
+ applicationRegistrationId: applicationRegistration.id,
+ workspaceId,
+ },
+ });
+
+ if (existingApplication) {
+ return existingApplication;
+ }
+
+ this.logger.log(
+ `Auto-installing application "${applicationRegistration.name}" in workspace ${workspaceId}`,
+ );
+
+ // TODO: defaulting to version 0.0.0, build better system
+ return this.applicationService.create({
+ universalIdentifier: applicationRegistration.universalIdentifier,
+ name: applicationRegistration.name,
+ description: applicationRegistration.description,
+ version: '0.0.0',
+ sourcePath: 'oauth-install',
+ applicationRegistrationId: applicationRegistration.id,
+ workspaceId,
+ });
+ }
+
+ // OAuth RFC 6749 requires expires_in as seconds
+ private getAccessTokenExpiresInSeconds(): number {
+ const duration = this.twentyConfigService.get(
+ 'APPLICATION_ACCESS_TOKEN_EXPIRES_IN',
+ );
+
+ return Math.floor(ms(duration) / 1000);
+ }
+
+ private errorResponse(
+ error: string,
+ errorDescription: string,
+ ): OAuthErrorResponse {
+ return { error, error_description: errorDescription };
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-error-response.type.ts b/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-error-response.type.ts
new file mode 100644
index 00000000000..a79f7f2d972
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-error-response.type.ts
@@ -0,0 +1,4 @@
+export type OAuthErrorResponse = {
+ error: string;
+ error_description: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-token-response.type.ts b/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-token-response.type.ts
new file mode 100644
index 00000000000..78c9b41443b
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application-registration/types/oauth-token-response.type.ts
@@ -0,0 +1,7 @@
+export type OAuthTokenResponse = {
+ access_token: string;
+ token_type: string;
+ expires_in: number;
+ refresh_token?: string;
+ scope?: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-sync.module.ts b/packages/twenty-server/src/engine/core-modules/application/application-sync.module.ts
index 4ef27559779..a8e8c025e31 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-sync.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-sync.module.ts
@@ -1,6 +1,7 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
+import { ApplicationRegistrationModule } from 'src/engine/core-modules/application-registration/application-registration.module';
import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
import { ApplicationDevelopmentResolver } from 'src/engine/core-modules/application/resolvers/application-development.resolver';
import { ApplicationResolver } from 'src/engine/core-modules/application/resolvers/application.resolver';
@@ -24,6 +25,7 @@ import { CodeStepBuildModule } from 'src/modules/workflow/workflow-builder/workf
@Module({
imports: [
TypeOrmModule.forFeature([FileEntity]),
+ ApplicationRegistrationModule,
ApplicationModule,
ApplicationVariableEntityModule,
TokenModule,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application.entity.ts b/packages/twenty-server/src/engine/core-modules/application/application.entity.ts
index 19928dc1e2c..9f1057f91f5 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application.entity.ts
@@ -7,6 +7,7 @@ import {
Entity,
Index,
JoinColumn,
+ ManyToOne,
OneToMany,
OneToOne,
PrimaryGeneratedColumn,
@@ -14,6 +15,7 @@ import {
UpdateDateColumn,
} from 'typeorm';
+import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application-registration/application-registration.entity';
import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';
import { ApplicationVariableEntity } from 'src/engine/core-modules/applicationVariable/application-variable.entity';
import { AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
@@ -94,6 +96,16 @@ export class ApplicationEntity extends WorkspaceRelatedEntity {
@Column({ nullable: false, type: 'boolean', default: true })
canBeUninstalled: boolean;
+ @Column({ nullable: true, type: 'uuid' })
+ applicationRegistrationId: string | null;
+
+ @ManyToOne(() => ApplicationRegistrationEntity, {
+ onDelete: 'SET NULL',
+ nullable: true,
+ })
+ @JoinColumn({ name: 'applicationRegistrationId' })
+ applicationRegistration: Relation<ApplicationRegistrationEntity> | null;
+
@OneToMany(() => AgentEntity, (agent) => agent.application, {
onDelete: 'CASCADE',
})
diff --git a/packages/twenty-server/src/engine/core-modules/application/constants/application-entity-relation-properties.constant.ts b/packages/twenty-server/src/engine/core-modules/application/constants/application-entity-relation-properties.constant.ts
index d45d83c7879..4bc590b6d0a 100644
--- a/packages/twenty-server/src/engine/core-modules/application/constants/application-entity-relation-properties.constant.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/constants/application-entity-relation-properties.constant.ts
@@ -8,4 +8,5 @@ export const APPLICATION_ENTITY_RELATION_PROPERTIES = [
'applicationVariables',
'packageJsonFile',
'yarnLockFile',
+ 'applicationRegistration',
] as const satisfies (keyof ApplicationEntity)[];
diff --git a/packages/twenty-server/src/engine/core-modules/application/dtos/create-application.input.ts b/packages/twenty-server/src/engine/core-modules/application/dtos/create-application.input.ts
index a82d28ce964..2981656878d 100644
--- a/packages/twenty-server/src/engine/core-modules/application/dtos/create-application.input.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/dtos/create-application.input.ts
@@ -1,6 +1,6 @@
import { Field, InputType } from '@nestjs/graphql';
-import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
+import { IsNotEmpty, IsOptional, IsString, IsUUID } from 'class-validator';
@InputType()
export class CreateApplicationInput {
@@ -28,4 +28,9 @@ export class CreateApplicationInput {
@IsNotEmpty()
@Field()
sourcePath: string;
+
+ @IsUUID()
+ @IsOptional()
+ @Field({ nullable: true })
+ applicationRegistrationId?: string;
}
diff --git a/packages/twenty-server/src/engine/core-modules/application/dtos/workspace-migration.dto.ts b/packages/twenty-server/src/engine/core-modules/application/dtos/workspace-migration.dto.ts
index 7ff2d0e5016..047e7cc958b 100644
--- a/packages/twenty-server/src/engine/core-modules/application/dtos/workspace-migration.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/dtos/workspace-migration.dto.ts
@@ -2,7 +2,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
import GraphQLJSON from 'graphql-type-json';
-@ObjectType()
+@ObjectType('WorkspaceMigration')
export class WorkspaceMigrationDTO {
@Field(() => String)
applicationUniversalIdentifier: string;
diff --git a/packages/twenty-server/src/engine/core-modules/application/services/application-sync.service.ts b/packages/twenty-server/src/engine/core-modules/application/services/application-sync.service.ts
index 370323bbc7d..f3ad98490d8 100644
--- a/packages/twenty-server/src/engine/core-modules/application/services/application-sync.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/services/application-sync.service.ts
@@ -5,6 +5,8 @@ import { FileFolder } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { PackageJson } from 'type-fest';
+import { ApplicationRegistrationVariableService } from 'src/engine/core-modules/application-registration/application-registration-variable.service';
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
import {
ApplicationException,
@@ -38,6 +40,8 @@ export class ApplicationSyncService {
private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,
private readonly workspaceCacheService: WorkspaceCacheService,
private readonly fileStorageService: FileStorageService,
+ private readonly applicationRegistrationService: ApplicationRegistrationService,
+ private readonly applicationRegistrationVariableService: ApplicationRegistrationVariableService,
) {}
public async synchronizeFromManifest({
@@ -118,13 +122,41 @@ export class ApplicationSyncService {
},
);
+ const applicationRegistrationMetadata = {
+ name,
+ description: manifest.application.description,
+ logoUrl: manifest.application.logoUrl,
+ author: manifest.application.author,
+ websiteUrl: manifest.application.websiteUrl,
+ termsUrl: manifest.application.termsUrl,
+ };
+
+ const applicationRegistrationId =
+ await this.resolveApplicationRegistrationId(
+ application.applicationRegistrationId,
+ manifest.application.universalIdentifier,
+ applicationRegistrationMetadata,
+ );
+
+ await this.applicationRegistrationService.update({
+ id: applicationRegistrationId,
+ update: applicationRegistrationMetadata,
+ });
+
+ if (manifest.application.serverVariables) {
+ await this.applicationRegistrationVariableService.syncVariableSchemas(
+ applicationRegistrationId,
+ manifest.application.serverVariables,
+ );
+ }
+
return await this.applicationService.update(application.id, {
name,
description: manifest.application.description,
version: packageJson.version,
packageJsonChecksum: manifest.application.packageJsonChecksum,
yarnLockChecksum: manifest.application.yarnLockChecksum,
- //availablePackages: manifest.application.availablePackages, // TODO: compute available package in dev-mode-orchestrator
+ applicationRegistrationId,
});
}
@@ -204,4 +236,42 @@ export class ApplicationSyncService {
return validateAndBuildResult.workspaceMigration;
}
+
+ private async resolveApplicationRegistrationId(
+ existingId: string | null,
+ universalIdentifier: string,
+ metadata: {
+ name: string;
+ description?: string;
+ logoUrl?: string;
+ author?: string;
+ websiteUrl?: string;
+ termsUrl?: string;
+ },
+ ): Promise<string> {
+ if (existingId) {
+ return existingId;
+ }
+
+ const existingRegistration =
+ await this.applicationRegistrationService.findOneByUniversalIdentifier(
+ universalIdentifier,
+ );
+
+ if (existingRegistration) {
+ return existingRegistration.id;
+ }
+
+ const { applicationRegistration: newRegistration } =
+ await this.applicationRegistrationService.create(
+ { ...metadata, universalIdentifier },
+ null,
+ );
+
+ this.logger.log(
+ `Created app registration for ${metadata.name} (${universalIdentifier})`,
+ );
+
+ return newRegistration.id;
+ }
}
diff --git a/packages/twenty-server/src/engine/core-modules/application/services/marketplace.service.ts b/packages/twenty-server/src/engine/core-modules/application/services/marketplace.service.ts
index 9a9709e32f7..a3b49cc8bce 100644
--- a/packages/twenty-server/src/engine/core-modules/application/services/marketplace.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/services/marketplace.service.ts
@@ -191,9 +191,8 @@ export class MarketplaceService {
const packageJson = JSON.parse(packageJsonContent) as PackageJson;
const { application } = manifest;
- const marketplaceData = application.marketplaceData;
- if (!marketplaceData?.author || !marketplaceData?.category) {
+ if (!application.author || !application.category) {
return null;
}
@@ -258,14 +257,14 @@ export class MarketplaceService {
description: application.description ?? '',
icon: application.icon ?? 'IconApps',
version: packageJson.version ?? '0.1.0',
- author: marketplaceData.author,
- category: marketplaceData.category,
- logo: this.resolveAssetUrl(appPath, marketplaceData.logo),
- screenshots: this.resolveAssetUrls(appPath, marketplaceData.screenshots),
- aboutDescription: marketplaceData.aboutDescription ?? '',
- providers: marketplaceData.providers ?? [],
- websiteUrl: marketplaceData.websiteUrl,
- termsUrl: marketplaceData.termsUrl,
+ author: application.author,
+ category: application.category,
+ logo: this.resolveAssetUrl(appPath, application.logoUrl),
+ screenshots: this.resolveAssetUrls(appPath, application.screenshots),
+ aboutDescription: application.aboutDescription ?? '',
+ providers: application.providers ?? [],
+ websiteUrl: application.websiteUrl,
+ termsUrl: application.termsUrl,
objects,
fields,
logicFunctions,
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.module.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.module.ts
index 40c10fe42d6..1d124947a38 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.module.ts
@@ -4,6 +4,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { ApiKeyEntity } from 'src/engine/core-modules/api-key/api-key.entity';
import { ApiKeyModule } from 'src/engine/core-modules/api-key/api-key.module';
+import { ApplicationRegistrationModule } from 'src/engine/core-modules/application-registration/application-registration.module';
import { AppTokenEntity } from 'src/engine/core-modules/app-token/app-token.entity';
import { AppTokenService } from 'src/engine/core-modules/app-token/services/app-token.service';
import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
@@ -117,6 +118,7 @@ import { JwtAuthStrategy } from './strategies/jwt.auth.strategy';
AuditModule,
SubdomainManagerModule,
DomainServerConfigModule,
+ ApplicationRegistrationModule,
ApplicationModule,
WorkspaceCacheModule,
SecureHttpClientModule,
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
index ba26368d8ff..a6b5a961f16 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
@@ -24,7 +24,6 @@ import { PermissionsService } from 'src/engine/metadata-modules/permissions/perm
import { AuthResolver } from './auth.resolver';
import { AuthService } from './services/auth.service';
-// import { OAuthService } from './services/oauth.service';
import { ResetPasswordService } from './services/reset-password.service';
import { EmailVerificationTokenService } from './token/services/email-verification-token.service';
import { LoginTokenService } from './token/services/login-token.service';
@@ -139,10 +138,6 @@ describe('AuthResolver', () => {
}),
},
},
- // {
- // provide: OAuthService,
- // useValue: {},
- // },
],
})
.overrideGuard(CaptchaGuard)
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
index 2d364b3544c..855dda1cb7a 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
@@ -11,17 +11,16 @@ import { Repository } from 'typeorm';
import { ApiKeyTokenInput } from 'src/engine/core-modules/auth/dto/api-key-token.input';
import { AppTokenInput } from 'src/engine/core-modules/auth/dto/app-token.input';
-import { AuthorizeAppOutput } from 'src/engine/core-modules/auth/dto/authorize-app.dto';
+import { AuthorizeAppDTO } from 'src/engine/core-modules/auth/dto/authorize-app.dto';
import { AuthorizeAppInput } from 'src/engine/core-modules/auth/dto/authorize-app.input';
-import { EmailPasswordResetLinkOutput } from 'src/engine/core-modules/auth/dto/email-password-reset-link.dto';
+import { EmailPasswordResetLinkDTO } from 'src/engine/core-modules/auth/dto/email-password-reset-link.dto';
import { EmailPasswordResetLinkInput } from 'src/engine/core-modules/auth/dto/email-password-reset-link.input';
-import { InvalidatePasswordOutput } from 'src/engine/core-modules/auth/dto/invalidate-password.dto';
-import { TransientTokenOutput } from 'src/engine/core-modules/auth/dto/transient-token.dto';
+import { InvalidatePasswordDTO } from 'src/engine/core-modules/auth/dto/invalidate-password.dto';
+import { TransientTokenDTO } from 'src/engine/core-modules/auth/dto/transient-token.dto';
import { UpdatePasswordViaResetTokenInput } from 'src/engine/core-modules/auth/dto/update-password-via-reset-token.input';
-import { ValidatePasswordResetTokenOutput } from 'src/engine/core-modules/auth/dto/validate-password-reset-token.dto';
+import { ValidatePasswordResetTokenDTO } from 'src/engine/core-modules/auth/dto/validate-password-reset-token.dto';
import { ValidatePasswordResetTokenInput } from 'src/engine/core-modules/auth/dto/validate-password-reset-token.input';
import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter';
-// import { OAuthService } from 'src/engine/core-modules/auth/services/oauth.service';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
import { ApiKeyService } from 'src/engine/core-modules/api-key/services/api-key.service';
import { AppTokenEntity } from 'src/engine/core-modules/app-token/app-token.entity';
@@ -31,12 +30,12 @@ import {
AuthException,
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
-import { AvailableWorkspacesAndAccessTokensOutput } from 'src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.output';
+import { AvailableWorkspacesAndAccessTokensDTO } from 'src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.dto';
import { GetAuthTokenFromEmailVerificationTokenInput } from 'src/engine/core-modules/auth/dto/get-auth-token-from-email-verification-token.input';
import { GetAuthorizationUrlForSSOInput } from 'src/engine/core-modules/auth/dto/get-authorization-url-for-sso.input';
-import { GetAuthorizationUrlForSSOOutput } from 'src/engine/core-modules/auth/dto/get-authorization-url-for-sso.output';
-import { SignUpOutput } from 'src/engine/core-modules/auth/dto/sign-up.output';
-import { VerifyEmailAndGetLoginTokenOutput } from 'src/engine/core-modules/auth/dto/verify-email-and-get-login-token.output';
+import { GetAuthorizationUrlForSSODTO } from 'src/engine/core-modules/auth/dto/get-authorization-url-for-sso.dto';
+import { SignUpDTO } from 'src/engine/core-modules/auth/dto/sign-up.dto';
+import { VerifyEmailAndGetLoginTokenDTO } from 'src/engine/core-modules/auth/dto/verify-email-and-get-login-token.dto';
import { ResetPasswordService } from 'src/engine/core-modules/auth/services/reset-password.service';
import { SignInUpService } from 'src/engine/core-modules/auth/services/sign-in-up.service';
import { EmailVerificationTokenService } from 'src/engine/core-modules/auth/token/services/email-verification-token.service';
@@ -82,12 +81,12 @@ import { PermissionsGraphqlApiExceptionFilter } from 'src/engine/metadata-module
import { ApiKeyToken } from './dto/api-key-token.dto';
import { AuthTokens } from './dto/auth-tokens.dto';
import { GetAuthTokensFromLoginTokenInput } from './dto/get-auth-tokens-from-login-token.input';
-import { LoginTokenOutput } from './dto/login-token.dto';
+import { LoginTokenDTO } from './dto/login-token.dto';
import { SignUpInput } from './dto/sign-up.input';
import { UserCredentialsInput } from './dto/user-credentials.input';
-import { CheckUserExistOutput } from './dto/user-exists.dto';
+import { CheckUserExistDTO } from './dto/user-exists.dto';
import { EmailAndCaptchaInput } from './dto/user-exists.input';
-import { WorkspaceInviteHashValidOutput } from './dto/workspace-invite-hash-valid.dto';
+import { WorkspaceInviteHashValidDTO } from './dto/workspace-invite-hash-valid.dto';
import { WorkspaceInviteHashValidInput } from './dto/workspace-invite-hash.input';
import { AuthService } from './services/auth.service';
@@ -128,16 +127,16 @@ export class AuthResolver {
) {}
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
- @Query(() => CheckUserExistOutput)
+ @Query(() => CheckUserExistDTO)
async checkUserExists(
@Args() checkUserExistsInput: EmailAndCaptchaInput,
- ): Promise<CheckUserExistOutput> {
+ ): Promise<CheckUserExistDTO> {
return await this.authService.checkUserExists(
checkUserExistsInput.email.toLowerCase(),
);
}
- @Mutation(() => GetAuthorizationUrlForSSOOutput)
+ @Mutation(() => GetAuthorizationUrlForSSODTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async getAuthorizationUrlForSSO(
@Args('input') params: GetAuthorizationUrlForSSOInput,
@@ -148,11 +147,11 @@ export class AuthResolver {
);
}
- @Query(() => WorkspaceInviteHashValidOutput)
+ @Query(() => WorkspaceInviteHashValidDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async checkWorkspaceInviteHashIsValid(
@Args() workspaceInviteHashValidInput: WorkspaceInviteHashValidInput,
- ): Promise<WorkspaceInviteHashValidOutput> {
+ ): Promise<WorkspaceInviteHashValidDTO> {
return await this.authService.checkWorkspaceInviteHashIsValid(
workspaceInviteHashValidInput.inviteHash,
);
@@ -168,13 +167,13 @@ export class AuthResolver {
);
}
- @Mutation(() => LoginTokenOutput)
+ @Mutation(() => LoginTokenDTO)
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
async getLoginTokenFromCredentials(
@Args()
getLoginTokenFromCredentialsInput: UserCredentialsInput,
@Args('origin') origin: string,
- ): Promise<LoginTokenOutput> {
+ ): Promise<LoginTokenDTO> {
const workspace =
await this.workspaceDomainsService.getWorkspaceByOriginOrDefaultWorkspace(
origin,
@@ -203,12 +202,12 @@ export class AuthResolver {
return { loginToken };
}
- @Mutation(() => AvailableWorkspacesAndAccessTokensOutput)
+ @Mutation(() => AvailableWorkspacesAndAccessTokensDTO)
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
async signIn(
@Args()
userCredentials: UserCredentialsInput,
- ): Promise<AvailableWorkspacesAndAccessTokensOutput> {
+ ): Promise<AvailableWorkspacesAndAccessTokensDTO> {
const user =
await this.authService.validateLoginWithPassword(userCredentials);
@@ -241,7 +240,7 @@ export class AuthResolver {
};
}
- @Mutation(() => VerifyEmailAndGetLoginTokenOutput)
+ @Mutation(() => VerifyEmailAndGetLoginTokenDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async verifyEmailAndGetLoginToken(
@Args()
@@ -254,7 +253,10 @@ export class AuthResolver {
getAuthTokenFromEmailVerificationTokenInput,
);
- if (appToken.context && appToken.context.email !== appToken.user.email) {
+ if (
+ appToken.context?.email &&
+ appToken.context.email !== appToken.user.email
+ ) {
await this.userService.updateEmailFromVerificationToken(
appToken.user.id,
appToken.context.email,
@@ -283,7 +285,7 @@ export class AuthResolver {
return { loginToken, workspaceUrls };
}
- @Mutation(() => AvailableWorkspacesAndAccessTokensOutput)
+ @Mutation(() => AvailableWorkspacesAndAccessTokensDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async verifyEmailAndGetWorkspaceAgnosticToken(
@Args()
@@ -295,7 +297,10 @@ export class AuthResolver {
getAuthTokenFromEmailVerificationTokenInput,
);
- if (appToken.context && appToken.context.email !== appToken.user.email) {
+ if (
+ appToken.context?.email &&
+ appToken.context.email !== appToken.user.email
+ ) {
await this.userService.updateEmailFromVerificationToken(
appToken.user.id,
appToken.context.email,
@@ -373,11 +378,11 @@ export class AuthResolver {
return await this.authService.verify(email, workspace.id, authProvider);
}
- @Mutation(() => AvailableWorkspacesAndAccessTokensOutput)
+ @Mutation(() => AvailableWorkspacesAndAccessTokensDTO)
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
async signUp(
@Args() signUpInput: UserCredentialsInput,
- ): Promise<AvailableWorkspacesAndAccessTokensOutput> {
+ ): Promise<AvailableWorkspacesAndAccessTokensDTO> {
const user = await this.signInUpService.signUpWithoutWorkspace(
{
email: signUpInput.email,
@@ -426,12 +431,12 @@ export class AuthResolver {
};
}
- @Mutation(() => SignUpOutput)
+ @Mutation(() => SignUpDTO)
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
async signUpInWorkspace(
@Args() signUpInput: SignUpInput,
@AuthProvider() authProvider: AuthProviderEnum,
- ): Promise<SignUpOutput> {
+ ): Promise<SignUpDTO> {
const currentWorkspace = await this.authService.findWorkspaceForSignInUp({
workspaceInviteHash: signUpInput.workspaceInviteHash,
authProvider: AuthProviderEnum.Password,
@@ -500,12 +505,12 @@ export class AuthResolver {
};
}
- @Mutation(() => SignUpOutput)
+ @Mutation(() => SignUpDTO)
@UseGuards(UserAuthGuard, NoPermissionGuard)
async signUpInNewWorkspace(
@AuthUser() currentUser: UserEntity,
@AuthProvider() authProvider: AuthProviderEnum,
- ): Promise<SignUpOutput> {
+ ): Promise<SignUpDTO> {
const { user, workspace } = await this.signInUpService.signUpOnNewWorkspace(
{ type: 'existingUser', existingUser: currentUser },
);
@@ -525,12 +530,12 @@ export class AuthResolver {
};
}
- @Mutation(() => TransientTokenOutput)
+ @Mutation(() => TransientTokenDTO)
@UseGuards(UserAuthGuard, NoPermissionGuard)
async generateTransientToken(
@AuthUser() user: UserEntity,
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<TransientTokenOutput | void> {
+ ): Promise<TransientTokenDTO | void> {
const workspaceMember = await this.userService.loadWorkspaceMember(
user,
workspace,
@@ -771,13 +776,13 @@ export class AuthResolver {
};
}
- @Mutation(() => AuthorizeAppOutput)
+ @Mutation(() => AuthorizeAppDTO)
@UseGuards(UserAuthGuard, NoPermissionGuard)
async authorizeApp(
@Args() authorizeAppInput: AuthorizeAppInput,
@AuthUser() user: UserEntity,
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<AuthorizeAppOutput> {
+ ): Promise<AuthorizeAppDTO> {
return await this.authService.generateAuthorizationCode(
authorizeAppInput,
user,
@@ -811,12 +816,12 @@ export class AuthResolver {
);
}
- @Mutation(() => EmailPasswordResetLinkOutput)
+ @Mutation(() => EmailPasswordResetLinkDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async emailPasswordResetLink(
@Args() emailPasswordResetInput: EmailPasswordResetLinkInput,
@Context() context: I18nContext,
- ): Promise<EmailPasswordResetLinkOutput> {
+ ): Promise<EmailPasswordResetLinkDTO> {
const resetToken =
await this.resetPasswordService.generatePasswordResetToken(
emailPasswordResetInput.email,
@@ -830,12 +835,12 @@ export class AuthResolver {
);
}
- @Mutation(() => InvalidatePasswordOutput)
+ @Mutation(() => InvalidatePasswordDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async updatePasswordViaResetToken(
@Args()
{ passwordResetToken, newPassword }: UpdatePasswordViaResetTokenInput,
- ): Promise<InvalidatePasswordOutput> {
+ ): Promise<InvalidatePasswordDTO> {
const { id } =
await this.resetPasswordService.validatePasswordResetToken(
passwordResetToken,
@@ -846,11 +851,11 @@ export class AuthResolver {
return await this.resetPasswordService.invalidatePasswordResetToken(id);
}
- @Query(() => ValidatePasswordResetTokenOutput)
+ @Query(() => ValidatePasswordResetTokenDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async validatePasswordResetToken(
@Args() args: ValidatePasswordResetTokenInput,
- ): Promise<ValidatePasswordResetTokenOutput> {
+ ): Promise<ValidatePasswordResetTokenDTO> {
return this.resetPasswordService.validatePasswordResetToken(
args.passwordResetToken,
);
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/authorize-app.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/authorize-app.dto.ts
index 1b0ac5a1762..164c67dd5ec 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/authorize-app.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/authorize-app.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class AuthorizeAppOutput {
+@ObjectType('AuthorizeApp')
+export class AuthorizeAppDTO {
@Field(() => String)
redirectUrl: string;
}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.dto.ts
similarity index 69%
rename from packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.output.ts
rename to packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.dto.ts
index 51f3ef0aef6..20a24126aad 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.dto.ts
@@ -1,11 +1,11 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { AvailableWorkspaces } from 'src/engine/core-modules/auth/dto/available-workspaces.output';
+import { AvailableWorkspaces } from 'src/engine/core-modules/auth/dto/available-workspaces.dto';
import { AuthTokenPair } from './auth-token-pair.dto';
-@ObjectType()
-export class AvailableWorkspacesAndAccessTokensOutput {
+@ObjectType('AvailableWorkspacesAndAccessTokens')
+export class AvailableWorkspacesAndAccessTokensDTO {
@Field(() => AuthTokenPair)
tokens: AuthTokenPair;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.dto.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts
rename to packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.dto.ts
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/email-password-reset-link.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/email-password-reset-link.dto.ts
index fa305ec1cbb..b73fecdd256 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/email-password-reset-link.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/email-password-reset-link.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class EmailPasswordResetLinkOutput {
+@ObjectType('EmailPasswordResetLink')
+export class EmailPasswordResetLinkDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.dto.ts
index 551dae92919..b93b9c2f57a 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AuthToken } from 'src/engine/core-modules/auth/dto/auth-token.dto';
-@ObjectType()
-export class ExchangeAuthCodeOutput {
+@ObjectType('ExchangeAuthCode')
+export class ExchangeAuthCodeDTO {
@Field(() => AuthToken)
accessOrWorkspaceAgnosticToken: AuthToken;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.entity.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.entity.ts
deleted file mode 100644
index 1e80566a749..00000000000
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/exchange-auth-code.entity.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Field, ObjectType } from '@nestjs/graphql';
-
-import { AuthToken } from 'src/engine/core-modules/auth/dto/auth-token.dto';
-
-@ObjectType()
-export class ExchangeAuthCode {
- @Field(() => AuthToken)
- accessOrWorkspaceAgnosticToken: AuthToken;
-
- @Field(() => AuthToken)
- refreshToken: AuthToken;
-
- @Field(() => AuthToken)
- loginToken: AuthToken;
-}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.dto.ts
similarity index 83%
rename from packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.output.ts
rename to packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.dto.ts
index 95b05312254..8cf30e641b6 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/get-authorization-url-for-sso.dto.ts
@@ -5,8 +5,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { type SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
-@ObjectType()
-export class GetAuthorizationUrlForSSOOutput {
+@ObjectType('GetAuthorizationUrlForSSO')
+export class GetAuthorizationUrlForSSODTO {
@Field(() => String)
authorizationURL: string;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/invalidate-password.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/invalidate-password.dto.ts
index 57ab2018e35..b7f1887009d 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/invalidate-password.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/invalidate-password.dto.ts
@@ -1,7 +1,7 @@
import { ObjectType, Field } from '@nestjs/graphql';
-@ObjectType()
-export class InvalidatePasswordOutput {
+@ObjectType('InvalidatePassword')
+export class InvalidatePasswordDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/login-token.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/login-token.dto.ts
index 148ad88e266..a30688ef728 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/login-token.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/login-token.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AuthToken } from 'src/engine/core-modules/auth/dto/auth-token.dto';
-@ObjectType()
-export class LoginTokenOutput {
+@ObjectType('LoginToken')
+export class LoginTokenDTO {
@Field(() => AuthToken)
loginToken: AuthToken;
}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.dto.ts
similarity index 85%
rename from packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts
rename to packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.dto.ts
index be3b4567495..b76aca7997f 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.dto.ts
@@ -4,8 +4,8 @@ import { WorkspaceUrlsAndIdDTO } from 'src/engine/core-modules/workspace/dtos/wo
import { AuthToken } from './auth-token.dto';
-@ObjectType('SignUpOutput')
-export class SignUpOutput {
+@ObjectType('SignUp')
+export class SignUpDTO {
@Field(() => AuthToken)
loginToken: AuthToken;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/transient-token.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/transient-token.dto.ts
index 1584e465958..479f977b74c 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/transient-token.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/transient-token.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AuthToken } from 'src/engine/core-modules/auth/dto/auth-token.dto';
-@ObjectType()
-export class TransientTokenOutput {
+@ObjectType('TransientToken')
+export class TransientTokenDTO {
@Field(() => AuthToken)
transientToken: AuthToken;
}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/update-password.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/update-password.dto.ts
index cc9c8325c2d..2edb1138193 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/update-password.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/update-password.dto.ts
@@ -1,7 +1,7 @@
import { ObjectType, Field } from '@nestjs/graphql';
-@ObjectType()
-export class UpdatePasswordOutput {
+@ObjectType('UpdatePassword')
+export class UpdatePasswordDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/user-exists.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/user-exists.dto.ts
index a6ff467b7af..2e539d73bbe 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/user-exists.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/user-exists.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class CheckUserExistOutput {
+@ObjectType('CheckUserExist')
+export class CheckUserExistDTO {
@Field(() => Boolean)
exists: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/validate-password-reset-token.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/validate-password-reset-token.dto.ts
index 3bb4e515efa..198ef1200f7 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/validate-password-reset-token.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/validate-password-reset-token.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType()
-export class ValidatePasswordResetTokenOutput {
+@ObjectType('ValidatePasswordResetToken')
+export class ValidatePasswordResetTokenDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.dto.ts
similarity index 76%
rename from packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.output.ts
rename to packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.dto.ts
index bd35bd589a0..09a5285fafd 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/verify-email-and-get-login-token.dto.ts
@@ -4,8 +4,8 @@ import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspa
import { AuthToken } from './auth-token.dto';
-@ObjectType('VerifyEmailAndGetLoginTokenOutput')
-export class VerifyEmailAndGetLoginTokenOutput {
+@ObjectType('VerifyEmailAndGetLoginToken')
+export class VerifyEmailAndGetLoginTokenDTO {
@Field(() => AuthToken)
loginToken: AuthToken;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto.ts
index b2c88d05891..d49699ca0c0 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class WorkspaceInviteHashValidOutput {
+@ObjectType('WorkspaceInviteHashValid')
+export class WorkspaceInviteHashValidDTO {
@Field(() => Boolean)
isValid: boolean;
}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.spec.ts
index 75427edb430..f74c554d21a 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.spec.ts
@@ -29,6 +29,7 @@ import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { WorkspaceInvitationService } from 'src/engine/core-modules/workspace-invitation/services/workspace-invitation.service';
import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/workspace.type';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
import { PermissionsService } from 'src/engine/metadata-modules/permissions/permissions.service';
import { AuthService } from './auth.service';
@@ -169,6 +170,10 @@ describe('AuthService', () => {
.mockResolvedValue(false),
},
},
+ {
+ provide: ApplicationRegistrationService,
+ useValue: {},
+ },
],
}).compile();
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
index 743a2e1f3c9..301d5c15935 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
@@ -13,8 +13,7 @@ import { AppPath } from 'twenty-shared/types';
import { assertIsDefinedOrThrow, isDefined } from 'twenty-shared/utils';
import { IsNull, Repository } from 'typeorm';
-import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
-
+import { ApplicationRegistrationService } from 'src/engine/core-modules/application-registration/application-registration.service';
import {
AppTokenEntity,
AppTokenType,
@@ -30,12 +29,13 @@ import {
hashPassword,
} from 'src/engine/core-modules/auth/auth.util';
import { type AuthTokens } from 'src/engine/core-modules/auth/dto/auth-tokens.dto';
-import { type AuthorizeAppOutput } from 'src/engine/core-modules/auth/dto/authorize-app.dto';
+import { validateRedirectUri } from 'src/engine/core-modules/auth/utils/validate-redirect-uri.util';
+import { type AuthorizeAppDTO } from 'src/engine/core-modules/auth/dto/authorize-app.dto';
import { type AuthorizeAppInput } from 'src/engine/core-modules/auth/dto/authorize-app.input';
-import { type UpdatePasswordOutput } from 'src/engine/core-modules/auth/dto/update-password.dto';
+import { type UpdatePasswordDTO } from 'src/engine/core-modules/auth/dto/update-password.dto';
import { type UserCredentialsInput } from 'src/engine/core-modules/auth/dto/user-credentials.input';
-import { type CheckUserExistOutput } from 'src/engine/core-modules/auth/dto/user-exists.dto';
-import { type WorkspaceInviteHashValidOutput } from 'src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto';
+import { type CheckUserExistDTO } from 'src/engine/core-modules/auth/dto/user-exists.dto';
+import { type WorkspaceInviteHashValidDTO } from 'src/engine/core-modules/auth/dto/workspace-invite-hash-valid.dto';
import { AuthSsoService } from 'src/engine/core-modules/auth/services/auth-sso.service';
import { SignInUpService } from 'src/engine/core-modules/auth/services/sign-in-up.service';
import { type GoogleRequest } from 'src/engine/core-modules/auth/strategies/google.auth.strategy';
@@ -94,6 +94,7 @@ export class AuthService {
private readonly appTokenRepository: Repository<AppTokenEntity>,
private readonly i18nService: I18nService,
private readonly auditService: AuditService,
+ private readonly applicationRegistrationService: ApplicationRegistrationService,
) {}
private async checkAccessAndUseInvitationOrThrow(
@@ -467,7 +468,7 @@ export class AuthService {
).flat(2).length;
}
- async checkUserExists(email: string): Promise<CheckUserExistOutput> {
+ async checkUserExists(email: string): Promise<CheckUserExistDTO> {
const user = await this.userService.findUserByEmail(email);
const isUserExist = isDefined(user);
@@ -482,7 +483,7 @@ export class AuthService {
async checkWorkspaceInviteHashIsValid(
inviteHash: string,
- ): Promise<WorkspaceInviteHashValidOutput> {
+ ): Promise<WorkspaceInviteHashValidDTO> {
const workspace = await this.workspaceRepository.findOneBy({
inviteHash,
});
@@ -494,51 +495,54 @@ export class AuthService {
authorizeAppInput: AuthorizeAppInput,
user: UserEntity,
workspace: WorkspaceEntity,
- ): Promise<AuthorizeAppOutput> {
- // TODO: replace with db call to - third party app table
- const apps = [
- {
- id: 'chrome',
- name: 'Chrome Extension',
- redirectUrl:
- this.twentyConfigService.get('NODE_ENV') ===
- NodeEnvironment.DEVELOPMENT
- ? authorizeAppInput.redirectUrl
- : `https://${this.twentyConfigService.get(
- 'CHROME_EXTENSION_ID',
- )}.chromiumapp.org/`,
- },
- ];
-
+ ): Promise<AuthorizeAppDTO> {
const { clientId, codeChallenge } = authorizeAppInput;
- const client = apps.find((app) => app.id === clientId);
+ const applicationRegistration =
+ await this.applicationRegistrationService.findOneByClientId(clientId);
- if (!client) {
+ if (!applicationRegistration) {
throw new AuthException(
`Client not found for '${clientId}'`,
AuthExceptionCode.CLIENT_NOT_FOUND,
);
}
- if (!client.redirectUrl || !authorizeAppInput.redirectUrl) {
+ if (!authorizeAppInput.redirectUrl) {
throw new AuthException(
- `redirectUrl not found for '${clientId}'`,
+ `redirectUrl not provided for '${clientId}'`,
AuthExceptionCode.FORBIDDEN_EXCEPTION,
);
}
- if (client.redirectUrl !== authorizeAppInput.redirectUrl) {
+ if (
+ !applicationRegistration.oAuthRedirectUris.includes(
+ authorizeAppInput.redirectUrl,
+ )
+ ) {
throw new AuthException(
`redirectUrl mismatch for '${clientId}'`,
AuthExceptionCode.FORBIDDEN_EXCEPTION,
);
}
+ const redirectUriValidation = validateRedirectUri(
+ authorizeAppInput.redirectUrl,
+ );
+
+ if (!redirectUriValidation.valid) {
+ throw new AuthException(
+ redirectUriValidation.reason,
+ AuthExceptionCode.FORBIDDEN_EXCEPTION,
+ );
+ }
+
const authorizationCode = crypto.randomBytes(42).toString('hex');
const expiresAt = addMilliseconds(new Date().getTime(), ms('5m'));
+ const authCodeContext = { redirectUri: authorizeAppInput.redirectUrl };
+
if (codeChallenge) {
const tokens = this.appTokenRepository.create([
{
@@ -554,6 +558,7 @@ export class AuthService {
userId: user.id,
workspaceId: workspace.id,
expiresAt,
+ context: authCodeContext,
},
]);
@@ -565,22 +570,24 @@ export class AuthService {
userId: user.id,
workspaceId: workspace.id,
expiresAt,
+ context: authCodeContext,
});
await this.appTokenRepository.save(token);
}
- const redirectUrl = `${
- client.redirectUrl ? client.redirectUrl : authorizeAppInput.redirectUrl
- }?authorizationCode=${authorizationCode}`;
+ redirectUriValidation.parsed.searchParams.set(
+ 'authorizationCode',
+ authorizationCode,
+ );
- return { redirectUrl };
+ return { redirectUrl: redirectUriValidation.parsed.toString() };
}
async updatePassword(
userId: string,
newPassword: string,
- ): Promise<UpdatePasswordOutput> {
+ ): Promise<UpdatePasswordDTO> {
if (!userId) {
throw new AuthException(
'User ID is required',
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/oauth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/oauth.service.ts
deleted file mode 100644
index a76c40744d9..00000000000
--- a/packages/twenty-server/src/engine/core-modules/auth/services/oauth.service.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-// import { Injectable } from '@nestjs/common';
-// import { InjectRepository } from '@nestjs/typeorm';
-//
-// import crypto from 'crypto';
-//
-// import { Repository } from 'typeorm';
-//
-// import { AppTokenEntity } from 'src/engine/core-modules/app-token/app-token.entity';
-// import {
-// AuthException,
-// AuthExceptionCode,
-// } from 'src/engine/core-modules/auth/auth.exception';
-// import { ExchangeAuthCode } from 'src/engine/core-modules/auth/dto/exchange-auth-code.entity';
-// import { ExchangeAuthCodeInput } from 'src/engine/core-modules/auth/dto/exchange-auth-code.input';
-// import { AccessTokenService } from 'src/engine/core-modules/auth/token/services/access-token.service';
-// import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
-// import { RefreshTokenService } from 'src/engine/core-modules/auth/token/services/refresh-token.service';
-// import { UserEntity } from 'src/engine/core-modules/user/user.entity';
-// import { userValidator } from 'src/engine/core-modules/user/user.validate';
-//
-// @Injectable()
-// export class OAuthService {
-// constructor(
-// @InjectRepository(UserEntity)
-// private readonly userRepository: Repository<UserEntity>,
-// @InjectRepository(AppTokenEntity)
-// private readonly appTokenRepository: Repository<AppTokenEntity>,
-// private readonly accessTokenService: AccessTokenService,
-// private readonly refreshTokenService: RefreshTokenService,
-// private readonly loginTokenService: LoginTokenService,
-// ) {}
-//
-// async verifyAuthorizationCode(
-// exchangeAuthCodeInput: ExchangeAuthCodeInput,
-// ): Promise<ExchangeAuthCode> {
-// const { authorizationCode, codeVerifier } = exchangeAuthCodeInput;
-//
-// if (!authorizationCode) {
-// throw new AuthException(
-// 'Authorization code not found',
-// AuthExceptionCode.INVALID_INPUT,
-// );
-// }
-//
-// let userId = '';
-//
-// if (codeVerifier) {
-// const authorizationCodeAppToken = await this.appTokenRepository.findOne({
-// where: {
-// value: authorizationCode,
-// },
-// });
-//
-// if (!authorizationCodeAppToken) {
-// throw new AuthException(
-// 'Authorization code does not exist',
-// AuthExceptionCode.INVALID_INPUT,
-// );
-// }
-//
-// if (!(authorizationCodeAppToken.expiresAt.getTime() >= Date.now())) {
-// throw new AuthException(
-// 'Authorization code expired.',
-// AuthExceptionCode.FORBIDDEN_EXCEPTION,
-// );
-// }
-//
-// const codeChallenge = crypto
-// .createHash('sha256')
-// .update(codeVerifier)
-// .digest()
-// .toString('base64')
-// .replace(/\+/g, '-')
-// .replace(/\//g, '_')
-// .replace(/=/g, '');
-//
-// const codeChallengeAppToken = await this.appTokenRepository.findOne({
-// where: {
-// value: codeChallenge,
-// },
-// });
-//
-// if (!codeChallengeAppToken || !codeChallengeAppToken.userId) {
-// throw new AuthException(
-// 'code verifier doesnt match the challenge',
-// AuthExceptionCode.FORBIDDEN_EXCEPTION,
-// );
-// }
-//
-// if (!(codeChallengeAppToken.expiresAt.getTime() >= Date.now())) {
-// throw new AuthException(
-// 'code challenge expired.',
-// AuthExceptionCode.FORBIDDEN_EXCEPTION,
-// );
-// }
-//
-// if (codeChallengeAppToken.userId !== authorizationCodeAppToken.userId) {
-// throw new AuthException(
-// 'authorization code / code verifier was not created by same client',
-// AuthExceptionCode.FORBIDDEN_EXCEPTION,
-// );
-// }
-//
-// if (codeChallengeAppToken.revokedAt) {
-// throw new AuthException(
-// 'Token has been revoked.',
-// AuthExceptionCode.FORBIDDEN_EXCEPTION,
-// );
-// }
-//
-// await this.appTokenRepository.save({
-// id: codeChallengeAppToken.id,
-// revokedAt: new Date(),
-// });
-//
-// userId = codeChallengeAppToken.userId;
-// }
-//
-// const user = await this.userRepository.findOne({
-// where: { id: userId },
-// relations: ['defaultWorkspace'],
-// });
-//
-// userValidator.assertIsDefinedOrThrow(
-// user,
-// new AuthException(
-// 'User who generated the token does not exist',
-// AuthExceptionCode.INVALID_INPUT,
-// ),
-// );
-//
-// if (!user.defaultWorkspace) {
-// throw new AuthException(
-// 'User does not have a default workspace',
-// AuthExceptionCode.INVALID_DATA,
-// );
-// }
-//
-// const accessToken = await this.accessTokenService.generateAccessToken(
-// user.id,
-// user.defaultWorkspaceId,
-// );
-// const refreshToken = await this.refreshTokenService.generateRefreshToken(
-// user.id,
-// user.defaultWorkspaceId,
-// );
-// const loginToken = await this.loginTokenService.generateLoginToken(
-// user.email,
-// );
-//
-// return {
-// accessToken,
-// refreshToken,
-// loginToken,
-// };
-// }
-// }
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts
index f214391e2cd..b96cfb24967 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/reset-password.service.ts
@@ -25,10 +25,10 @@ import {
AuthException,
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
-import { type EmailPasswordResetLinkOutput } from 'src/engine/core-modules/auth/dto/email-password-reset-link.dto';
-import { type InvalidatePasswordOutput } from 'src/engine/core-modules/auth/dto/invalidate-password.dto';
+import { type EmailPasswordResetLinkDTO } from 'src/engine/core-modules/auth/dto/email-password-reset-link.dto';
+import { type InvalidatePasswordDTO } from 'src/engine/core-modules/auth/dto/invalidate-password.dto';
import { type PasswordResetToken } from 'src/engine/core-modules/auth/dto/password-reset-token.dto';
-import { type ValidatePasswordResetTokenOutput } from 'src/engine/core-modules/auth/dto/validate-password-reset-token.dto';
+import { type ValidatePasswordResetTokenDTO } from 'src/engine/core-modules/auth/dto/validate-password-reset-token.dto';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
import { EmailService } from 'src/engine/core-modules/email/email.service';
import { I18nService } from 'src/engine/core-modules/i18n/i18n.service';
@@ -119,7 +119,7 @@ export class ResetPasswordService {
resetToken: PasswordResetToken,
email: string,
locale: keyof typeof APP_LOCALES,
- ): Promise<EmailPasswordResetLinkOutput> {
+ ): Promise<EmailPasswordResetLinkDTO> {
const user = await this.userService.findUserByEmailOrThrow(
email,
new AuthException('User not found', AuthExceptionCode.INVALID_INPUT),
@@ -180,7 +180,7 @@ export class ResetPasswordService {
async validatePasswordResetToken(
resetToken: string,
- ): Promise<ValidatePasswordResetTokenOutput> {
+ ): Promise<ValidatePasswordResetTokenDTO> {
const hashedResetToken = crypto
.createHash('sha256')
.update(resetToken)
@@ -216,7 +216,7 @@ export class ResetPasswordService {
async invalidatePasswordResetToken(
userId: string,
- ): Promise<InvalidatePasswordOutput> {
+ ): Promise<InvalidatePasswordDTO> {
const user = await this.userService.findUserByIdOrThrow(
userId,
new AuthException('User not found', AuthExceptionCode.INVALID_INPUT),
diff --git a/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.spec.ts
index 38de866c041..07c2c554a8d 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.spec.ts
@@ -259,9 +259,13 @@ describe('JwtAuthStrategy', () => {
);
await expect(strategy.validate(payload as JwtPayload)).rejects.toThrow(
- new AuthException('User not found', expect.any(String), {
- userFriendlyMessage: msg`User does not have access to this workspace.`,
- }),
+ new AuthException(
+ 'User or user workspace not found',
+ expect.any(String),
+ {
+ userFriendlyMessage: msg`User does not have access to this workspace`,
+ },
+ ),
);
try {
@@ -301,15 +305,19 @@ describe('JwtAuthStrategy', () => {
);
await expect(strategy.validate(payload as JwtPayload)).rejects.toThrow(
- new AuthException('UserWorkspaceEntity not found', expect.any(String), {
- userFriendlyMessage: msg`User does not have access to this workspace.`,
- }),
+ new AuthException(
+ 'User or user workspace not found',
+ expect.any(String),
+ {
+ userFriendlyMessage: msg`User does not have access to this workspace`,
+ },
+ ),
);
try {
await strategy.validate(payload as JwtPayload);
} catch (e) {
- expect(e.code).toBe(AuthExceptionCode.USER_WORKSPACE_NOT_FOUND);
+ expect(e.code).toBe(AuthExceptionCode.USER_NOT_FOUND);
}
});
diff --git a/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.ts b/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.ts
index 7a2b3406fa3..e1886643faa 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/strategies/jwt.auth.strategy.ts
@@ -145,17 +145,6 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
);
}
- user = await this.userRepository.findOne({
- where: { id: userId },
- });
-
- if (!isDefined(user)) {
- throw new AuthException(
- 'User not found',
- AuthExceptionCode.USER_NOT_FOUND,
- );
- }
-
if (!payload.userWorkspaceId) {
throw new AuthException(
'UserWorkspaceEntity not found',
@@ -163,29 +152,31 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
);
}
- const userWorkspace = await this.userWorkspaceRepository.findOne({
- where: { id: payload.userWorkspaceId },
- relations: ['user', 'workspace'],
+ const userContext = await this.resolveUserContext({
+ userId,
+ userWorkspaceId: payload.userWorkspaceId,
});
assertIsDefinedOrThrow(
- userWorkspace,
+ userContext,
new AuthException(
- 'UserWorkspaceEntity not found',
- AuthExceptionCode.USER_WORKSPACE_NOT_FOUND,
+ 'User or user workspace not found',
+ AuthExceptionCode.USER_NOT_FOUND,
{
userFriendlyMessage: msg`User does not have access to this workspace`,
},
),
);
+ user = userContext.user;
+
context = {
...context,
user,
workspace,
authProvider: payload.authProvider,
- userWorkspace,
- userWorkspaceId: userWorkspace.id,
+ userWorkspace: userContext.userWorkspace,
+ userWorkspaceId: userContext.userWorkspace.id,
workspaceMemberId: payload.workspaceMemberId,
};
@@ -225,6 +216,41 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
};
}
+ private async resolveUserContext(params: {
+ userId: string;
+ userWorkspaceId: string;
+ expectedWorkspaceId?: string;
+ }): Promise<{
+ user: UserEntity;
+ userWorkspace: UserWorkspaceEntity;
+ } | null> {
+ const user = await this.userRepository.findOne({
+ where: { id: params.userId },
+ });
+
+ if (!isDefined(user)) {
+ return null;
+ }
+
+ const userWorkspace = await this.userWorkspaceRepository.findOne({
+ where: { id: params.userWorkspaceId },
+ relations: ['user', 'workspace'],
+ });
+
+ if (!isDefined(userWorkspace)) {
+ return null;
+ }
+
+ if (
+ isDefined(params.expectedWorkspaceId) &&
+ userWorkspace.workspace.id !== params.expectedWorkspaceId
+ ) {
+ return null;
+ }
+
+ return { user, userWorkspace };
+ }
+
private async validateImpersonation(payload: AccessTokenJwtPayload) {
// Validate required impersonation fields
if (
@@ -359,12 +385,23 @@ export class JwtAuthStrategy extends PassportStrategy(Strategy, 'jwt') {
);
}
- // TODO: Token carries userId/userWorkspaceId but they are unused.
- // Compute the intersection of user and application permissions instead.
- return {
- application,
- workspace,
- };
+ const context: AuthContext = { application, workspace };
+
+ if (payload.userId && payload.userWorkspaceId) {
+ const userContext = await this.resolveUserContext({
+ userId: payload.userId,
+ userWorkspaceId: payload.userWorkspaceId,
+ expectedWorkspaceId: workspace.id,
+ });
+
+ if (isDefined(userContext)) {
+ context.user = userContext.user;
+ context.userWorkspace = userContext.userWorkspace;
+ context.userWorkspaceId = userContext.userWorkspace.id;
+ }
+ }
+
+ return context;
}
private isLegacyApiKeyPayload(
diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.spec.ts
index 7519a53abf2..4b36ce941da 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.spec.ts
@@ -12,6 +12,7 @@ import {
import { ApplicationTokenService } from 'src/engine/core-modules/auth/token/services/application-token.service';
import { JwtTokenTypeEnum } from 'src/engine/core-modules/auth/types/auth-context.type';
import { JwtWrapperService } from 'src/engine/core-modules/jwt/services/jwt-wrapper.service';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { WorkspaceException } from 'src/engine/core-modules/workspace/workspace.exception';
@@ -43,6 +44,12 @@ describe('ApplicationTokenService', () => {
provide: getRepositoryToken(WorkspaceEntity),
useClass: Repository,
},
+ {
+ provide: TwentyConfigService,
+ useValue: {
+ get: jest.fn().mockReturnValue('1h'),
+ },
+ },
],
}).compile();
@@ -79,7 +86,6 @@ describe('ApplicationTokenService', () => {
const result = await service.generateApplicationAccessToken({
workspaceId,
applicationId,
- expiresInSeconds: 10,
});
expect(result).toEqual({
@@ -117,7 +123,6 @@ describe('ApplicationTokenService', () => {
applicationId,
userWorkspaceId,
userId,
- expiresInSeconds: 10,
});
expect(result).toEqual({
@@ -151,7 +156,6 @@ describe('ApplicationTokenService', () => {
service.generateApplicationAccessToken({
applicationId: 'non-existent-application',
workspaceId: 'workspace-id',
- expiresInSeconds: 10,
}),
).rejects.toThrow(ApplicationException);
});
@@ -163,7 +167,6 @@ describe('ApplicationTokenService', () => {
service.generateApplicationAccessToken({
applicationId: 'application-id',
workspaceId: 'non-existent-workspace',
- expiresInSeconds: 10,
}),
).rejects.toThrow(WorkspaceException);
});
diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.ts
index d8da0feeedd..8eeb250a2cd 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/application-token.service.ts
@@ -24,9 +24,8 @@ import {
AuthException,
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
-const APPLICATION_ACCESS_TOKEN_EXPIRY_SECONDS = 1800;
-const APPLICATION_REFRESH_TOKEN_EXPIRY_SECONDS = 60 * 60 * 24 * 60; // 60 days
const APPLICATION_REFRESH_TOKEN_INVALID_OR_EXPIRED_MESSAGE =
'Application refresh token invalid or expired';
@@ -39,6 +38,7 @@ export class ApplicationTokenService {
private readonly workspaceRepository: Repository<WorkspaceEntity>,
@InjectRepository(ApplicationEntity)
private readonly applicationRepository: Repository<ApplicationEntity>,
+ private readonly twentyConfigService: TwentyConfigService,
) {}
async generateApplicationAccessToken({
@@ -46,23 +46,25 @@ export class ApplicationTokenService {
applicationId,
userWorkspaceId,
userId,
- expiresInSeconds = APPLICATION_ACCESS_TOKEN_EXPIRY_SECONDS,
}: {
workspaceId: string;
applicationId: string;
userWorkspaceId?: string;
userId?: string;
- expiresInSeconds?: number;
}): Promise<AuthToken> {
await this.validateWorkspaceAndApplication(workspaceId, applicationId);
+ const expiresIn = this.twentyConfigService.get(
+ 'APPLICATION_ACCESS_TOKEN_EXPIRES_IN',
+ );
+
return this.signApplicationToken({
workspaceId,
applicationId,
userWorkspaceId,
userId,
tokenType: JwtTokenTypeEnum.APPLICATION_ACCESS,
- expiresInSeconds,
+ expiresIn,
});
}
@@ -82,27 +84,31 @@ export class ApplicationTokenService {
}> {
await this.validateWorkspaceAndApplication(workspaceId, applicationId);
- const [applicationAccessToken, applicationRefreshToken] = await Promise.all(
- [
- this.signApplicationToken({
- workspaceId,
- applicationId,
- userWorkspaceId,
- userId,
- tokenType: JwtTokenTypeEnum.APPLICATION_ACCESS,
- expiresInSeconds: APPLICATION_ACCESS_TOKEN_EXPIRY_SECONDS,
- }),
- this.signApplicationToken({
- workspaceId,
- applicationId,
- userWorkspaceId,
- userId,
- tokenType: JwtTokenTypeEnum.APPLICATION_REFRESH,
- expiresInSeconds: APPLICATION_REFRESH_TOKEN_EXPIRY_SECONDS,
- }),
- ],
+ const accessTokenExpiresIn = this.twentyConfigService.get(
+ 'APPLICATION_ACCESS_TOKEN_EXPIRES_IN',
+ );
+ const refreshTokenExpiresIn = this.twentyConfigService.get(
+ 'APPLICATION_REFRESH_TOKEN_EXPIRES_IN',
);
+ const applicationAccessToken = this.signApplicationToken({
+ workspaceId,
+ applicationId,
+ userWorkspaceId,
+ userId,
+ tokenType: JwtTokenTypeEnum.APPLICATION_ACCESS,
+ expiresIn: accessTokenExpiresIn,
+ });
+
+ const applicationRefreshToken = this.signApplicationToken({
+ workspaceId,
+ applicationId,
+ userWorkspaceId,
+ userId,
+ tokenType: JwtTokenTypeEnum.APPLICATION_REFRESH,
+ expiresIn: refreshTokenExpiresIn,
+ });
+
return { applicationAccessToken, applicationRefreshToken };
}
@@ -188,7 +194,7 @@ export class ApplicationTokenService {
userWorkspaceId,
userId,
tokenType,
- expiresInSeconds,
+ expiresIn,
}: {
workspaceId: string;
applicationId: string;
@@ -197,9 +203,8 @@ export class ApplicationTokenService {
tokenType:
| JwtTokenTypeEnum.APPLICATION_ACCESS
| JwtTokenTypeEnum.APPLICATION_REFRESH;
- expiresInSeconds: number;
+ expiresIn: string;
}): AuthToken {
- const expiresIn = `${expiresInSeconds}s`;
const expiresAt = addMilliseconds(new Date().getTime(), ms(expiresIn));
const jwtPayload:
diff --git a/packages/twenty-server/src/engine/core-modules/auth/utils/validate-redirect-uri.util.ts b/packages/twenty-server/src/engine/core-modules/auth/utils/validate-redirect-uri.util.ts
new file mode 100644
index 00000000000..acb39fb2c34
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/auth/utils/validate-redirect-uri.util.ts
@@ -0,0 +1,31 @@
+// RFC 6749 redirect URI validation: must be absolute, HTTPS (except localhost), no fragments
+export const validateRedirectUri = (
+ uri: string,
+): { valid: true; parsed: URL } | { valid: false; reason: string } => {
+ let parsed: URL;
+
+ try {
+ parsed = new URL(uri);
+ } catch {
+ return { valid: false, reason: `Invalid redirect URI: ${uri}` };
+ }
+
+ const isLocalhost =
+ parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1';
+
+ if (parsed.protocol !== 'https:' && !isLocalhost) {
+ return {
+ valid: false,
+ reason: `Redirect URIs must use HTTPS (except localhost): ${uri}`,
+ };
+ }
+
+ if (parsed.hash) {
+ return {
+ valid: false,
+ reason: `Redirect URIs must not contain fragments: ${uri}`,
+ };
+ }
+
+ return { valid: true, parsed };
+};
diff --git a/packages/twenty-server/src/engine/core-modules/billing/billing.resolver.ts b/packages/twenty-server/src/engine/core-modules/billing/billing.resolver.ts
index a96d5af31a4..c363f9027f2 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/billing.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/billing.resolver.ts
@@ -10,11 +10,11 @@ import { type ApiKeyEntity } from 'src/engine/core-modules/api-key/api-key.entit
import { BillingCheckoutSessionInput } from 'src/engine/core-modules/billing/dtos/inputs/billing-checkout-session.input';
import { BillingSessionInput } from 'src/engine/core-modules/billing/dtos/inputs/billing-session.input';
import { BillingUpdateSubscriptionItemPriceInput } from 'src/engine/core-modules/billing/dtos/inputs/billing-update-subscription-item-price.input';
-import { BillingEndTrialPeriodOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-end-trial-period.output';
-import { BillingMeteredProductUsageOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-metered-product-usage.output';
-import { BillingPlanOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-plan.output';
-import { BillingSessionOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-session.output';
-import { BillingUpdateOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-update.output';
+import { BillingEndTrialPeriodDTO } from 'src/engine/core-modules/billing/dtos/billing-end-trial-period.dto';
+import { BillingMeteredProductUsageDTO } from 'src/engine/core-modules/billing/dtos/billing-metered-product-usage.dto';
+import { BillingPlanDTO } from 'src/engine/core-modules/billing/dtos/billing-plan.dto';
+import { BillingSessionDTO } from 'src/engine/core-modules/billing/dtos/billing-session.dto';
+import { BillingUpdateDTO } from 'src/engine/core-modules/billing/dtos/billing-update.dto';
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
import { BillingPlanService } from 'src/engine/core-modules/billing/services/billing-plan.service';
import { BillingPortalWorkspaceService } from 'src/engine/core-modules/billing/services/billing-portal.workspace-service';
@@ -65,7 +65,7 @@ export class BillingResolver {
private readonly permissionsService: PermissionsService,
) {}
- @Query(() => BillingSessionOutput)
+ @Query(() => BillingSessionDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -82,7 +82,7 @@ export class BillingResolver {
};
}
- @Mutation(() => BillingSessionOutput)
+ @Mutation(() => BillingSessionDTO)
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, NoPermissionGuard)
async checkoutSession(
@AuthWorkspace() workspace: WorkspaceEntity,
@@ -143,7 +143,7 @@ export class BillingResolver {
}
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -165,7 +165,7 @@ export class BillingResolver {
};
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -185,7 +185,7 @@ export class BillingResolver {
};
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -205,7 +205,7 @@ export class BillingResolver {
};
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -229,7 +229,7 @@ export class BillingResolver {
};
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
@@ -255,22 +255,22 @@ export class BillingResolver {
};
}
- @Query(() => [BillingPlanOutput])
+ @Query(() => [BillingPlanDTO])
@UseGuards(WorkspaceAuthGuard, NoPermissionGuard)
- async listPlans(): Promise<BillingPlanOutput[]> {
+ async listPlans(): Promise<BillingPlanDTO[]> {
const plans = await this.billingPlanService.listPlans();
return plans.map(formatBillingDatabaseProductToGraphqlDTO);
}
- @Mutation(() => BillingEndTrialPeriodOutput)
+ @Mutation(() => BillingEndTrialPeriodDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
)
async endSubscriptionTrialPeriod(
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<BillingEndTrialPeriodOutput> {
+ ): Promise<BillingEndTrialPeriodDTO> {
const result =
await this.billingSubscriptionService.endTrialPeriod(workspace);
@@ -295,14 +295,14 @@ export class BillingResolver {
};
}
- @Query(() => [BillingMeteredProductUsageOutput])
+ @Query(() => [BillingMeteredProductUsageDTO])
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
)
async getMeteredProductsUsage(
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<BillingMeteredProductUsageOutput[]> {
+ ): Promise<BillingMeteredProductUsageDTO[]> {
const usageData =
await this.billingUsageService.getMeteredProductsUsage(workspace);
@@ -316,7 +316,7 @@ export class BillingResolver {
}));
}
- @Mutation(() => BillingUpdateOutput)
+ @Mutation(() => BillingUpdateDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.BILLING),
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-end-trial-period.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-end-trial-period.dto.ts
similarity index 89%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-end-trial-period.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-end-trial-period.dto.ts
index 20f3001ebd7..fc62ce6a77f 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-end-trial-period.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-end-trial-period.dto.ts
@@ -4,8 +4,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
-@ObjectType()
-export class BillingEndTrialPeriodOutput {
+@ObjectType('BillingEndTrialPeriod')
+export class BillingEndTrialPeriodDTO {
@Field(() => SubscriptionStatus, {
description: 'Updated subscription status',
nullable: true,
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-metered-product-usage.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-metered-product-usage.dto.ts
similarity index 86%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-metered-product-usage.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-metered-product-usage.dto.ts
index 95b938bbac1..9ae5b1e35cd 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-metered-product-usage.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-metered-product-usage.dto.ts
@@ -2,8 +2,8 @@ import { Field, Float, ObjectType } from '@nestjs/graphql';
import { BillingProductKey } from 'src/engine/core-modules/billing/enums/billing-product-key.enum';
-@ObjectType()
-export class BillingMeteredProductUsageOutput {
+@ObjectType('BillingMeteredProductUsage')
+export class BillingMeteredProductUsageDTO {
@Field(() => BillingProductKey)
productKey: BillingProductKey;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-plan.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-plan.dto.ts
similarity index 90%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-plan.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-plan.dto.ts
index 07932980fff..b5495d219a3 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-plan.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-plan.dto.ts
@@ -8,8 +8,8 @@ import {
} from 'src/engine/core-modules/billing/dtos/billing-product.dto';
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
-@ObjectType()
-export class BillingPlanOutput {
+@ObjectType('BillingPlan')
+export class BillingPlanDTO {
@Field(() => BillingPlanKey)
planKey: BillingPlanKey;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-price.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price.dto.ts
similarity index 87%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-price.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price.dto.ts
index 11b31718a0c..ebc5e4a5aad 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-price.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price.dto.ts
@@ -4,8 +4,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
-@ObjectType()
-export class BillingPriceOutput {
+@ObjectType('BillingPrice')
+export class BillingPriceDTO {
@Field(() => Number)
upTo: number;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-session.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-session.dto.ts
similarity index 69%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-session.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-session.dto.ts
index 66c19d94d0f..d0ce4bfa879 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-session.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-session.dto.ts
@@ -2,8 +2,8 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class BillingSessionOutput {
+@ObjectType('BillingSession')
+export class BillingSessionDTO {
@Field(() => String, { nullable: true })
url: string;
}
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-subscription-item.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-item.dto.ts
similarity index 94%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-subscription-item.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-item.dto.ts
index d08a74fd830..5aa23a04f0c 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-subscription-item.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-item.dto.ts
@@ -7,7 +7,7 @@ import { IDField } from '@ptc-org/nestjs-query-graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { BillingProductDTO } from 'src/engine/core-modules/billing/dtos/billing-product.dto';
-@ObjectType()
+@ObjectType('BillingSubscriptionItem')
export class BillingSubscriptionItemDTO {
@IDField(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-update.output.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-update.dto.ts
similarity index 89%
rename from packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-update.output.ts
rename to packages/twenty-server/src/engine/core-modules/billing/dtos/billing-update.dto.ts
index 0b51571f694..026c37938f4 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/outputs/billing-update.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-update.dto.ts
@@ -4,8 +4,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
-@ObjectType()
-export class BillingUpdateOutput {
+@ObjectType('BillingUpdate')
+export class BillingUpdateDTO {
@Field(() => BillingSubscriptionEntity, {
description: 'Current billing subscription',
})
diff --git a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
index 786979585b6..1a763a98202 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
@@ -38,7 +38,7 @@ export type CancellationDetailsJson = {
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { BillingSubscriptionSchedulePhaseDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
-import { BillingSubscriptionItemDTO } from 'src/engine/core-modules/billing/dtos/outputs/billing-subscription-item.output';
+import { BillingSubscriptionItemDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-item.dto';
import { BillingCustomerEntity } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
import { BillingSubscriptionItemEntity } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-usage.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-usage.service.ts
index 17b485dcf6c..08057a68dc1 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-usage.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-usage.service.ts
@@ -10,7 +10,7 @@ import {
BillingException,
BillingExceptionCode,
} from 'src/engine/core-modules/billing/billing.exception';
-import { type BillingMeteredProductUsageOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-metered-product-usage.output';
+import { type BillingMeteredProductUsageDTO } from 'src/engine/core-modules/billing/dtos/billing-metered-product-usage.dto';
import { BillingCustomerEntity } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
import { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
@@ -90,7 +90,7 @@ export class BillingUsageService {
async getMeteredProductsUsage(
workspace: WorkspaceEntity,
- ): Promise<BillingMeteredProductUsageOutput[]> {
+ ): Promise<BillingMeteredProductUsageDTO[]> {
const subscription =
await this.billingSubscriptionService.getCurrentBillingSubscriptionOrThrow(
{ workspaceId: workspace.id },
@@ -146,7 +146,7 @@ export class BillingUsageService {
>[number],
periodStart: Date,
periodEnd: Date,
- ): Promise<BillingMeteredProductUsageOutput> {
+ ): Promise<BillingMeteredProductUsageDTO> {
const meterEventsSum =
await this.stripeBillingMeterEventService.sumMeterEvents(
item.stripeMeterId,
diff --git a/packages/twenty-server/src/engine/core-modules/billing/utils/format-database-product-to-graphql-dto.util.ts b/packages/twenty-server/src/engine/core-modules/billing/utils/format-database-product-to-graphql-dto.util.ts
index cd5c9dcf980..0da8598904c 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/utils/format-database-product-to-graphql-dto.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/utils/format-database-product-to-graphql-dto.util.ts
@@ -2,7 +2,7 @@
import { type BillingPriceLicensedDTO } from 'src/engine/core-modules/billing/dtos/billing-price-licensed.dto';
import { type BillingPriceMeteredDTO } from 'src/engine/core-modules/billing/dtos/billing-price-metered.dto';
-import { type BillingPlanOutput } from 'src/engine/core-modules/billing/dtos/outputs/billing-plan.output';
+import { type BillingPlanDTO } from 'src/engine/core-modules/billing/dtos/billing-plan.dto';
import { type BillingPriceEntity } from 'src/engine/core-modules/billing/entities/billing-price.entity';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
@@ -11,7 +11,7 @@ import { toDisplayCredits } from 'src/engine/core-modules/billing/utils/to-displ
export const formatBillingDatabaseProductToGraphqlDTO = (
plan: BillingGetPlanResult,
-): BillingPlanOutput => {
+): BillingPlanDTO => {
return {
planKey: plan.planKey,
licensedProducts: plan.licensedProducts.map((product) => {
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
index f594eece774..e3c504af86b 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
@@ -5,7 +5,7 @@ import { SupportDriver } from 'src/engine/core-modules/twenty-config/interfaces/
import { BillingTrialPeriodDTO } from 'src/engine/core-modules/billing/dtos/billing-trial-period.dto';
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
-import { AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+import { AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data.dto';
import {
InferenceProvider,
ModelFamily,
@@ -90,8 +90,8 @@ export class AdminAIModelConfig {
isRecommended?: boolean;
}
-@ObjectType()
-export class AdminAIModelsOutput {
+@ObjectType('AdminAIModels')
+export class AdminAIModelsDTO {
@Field(() => Boolean)
autoEnableNewModels: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
index 08dc7e0b0fe..512963f3b37 100644
--- a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
@@ -7,6 +7,7 @@ import { ActorModule } from 'src/engine/core-modules/actor/actor.module';
import { AdminPanelModule } from 'src/engine/core-modules/admin-panel/admin-panel.module';
import { ApiKeyModule } from 'src/engine/core-modules/api-key/api-key.module';
import { AppTokenModule } from 'src/engine/core-modules/app-token/app-token.module';
+import { ApplicationRegistrationModule } from 'src/engine/core-modules/application-registration/application-registration.module';
import { ApplicationSyncModule } from 'src/engine/core-modules/application/application-sync.module';
import { ApplicationModule } from 'src/engine/core-modules/application/application.module';
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
@@ -88,6 +89,7 @@ import { FileModule } from './file/file.module';
FileModule,
RowLevelPermissionModule,
OpenApiModule,
+ ApplicationRegistrationModule,
ApplicationModule,
ApplicationSyncModule,
AppTokenModule,
diff --git a/packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.output.ts b/packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.dto.ts
similarity index 63%
rename from packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.output.ts
rename to packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.dto.ts
index 57434c5644e..d9639fff499 100644
--- a/packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/email-verification/dtos/resend-email-verification-token.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { IsBoolean } from 'class-validator';
-@ObjectType()
-export class ResendEmailVerificationTokenOutput {
+@ObjectType('ResendEmailVerificationToken')
+export class ResendEmailVerificationTokenDTO {
@IsBoolean()
@Field(() => Boolean)
success: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/email-verification/email-verification.resolver.ts b/packages/twenty-server/src/engine/core-modules/email-verification/email-verification.resolver.ts
index aeda0a4159a..1ef39442d4e 100644
--- a/packages/twenty-server/src/engine/core-modules/email-verification/email-verification.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/email-verification/email-verification.resolver.ts
@@ -4,7 +4,7 @@ import { Args, Context, Mutation } from '@nestjs/graphql';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
import { ResendEmailVerificationTokenInput } from 'src/engine/core-modules/email-verification/dtos/resend-email-verification-token.input';
-import { ResendEmailVerificationTokenOutput } from 'src/engine/core-modules/email-verification/dtos/resend-email-verification-token.output';
+import { ResendEmailVerificationTokenDTO } from 'src/engine/core-modules/email-verification/dtos/resend-email-verification-token.dto';
import { EmailVerificationExceptionFilter } from 'src/engine/core-modules/email-verification/email-verification-exception-filter.util';
import { EmailVerificationService } from 'src/engine/core-modules/email-verification/services/email-verification.service';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
@@ -26,14 +26,14 @@ export class EmailVerificationResolver {
) {}
// TODO: this should be an authenticated endpoint
- @Mutation(() => ResendEmailVerificationTokenOutput)
+ @Mutation(() => ResendEmailVerificationTokenDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async resendEmailVerificationToken(
@Args()
resendEmailVerificationTokenInput: ResendEmailVerificationTokenInput,
@Args('origin') origin: string,
@Context() context: I18nContext,
- ): Promise<ResendEmailVerificationTokenOutput> {
+ ): Promise<ResendEmailVerificationTokenDTO> {
const workspace =
await this.workspaceDomainsService.getWorkspaceByOriginOrDefaultWorkspace(
origin,
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
index 5e47f61772d..8023e402735 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
@@ -18,7 +18,7 @@ registerEnumType(EmailingDomainStatus, {
});
@ObjectType('EmailingDomain')
-export class EmailingDomainDto {
+export class EmailingDomainDTO {
@IDField(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
index 3cce1f994a3..b262f2c9468 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
@@ -5,7 +5,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
import { EmailingDomainDriver } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain';
-import { EmailingDomainDto } from 'src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto';
+import { EmailingDomainDTO } from 'src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto';
import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -18,16 +18,16 @@ import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
SettingsPermissionGuard(PermissionFlagType.WORKSPACE),
)
@UsePipes(ResolverValidationPipe)
-@MetadataResolver(() => EmailingDomainDto)
+@MetadataResolver(() => EmailingDomainDTO)
export class EmailingDomainResolver {
constructor(private readonly emailingDomainService: EmailingDomainService) {}
- @Mutation(() => EmailingDomainDto)
+ @Mutation(() => EmailingDomainDTO)
async createEmailingDomain(
@Args('domain') domain: string,
@Args('driver') driver: EmailingDomainDriver,
@AuthWorkspace() currentWorkspace: WorkspaceEntity,
- ): Promise<EmailingDomainDto> {
+ ): Promise<EmailingDomainDTO> {
const emailingDomain =
await this.emailingDomainService.createEmailingDomain(
domain,
@@ -48,11 +48,11 @@ export class EmailingDomainResolver {
return true;
}
- @Mutation(() => EmailingDomainDto)
+ @Mutation(() => EmailingDomainDTO)
async verifyEmailingDomain(
@Args('id') id: string,
@AuthWorkspace() currentWorkspace: WorkspaceEntity,
- ): Promise<EmailingDomainDto> {
+ ): Promise<EmailingDomainDTO> {
const emailingDomain =
await this.emailingDomainService.verifyEmailingDomain(
currentWorkspace,
@@ -62,10 +62,10 @@ export class EmailingDomainResolver {
return emailingDomain;
}
- @Query(() => [EmailingDomainDto])
+ @Query(() => [EmailingDomainDTO])
async getEmailingDomains(
@AuthWorkspace() currentWorkspace: WorkspaceEntity,
- ): Promise<EmailingDomainDto[]> {
+ ): Promise<EmailingDomainDTO[]> {
const emailingDomains =
await this.emailingDomainService.getEmailingDomains(currentWorkspace);
diff --git a/packages/twenty-server/src/engine/core-modules/event-logs/dtos/event-log-result.output.ts b/packages/twenty-server/src/engine/core-modules/event-logs/dtos/event-log-result.dto.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/event-logs/dtos/event-log-result.output.ts
rename to packages/twenty-server/src/engine/core-modules/event-logs/dtos/event-log-result.dto.ts
diff --git a/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.resolver.ts b/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.resolver.ts
index d28bf44d429..3afeb849958 100644
--- a/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.resolver.ts
@@ -21,7 +21,7 @@ import { PermissionsGraphqlApiExceptionFilter } from 'src/engine/metadata-module
import { EventLogsService } from './event-logs.service';
import { EventLogQueryInput } from './dtos/event-log-query.input';
-import { EventLogQueryResult } from './dtos/event-log-result.output';
+import { EventLogQueryResult } from './dtos/event-log-result.dto';
@MetadataResolver()
@UseFilters(
diff --git a/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.service.ts b/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.service.ts
index 3eb0eddb1c1..27df68a40ec 100644
--- a/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/event-logs/event-logs.service.ts
@@ -23,7 +23,7 @@ import { EventLogQueryInput } from './dtos/event-log-query.input';
import {
EventLogQueryResult,
EventLogRecord,
-} from './dtos/event-log-result.output';
+} from './dtos/event-log-result.dto';
type ClickHouseEventRecord = {
event?: string;
diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag-dto.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag.dto.ts
similarity index 92%
rename from packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag-dto.ts
rename to packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag.dto.ts
index 24ecc2505e7..82c6c075cde 100644
--- a/packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag-dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/feature-flag/dtos/feature-flag.dto.ts
@@ -4,7 +4,7 @@ import { Column } from 'typeorm';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
-@ObjectType('FeatureFlagDTO')
+@ObjectType('FeatureFlag')
export class FeatureFlagDTO {
@Field(() => FeatureFlagKey)
@Column({ nullable: false, type: 'text' })
diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts
index b32fb39034d..e5978286c71 100644
--- a/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.entity.ts
@@ -1,6 +1,5 @@
-import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
+import { registerEnumType } from '@nestjs/graphql';
-import { IDField } from '@ptc-org/nestjs-query-graphql';
import {
Column,
CreateDateColumn,
@@ -10,23 +9,18 @@ import {
UpdateDateColumn,
} from 'typeorm';
-import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { WorkspaceRelatedEntity } from 'src/engine/workspace-manager/types/workspace-related-entity';
@Entity({ name: 'featureFlag', schema: 'core' })
-@ObjectType('FeatureFlag')
@Unique('IDX_FEATURE_FLAG_KEY_WORKSPACE_ID_UNIQUE', ['key', 'workspaceId'])
export class FeatureFlagEntity extends WorkspaceRelatedEntity {
- @IDField(() => UUIDScalarType)
@PrimaryGeneratedColumn('uuid')
id: string;
- @Field(() => FeatureFlagKey)
@Column({ nullable: false, type: 'text' })
key: FeatureFlagKey;
- @Field()
@Column({ nullable: false })
value: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.module.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.module.ts
index 07846854b94..97c266761df 100644
--- a/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/feature-flag/feature-flag.module.ts
@@ -1,7 +1,5 @@
import { Module } from '@nestjs/common';
-
-import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
-import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
+import { TypeOrmModule } from '@nestjs/typeorm';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
@@ -12,11 +10,7 @@ import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache
@Module({
imports: [
TypeORMModule,
- NestjsQueryGraphQLModule.forFeature({
- imports: [NestjsQueryTypeOrmModule.forFeature([FeatureFlagEntity])],
- services: [],
- resolvers: [],
- }),
+ TypeOrmModule.forFeature([FeatureFlagEntity]),
WorkspaceFeatureFlagsMapCacheModule,
WorkspaceCacheModule,
],
diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/services/feature-flag.service.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/services/feature-flag.service.ts
index 66e9a68340c..9429a1f8aa4 100644
--- a/packages/twenty-server/src/engine/core-modules/feature-flag/services/feature-flag.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/feature-flag/services/feature-flag.service.ts
@@ -5,7 +5,7 @@ import { Repository } from 'typeorm';
import { type FeatureFlagMap } from 'src/engine/core-modules/feature-flag/interfaces/feature-flag-map.interface';
-import { type FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag-dto';
+import { type FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag.dto';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import {
diff --git a/packages/twenty-server/src/engine/core-modules/file/dtos/file-with-sign-url.dto.ts b/packages/twenty-server/src/engine/core-modules/file/dtos/file-with-sign-url.dto.ts
index 6b8fd9b1e20..235be18ddb6 100644
--- a/packages/twenty-server/src/engine/core-modules/file/dtos/file-with-sign-url.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/dtos/file-with-sign-url.dto.ts
@@ -3,7 +3,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
@ObjectType('FileWithSignedUrl')
-export class FileWithSignedUrlDto {
+export class FileWithSignedUrlDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/file/file-core-picture/resolvers/file-core-picture.resolver.ts b/packages/twenty-server/src/engine/core-modules/file/file-core-picture/resolvers/file-core-picture.resolver.ts
index 03125156914..66733c574c5 100644
--- a/packages/twenty-server/src/engine/core-modules/file/file-core-picture/resolvers/file-core-picture.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/file-core-picture/resolvers/file-core-picture.resolver.ts
@@ -7,7 +7,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import type { FileUpload } from 'graphql-upload/processRequest.mjs';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FileCorePictureService } from 'src/engine/core-modules/file/file-core-picture/services/file-core-picture.service';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
@@ -31,7 +31,7 @@ export class FileCorePictureResolver {
private readonly fileCorePictureService: FileCorePictureService,
) {}
- @Mutation(() => FileWithSignedUrlDto)
+ @Mutation(() => FileWithSignedUrlDTO)
@UseGuards(
WorkspaceAuthGuard,
SettingsPermissionGuard(PermissionFlagType.WORKSPACE),
@@ -40,7 +40,7 @@ export class FileCorePictureResolver {
@AuthWorkspace() workspace: WorkspaceEntity,
@Args({ name: 'file', type: () => GraphQLUpload })
{ createReadStream, filename }: FileUpload,
- ): Promise<FileWithSignedUrlDto> {
+ ): Promise<FileWithSignedUrlDTO> {
const buffer = await streamToBuffer(createReadStream());
return await this.fileCorePictureService.uploadWorkspacePicture({
@@ -50,13 +50,13 @@ export class FileCorePictureResolver {
});
}
- @Mutation(() => FileWithSignedUrlDto)
+ @Mutation(() => FileWithSignedUrlDTO)
@UseGuards(WorkspaceAuthGuard, UploadProfilePicturePermissionGuard)
async uploadWorkspaceMemberProfilePicture(
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
@Args({ name: 'file', type: () => GraphQLUpload })
{ createReadStream, filename }: FileUpload,
- ): Promise<FileWithSignedUrlDto> {
+ ): Promise<FileWithSignedUrlDTO> {
const buffer = await streamToBuffer(createReadStream());
return await this.fileCorePictureService.uploadWorkspaceMemberProfilePicture(
diff --git a/packages/twenty-server/src/engine/core-modules/file/file-core-picture/services/file-core-picture.service.ts b/packages/twenty-server/src/engine/core-modules/file/file-core-picture/services/file-core-picture.service.ts
index 75fb6e9d647..2c91b045c17 100644
--- a/packages/twenty-server/src/engine/core-modules/file/file-core-picture/services/file-core-picture.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/file-core-picture/services/file-core-picture.service.ts
@@ -12,7 +12,7 @@ import { v4 } from 'uuid';
import { ApplicationService } from 'src/engine/core-modules/application/services/application.service';
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';
import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
import { extractFileInfo } from 'src/engine/core-modules/file/utils/extract-file-info.utils';
@@ -88,7 +88,7 @@ export class FileCorePictureService {
file: Buffer;
filename: string;
workspace: WorkspaceEntity;
- }): Promise<FileWithSignedUrlDto> {
+ }): Promise<FileWithSignedUrlDTO> {
const savedFile = await this.uploadCorePicture({
file,
filename,
@@ -130,7 +130,7 @@ export class FileCorePictureService {
workspaceId: string;
applicationUniversalIdentifier?: string;
queryRunner?: QueryRunner;
- }): Promise<FileWithSignedUrlDto> {
+ }): Promise<FileWithSignedUrlDTO> {
const savedFile = await this.uploadCorePicture({
file,
filename,
@@ -211,7 +211,7 @@ export class FileCorePictureService {
workspaceId: string;
applicationUniversalIdentifier?: string;
queryRunner?: QueryRunner;
- }): Promise<FileWithSignedUrlDto | undefined> {
+ }): Promise<FileWithSignedUrlDTO | undefined> {
const imageData = await this.fetchImageBufferFromUrl(imageUrl);
if (!isDefined(imageData)) {
@@ -265,7 +265,7 @@ export class FileCorePictureService {
targetWorkspaceId: string;
targetApplicationUniversalIdentifier?: string;
queryRunner?: QueryRunner;
- }): Promise<FileWithSignedUrlDto> {
+ }): Promise<FileWithSignedUrlDTO> {
const sourceFile = await this.fileRepository.findOneOrFail({
where: {
id: sourceFileId,
diff --git a/packages/twenty-server/src/engine/core-modules/file/file-workflow/resolvers/file-workflow.resolver.ts b/packages/twenty-server/src/engine/core-modules/file/file-workflow/resolvers/file-workflow.resolver.ts
index 97c45554be3..d4e88ea66f0 100644
--- a/packages/twenty-server/src/engine/core-modules/file/file-workflow/resolvers/file-workflow.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/file-workflow/resolvers/file-workflow.resolver.ts
@@ -7,7 +7,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import type { FileUpload } from 'graphql-upload/processRequest.mjs';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FileWorkflowService } from 'src/engine/core-modules/file/file-workflow/services/file-workflow.service';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
@@ -24,14 +24,14 @@ import { streamToBuffer } from 'src/utils/stream-to-buffer';
export class FileWorkflowResolver {
constructor(private readonly fileWorkflowService: FileWorkflowService) {}
- @Mutation(() => FileWithSignedUrlDto)
+ @Mutation(() => FileWithSignedUrlDTO)
@UseGuards(SettingsPermissionGuard(PermissionFlagType.UPLOAD_FILE))
async uploadWorkflowFile(
@AuthWorkspace()
{ id: workspaceId }: WorkspaceEntity,
@Args({ name: 'file', type: () => GraphQLUpload })
{ createReadStream, filename }: FileUpload,
- ): Promise<FileWithSignedUrlDto> {
+ ): Promise<FileWithSignedUrlDTO> {
const stream = createReadStream();
const buffer = await streamToBuffer(stream);
diff --git a/packages/twenty-server/src/engine/core-modules/file/file-workflow/services/file-workflow.service.ts b/packages/twenty-server/src/engine/core-modules/file/file-workflow/services/file-workflow.service.ts
index e837355865a..66b9da1ea88 100644
--- a/packages/twenty-server/src/engine/core-modules/file/file-workflow/services/file-workflow.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/file-workflow/services/file-workflow.service.ts
@@ -6,7 +6,7 @@ import { v4 } from 'uuid';
import { ApplicationService } from 'src/engine/core-modules/application/services/application.service';
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
import { extractFileInfo } from 'src/engine/core-modules/file/utils/extract-file-info.utils';
import { sanitizeFile } from 'src/engine/core-modules/file/utils/sanitize-file.utils';
@@ -27,7 +27,7 @@ export class FileWorkflowService {
file: Buffer;
filename: string;
workspaceId: string;
- }): Promise<FileWithSignedUrlDto> {
+ }): Promise<FileWithSignedUrlDTO> {
const { mimeType, ext } = await extractFileInfo({
file,
filename,
diff --git a/packages/twenty-server/src/engine/core-modules/file/files-field/resolvers/files-field.resolver.ts b/packages/twenty-server/src/engine/core-modules/file/files-field/resolvers/files-field.resolver.ts
index 2ccf58eb556..547d0d42b7a 100644
--- a/packages/twenty-server/src/engine/core-modules/file/files-field/resolvers/files-field.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/files-field/resolvers/files-field.resolver.ts
@@ -7,7 +7,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import type { FileUpload } from 'graphql-upload/processRequest.mjs';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FilesFieldService } from 'src/engine/core-modules/file/files-field/services/files-field.service';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
@@ -24,7 +24,7 @@ import { streamToBuffer } from 'src/utils/stream-to-buffer';
export class FilesFieldResolver {
constructor(private readonly filesFieldService: FilesFieldService) {}
- @Mutation(() => FileWithSignedUrlDto)
+ @Mutation(() => FileWithSignedUrlDTO)
@UseGuards(SettingsPermissionGuard(PermissionFlagType.UPLOAD_FILE))
async uploadFilesFieldFile(
@AuthWorkspace()
@@ -37,7 +37,7 @@ export class FilesFieldResolver {
nullable: false,
})
fieldMetadataId: string,
- ): Promise<FileWithSignedUrlDto> {
+ ): Promise<FileWithSignedUrlDTO> {
const stream = createReadStream();
const buffer = await streamToBuffer(stream);
@@ -49,7 +49,7 @@ export class FilesFieldResolver {
});
}
- @Mutation(() => FileWithSignedUrlDto)
+ @Mutation(() => FileWithSignedUrlDTO)
@UseGuards(SettingsPermissionGuard(PermissionFlagType.UPLOAD_FILE))
async uploadFilesFieldFileByUniversalIdentifier(
@AuthWorkspace()
@@ -62,7 +62,7 @@ export class FilesFieldResolver {
nullable: false,
})
fieldMetadataUniversalIdentifier: string,
- ): Promise<FileWithSignedUrlDto> {
+ ): Promise<FileWithSignedUrlDTO> {
const stream = createReadStream();
const buffer = await streamToBuffer(stream);
diff --git a/packages/twenty-server/src/engine/core-modules/file/files-field/services/files-field.service.ts b/packages/twenty-server/src/engine/core-modules/file/files-field/services/files-field.service.ts
index 53e75f12a93..2f16534ff5c 100644
--- a/packages/twenty-server/src/engine/core-modules/file/files-field/services/files-field.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/files-field/services/files-field.service.ts
@@ -9,7 +9,7 @@ import { v4 } from 'uuid';
import { ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
import { FileStorageService } from 'src/engine/core-modules/file-storage/file-storage.service';
-import { FileWithSignedUrlDto } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
+import { FileWithSignedUrlDTO } from 'src/engine/core-modules/file/dtos/file-with-sign-url.dto';
import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
import {
FilesFieldException,
@@ -42,7 +42,7 @@ export class FilesFieldService {
workspaceId: string;
fieldMetadataId?: string;
fieldMetadataUniversalIdentifier?: string;
- }): Promise<FileWithSignedUrlDto> {
+ }): Promise<FileWithSignedUrlDTO> {
if (!fieldMetadataId && !fieldMetadataUniversalIdentifier) {
throw new FilesFieldException(
'fieldMetadataId or fieldMetadataUniversalIdentifier must be provided',
diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
index c8186595013..78c5d4d4fa2 100644
--- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
@@ -42,7 +42,7 @@ export class EmailAccountConnectionParameters {
}
@ObjectType('ConnectionParametersOutput')
-export class ConnectionParametersOutputDTO {
+export class ConnectionParametersDTO {
@Field(() => String)
host: string;
@@ -61,12 +61,12 @@ export class ConnectionParametersOutputDTO {
@ObjectType('ImapSmtpCaldavConnectionParameters')
export class ImapSmtpCaldavConnectionParametersDTO {
- @Field(() => ConnectionParametersOutputDTO, { nullable: true })
- IMAP?: ConnectionParametersOutputDTO;
+ @Field(() => ConnectionParametersDTO, { nullable: true })
+ IMAP?: ConnectionParametersDTO;
- @Field(() => ConnectionParametersOutputDTO, { nullable: true })
- SMTP?: ConnectionParametersOutputDTO;
+ @Field(() => ConnectionParametersDTO, { nullable: true })
+ SMTP?: ConnectionParametersDTO;
- @Field(() => ConnectionParametersOutputDTO, { nullable: true })
- CALDAV?: ConnectionParametersOutputDTO;
+ @Field(() => ConnectionParametersDTO, { nullable: true })
+ CALDAV?: ConnectionParametersDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/impersonation/impersonation.resolver.ts b/packages/twenty-server/src/engine/core-modules/impersonation/impersonation.resolver.ts
index 84a27bd5303..2e55b373b78 100644
--- a/packages/twenty-server/src/engine/core-modules/impersonation/impersonation.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/impersonation/impersonation.resolver.ts
@@ -2,7 +2,7 @@ import { UseGuards, UsePipes } from '@nestjs/common';
import { Args, Mutation } from '@nestjs/graphql';
import { ImpersonateInput } from 'src/engine/core-modules/admin-panel/dtos/impersonate.input';
-import { ImpersonateOutput } from 'src/engine/core-modules/admin-panel/dtos/impersonate.output';
+import { ImpersonateDTO } from 'src/engine/core-modules/admin-panel/dtos/impersonate.dto';
import {
AuthException,
AuthExceptionCode,
@@ -29,11 +29,11 @@ export class ImpersonationResolver {
ImpersonatePermissionGuard,
CustomPermissionGuard,
)
- @Mutation(() => ImpersonateOutput)
+ @Mutation(() => ImpersonateDTO)
async impersonate(
@Args() { workspaceId, userId: toImpersonateUserId }: ImpersonateInput,
@AuthUserWorkspaceId() impersonatorUserWorkspaceId: string,
- ): Promise<ImpersonateOutput> {
+ ): Promise<ImpersonateDTO> {
if (!impersonatorUserWorkspaceId) {
throw new AuthException(
'Impersonator user not found',
diff --git a/packages/twenty-server/src/engine/core-modules/lab/lab.resolver.ts b/packages/twenty-server/src/engine/core-modules/lab/lab.resolver.ts
index 7489915a53e..95da88498b3 100644
--- a/packages/twenty-server/src/engine/core-modules/lab/lab.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/lab/lab.resolver.ts
@@ -4,7 +4,7 @@ import { Args, Mutation } from '@nestjs/graphql';
import { PermissionFlagType } from 'twenty-shared/constants';
import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter';
-import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag-dto';
+import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag.dto';
import { FeatureFlagException } from 'src/engine/core-modules/feature-flag/feature-flag.exception';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
diff --git a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
index 39664b7200b..af752a95c18 100644
--- a/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service.ts
@@ -29,8 +29,6 @@ import type { FlatApplicationVariable } from 'src/engine/core-modules/applicatio
import { FlatLogicFunction } from 'src/engine/metadata-modules/logic-function/types/flat-logic-function.type';
import { FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
-const MIN_TOKEN_EXPIRATION_IN_SECONDS = 5;
-
export class LogicFunctionExecutionException extends Error {
constructor(
message: string,
@@ -81,7 +79,7 @@ export class LogicFunctionExecutorService {
workspaceId,
flatApplication,
flatApplicationVariables,
- flatLogicFunction,
+ _flatLogicFunction: flatLogicFunction,
});
const resultLogicFunction = await this.driver.execute({
@@ -171,22 +169,18 @@ export class LogicFunctionExecutorService {
private async getExecutionEnvVariables({
workspaceId,
flatApplication,
- flatLogicFunction,
+ _flatLogicFunction,
flatApplicationVariables,
}: {
workspaceId: string;
flatApplication: FlatApplication;
- flatLogicFunction: FlatLogicFunction;
+ _flatLogicFunction: FlatLogicFunction;
flatApplicationVariables: FlatApplicationVariable[];
}) {
const applicationAccessToken =
await this.applicationTokenService.generateApplicationAccessToken({
workspaceId,
applicationId: flatApplication.id,
- expiresInSeconds: Math.max(
- flatLogicFunction.timeoutSeconds,
- MIN_TOKEN_EXPIRATION_IN_SECONDS,
- ),
});
const baseUrl = cleanServerUrl(this.twentyConfigService.get('SERVER_URL'));
diff --git a/packages/twenty-server/src/engine/core-modules/marketplace/mocks/mock-manifest.json b/packages/twenty-server/src/engine/core-modules/marketplace/mocks/mock-manifest.json
index d351624e7e0..22b9f4c8117 100644
--- a/packages/twenty-server/src/engine/core-modules/marketplace/mocks/mock-manifest.json
+++ b/packages/twenty-server/src/engine/core-modules/marketplace/mocks/mock-manifest.json
@@ -5,20 +5,18 @@
"displayName": "Data Enrichment",
"description": "Enrich your data easily. Choose your provider.",
"icon": "IconSparkles",
- "marketplaceData": {
- "author": "Cosmos Labs",
- "category": "Data",
- "logo": "assets/logo.png",
- "screenshots": [
- "assets/screenshot-1.png",
- "assets/screenshot-2.png",
- "assets/screenshot-3.png"
- ],
- "aboutDescription": "Enhance your workspace with automated data intelligence. This app monitors your new records and automatically populates missing details such as job titles, company size, social profiles, and industry insights.",
- "providers": ["Clearbit", "Apollo", "Hunter.io"],
- "websiteUrl": "https://google.com",
- "termsUrl": "https://google.com"
- }
+ "author": "Cosmos Labs",
+ "category": "Data",
+ "logoUrl": "assets/logo.png",
+ "screenshots": [
+ "assets/screenshot-1.png",
+ "assets/screenshot-2.png",
+ "assets/screenshot-3.png"
+ ],
+ "aboutDescription": "Enhance your workspace with automated data intelligence. This app monitors your new records and automatically populates missing details such as job titles, company size, social profiles, and industry insights.",
+ "providers": ["Clearbit", "Apollo", "Hunter.io"],
+ "websiteUrl": "https://google.com",
+ "termsUrl": "https://google.com"
},
"entities": {
"objects": [],
diff --git a/packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.output.ts b/packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.dto.ts
similarity index 82%
rename from packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.output.ts
rename to packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.dto.ts
index 77c3d43abcd..e1b2cf7c21c 100644
--- a/packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/sso/dtos/delete-sso.dto.ts
@@ -4,8 +4,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType()
-export class DeleteSsoOutput {
+@ObjectType('DeleteSso')
+export class DeleteSsoDTO {
@Field(() => UUIDScalarType)
identityProviderId: string;
}
diff --git a/packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.output.ts b/packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.dto.ts
similarity index 93%
rename from packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.output.ts
rename to packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.dto.ts
index 9dd58b51d3c..042fd9f5aae 100644
--- a/packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.dto.ts
@@ -9,8 +9,8 @@ import {
SSOIdentityProviderStatus,
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-@ObjectType()
-export class SetupSsoOutput {
+@ObjectType('EditSso')
+export class EditSsoDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.output.ts b/packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.dto.ts
similarity index 92%
rename from packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.output.ts
rename to packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.dto.ts
index f6a5b95d844..79c5186c66d 100644
--- a/packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/sso/dtos/find-available-SSO-IDP.dto.ts
@@ -18,8 +18,8 @@ class WorkspaceNameAndId {
id: string;
}
-@ObjectType()
-export class FindAvailableSSOIDPOutput {
+@ObjectType('FindAvailableSSOIDP')
+export class FindAvailableSSOIDPDTO {
@Field(() => IdentityProviderType)
type: SSOConfiguration['type'];
diff --git a/packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.output.ts b/packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.dto.ts
similarity index 93%
rename from packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.output.ts
rename to packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.dto.ts
index f45cce99da5..8e365bdfc83 100644
--- a/packages/twenty-server/src/engine/core-modules/sso/dtos/edit-sso.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/sso/dtos/setup-sso.dto.ts
@@ -9,8 +9,8 @@ import {
SSOIdentityProviderStatus,
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-@ObjectType()
-export class EditSsoOutput {
+@ObjectType('SetupSso')
+export class SetupSsoDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/sso/sso.resolver.ts b/packages/twenty-server/src/engine/core-modules/sso/sso.resolver.ts
index 56b6d7c81b4..74b93492d57 100644
--- a/packages/twenty-server/src/engine/core-modules/sso/sso.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/sso/sso.resolver.ts
@@ -10,15 +10,15 @@ import { EnterpriseFeaturesEnabledGuard } from 'src/engine/core-modules/auth/gua
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { DeleteSsoInput } from 'src/engine/core-modules/sso/dtos/delete-sso.input';
-import { DeleteSsoOutput } from 'src/engine/core-modules/sso/dtos/delete-sso.output';
+import { DeleteSsoDTO } from 'src/engine/core-modules/sso/dtos/delete-sso.dto';
import { EditSsoInput } from 'src/engine/core-modules/sso/dtos/edit-sso.input';
-import { EditSsoOutput } from 'src/engine/core-modules/sso/dtos/edit-sso.output';
-import { FindAvailableSSOIDPOutput } from 'src/engine/core-modules/sso/dtos/find-available-SSO-IDP.output';
+import { EditSsoDTO } from 'src/engine/core-modules/sso/dtos/edit-sso.dto';
+import { FindAvailableSSOIDPDTO } from 'src/engine/core-modules/sso/dtos/find-available-SSO-IDP.dto';
import {
SetupOIDCSsoInput,
SetupSAMLSsoInput,
} from 'src/engine/core-modules/sso/dtos/setup-sso.input';
-import { SetupSsoOutput } from 'src/engine/core-modules/sso/dtos/setup-sso.output';
+import { SetupSsoDTO } from 'src/engine/core-modules/sso/dtos/setup-sso.dto';
import { SSOService } from 'src/engine/core-modules/sso/services/sso.service';
import { type SSOException } from 'src/engine/core-modules/sso/sso.exception';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -38,11 +38,11 @@ export class SSOResolver {
constructor(private readonly sSOService: SSOService) {}
@UseGuards(WorkspaceAuthGuard, EnterpriseFeaturesEnabledGuard)
- @Mutation(() => SetupSsoOutput)
+ @Mutation(() => SetupSsoDTO)
async createOIDCIdentityProvider(
@Args('input') setupSsoInput: SetupOIDCSsoInput,
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
- ): Promise<SetupSsoOutput | SSOException> {
+ ): Promise<SetupSsoDTO | SSOException> {
return this.sSOService.createOIDCIdentityProvider(
setupSsoInput,
workspaceId,
@@ -50,7 +50,7 @@ export class SSOResolver {
}
@UseGuards(WorkspaceAuthGuard, EnterpriseFeaturesEnabledGuard)
- @Query(() => [FindAvailableSSOIDPOutput])
+ @Query(() => [FindAvailableSSOIDPDTO])
async getSSOIdentityProviders(
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
) {
@@ -58,11 +58,11 @@ export class SSOResolver {
}
@UseGuards(WorkspaceAuthGuard, EnterpriseFeaturesEnabledGuard)
- @Mutation(() => SetupSsoOutput)
+ @Mutation(() => SetupSsoDTO)
async createSAMLIdentityProvider(
@Args('input') setupSsoInput: SetupSAMLSsoInput,
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
- ): Promise<SetupSsoOutput | SSOException> {
+ ): Promise<SetupSsoDTO | SSOException> {
return this.sSOService.createSAMLIdentityProvider(
setupSsoInput,
workspaceId,
@@ -70,7 +70,7 @@ export class SSOResolver {
}
@UseGuards(WorkspaceAuthGuard, EnterpriseFeaturesEnabledGuard)
- @Mutation(() => DeleteSsoOutput)
+ @Mutation(() => DeleteSsoDTO)
async deleteSSOIdentityProvider(
@Args('input') { identityProviderId }: DeleteSsoInput,
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
@@ -82,7 +82,7 @@ export class SSOResolver {
}
@UseGuards(WorkspaceAuthGuard, EnterpriseFeaturesEnabledGuard)
- @Mutation(() => EditSsoOutput)
+ @Mutation(() => EditSsoDTO)
async editSSOIdentityProvider(
@Args('input') input: EditSsoInput,
@AuthWorkspace() { id: workspaceId }: WorkspaceEntity,
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
index 8ffa1e6db79..8c69f86e301 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
@@ -12,10 +12,10 @@ import {
import { isDefined } from 'twenty-shared/utils';
import { type LoggerOptions } from 'typeorm/logger/LoggerOptions';
+import { LogicFunctionDriverType } from 'src/engine/core-modules/logic-function/logic-function-drivers/interfaces/logic-function-driver.interface';
import { type AwsRegion } from 'src/engine/core-modules/twenty-config/interfaces/aws-region.interface';
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
import { SupportDriver } from 'src/engine/core-modules/twenty-config/interfaces/support.interface';
-import { LogicFunctionDriverType } from 'src/engine/core-modules/logic-function/logic-function-drivers/interfaces/logic-function-driver.interface';
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
import { CodeInterpreterDriverType } from 'src/engine/core-modules/code-interpreter/code-interpreter.interface';
@@ -308,6 +308,24 @@ export class ConfigVariables {
})
SHORT_TERM_TOKEN_EXPIRES_IN = '5m';
+ @ConfigVariablesMetadata({
+ group: ConfigVariablesGroup.TOKENS_DURATION,
+ description: 'Duration for which an application access token is valid',
+ type: ConfigVariableType.STRING,
+ })
+ @IsDuration()
+ @IsOptional()
+ APPLICATION_ACCESS_TOKEN_EXPIRES_IN = '30m';
+
+ @ConfigVariablesMetadata({
+ group: ConfigVariablesGroup.TOKENS_DURATION,
+ description: 'Duration for which an application refresh token is valid',
+ type: ConfigVariableType.STRING,
+ })
+ @IsDuration()
+ @IsOptional()
+ APPLICATION_REFRESH_TOKEN_EXPIRES_IN = '60d';
+
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Email address used as the sender for outgoing emails',
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.output.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.dto.ts
similarity index 61%
rename from packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.output.ts
rename to packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.dto.ts
index e9795569675..eb46e95847c 100644
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/delete-two-factor-authentication-method.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class DeleteTwoFactorAuthenticationMethodOutput {
+@ObjectType('DeleteTwoFactorAuthenticationMethod')
+export class DeleteTwoFactorAuthenticationMethodDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.dto.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.dto.ts
new file mode 100644
index 00000000000..7fbbba60fb6
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.dto.ts
@@ -0,0 +1,7 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('InitiateTwoFactorAuthenticationProvisioning')
+export class InitiateTwoFactorAuthenticationProvisioningDTO {
+ @Field(() => String)
+ uri: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.output.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.output.ts
deleted file mode 100644
index 394754be279..00000000000
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/initiate-two-factor-authentication-provisioning.output.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Field, ObjectType } from '@nestjs/graphql';
-
-@ObjectType()
-export class InitiateTwoFactorAuthenticationProvisioningOutput {
- @Field(() => String)
- uri: string;
-}
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto.ts
index 908b8f0cf5f..e02b903b8fb 100644
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType('TwoFactorAuthenticationMethodDTO')
-export class TwoFactorAuthenticationMethodSummaryDto {
+@ObjectType('TwoFactorAuthenticationMethodSummary')
+export class TwoFactorAuthenticationMethodSummaryDTO {
@Field(() => UUIDScalarType, { nullable: false })
twoFactorAuthenticationMethodId: string;
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.dto.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.dto.ts
new file mode 100644
index 00000000000..18747a81319
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.dto.ts
@@ -0,0 +1,7 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('VerifyTwoFactorAuthenticationMethod')
+export class VerifyTwoFactorAuthenticationMethodDTO {
+ @Field(() => Boolean)
+ success: boolean;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.output.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.output.ts
deleted file mode 100644
index 1949cde3a64..00000000000
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/dto/verify-two-factor-authentication-method.output.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Field, ObjectType } from '@nestjs/graphql';
-
-@ObjectType()
-export class VerifyTwoFactorAuthenticationMethodOutput {
- @Field(() => Boolean)
- success: boolean;
-}
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity.ts
index a9b8db67e27..714439e4350 100644
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity.ts
@@ -1,5 +1,3 @@
-import { Field, ObjectType } from '@nestjs/graphql';
-
import { TwoFactorAuthenticationStrategy } from 'twenty-shared/types';
import {
Column,
@@ -18,17 +16,13 @@ import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user
@Index(['userWorkspaceId', 'strategy'], { unique: true })
@Entity({ name: 'twoFactorAuthenticationMethod', schema: 'core' })
-@ObjectType('TwoFactorAuthenticationMethod')
export class TwoFactorAuthenticationMethodEntity {
- @Field()
@PrimaryGeneratedColumn('uuid')
id: string;
- @Field({ nullable: false })
@Column({ nullable: false, type: 'uuid' })
userWorkspaceId: string;
- @Field(() => UserWorkspaceEntity)
@ManyToOne(
() => UserWorkspaceEntity,
(userWorkspace) => userWorkspace.twoFactorAuthenticationMethods,
@@ -49,22 +43,18 @@ export class TwoFactorAuthenticationMethodEntity {
})
status: OTPStatus;
- @Field(() => TwoFactorAuthenticationStrategy)
@Column({
type: 'enum',
enum: TwoFactorAuthenticationStrategy,
})
strategy: TwoFactorAuthenticationStrategy;
- @Field()
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;
- @Field()
@UpdateDateColumn({ type: 'timestamptz' })
updatedAt: Date;
- @Field({ nullable: true })
@Column({ nullable: true, type: 'timestamptz' })
deletedAt: Date;
}
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/two-factor-authentication.resolver.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/two-factor-authentication.resolver.ts
index 7f1e5098dc3..e4e89bd2569 100644
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/two-factor-authentication.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/two-factor-authentication.resolver.ts
@@ -28,11 +28,11 @@ import { PermissionsGraphqlApiExceptionFilter } from 'src/engine/metadata-module
import { TwoFactorAuthenticationService } from './two-factor-authentication.service';
import { DeleteTwoFactorAuthenticationMethodInput } from './dto/delete-two-factor-authentication-method.input';
-import { DeleteTwoFactorAuthenticationMethodOutput } from './dto/delete-two-factor-authentication-method.output';
+import { DeleteTwoFactorAuthenticationMethodDTO } from './dto/delete-two-factor-authentication-method.dto';
import { InitiateTwoFactorAuthenticationProvisioningInput } from './dto/initiate-two-factor-authentication-provisioning.input';
-import { InitiateTwoFactorAuthenticationProvisioningOutput } from './dto/initiate-two-factor-authentication-provisioning.output';
+import { InitiateTwoFactorAuthenticationProvisioningDTO } from './dto/initiate-two-factor-authentication-provisioning.dto';
import { VerifyTwoFactorAuthenticationMethodInput } from './dto/verify-two-factor-authentication-method.input';
-import { VerifyTwoFactorAuthenticationMethodOutput } from './dto/verify-two-factor-authentication-method.output';
+import { VerifyTwoFactorAuthenticationMethodDTO } from './dto/verify-two-factor-authentication-method.dto';
import { TwoFactorAuthenticationMethodEntity } from './entities/two-factor-authentication-method.entity';
@MetadataResolver()
@@ -47,13 +47,13 @@ export class TwoFactorAuthenticationResolver {
private readonly twoFactorAuthenticationMethodRepository: Repository<TwoFactorAuthenticationMethodEntity>,
) {}
- @Mutation(() => InitiateTwoFactorAuthenticationProvisioningOutput)
+ @Mutation(() => InitiateTwoFactorAuthenticationProvisioningDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async initiateOTPProvisioning(
@Args()
initiateTwoFactorAuthenticationProvisioningInput: InitiateTwoFactorAuthenticationProvisioningInput,
@Args('origin') origin: string,
- ): Promise<InitiateTwoFactorAuthenticationProvisioningOutput> {
+ ): Promise<InitiateTwoFactorAuthenticationProvisioningDTO> {
const { sub: userEmail, workspaceId: tokenWorkspaceId } =
await this.loginTokenService.verifyLoginToken(
initiateTwoFactorAuthenticationProvisioningInput.loginToken,
@@ -99,12 +99,12 @@ export class TwoFactorAuthenticationResolver {
return { uri };
}
- @Mutation(() => InitiateTwoFactorAuthenticationProvisioningOutput)
+ @Mutation(() => InitiateTwoFactorAuthenticationProvisioningDTO)
@UseGuards(UserAuthGuard, NoPermissionGuard)
async initiateOTPProvisioningForAuthenticatedUser(
@AuthUser() user: UserEntity,
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<InitiateTwoFactorAuthenticationProvisioningOutput> {
+ ): Promise<InitiateTwoFactorAuthenticationProvisioningDTO> {
const uri =
await this.twoFactorAuthenticationService.initiateStrategyConfiguration(
user.id,
@@ -123,14 +123,14 @@ export class TwoFactorAuthenticationResolver {
return { uri };
}
- @Mutation(() => DeleteTwoFactorAuthenticationMethodOutput)
+ @Mutation(() => DeleteTwoFactorAuthenticationMethodDTO)
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, CustomPermissionGuard)
async deleteTwoFactorAuthenticationMethod(
@Args()
deleteTwoFactorAuthenticationMethodInput: DeleteTwoFactorAuthenticationMethodInput,
@AuthWorkspace() workspace: WorkspaceEntity,
@AuthUser() user: UserEntity,
- ): Promise<DeleteTwoFactorAuthenticationMethodOutput> {
+ ): Promise<DeleteTwoFactorAuthenticationMethodDTO> {
const twoFactorMethod =
await this.twoFactorAuthenticationMethodRepository.findOne({
where: {
@@ -163,14 +163,14 @@ export class TwoFactorAuthenticationResolver {
return { success: true };
}
- @Mutation(() => VerifyTwoFactorAuthenticationMethodOutput)
+ @Mutation(() => VerifyTwoFactorAuthenticationMethodDTO)
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, NoPermissionGuard)
async verifyTwoFactorAuthenticationMethodForAuthenticatedUser(
@Args()
verifyTwoFactorAuthenticationMethodInput: VerifyTwoFactorAuthenticationMethodInput,
@AuthWorkspace() workspace: WorkspaceEntity,
@AuthUser() user: UserEntity,
- ): Promise<VerifyTwoFactorAuthenticationMethodOutput> {
+ ): Promise<VerifyTwoFactorAuthenticationMethodDTO> {
return await this.twoFactorAuthenticationService.verifyTwoFactorAuthenticationMethodForAuthenticatedUser(
user.id,
verifyTwoFactorAuthenticationMethodInput.otp,
diff --git a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/utils/two-factor-authentication-method.presenter.ts b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/utils/two-factor-authentication-method.presenter.ts
index 8cf656c8e7d..6d59acbfd04 100644
--- a/packages/twenty-server/src/engine/core-modules/two-factor-authentication/utils/two-factor-authentication-method.presenter.ts
+++ b/packages/twenty-server/src/engine/core-modules/two-factor-authentication/utils/two-factor-authentication-method.presenter.ts
@@ -1,11 +1,11 @@
import { isDefined } from 'twenty-shared/utils';
-import { type TwoFactorAuthenticationMethodSummaryDto } from 'src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto';
+import { type TwoFactorAuthenticationMethodSummaryDTO } from 'src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto';
import { type TwoFactorAuthenticationMethodEntity } from 'src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity';
export function buildTwoFactorAuthenticationMethodSummary(
methods: TwoFactorAuthenticationMethodEntity[] | undefined,
-): TwoFactorAuthenticationMethodSummaryDto[] | undefined {
+): TwoFactorAuthenticationMethodSummaryDTO[] | undefined {
if (!isDefined(methods)) return undefined;
return methods.map((method) => ({
diff --git a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts
index 3dc63f55e83..668fa27a548 100644
--- a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts
@@ -21,7 +21,7 @@ import {
} from 'typeorm';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { TwoFactorAuthenticationMethodSummaryDto } from 'src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto';
+import { TwoFactorAuthenticationMethodSummaryDTO } from 'src/engine/core-modules/two-factor-authentication/dto/two-factor-authentication-method.dto';
import { TwoFactorAuthenticationMethodEntity } from 'src/engine/core-modules/two-factor-authentication/entities/two-factor-authentication-method.entity';
import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { ObjectPermissionDTO } from 'src/engine/metadata-modules/object-permission/dtos/object-permission.dto';
@@ -101,6 +101,6 @@ export class UserWorkspaceEntity extends WorkspaceRelatedEntity {
@Field(() => [ObjectPermissionDTO], { nullable: true })
objectsPermissions?: ObjectPermissionDTO[];
- @Field(() => [TwoFactorAuthenticationMethodSummaryDto], { nullable: true })
- twoFactorAuthenticationMethodSummary?: TwoFactorAuthenticationMethodSummaryDto[];
+ @Field(() => [TwoFactorAuthenticationMethodSummaryDTO], { nullable: true })
+ twoFactorAuthenticationMethodSummary?: TwoFactorAuthenticationMethodSummaryDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
index 3bb03ee99ab..4210b5acbde 100644
--- a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
@@ -14,7 +14,7 @@ import {
AuthException,
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
-import { type AvailableWorkspace } from 'src/engine/core-modules/auth/dto/available-workspaces.output';
+import { type AvailableWorkspace } from 'src/engine/core-modules/auth/dto/available-workspaces.dto';
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
diff --git a/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts b/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
index 0ba76040b8c..33f3d993b87 100644
--- a/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
@@ -19,7 +19,7 @@ import {
AuthException,
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
-import { AvailableWorkspaces } from 'src/engine/core-modules/auth/dto/available-workspaces.output';
+import { AvailableWorkspaces } from 'src/engine/core-modules/auth/dto/available-workspaces.dto';
import { OnboardingStatus } from 'src/engine/core-modules/onboarding/enums/onboarding-status.enum';
import {
OnboardingService,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/compute-step-output-schema-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/compute-step-output-schema.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/compute-step-output-schema-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/compute-step-output-schema.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-edge-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-edge.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-edge-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-edge.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step.input.ts
similarity index 96%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step.input.ts
index ff7cda34983..71709d68c13 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/create-workflow-version-step.input.ts
@@ -3,7 +3,7 @@ import { Field, InputType } from '@nestjs/graphql';
import graphqlTypeJson from 'graphql-type-json';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-input.dto';
+import { WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position.input';
import { WorkflowStepConnectionOptions } from 'src/modules/workflow/workflow-builder/workflow-version-step/types/WorkflowStepCreationOptions';
import { WorkflowActionSettings } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action-settings.type';
import { WorkflowActionType } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-workflow-version-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-workflow-version-step.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-workflow-version-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/delete-workflow-version-step.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/duplicate-workflow.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version-output.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version.dto.ts
similarity index 73%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version-output.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version.dto.ts
index 1dc1656f362..60b833df040 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version-output.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType('RunWorkflowVersionOutput')
-export class RunWorkflowVersionOutput {
+@ObjectType('RunWorkflowVersion')
+export class RunWorkflowVersionDTO {
@Field(() => UUIDScalarType)
workflowRunId: string;
}
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/run-workflow-version.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/submit-form-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/submit-form-step.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/submit-form-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/submit-form-step.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request-output.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request.dto.ts
similarity index 93%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request-output.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request.dto.ts
index 0d42d7bbac8..45e43b66df9 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request-output.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import graphqlTypeJson from 'graphql-type-json';
-@ObjectType()
-export class TestHttpRequestOutput {
+@ObjectType('TestHttpRequest')
+export class TestHttpRequestDTO {
@Field(() => Boolean, {
description: 'Whether the request was successful',
})
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/test-http-request.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-run-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-run-step.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-run-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-run-step.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update.input.ts
similarity index 88%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update.input.ts
index b6a4511adba..f4e278da4c3 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update-input.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-update.input.ts
@@ -1,6 +1,6 @@
import { Field, InputType } from '@nestjs/graphql';
-import { WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-input.dto';
+import { WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position.input';
@InputType()
export class WorkflowStepPositionUpdateInput {
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-step-position.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions.input.ts
similarity index 89%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions.input.ts
index 5b11066bb40..93c7320df81 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions-input.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-positions.input.ts
@@ -1,6 +1,6 @@
import { Field, InputType } from '@nestjs/graphql';
-import { WorkflowStepPositionUpdateInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-update-input.dto';
+import { WorkflowStepPositionUpdateInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-update.input';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
@InputType()
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-step-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-step.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-step-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-step.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-trigger-input.dto.ts b/packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-trigger.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-trigger-input.dto.ts
rename to packages/twenty-server/src/engine/core-modules/workflow/dtos/update-workflow-version-trigger.input.ts
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-builder.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-builder.resolver.ts
index 58c5216ce2c..2b3ce432640 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-builder.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-builder.resolver.ts
@@ -7,7 +7,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { CoreResolver } from 'src/engine/api/graphql/graphql-config/decorators/core-resolver.decorator';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
-import { ComputeStepOutputSchemaInput } from 'src/engine/core-modules/workflow/dtos/compute-step-output-schema-input.dto';
+import { ComputeStepOutputSchemaInput } from 'src/engine/core-modules/workflow/dtos/compute-step-output-schema.input';
import { WorkflowTriggerGraphqlApiExceptionFilter } from 'src/engine/core-modules/workflow/filters/workflow-trigger-graphql-api-exception.filter';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-trigger.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-trigger.resolver.ts
index 1c5381478c5..ba5fdfd6f95 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-trigger.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-trigger.resolver.ts
@@ -9,8 +9,8 @@ import { buildCreatedByFromFullNameMetadata } from 'src/engine/core-modules/acto
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { UserEntity } from 'src/engine/core-modules/user/user.entity';
-import { RunWorkflowVersionInput } from 'src/engine/core-modules/workflow/dtos/run-workflow-version-input.dto';
-import { RunWorkflowVersionOutput } from 'src/engine/core-modules/workflow/dtos/run-workflow-version-output.dto';
+import { RunWorkflowVersionInput } from 'src/engine/core-modules/workflow/dtos/run-workflow-version.input';
+import { RunWorkflowVersionDTO } from 'src/engine/core-modules/workflow/dtos/run-workflow-version.dto';
import { WorkflowRunDTO } from 'src/engine/core-modules/workflow/dtos/workflow-run.dto';
import { WorkflowTriggerGraphqlApiExceptionFilter } from 'src/engine/core-modules/workflow/filters/workflow-trigger-graphql-api-exception.filter';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -67,7 +67,7 @@ export class WorkflowTriggerResolver {
);
}
- @Mutation(() => RunWorkflowVersionOutput)
+ @Mutation(() => RunWorkflowVersionDTO)
async runWorkflowVersion(
@AuthUser() user: UserEntity,
@AuthWorkspace() workspace: WorkspaceEntity,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-edge.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-edge.resolver.ts
index f381c534003..df16e730a00 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-edge.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-edge.resolver.ts
@@ -6,7 +6,7 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { CoreResolver } from 'src/engine/api/graphql/graphql-config/decorators/core-resolver.decorator';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
-import { CreateWorkflowVersionEdgeInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-edge-input.dto';
+import { CreateWorkflowVersionEdgeInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-edge.input';
import { WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
import { WorkflowVersionEdgeGraphqlApiExceptionFilter } from 'src/engine/core-modules/workflow/filters/workflow-version-edge-graphql-api-exception.filter';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-step.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-step.resolver.ts
index edef68c126a..4f467defdbf 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-step.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version-step.resolver.ts
@@ -9,14 +9,14 @@ import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/service
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { HttpTool } from 'src/engine/core-modules/tool/tools/http-tool/http-tool';
-import { CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto';
-import { DeleteWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/delete-workflow-version-step-input.dto';
-import { DuplicateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step-input.dto';
-import { SubmitFormStepInput } from 'src/engine/core-modules/workflow/dtos/submit-form-step-input.dto';
-import { TestHttpRequestInput } from 'src/engine/core-modules/workflow/dtos/test-http-request-input.dto';
-import { TestHttpRequestOutput } from 'src/engine/core-modules/workflow/dtos/test-http-request-output.dto';
-import { UpdateWorkflowRunStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-run-step-input.dto';
-import { UpdateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-step-input.dto';
+import { CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step.input';
+import { DeleteWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/delete-workflow-version-step.input';
+import { DuplicateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/duplicate-workflow-version-step.input';
+import { SubmitFormStepInput } from 'src/engine/core-modules/workflow/dtos/submit-form-step.input';
+import { TestHttpRequestInput } from 'src/engine/core-modules/workflow/dtos/test-http-request.input';
+import { TestHttpRequestDTO } from 'src/engine/core-modules/workflow/dtos/test-http-request.dto';
+import { UpdateWorkflowRunStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-run-step.input';
+import { UpdateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-step.input';
import { WorkflowActionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-action.dto';
import { WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
import { WorkflowVersionStepGraphqlApiExceptionFilter } from 'src/engine/core-modules/workflow/filters/workflow-version-step-graphql-api-exception.filter';
@@ -149,12 +149,12 @@ export class WorkflowVersionStepResolver {
);
}
- @Mutation(() => TestHttpRequestOutput)
+ @Mutation(() => TestHttpRequestDTO)
async testHttpRequest(
@AuthWorkspace() workspace: WorkspaceEntity,
@Args('input')
{ url, method, headers, body }: TestHttpRequestInput,
- ): Promise<TestHttpRequestOutput> {
+ ): Promise<TestHttpRequestDTO> {
return this.httpTool.execute(
{
url,
diff --git a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version.resolver.ts b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version.resolver.ts
index 6841b259851..256faa835ee 100644
--- a/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workflow/resolvers/workflow-version.resolver.ts
@@ -6,9 +6,9 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { CoreResolver } from 'src/engine/api/graphql/graphql-config/decorators/core-resolver.decorator';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
-import { CreateDraftFromWorkflowVersionInput } from 'src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version-input.dto';
-import { DuplicateWorkflowInput } from 'src/engine/core-modules/workflow/dtos/duplicate-workflow-input.dto';
-import { UpdateWorkflowVersionPositionsInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-positions-input.dto';
+import { CreateDraftFromWorkflowVersionInput } from 'src/engine/core-modules/workflow/dtos/create-draft-from-workflow-version.input';
+import { DuplicateWorkflowInput } from 'src/engine/core-modules/workflow/dtos/duplicate-workflow.input';
+import { UpdateWorkflowVersionPositionsInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-positions.input';
import { WorkflowVersionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version.dto';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
diff --git a/packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.output.ts b/packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.dto.ts
similarity index 86%
rename from packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.output.ts
rename to packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.dto.ts
index aa72b2c61ce..4f12e2088a5 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace-invitation/dtos/send-invitations.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { WorkspaceInvitation } from 'src/engine/core-modules/workspace-invitation/dtos/workspace-invitation.dto';
-@ObjectType()
-export class SendInvitationsOutput {
+@ObjectType('SendInvitations')
+export class SendInvitationsDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts b/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts
index d9fbb3071cc..691d0329c9a 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace-invitation/services/workspace-invitation.service.ts
@@ -28,7 +28,7 @@ import { OnboardingService } from 'src/engine/core-modules/onboarding/onboarding
import { ThrottlerService } from 'src/engine/core-modules/throttler/throttler.service';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
-import { type SendInvitationsOutput } from 'src/engine/core-modules/workspace-invitation/dtos/send-invitations.output';
+import { type SendInvitationsDTO } from 'src/engine/core-modules/workspace-invitation/dtos/send-invitations.dto';
import { castAppTokenToWorkspaceInvitationUtil } from 'src/engine/core-modules/workspace-invitation/utils/cast-app-token-to-workspace-invitation.util';
import {
WorkspaceInvitationException,
@@ -246,7 +246,7 @@ export class WorkspaceInvitationService {
workspace: WorkspaceEntity,
sender: WorkspaceMemberWorkspaceEntity,
usePersonalInvitation = true,
- ): Promise<SendInvitationsOutput> {
+ ): Promise<SendInvitationsDTO> {
if (!workspace?.inviteHash) {
return {
success: false,
diff --git a/packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts b/packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts
index 8c5b0f23521..74c321d061c 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace-invitation/workspace-invitation.resolver.ts
@@ -7,7 +7,7 @@ import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorato
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { UserEntity } from 'src/engine/core-modules/user/user.entity';
-import { SendInvitationsOutput } from 'src/engine/core-modules/workspace-invitation/dtos/send-invitations.output';
+import { SendInvitationsDTO } from 'src/engine/core-modules/workspace-invitation/dtos/send-invitations.dto';
import { WorkspaceInvitation } from 'src/engine/core-modules/workspace-invitation/dtos/workspace-invitation.dto';
import { WorkspaceInvitationService } from 'src/engine/core-modules/workspace-invitation/services/workspace-invitation.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -50,7 +50,7 @@ export class WorkspaceInvitationResolver {
);
}
- @Mutation(() => SendInvitationsOutput)
+ @Mutation(() => SendInvitationsDTO)
@UseGuards(UserAuthGuard)
async resendWorkspaceInvitation(
@Args('appTokenId') appTokenId: string,
@@ -90,13 +90,13 @@ export class WorkspaceInvitationResolver {
return this.workspaceInvitationService.loadWorkspaceInvitations(workspace);
}
- @Mutation(() => SendInvitationsOutput)
+ @Mutation(() => SendInvitationsDTO)
@UseGuards(UserAuthGuard)
async sendInvitations(
@Args() sendInviteLinkInput: SendInvitationsInput,
@AuthUser() user: UserEntity,
@AuthWorkspace() workspace: WorkspaceEntity,
- ): Promise<SendInvitationsOutput> {
+ ): Promise<SendInvitationsDTO> {
const authContext = buildSystemAuthContext(workspace.id);
const workspaceMember =
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts b/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data.dto.ts
similarity index 95%
rename from packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts
rename to packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data.dto.ts
index bd8c7e1d353..2408aa4a099 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data.dto.ts
@@ -56,8 +56,8 @@ export class AuthBypassProvidersDTO {
microsoft: boolean;
}
-@ObjectType('PublicWorkspaceDataOutput')
-export class PublicWorkspaceDataOutput {
+@ObjectType('PublicWorkspaceData')
+export class PublicWorkspaceDataDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-bypass-providers-by-workspace.util.ts b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-bypass-providers-by-workspace.util.ts
index 3f127f603c0..daeb0a57b1a 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-bypass-providers-by-workspace.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-bypass-providers-by-workspace.util.ts
@@ -1,4 +1,4 @@
-import { type AuthBypassProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+import { type AuthBypassProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data.dto';
import { type WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
export const getAuthBypassProvidersByWorkspace = ({
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
index 29ceec8cd8a..89027a6d7cd 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
@@ -4,7 +4,7 @@ import {
SSOIdentityProviderStatus,
type WorkspaceSSOIdentityProviderEntity,
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-import { type AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+import { type AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data.dto';
import { type WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
export const getAuthProvidersByWorkspace = ({
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
index cf4988cee46..dea8e48ff90 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
@@ -28,7 +28,7 @@ import { DomainValidRecords } from 'src/engine/core-modules/dns-manager/dtos/dom
import { DnsManagerService } from 'src/engine/core-modules/dns-manager/services/dns-manager.service';
import { CustomDomainManagerService } from 'src/engine/core-modules/domain/custom-domain-manager/services/custom-domain-manager.service';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
-import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag-dto';
+import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag.dto';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { SignedFileDTO } from 'src/engine/core-modules/file/file-upload/dtos/signed-file.dto';
@@ -43,8 +43,8 @@ import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { ActivateWorkspaceInput } from 'src/engine/core-modules/workspace/dtos/activate-workspace-input';
import {
type AuthProvidersDTO,
- PublicWorkspaceDataOutput,
-} from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+ PublicWorkspaceDataDTO,
+} from 'src/engine/core-modules/workspace/dtos/public-workspace-data.dto';
import { UpdateWorkspaceInput } from 'src/engine/core-modules/workspace/dtos/update-workspace-input';
import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
import { WorkspaceService } from 'src/engine/core-modules/workspace/services/workspace.service';
@@ -416,12 +416,12 @@ export class WorkspaceResolver {
return this.viewService.findByWorkspaceId(workspace.id, userWorkspaceId);
}
- @Query(() => PublicWorkspaceDataOutput)
+ @Query(() => PublicWorkspaceDataDTO)
@UseGuards(PublicEndpointGuard, NoPermissionGuard)
async getPublicWorkspaceDataByDomain(
@OriginHeader() originHeader: string,
@Args('origin', { nullable: true }) origin?: string,
- ): Promise<PublicWorkspaceDataOutput | undefined> {
+ ): Promise<PublicWorkspaceDataDTO | undefined> {
try {
const systemEnabledProviders: AuthProvidersDTO = {
google: this.twentyConfigService.get('AUTH_GOOGLE_ENABLED'),
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/__tests__/morph-relation-from-create-field-input-to-flat-field-metadatas-to-create.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/__tests__/morph-relation-from-create-field-input-to-flat-field-metadatas-to-create.spec.ts
index cf38a96ec7a..ea945543ed9 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/__tests__/morph-relation-from-create-field-input-to-flat-field-metadatas-to-create.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/__tests__/morph-relation-from-create-field-input-to-flat-field-metadatas-to-create.spec.ts
@@ -38,6 +38,7 @@ const MOCK_FLAT_APPLICATION: FlatApplication = {
defaultRole: null,
settingsCustomTabFrontComponentId: null,
canBeUninstalled: false,
+ applicationRegistrationId: null,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/utils/__tests__/generate-morph-or-relation-flat-field-metadata-pair.spec.ts b/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/utils/__tests__/generate-morph-or-relation-flat-field-metadata-pair.spec.ts
index a1c0fec51fe..e55c01d0086 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/utils/__tests__/generate-morph-or-relation-flat-field-metadata-pair.spec.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/utils/__tests__/generate-morph-or-relation-flat-field-metadata-pair.spec.ts
@@ -33,6 +33,7 @@ const MOCK_FLAT_APPLICATION: FlatApplication = {
defaultRole: null,
settingsCustomTabFrontComponentId: null,
canBeUninstalled: false,
+ applicationRegistrationId: null,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-create-role-input-to-flat-role-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-create-role-input-to-flat-role-to-create.util.ts
index 42223007c91..e2539f9f079 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-create-role-input-to-flat-role-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-create-role-input-to-flat-role-to-create.util.ts
@@ -3,7 +3,7 @@ import { v4 } from 'uuid';
import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
import { type FlatRole } from 'src/engine/metadata-modules/flat-role/types/flat-role.type';
-import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role-input.dto';
+import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role.input';
export const fromCreateRoleInputToFlatRoleToCreate = ({
createRoleInput,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-update-role-input-to-flat-role-to-update-or-throw.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-update-role-input-to-flat-role-to-update-or-throw.util.ts
index 1bfa554a0fb..af3b7068d26 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-update-role-input-to-flat-role-to-update-or-throw.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-role/utils/from-update-role-input-to-flat-role-to-update-or-throw.util.ts
@@ -8,7 +8,7 @@ import {
PermissionsException,
PermissionsExceptionCode,
} from 'src/engine/metadata-modules/permissions/permissions.exception';
-import { type UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role-input.dto';
+import { type UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role.input';
export const fromUpdateRoleInputToFlatRoleToUpdateOrThrow = ({
flatRoleMaps,
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/dtos/create-role-input.dto.ts b/packages/twenty-server/src/engine/metadata-modules/role/dtos/create-role.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/metadata-modules/role/dtos/create-role-input.dto.ts
rename to packages/twenty-server/src/engine/metadata-modules/role/dtos/create-role.input.ts
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/dtos/update-role-input.dto.ts b/packages/twenty-server/src/engine/metadata-modules/role/dtos/update-role.input.ts
similarity index 100%
rename from packages/twenty-server/src/engine/metadata-modules/role/dtos/update-role-input.dto.ts
rename to packages/twenty-server/src/engine/metadata-modules/role/dtos/update-role.input.ts
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts b/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
index c805b2384bc..4c5587ee1c9 100644
--- a/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
@@ -48,12 +48,12 @@ import {
PermissionsExceptionMessage,
} from 'src/engine/metadata-modules/permissions/permissions.exception';
import { PermissionsGraphqlApiExceptionFilter } from 'src/engine/metadata-modules/permissions/utils/permissions-graphql-api-exception.filter';
-import { CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role-input.dto';
+import { CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role.input';
import {
ApiKeyForRoleDTO,
RoleDTO,
} from 'src/engine/metadata-modules/role/dtos/role.dto';
-import { UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role-input.dto';
+import { UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role.input';
import { RoleService } from 'src/engine/metadata-modules/role/role.service';
import { fromRoleEntitiesToRoleDtos } from 'src/engine/metadata-modules/role/utils/fromRoleEntityToRoleDto.util';
import { UpsertRowLevelPermissionPredicatesInput } from 'src/engine/metadata-modules/row-level-permission-predicate/dtos/inputs/upsert-row-level-permission-predicates.input';
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/role.service.ts b/packages/twenty-server/src/engine/metadata-modules/role/role.service.ts
index f81bf4ab44c..561451c714e 100644
--- a/packages/twenty-server/src/engine/metadata-modules/role/role.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/role/role.service.ts
@@ -20,9 +20,9 @@ import {
PermissionsExceptionCode,
PermissionsExceptionMessage,
} from 'src/engine/metadata-modules/permissions/permissions.exception';
-import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role-input.dto';
+import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role.input';
import { RoleDTO } from 'src/engine/metadata-modules/role/dtos/role.dto';
-import { type UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role-input.dto';
+import { type UpdateRoleInput } from 'src/engine/metadata-modules/role/dtos/update-role.input';
import { RoleEntity } from 'src/engine/metadata-modules/role/role.entity';
import { fromFlatRoleToRoleDto } from 'src/engine/metadata-modules/role/utils/fromFlatRoleToRoleDto.util';
import { UserRoleService } from 'src/engine/metadata-modules/user-role/user-role.service';
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/bar-chart-data-output.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/bar-chart-data.dto.ts
similarity index 90%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/bar-chart-data-output.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/bar-chart-data.dto.ts
index 6a1587f38a9..43acd87404e 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/bar-chart-data-output.dto.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/bar-chart-data.dto.ts
@@ -4,10 +4,10 @@ import { GraphQLJSON } from 'graphql-type-json';
import { BarChartGroupMode } from 'src/engine/metadata-modules/page-layout-widget/enums/bar-chart-group-mode.enum';
import { BarChartLayout } from 'src/engine/metadata-modules/page-layout-widget/enums/bar-chart-layout.enum';
-import { BarChartSeriesDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/bar-chart-series.dto';
+import { BarChartSeriesDTO } from 'src/modules/dashboard/chart-data/dtos/bar-chart-series.dto';
-@ObjectType('BarChartDataOutput')
-export class BarChartDataOutputDTO {
+@ObjectType('BarChartData')
+export class BarChartDataDTO {
@Field(() => [GraphQLJSON])
data: Record<string, string | number>[];
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/bar-chart-series.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/bar-chart-series.dto.ts
similarity index 100%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/bar-chart-series.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/bar-chart-series.dto.ts
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-point.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-data-point.dto.ts
similarity index 100%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-point.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-data-point.dto.ts
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-output.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-data.dto.ts
similarity index 83%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-output.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-data.dto.ts
index 71f984edc67..09a5b7f41c5 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-output.dto.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-data.dto.ts
@@ -2,10 +2,10 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json';
-import { LineChartSeriesDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/line-chart-series.dto';
+import { LineChartSeriesDTO } from 'src/modules/dashboard/chart-data/dtos/line-chart-series.dto';
-@ObjectType('LineChartDataOutput')
-export class LineChartDataOutputDTO {
+@ObjectType('LineChartData')
+export class LineChartDataDTO {
@Field(() => [LineChartSeriesDTO])
series: LineChartSeriesDTO[];
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-series.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-series.dto.ts
similarity index 87%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-series.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-series.dto.ts
index 0090f46ede3..0fd2df583b2 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/line-chart-series.dto.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/line-chart-series.dto.ts
@@ -1,6 +1,6 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { LineChartDataPointDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-point.dto';
+import { LineChartDataPointDTO } from 'src/modules/dashboard/chart-data/dtos/line-chart-data-point.dto';
@ObjectType('LineChartSeries')
export class LineChartSeriesDTO {
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-item.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/pie-chart-data-item.dto.ts
similarity index 100%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-item.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/pie-chart-data-item.dto.ts
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-output.dto.ts b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/pie-chart-data.dto.ts
similarity index 81%
rename from packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-output.dto.ts
rename to packages/twenty-server/src/modules/dashboard/chart-data/dtos/pie-chart-data.dto.ts
index 4fb88c8485b..9108cec0fda 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-output.dto.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/dtos/pie-chart-data.dto.ts
@@ -2,10 +2,10 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { GraphQLJSON } from 'graphql-type-json';
-import { PieChartDataItemDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-item.dto';
+import { PieChartDataItemDTO } from 'src/modules/dashboard/chart-data/dtos/pie-chart-data-item.dto';
-@ObjectType('PieChartDataOutput')
-export class PieChartDataOutputDTO {
+@ObjectType('PieChartData')
+export class PieChartDataDTO {
@Field(() => [PieChartDataItemDTO])
data: PieChartDataItemDTO[];
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/bar-chart-data.resolver.ts b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/bar-chart-data.resolver.ts
index d1b60cffee4..61b8bd8d474 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/bar-chart-data.resolver.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/bar-chart-data.resolver.ts
@@ -13,7 +13,7 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { BarChartDataInput } from 'src/modules/dashboard/chart-data/dtos/inputs/bar-chart-data.input';
-import { BarChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/bar-chart-data-output.dto';
+import { BarChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/bar-chart-data.dto';
import { ChartDataGraphqlApiExceptionFilter } from 'src/modules/dashboard/chart-data/filters/chart-data-graphql-api-exception.filter';
import { BarChartDataService } from 'src/modules/dashboard/chart-data/services/bar-chart-data.service';
@@ -24,7 +24,7 @@ import { BarChartDataService } from 'src/modules/dashboard/chart-data/services/b
export class BarChartDataResolver {
constructor(private readonly barChartDataService: BarChartDataService) {}
- @Query(() => BarChartDataOutputDTO)
+ @Query(() => BarChartDataDTO)
@UseGuards(NoPermissionGuard)
async barChartData(
@Args('input') input: BarChartDataInput,
@@ -32,7 +32,7 @@ export class BarChartDataResolver {
@AuthUser() user: UserEntity,
@AuthWorkspaceMemberId() workspaceMemberId: string,
@AuthUserWorkspaceId() userWorkspaceId: string,
- ): Promise<BarChartDataOutputDTO> {
+ ): Promise<BarChartDataDTO> {
const authContext: AuthContext = {
user,
workspace,
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/line-chart-data.resolver.ts b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/line-chart-data.resolver.ts
index 0afebf50d08..5555d920f7e 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/line-chart-data.resolver.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/line-chart-data.resolver.ts
@@ -13,7 +13,7 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { LineChartDataInput } from 'src/modules/dashboard/chart-data/dtos/inputs/line-chart-data.input';
-import { LineChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-output.dto';
+import { LineChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/line-chart-data.dto';
import { ChartDataGraphqlApiExceptionFilter } from 'src/modules/dashboard/chart-data/filters/chart-data-graphql-api-exception.filter';
import { LineChartDataService } from 'src/modules/dashboard/chart-data/services/line-chart-data.service';
@@ -24,7 +24,7 @@ import { LineChartDataService } from 'src/modules/dashboard/chart-data/services/
export class LineChartDataResolver {
constructor(private readonly lineChartDataService: LineChartDataService) {}
- @Query(() => LineChartDataOutputDTO)
+ @Query(() => LineChartDataDTO)
@UseGuards(NoPermissionGuard)
async lineChartData(
@Args('input') input: LineChartDataInput,
@@ -32,7 +32,7 @@ export class LineChartDataResolver {
@AuthUser() user: UserEntity,
@AuthWorkspaceMemberId() workspaceMemberId: string,
@AuthUserWorkspaceId() userWorkspaceId: string,
- ): Promise<LineChartDataOutputDTO> {
+ ): Promise<LineChartDataDTO> {
const authContext: AuthContext = {
user,
workspace,
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/pie-chart-data.resolver.ts b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/pie-chart-data.resolver.ts
index 6921741533b..9cf62589368 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/pie-chart-data.resolver.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/resolvers/pie-chart-data.resolver.ts
@@ -13,7 +13,7 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { PieChartDataInput } from 'src/modules/dashboard/chart-data/dtos/inputs/pie-chart-data.input';
-import { PieChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-output.dto';
+import { PieChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/pie-chart-data.dto';
import { ChartDataGraphqlApiExceptionFilter } from 'src/modules/dashboard/chart-data/filters/chart-data-graphql-api-exception.filter';
import { PieChartDataService } from 'src/modules/dashboard/chart-data/services/pie-chart-data.service';
@@ -24,7 +24,7 @@ import { PieChartDataService } from 'src/modules/dashboard/chart-data/services/p
export class PieChartDataResolver {
constructor(private readonly pieChartDataService: PieChartDataService) {}
- @Query(() => PieChartDataOutputDTO)
+ @Query(() => PieChartDataDTO)
@UseGuards(NoPermissionGuard)
async pieChartData(
@Args('input') input: PieChartDataInput,
@@ -32,7 +32,7 @@ export class PieChartDataResolver {
@AuthUser() user: UserEntity,
@AuthWorkspaceMemberId() workspaceMemberId: string,
@AuthUserWorkspaceId() userWorkspaceId: string,
- ): Promise<PieChartDataOutputDTO> {
+ ): Promise<PieChartDataDTO> {
const authContext: AuthContext = {
user,
workspace,
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/services/bar-chart-data.service.ts b/packages/twenty-server/src/modules/dashboard/chart-data/services/bar-chart-data.service.ts
index 5a98f4f2c8c..b34d522eb91 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/services/bar-chart-data.service.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/services/bar-chart-data.service.ts
@@ -19,7 +19,7 @@ import { GraphOrderBy } from 'src/engine/metadata-modules/page-layout-widget/enu
import { BAR_CHART_MAXIMUM_NUMBER_OF_BARS } from 'src/modules/dashboard/chart-data/constants/bar-chart-maximum-number-of-bars.constant';
import { BAR_CHART_MAXIMUM_NUMBER_OF_GROUPS_PER_BAR } from 'src/modules/dashboard/chart-data/constants/bar-chart-maximum-number-of-groups-per-bar.constant';
import { EXTRA_ITEM_TO_DETECT_TOO_MANY_GROUPS } from 'src/modules/dashboard/chart-data/constants/extra-item-to-detect-too-many-groups.constant';
-import { BarChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/bar-chart-data-output.dto';
+import { BarChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/bar-chart-data.dto';
import {
ChartDataException,
ChartDataExceptionCode,
@@ -59,7 +59,7 @@ export class BarChartDataService {
objectMetadataId,
configuration,
authContext,
- }: GetBarChartDataParams): Promise<BarChartDataOutputDTO> {
+ }: GetBarChartDataParams): Promise<BarChartDataDTO> {
try {
const { flatObjectMetadataMaps, flatFieldMetadataMaps } =
await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
@@ -218,7 +218,7 @@ export class BarChartDataService {
configuration: BarChartConfigurationDTO;
userTimezone: string;
firstDayOfTheWeek: CalendarStartDay;
- }): BarChartDataOutputDTO {
+ }): BarChartDataDTO {
const layout = configuration.layout ?? BarChartLayout.VERTICAL;
const isHorizontal = layout === BarChartLayout.HORIZONTAL;
@@ -354,7 +354,7 @@ export class BarChartDataService {
configuration: BarChartConfigurationDTO;
userTimezone: string;
firstDayOfTheWeek: CalendarStartDay;
- }): BarChartDataOutputDTO {
+ }): BarChartDataDTO {
const layout = configuration.layout ?? BarChartLayout.VERTICAL;
const isHorizontal = layout === BarChartLayout.HORIZONTAL;
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/services/line-chart-data.service.ts b/packages/twenty-server/src/modules/dashboard/chart-data/services/line-chart-data.service.ts
index ba268738f8f..2775ff90587 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/services/line-chart-data.service.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/services/line-chart-data.service.ts
@@ -17,7 +17,7 @@ import { EXTRA_ITEM_TO_DETECT_TOO_MANY_GROUPS } from 'src/modules/dashboard/char
import { LINE_CHART_MAXIMUM_NUMBER_OF_DATA_POINTS } from 'src/modules/dashboard/chart-data/constants/line-chart-maximum-number-of-data-points.constant';
import { LINE_CHART_MAXIMUM_NUMBER_OF_NON_STACKED_SERIES } from 'src/modules/dashboard/chart-data/constants/line-chart-maximum-number-of-non-stacked-series.constant';
import { LINE_CHART_MAXIMUM_NUMBER_OF_STACKED_SERIES } from 'src/modules/dashboard/chart-data/constants/line-chart-maximum-number-of-stacked-series.constant';
-import { LineChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/line-chart-data-output.dto';
+import { LineChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/line-chart-data.dto';
import {
ChartDataException,
ChartDataExceptionCode,
@@ -58,7 +58,7 @@ export class LineChartDataService {
objectMetadataId,
configuration,
authContext,
- }: GetLineChartDataParams): Promise<LineChartDataOutputDTO> {
+ }: GetLineChartDataParams): Promise<LineChartDataDTO> {
try {
const { flatObjectMetadataMaps, flatFieldMetadataMaps } =
await this.workspaceManyOrAllFlatEntityMapsCacheService.getOrRecomputeManyOrAllFlatEntityMaps(
@@ -228,7 +228,7 @@ export class LineChartDataService {
userTimezone: string;
firstDayOfTheWeek: CalendarStartDay;
seriesIdPrefix: string;
- }): LineChartDataOutputDTO {
+ }): LineChartDataDTO {
const filteredResults = configuration.omitNullValues
? rawResults.filter(
(result) =>
@@ -355,7 +355,7 @@ export class LineChartDataService {
userTimezone: string;
firstDayOfTheWeek: CalendarStartDay;
seriesIdPrefix: string;
- }): LineChartDataOutputDTO {
+ }): LineChartDataDTO {
const filteredResults = configuration.omitNullValues
? rawResults.filter(
(result) =>
diff --git a/packages/twenty-server/src/modules/dashboard/chart-data/services/pie-chart-data.service.ts b/packages/twenty-server/src/modules/dashboard/chart-data/services/pie-chart-data.service.ts
index bc632354ce6..9667dbfd5d2 100644
--- a/packages/twenty-server/src/modules/dashboard/chart-data/services/pie-chart-data.service.ts
+++ b/packages/twenty-server/src/modules/dashboard/chart-data/services/pie-chart-data.service.ts
@@ -15,7 +15,7 @@ import { PieChartConfigurationDTO } from 'src/engine/metadata-modules/page-layou
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
import { EXTRA_ITEM_TO_DETECT_TOO_MANY_GROUPS } from 'src/modules/dashboard/chart-data/constants/extra-item-to-detect-too-many-groups.constant';
import { PIE_CHART_MAXIMUM_NUMBER_OF_SLICES } from 'src/modules/dashboard/chart-data/constants/pie-chart-maximum-number-of-slices.constant';
-import { PieChartDataOutputDTO } from 'src/modules/dashboard/chart-data/dtos/outputs/pie-chart-data-output.dto';
+import { PieChartDataDTO } from 'src/modules/dashboard/chart-data/dtos/pie-chart-data.dto';
import {
ChartDataException,
ChartDataExceptionCode,
@@ -46,7 +46,7 @@ export class PieChartDataService {
objectMetadataId,
configuration,
authContext,
- }: GetPieChartDataParams): Promise<PieChartDataOutputDTO> {
+ }: GetPieChartDataParams): Promise<PieChartDataDTO> {
try {
if (
configuration.configurationType !== WidgetConfigurationType.PIE_CHART
@@ -172,7 +172,7 @@ export class PieChartDataService {
configuration: PieChartConfigurationDTO;
userTimezone: string;
firstDayOfTheWeek: CalendarStartDay;
- }): PieChartDataOutputDTO {
+ }): PieChartDataDTO {
const filteredResults = configuration.hideEmptyCategory
? rawResults.filter(
(result) =>
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-creation.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-creation.workspace-service.ts
index b89e1f02947..006948ab191 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-creation.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-creation.workspace-service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { isDefined } from 'twenty-shared/utils';
-import { type CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto';
+import { type CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step.input';
import { type WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
import {
WorkflowVersionStepException,
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-operations.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-operations.workspace-service.ts
index e3df157088e..37570f84ce8 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-operations.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-operations.workspace-service.ts
@@ -16,7 +16,7 @@ import { Repository } from 'typeorm';
import { v4 } from 'uuid';
import { getFlatFieldsFromFlatObjectMetadata } from 'src/engine/api/graphql/workspace-schema-builder/utils/get-flat-fields-for-flat-object-metadata.util';
-import { type WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-input.dto';
+import { type WorkflowStepPositionInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position.input';
import { AiAgentRoleService } from 'src/engine/metadata-modules/ai/ai-agent-role/ai-agent-role.service';
import { AgentService } from 'src/engine/metadata-modules/ai/ai-agent/agent.service';
import { DEFAULT_SMART_MODEL } from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step.workspace-service.ts
index 4994c94beb7..1c29e91b7b1 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step.workspace-service.ts
@@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
-import { type CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto';
+import { type CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step.input';
import { WorkflowActionDTO } from 'src/engine/core-modules/workflow/dtos/workflow-action.dto';
import { type WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
import { WorkflowVersionStepCreationWorkspaceService } from 'src/modules/workflow/workflow-builder/workflow-version-step/workflow-version-step-creation.workspace-service';
diff --git a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version/workflow-version.workspace-service.ts b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version/workflow-version.workspace-service.ts
index 3ce13136c84..554a3f98977 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version/workflow-version.workspace-service.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-builder/workflow-version/workflow-version.workspace-service.ts
@@ -5,7 +5,7 @@ import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { WithLock } from 'src/engine/core-modules/cache-lock/with-lock.decorator';
import { RecordPositionService } from 'src/engine/core-modules/record-position/services/record-position.service';
-import { type WorkflowStepPositionUpdateInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-update-input.dto';
+import { type WorkflowStepPositionUpdateInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-step-position-update.input';
import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager';
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
import {
diff --git a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/create-workflow-version-step.tool.ts b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/create-workflow-version-step.tool.ts
index 9de720f7c35..5d6198cb558 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/create-workflow-version-step.tool.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/create-workflow-version-step.tool.ts
@@ -2,7 +2,7 @@ import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { z } from 'zod';
-import type { CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step-input.dto';
+import type { CreateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/create-workflow-version-step.input';
import { type WorkflowVersionStepChangesDTO } from 'src/engine/core-modules/workflow/dtos/workflow-version-step-changes.dto';
import { WorkflowActionType } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action-type.enum';
import {
diff --git a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-positions.tool.ts b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-positions.tool.ts
index 6c08e268c2c..ae2ac3dcf04 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-positions.tool.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-positions.tool.ts
@@ -1,6 +1,6 @@
import { z } from 'zod';
-import type { UpdateWorkflowVersionPositionsInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-positions-input.dto';
+import type { UpdateWorkflowVersionPositionsInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-positions.input';
import {
type WorkflowToolContext,
type WorkflowToolDependencies,
diff --git a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-step.tool.ts b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-step.tool.ts
index 962d313ab0a..1d3110d7710 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-step.tool.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-step.tool.ts
@@ -1,7 +1,7 @@
import { workflowActionSchema } from 'twenty-shared/workflow';
import { z } from 'zod';
-import type { UpdateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-step-input.dto';
+import type { UpdateWorkflowVersionStepInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-step.input';
import {
type WorkflowToolContext,
type WorkflowToolDependencies,
diff --git a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-trigger.tool.ts b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-trigger.tool.ts
index d5d495eb51f..82aee5f6b80 100644
--- a/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-trigger.tool.ts
+++ b/packages/twenty-server/src/modules/workflow/workflow-tools/tools/update-workflow-version-trigger.tool.ts
@@ -1,7 +1,7 @@
import { workflowTriggerSchema } from 'twenty-shared/workflow';
import { z } from 'zod';
-import type { UpdateWorkflowVersionTriggerInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-trigger-input.dto';
+import type { UpdateWorkflowVersionTriggerInput } from 'src/engine/core-modules/workflow/dtos/update-workflow-version-trigger.input';
import {
type WorkflowToolContext,
type WorkflowToolDependencies,
diff --git a/packages/twenty-server/test/integration/graphql/utils/sign-up-in-new-workspace.util.ts b/packages/twenty-server/test/integration/graphql/utils/sign-up-in-new-workspace.util.ts
index 34c34a63493..26d4072b3a4 100644
--- a/packages/twenty-server/test/integration/graphql/utils/sign-up-in-new-workspace.util.ts
+++ b/packages/twenty-server/test/integration/graphql/utils/sign-up-in-new-workspace.util.ts
@@ -4,7 +4,7 @@ import { warnIfErrorButNotExpectedToFail } from 'test/integration/metadata/utils
import { warnIfNoErrorButExpectedToFail } from 'test/integration/metadata/utils/warn-if-no-error-but-expected-to-fail.util';
import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
-import { type SignUpOutput } from 'src/engine/core-modules/auth/dto/sign-up.output';
+import { type SignUpDTO } from 'src/engine/core-modules/auth/dto/sign-up.dto';
type SignUpOnNewWorkspaceUtilArgs = {
accessToken: string;
@@ -15,7 +15,7 @@ export const signUpInNewWorkspace = async ({
accessToken,
expectToFail,
}: SignUpOnNewWorkspaceUtilArgs): CommonResponseBody<{
- signUpInNewWorkspace: SignUpOutput;
+ signUpInNewWorkspace: SignUpDTO;
}> => {
const mutation = gql`
mutation SignUpInNewWorkspace {
diff --git a/packages/twenty-server/test/integration/graphql/utils/sign-up.util.ts b/packages/twenty-server/test/integration/graphql/utils/sign-up.util.ts
index 917769acb84..404565c2552 100644
--- a/packages/twenty-server/test/integration/graphql/utils/sign-up.util.ts
+++ b/packages/twenty-server/test/integration/graphql/utils/sign-up.util.ts
@@ -4,7 +4,7 @@ import { warnIfErrorButNotExpectedToFail } from 'test/integration/metadata/utils
import { warnIfNoErrorButExpectedToFail } from 'test/integration/metadata/utils/warn-if-no-error-but-expected-to-fail.util';
import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
-import { type AvailableWorkspacesAndAccessTokensOutput } from 'src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.output';
+import { type AvailableWorkspacesAndAccessTokensDTO } from 'src/engine/core-modules/auth/dto/available-workspaces-and-access-tokens.dto';
import { type UserCredentialsInput } from 'src/engine/core-modules/auth/dto/user-credentials.input';
type SignUpUtilArgs = {
@@ -16,7 +16,7 @@ export const signUp = async ({
input,
expectToFail,
}: SignUpUtilArgs): CommonResponseBody<{
- signUp: AvailableWorkspacesAndAccessTokensOutput;
+ signUp: AvailableWorkspacesAndAccessTokensDTO;
}> => {
const mutation = gql`
mutation SignUp(
diff --git a/packages/twenty-server/test/integration/metadata/suites/role/failing-role-creation.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/role/failing-role-creation.integration-spec.ts
index fa08e112a2f..1c9de7c7593 100644
--- a/packages/twenty-server/test/integration/metadata/suites/role/failing-role-creation.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/role/failing-role-creation.integration-spec.ts
@@ -7,7 +7,7 @@ import {
} from 'twenty-shared/testing';
import { isDefined } from 'twenty-shared/utils';
-import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role-input.dto';
+import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role.input';
type TestContext = {
input: CreateRoleInput;
diff --git a/packages/twenty-server/test/integration/metadata/suites/role/failing-role-update.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/role/failing-role-update.integration-spec.ts
index bda4539f36a..a9991668804 100644
--- a/packages/twenty-server/test/integration/metadata/suites/role/failing-role-update.integration-spec.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/role/failing-role-update.integration-spec.ts
@@ -9,7 +9,7 @@ import {
type EachTestingContext,
} from 'twenty-shared/testing';
-import { type UpdateRolePayload } from 'src/engine/metadata-modules/role/dtos/update-role-input.dto';
+import { type UpdateRolePayload } from 'src/engine/metadata-modules/role/dtos/update-role.input';
type TestContext = {
input: (testSetup: TestSetup) => {
diff --git a/packages/twenty-server/test/integration/metadata/suites/role/utils/create-one-role-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/role/utils/create-one-role-query-factory.util.ts
index 9f94b9cb889..0563bbf052f 100644
--- a/packages/twenty-server/test/integration/metadata/suites/role/utils/create-one-role-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/role/utils/create-one-role-query-factory.util.ts
@@ -1,7 +1,7 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
-import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role-input.dto';
+import { type CreateRoleInput } from 'src/engine/metadata-modules/role/dtos/create-role.input';
export type CreateOneRoleFactoryInput = CreateRoleInput;
diff --git a/packages/twenty-server/test/integration/metadata/suites/role/utils/update-one-role-query-factory.util.ts b/packages/twenty-server/test/integration/metadata/suites/role/utils/update-one-role-query-factory.util.ts
index 3c37d329e1e..6abd5b64d1f 100644
--- a/packages/twenty-server/test/integration/metadata/suites/role/utils/update-one-role-query-factory.util.ts
+++ b/packages/twenty-server/test/integration/metadata/suites/role/utils/update-one-role-query-factory.util.ts
@@ -1,7 +1,7 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
-import { type UpdateRolePayload } from 'src/engine/metadata-modules/role/dtos/update-role-input.dto';
+import { type UpdateRolePayload } from 'src/engine/metadata-modules/role/dtos/update-role.input';
export type UpdateOneRoleFactoryInput = {
idToUpdate: string;
diff --git a/packages/twenty-server/test/integration/oauth/suites/oauth.integration-spec.ts b/packages/twenty-server/test/integration/oauth/suites/oauth.integration-spec.ts
new file mode 100644
index 00000000000..ce052b5d5b0
--- /dev/null
+++ b/packages/twenty-server/test/integration/oauth/suites/oauth.integration-spec.ts
@@ -0,0 +1,630 @@
+import crypto from 'crypto';
+
+import bcrypt from 'bcrypt';
+import request from 'supertest';
+import { type DataSource } from 'typeorm';
+import { base64UrlEncode } from 'twenty-shared/utils';
+
+import { AppTokenType } from 'src/engine/core-modules/app-token/app-token.entity';
+
+const TEST_WORKSPACE_ID = '20202020-1c25-4d02-bf25-6aeccf7ea419';
+const TEST_USER_ID = '20202020-e6b5-4680-8a32-b8209737156b';
+
+type TestRegistration = {
+ id: string;
+ universalIdentifier: string;
+ name: string;
+ description: string | null;
+ oAuthClientId: string;
+ oAuthRedirectUris: string[];
+ oAuthScopes: string[];
+};
+
+type TestApplication = {
+ id: string;
+};
+
+const insertRegistration = async (
+ ds: DataSource,
+ params: {
+ name: string;
+ description?: string;
+ clientSecretHash: string;
+ redirectUris: string[];
+ scopes: string[];
+ },
+): Promise<TestRegistration> => {
+ const id = crypto.randomUUID();
+ const universalIdentifier = crypto.randomUUID();
+ const oAuthClientId = crypto.randomUUID();
+
+ await ds.query(
+ `INSERT INTO core."applicationRegistration"
+ (id, "universalIdentifier", name, description, "oAuthClientId", "oAuthClientSecretHash", "oAuthRedirectUris", "oAuthScopes")
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`,
+ [
+ id,
+ universalIdentifier,
+ params.name,
+ params.description ?? null,
+ oAuthClientId,
+ params.clientSecretHash,
+ params.redirectUris,
+ params.scopes,
+ ],
+ );
+
+ return {
+ id,
+ universalIdentifier,
+ name: params.name,
+ description: params.description ?? null,
+ oAuthClientId,
+ oAuthRedirectUris: params.redirectUris,
+ oAuthScopes: params.scopes,
+ };
+};
+
+const insertApplication = async (
+ ds: DataSource,
+ params: {
+ universalIdentifier: string;
+ name: string;
+ workspaceId: string;
+ applicationRegistrationId: string;
+ },
+): Promise<TestApplication> => {
+ const id = crypto.randomUUID();
+
+ await ds.query(
+ `INSERT INTO core."application"
+ (id, "universalIdentifier", name, "workspaceId", "applicationRegistrationId", "sourceType", "sourcePath", "canBeUninstalled")
+ VALUES ($1, $2, $3, $4, $5, 'local', '', true)`,
+ [
+ id,
+ params.universalIdentifier,
+ params.name,
+ params.workspaceId,
+ params.applicationRegistrationId,
+ ],
+ );
+
+ return { id };
+};
+
+const insertAppToken = async (
+ ds: DataSource,
+ params: {
+ value: string;
+ type: AppTokenType;
+ userId: string;
+ workspaceId: string;
+ expiresAt: Date;
+ context?: Record<string, string>;
+ },
+): Promise<string> => {
+ const rows = await ds.query(
+ `INSERT INTO core."appToken"
+ (value, type, "userId", "workspaceId", "expiresAt", context)
+ VALUES ($1, $2, $3, $4, $5, $6)
+ RETURNING id`,
+ [
+ params.value,
+ params.type,
+ params.userId,
+ params.workspaceId,
+ params.expiresAt,
+ params.context ? JSON.stringify(params.context) : null,
+ ],
+ );
+
+ return rows[0].id;
+};
+
+describe('OAuth (integration)', () => {
+ const baseUrl = `http://localhost:${APP_PORT}`;
+
+ let ds: DataSource;
+
+ let testRegistration: TestRegistration;
+ let testClientSecret: string;
+ let testApplication: TestApplication;
+
+ let autoInstallRegistration: TestRegistration;
+ let autoInstallClientSecret: string;
+
+ const createdEntityIds: {
+ registrations: string[];
+ tokens: string[];
+ applications: string[];
+ } = { registrations: [], tokens: [], applications: [] };
+
+ beforeAll(async () => {
+ ds = global.testDataSource;
+
+ testClientSecret = crypto.randomBytes(32).toString('hex');
+ const clientSecretHash = await bcrypt.hash(testClientSecret, 10);
+
+ testRegistration = await insertRegistration(ds, {
+ name: 'OAuth Integration Test App',
+ clientSecretHash,
+ redirectUris: ['https://example.com/callback'],
+ scopes: ['read', 'write'],
+ });
+ createdEntityIds.registrations.push(testRegistration.id);
+
+ testApplication = await insertApplication(ds, {
+ universalIdentifier: testRegistration.universalIdentifier,
+ name: testRegistration.name,
+ workspaceId: TEST_WORKSPACE_ID,
+ applicationRegistrationId: testRegistration.id,
+ });
+
+ autoInstallClientSecret = crypto.randomBytes(32).toString('hex');
+ const autoInstallSecretHash = await bcrypt.hash(
+ autoInstallClientSecret,
+ 10,
+ );
+
+ autoInstallRegistration = await insertRegistration(ds, {
+ name: 'OAuth Auto-Install Test App',
+ description: 'App for testing OAuth auto-install',
+ clientSecretHash: autoInstallSecretHash,
+ redirectUris: ['https://example.com/callback'],
+ scopes: ['api'],
+ });
+ createdEntityIds.registrations.push(autoInstallRegistration.id);
+ });
+
+ afterAll(async () => {
+ if (createdEntityIds.tokens.length > 0) {
+ const placeholders = createdEntityIds.tokens
+ .map((_, i) => `$${i + 1}`)
+ .join(', ');
+
+ await ds.query(
+ `DELETE FROM core."appToken" WHERE id IN (${placeholders})`,
+ createdEntityIds.tokens,
+ );
+ }
+
+ if (createdEntityIds.applications.length > 0) {
+ const placeholders = createdEntityIds.applications
+ .map((_, i) => `$${i + 1}`)
+ .join(', ');
+
+ await ds.query(
+ `DELETE FROM core."application" WHERE id IN (${placeholders})`,
+ createdEntityIds.applications,
+ );
+ }
+
+ if (testApplication) {
+ await ds.query(`DELETE FROM core."application" WHERE id = $1`, [
+ testApplication.id,
+ ]);
+ }
+
+ if (createdEntityIds.registrations.length > 0) {
+ const placeholders = createdEntityIds.registrations
+ .map((_, i) => `$${i + 1}`)
+ .join(', ');
+
+ await ds.query(
+ `DELETE FROM core."applicationRegistration" WHERE id IN (${placeholders})`,
+ createdEntityIds.registrations,
+ );
+ }
+ });
+
+ const postToken = (body: Record<string, string>) =>
+ request(baseUrl).post('/oauth/token').send(body);
+
+ describe('Discovery endpoint', () => {
+ it('should return OAuth authorization server metadata', async () => {
+ const res = await request(baseUrl)
+ .get('/.well-known/oauth-authorization-server')
+ .expect(200);
+
+ expect(res.body.token_endpoint).toContain('/oauth/token');
+ expect(res.body.grant_types_supported).toEqual(
+ expect.arrayContaining([
+ 'authorization_code',
+ 'client_credentials',
+ 'refresh_token',
+ ]),
+ );
+ expect(res.body.code_challenge_methods_supported).toContain('S256');
+ expect(res.body.scopes_supported).toBeDefined();
+ expect(res.body.response_types_supported).toContain('code');
+ });
+ });
+
+ describe('Token endpoint validation', () => {
+ it('should return 400 for unsupported grant_type', async () => {
+ const res = await postToken({
+ grant_type: 'password',
+ client_id: testRegistration.oAuthClientId,
+ }).expect(400);
+
+ expect(res.body.error).toBe('unsupported_grant_type');
+ });
+
+ it('should return 400 for invalid client_id', async () => {
+ const res = await postToken({
+ grant_type: 'client_credentials',
+ client_id: 'non-existent-client',
+ client_secret: testClientSecret,
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_client');
+ });
+
+ it('should return 400 for invalid client_secret', async () => {
+ const res = await postToken({
+ grant_type: 'client_credentials',
+ client_id: testRegistration.oAuthClientId,
+ client_secret: 'wrong-secret',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_client');
+ });
+
+ it('should return 400 when grant_type is missing', async () => {
+ await postToken({
+ client_id: testRegistration.oAuthClientId,
+ }).expect(400);
+ });
+ });
+
+ describe('Client credentials grant', () => {
+ it('should issue an access token for valid credentials', async () => {
+ const res = await postToken({
+ grant_type: 'client_credentials',
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+ expect(res.body.token_type).toBe('Bearer');
+ expect(res.body.expires_in).toBeGreaterThan(0);
+ expect(res.body.scope).toBe('read write');
+ expect(res.body.refresh_token).toBeUndefined();
+ });
+ });
+
+ describe('Authorization code grant', () => {
+ const createAuthorizationCode = async (
+ redirectUri = 'https://example.com/callback',
+ ): Promise<string> => {
+ const code = crypto.randomBytes(42).toString('hex');
+
+ const tokenId = await insertAppToken(ds, {
+ value: code,
+ type: AppTokenType.AuthorizationCode,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() + 5 * 60 * 1000),
+ context: { redirectUri },
+ });
+
+ createdEntityIds.tokens.push(tokenId);
+
+ return code;
+ };
+
+ it('should exchange a valid authorization code for tokens', async () => {
+ const code = await createAuthorizationCode();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+ expect(res.body.refresh_token).toBeDefined();
+ expect(res.body.token_type).toBe('Bearer');
+ expect(res.body.expires_in).toBeGreaterThan(0);
+ });
+
+ it('should reject a reused authorization code', async () => {
+ const code = await createAuthorizationCode();
+
+ await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_grant');
+ });
+
+ it('should reject an expired authorization code', async () => {
+ const code = crypto.randomBytes(42).toString('hex');
+
+ const tokenId = await insertAppToken(ds, {
+ value: code,
+ type: AppTokenType.AuthorizationCode,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() - 1000),
+ });
+
+ createdEntityIds.tokens.push(tokenId);
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_grant');
+ });
+
+ it('should reject when redirect_uri does not match', async () => {
+ const code = await createAuthorizationCode();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://evil.com/callback',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_grant');
+ });
+
+ it('should require either client_secret or code_verifier', async () => {
+ const code = await createAuthorizationCode();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_request');
+ });
+ });
+
+ describe('Authorization code grant with PKCE', () => {
+ const createAuthCodeWithPkce = async (): Promise<{
+ code: string;
+ codeVerifier: string;
+ }> => {
+ const codeVerifier = crypto.randomBytes(32).toString('hex');
+ const codeChallenge = base64UrlEncode(
+ crypto.createHash('sha256').update(codeVerifier).digest(),
+ );
+
+ const code = crypto.randomBytes(42).toString('hex');
+
+ const codeTokenId = await insertAppToken(ds, {
+ value: code,
+ type: AppTokenType.AuthorizationCode,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() + 5 * 60 * 1000),
+ context: { redirectUri: 'https://example.com/callback' },
+ });
+
+ const challengeTokenId = await insertAppToken(ds, {
+ value: codeChallenge,
+ type: AppTokenType.CodeChallenge,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() + 5 * 60 * 1000),
+ });
+
+ createdEntityIds.tokens.push(codeTokenId, challengeTokenId);
+
+ return { code, codeVerifier };
+ };
+
+ it('should exchange code with valid PKCE verifier', async () => {
+ const { code, codeVerifier } = await createAuthCodeWithPkce();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ code_verifier: codeVerifier,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+ expect(res.body.refresh_token).toBeDefined();
+ expect(res.body.token_type).toBe('Bearer');
+ });
+
+ it('should reject code with wrong PKCE verifier', async () => {
+ const { code } = await createAuthCodeWithPkce();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ code_verifier: 'wrong-verifier',
+ redirect_uri: 'https://example.com/callback',
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_grant');
+ });
+ });
+
+ describe('OAuth auto-install', () => {
+ const createAutoInstallAuthCode = async (): Promise<string> => {
+ const code = crypto.randomBytes(42).toString('hex');
+
+ const tokenId = await insertAppToken(ds, {
+ value: code,
+ type: AppTokenType.AuthorizationCode,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() + 5 * 60 * 1000),
+ context: { redirectUri: 'https://example.com/callback' },
+ });
+
+ createdEntityIds.tokens.push(tokenId);
+
+ return code;
+ };
+
+ it('should auto-install application during authorization code exchange', async () => {
+ const code = await createAutoInstallAuthCode();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: autoInstallRegistration.oAuthClientId,
+ client_secret: autoInstallClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+ expect(res.body.refresh_token).toBeDefined();
+ expect(res.body.token_type).toBe('Bearer');
+ expect(res.body.scope).toBe('api');
+
+ const rows = await ds.query(
+ `SELECT id, name, description, "sourcePath", "universalIdentifier"
+ FROM core."application"
+ WHERE "applicationRegistrationId" = $1
+ AND "workspaceId" = $2`,
+ [autoInstallRegistration.id, TEST_WORKSPACE_ID],
+ );
+
+ expect(rows).toHaveLength(1);
+
+ const autoCreatedApp = rows[0];
+
+ expect(autoCreatedApp.name).toBe('OAuth Auto-Install Test App');
+ expect(autoCreatedApp.description).toBe(
+ 'App for testing OAuth auto-install',
+ );
+ expect(autoCreatedApp.sourcePath).toBe('oauth-install');
+ expect(autoCreatedApp.universalIdentifier).toBe(
+ autoInstallRegistration.universalIdentifier,
+ );
+
+ createdEntityIds.applications.push(autoCreatedApp.id);
+ });
+
+ it('should reuse existing application on subsequent authorization code exchanges', async () => {
+ const code = await createAutoInstallAuthCode();
+
+ const res = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: autoInstallRegistration.oAuthClientId,
+ client_secret: autoInstallClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+
+ const rows = await ds.query(
+ `SELECT id FROM core."application"
+ WHERE "applicationRegistrationId" = $1
+ AND "workspaceId" = $2`,
+ [autoInstallRegistration.id, TEST_WORKSPACE_ID],
+ );
+
+ expect(rows).toHaveLength(1);
+ });
+
+ it('should fail client credentials when app is not installed in any workspace', async () => {
+ const noInstallSecret = crypto.randomBytes(32).toString('hex');
+ const noInstallHash = await bcrypt.hash(noInstallSecret, 10);
+
+ const noInstallRegistration = await insertRegistration(ds, {
+ name: 'No Install Test App',
+ clientSecretHash: noInstallHash,
+ redirectUris: [],
+ scopes: ['api'],
+ });
+
+ createdEntityIds.registrations.push(noInstallRegistration.id);
+
+ const res = await postToken({
+ grant_type: 'client_credentials',
+ client_id: noInstallRegistration.oAuthClientId,
+ client_secret: noInstallSecret,
+ }).expect(400);
+
+ expect(res.body.error).toBe('server_error');
+ expect(res.body.error_description).toContain(
+ 'No workspace installation found',
+ );
+ });
+ });
+
+ describe('Refresh token grant', () => {
+ it('should issue new tokens from a valid refresh token', async () => {
+ const code = crypto.randomBytes(42).toString('hex');
+
+ const tokenId = await insertAppToken(ds, {
+ value: code,
+ type: AppTokenType.AuthorizationCode,
+ userId: TEST_USER_ID,
+ workspaceId: TEST_WORKSPACE_ID,
+ expiresAt: new Date(Date.now() + 5 * 60 * 1000),
+ context: { redirectUri: 'https://example.com/callback' },
+ });
+
+ createdEntityIds.tokens.push(tokenId);
+
+ const authCodeRes = await postToken({
+ grant_type: 'authorization_code',
+ code,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ redirect_uri: 'https://example.com/callback',
+ }).expect(200);
+
+ const refreshToken = authCodeRes.body.refresh_token;
+
+ expect(refreshToken).toBeDefined();
+
+ const res = await postToken({
+ grant_type: 'refresh_token',
+ refresh_token: refreshToken,
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ }).expect(200);
+
+ expect(res.body.access_token).toBeDefined();
+ expect(res.body.refresh_token).toBeDefined();
+ expect(res.body.token_type).toBe('Bearer');
+ expect(res.body.expires_in).toBeGreaterThan(0);
+ });
+
+ it('should reject an invalid refresh token', async () => {
+ const res = await postToken({
+ grant_type: 'refresh_token',
+ refresh_token: 'invalid-refresh-token',
+ client_id: testRegistration.oAuthClientId,
+ client_secret: testClientSecret,
+ }).expect(400);
+
+ expect(res.body.error).toBe('invalid_grant');
+ });
+ });
+});
diff --git a/packages/twenty-shared/src/application/applicationType.ts b/packages/twenty-shared/src/application/applicationType.ts
index b898e03cd8a..49e8e4d5c2c 100644
--- a/packages/twenty-shared/src/application/applicationType.ts
+++ b/packages/twenty-shared/src/application/applicationType.ts
@@ -1,24 +1,22 @@
import { type ApplicationVariables } from './applicationVariablesType';
+import { type ServerVariables } from './server-variables.type';
import { type SyncableEntityOptions } from './syncableEntityOptionsType';
-export type ApplicationMarketplaceData = {
+export type ApplicationManifest = SyncableEntityOptions & {
+ defaultRoleUniversalIdentifier: string;
+ displayName: string;
+ description: string;
+ icon?: string;
+ applicationVariables?: ApplicationVariables;
+ serverVariables?: ServerVariables;
author?: string;
category?: string;
- logo?: string;
+ logoUrl?: string;
screenshots?: string[];
aboutDescription?: string;
providers?: string[];
websiteUrl?: string;
termsUrl?: string;
-};
-
-export type ApplicationManifest = SyncableEntityOptions & {
- defaultRoleUniversalIdentifier: string;
- displayName: string;
- description: string;
- icon?: string;
- applicationVariables?: ApplicationVariables;
- marketplaceData?: ApplicationMarketplaceData;
preInstallLogicFunctionUniversalIdentifier?: string;
postInstallLogicFunctionUniversalIdentifier?: string;
settingsCustomTabFrontComponentUniversalIdentifier?: string;
diff --git a/packages/twenty-shared/src/application/index.ts b/packages/twenty-shared/src/application/index.ts
index 39bca33494f..d01505c7cbb 100644
--- a/packages/twenty-shared/src/application/index.ts
+++ b/packages/twenty-shared/src/application/index.ts
@@ -7,10 +7,7 @@
* |___/
*/
-export type {
- ApplicationMarketplaceData,
- ApplicationManifest,
-} from './applicationType';
+export type { ApplicationManifest } from './applicationType';
export type { ApplicationVariables } from './applicationVariablesType';
export type { AssetManifest } from './assetManifestType';
export { API_CLIENT_DIR } from './constants/ApiClientDirectory';
@@ -52,6 +49,7 @@ export type {
FieldPermissionManifest,
RoleManifest,
} from './roleManifestType';
+export type { ServerVariables } from './server-variables.type';
export type { SkillManifest } from './skillManifestType';
export type { SyncableEntityOptions } from './syncableEntityOptionsType';
export type {
diff --git a/packages/twenty-shared/src/application/server-variables.type.ts b/packages/twenty-shared/src/application/server-variables.type.ts
new file mode 100644
index 00000000000..8d0e37f6551
--- /dev/null
+++ b/packages/twenty-shared/src/application/server-variables.type.ts
@@ -0,0 +1,7 @@
+type ServerVariableSchema = {
+ description?: string;
+ isSecret?: boolean;
+ isRequired?: boolean;
+};
+
+export type ServerVariables = Record<string, ServerVariableSchema>;
diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.ts
index 7fb9c6bbe15..abd2902f680 100644
--- a/packages/twenty-shared/src/types/SettingsPath.ts
+++ b/packages/twenty-shared/src/types/SettingsPath.ts
@@ -38,6 +38,7 @@ export enum SettingsPath {
ApplicationDetail = 'applications/:applicationId',
ApplicationLogicFunctionDetail = 'applications/:applicationId/logicFunctions/:logicFunctionId',
AvailableApplicationDetail = 'applications/available/:availableApplicationId',
+ ApplicationRegistrationDetail = 'applications/registrations/:applicationRegistrationId',
LogicFunctions = 'functions',
NewLogicFunction = 'functions/new',
LogicFunctionDetail = 'functions/:logicFunctionId',
diff --git a/packages/twenty-shared/src/utils/base64UrlEncode.ts b/packages/twenty-shared/src/utils/base64UrlEncode.ts
new file mode 100644
index 00000000000..a944bd75cc8
--- /dev/null
+++ b/packages/twenty-shared/src/utils/base64UrlEncode.ts
@@ -0,0 +1,7 @@
+// RFC 4648 base64url encoding (URL-safe, no padding)
+export const base64UrlEncode = (buffer: Buffer): string =>
+ buffer
+ .toString('base64')
+ .replace(/\+/g, '-')
+ .replace(/\//g, '_')
+ .replace(/=/g, '');
diff --git a/packages/twenty-shared/src/utils/index.ts b/packages/twenty-shared/src/utils/index.ts
index baf2fd9bd5b..4b818c259e6 100644
--- a/packages/twenty-shared/src/utils/index.ts
+++ b/packages/twenty-shared/src/utils/index.ts
@@ -21,6 +21,7 @@ export { sumByProperty } from './array/sumByProperty';
export { upsertIntoArrayOfObjectsComparingId } from './array/upsertIntoArrayOfObjectsComparingId';
export { upsertPropertiesOfItemIntoArrayOfObjectsComparingId } from './array/upsertPropertiesOfItemIntoArrayOfObjectsComparingId';
export { assertUnreachable } from './assertUnreachable';
+export { base64UrlEncode } from './base64UrlEncode';
export { computeDiffBetweenObjects } from './compute-diff-between-objects';
export { isPlainDateAfter } from './date/isPlainDateAfter';
export { isPlainDateBefore } from './date/isPlainDateBefore';