The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix breaking change with dry run input (#21356)
martmull1d81bdbb2259
diff --git a/packages/twenty-sdk/src/cli/utilities/api/application-api.ts b/packages/twenty-sdk/src/cli/utilities/api/application-api.tsindex 2e579db2d2a..21b2bac81d9 100644--- a/packages/twenty-sdk/src/cli/utilities/api/application-api.ts+++ b/packages/twenty-sdk/src/cli/utilities/api/application-api.ts@@ -269,16 +269,27 @@ export class ApplicationApi {>> {try {- const mutation = `+ const isDryRun = options?.dryRun ?? false;++ const mutation = isDryRun+ ? `mutation SyncApplication($manifest: JSON!, $dryRun: Boolean) {syncApplication(manifest: $manifest, dryRun: $dryRun) {applicationUniversalIdentifieractions}}+ `+ : `+ mutation SyncApplication($manifest: JSON!) {+ syncApplication(manifest: $manifest) {+ applicationUniversalIdentifier+ actions+ }+ }`;- const variables = { manifest, dryRun: options?.dryRun ?? false };+ const variables = isDryRun ? { manifest, dryRun: true } : { manifest };const response = await this.client.post('/metadata',diff --git a/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts b/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.tsindex e6f2c759d8a..321f3a2bd3e 100644--- a/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts+++ b/packages/twenty-sdk/src/cli/utilities/build/manifest/__tests__/manifest-validate.spec.ts@@ -360,54 +360,6 @@ describe('manifestValidate', () => {});});- describe('agent responseFormat validation', () => {- it('should warn for each agent without a responseFormat', () => {- const result = manifestValidate({- ...validManifest,- agents: [- {- universalIdentifier: '550e8400-e29b-41d4-a716-446655440040',- name: 'agentWithoutFormat',- label: 'Agent Without Format',- prompt: 'Do something',- },- {- universalIdentifier: '550e8400-e29b-41d4-a716-446655440041',- name: 'anotherAgentWithoutFormat',- label: 'Another Agent Without Format',- prompt: 'Do something else',- },- ],- });-- expect(result.warnings).toContain(- 'Agent "agentWithoutFormat" has no responseFormat defined',- );- expect(result.warnings).toContain(- 'Agent "anotherAgentWithoutFormat" has no responseFormat defined',- );- });-- it('should not warn for an agent that has a responseFormat', () => {- const result = manifestValidate({- ...validManifest,- agents: [- {- universalIdentifier: '550e8400-e29b-41d4-a716-446655440042',- name: 'agentWithFormat',- label: 'Agent With Format',- prompt: 'Do something',- responseFormat: { type: 'text' },- },- ],- });-- expect(result.warnings).not.toContain(- 'Agent "agentWithFormat" has no responseFormat defined',- );- });- });-describe('UUID version validation', () => {it('should pass with UUID v4 identifiers', () => {const result = manifestValidate({diff --git a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-validate.ts b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-validate.tsindex 7657fbaea30..ff64918d45a 100644--- a/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-validate.ts+++ b/packages/twenty-sdk/src/cli/utilities/build/manifest/manifest-validate.ts@@ -2,7 +2,6 @@ import { validate as uuidValidate, version as uuidVersion } from 'uuid';import { type FieldManifest, type Manifest } from 'twenty-shared/application';import { FieldMetadataType, RelationType } from 'twenty-shared/types';-import { isDefined } from 'twenty-shared/utils';const MIN_UUID_VERSION = 4;@@ -154,12 +153,6 @@ export const manifestValidate = (manifest: Manifest) => {);}- for (const agent of manifest.agents) {- if (!isDefined(agent.responseFormat)) {- warnings.push(`Agent "${agent.name}" has no responseFormat defined`);- }- }-const allFields: Pick<FieldManifest,'type' | 'name' | 'universalSettings'