Skip to content

Commit 8799379

Browse files
Copilothotlong
andcommitted
Phase 8: Remove deprecated fields (formula, encryption, geoSpatial, stateMachine)
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 8178f0a commit 8799379

7 files changed

Lines changed: 23 additions & 52 deletions

File tree

packages/spec/src/data/driver-sql.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ describe('SQLDriverConfigSchema', () => {
186186
jsonFields: true,
187187
arrayFields: true,
188188
vectorSearch: true,
189-
geoSpatial: false,
190189
schemaSync: true,
191190
migrations: true,
192191
indexes: true,
@@ -240,7 +239,6 @@ describe('SQLDriverConfigSchema', () => {
240239
jsonFields: true,
241240
arrayFields: false,
242241
vectorSearch: false,
243-
geoSpatial: false,
244242
schemaSync: true,
245243
migrations: true,
246244
indexes: true,
@@ -330,7 +328,6 @@ describe('SQLDriverConfigSchema', () => {
330328
jsonFields: true,
331329
arrayFields: false,
332330
vectorSearch: false,
333-
geoSpatial: false,
334331
schemaSync: true,
335332
migrations: false,
336333
indexes: true,

packages/spec/src/data/driver-sql.zod.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export type SSLConfig = z.infer<typeof SSLConfigSchema>;
132132
* jsonFields: true,
133133
* arrayFields: true,
134134
* vectorSearch: true,
135-
* geoSpatial: false,
136135
* schemaSync: true,
137136
* migrations: true,
138137
* indexes: true,

packages/spec/src/data/driver.zod.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,6 @@ export const DriverCapabilitiesSchema = z.object({
205205
*/
206206
vectorSearch: z.boolean().default(false).describe('Supports vector embeddings and similarity search'),
207207

208-
/**
209-
* Whether the driver supports geospatial queries.
210-
* @deprecated Use geospatialQuery instead
211-
*/
212-
geoSpatial: z.boolean().default(false).describe('Supports geospatial queries (deprecated: use geospatialQuery)'),
213-
214208
// ============================================================================
215209
// Schema Management
216210
// ============================================================================
@@ -248,14 +242,6 @@ export const DriverCapabilitiesSchema = z.object({
248242
* Whether the driver supports query result caching.
249243
*/
250244
queryCache: z.boolean().default(false).describe('Supports query result caching'),
251-
}).refine((data) => {
252-
// Ensure deprecated geoSpatial and new geospatialQuery are consistent if both are provided
253-
if (data.geoSpatial !== undefined && data.geospatialQuery !== undefined && data.geoSpatial !== data.geospatialQuery) {
254-
return false;
255-
}
256-
return true;
257-
}, {
258-
message: 'Deprecated geoSpatial and geospatialQuery must have the same value if both are provided',
259245
});
260246

261247
/**

packages/spec/src/data/field.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ describe('FieldSchema', () => {
208208
expect(result.unique).toBe(false);
209209
expect(result.hidden).toBe(false);
210210
expect(result.readonly).toBe(false);
211-
expect(result.encryption).toBe(false);
212211
expect(result.index).toBe(false);
213212
expect(result.externalId).toBe(false);
214213
});
@@ -355,7 +354,6 @@ describe('FieldSchema', () => {
355354
type: 'password',
356355
hidden: true,
357356
readonly: true,
358-
encryption: true,
359357
};
360358

361359
expect(() => FieldSchema.parse(secureField)).not.toThrow();

packages/spec/src/data/field.zod.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,6 @@ export const FieldSchema = z.object({
377377

378378
/** Calculation */
379379
expression: z.string().optional().describe('Formula expression'),
380-
/** @deprecated Use `expression` instead. Will be removed in v2.0.0 */
381-
formula: z.string().optional()
382-
.describe('DEPRECATED: Use `expression` field instead. Scheduled for removal in v2.0.0'),
383380
summaryOperations: z.object({
384381
object: z.string(),
385382
field: z.string(),
@@ -460,9 +457,6 @@ export const FieldSchema = z.object({
460457
trackFeedHistory: z.boolean().optional().describe('Track field changes in Chatter/activity feed (Salesforce pattern)'),
461458
caseSensitive: z.boolean().optional().describe('Whether text comparisons are case-sensitive'),
462459
autonumberFormat: z.string().optional().describe('Auto-number display format pattern (e.g., "CASE-{0000}")'),
463-
/** @deprecated Use `encryptionConfig` instead. Will be removed in v2.0.0 */
464-
encryption: z.boolean().default(false).describe('DEPRECATED: Use `encryptionConfig` for enhanced encryption features. Scheduled for removal in v2.0.0'),
465-
466460
/** Indexing */
467461
index: z.boolean().default(false).describe('Create standard database index'),
468462
externalId: z.boolean().default(false).describe('Is external ID for upsert operations'),

packages/spec/src/data/object.test.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -493,20 +493,22 @@ describe('ObjectSchema', () => {
493493
fields: {
494494
status: { type: 'text' }
495495
},
496-
stateMachine: {
497-
id: 'leave_flow',
498-
initial: 'draft',
499-
states: {
500-
draft: { on: { SUBMIT: 'pending' } },
501-
pending: { on: { APPROVE: 'approved' } },
502-
approved: { type: 'final' }
496+
stateMachines: {
497+
leave_flow: {
498+
id: 'leave_flow',
499+
initial: 'draft',
500+
states: {
501+
draft: { on: { SUBMIT: 'pending' } },
502+
pending: { on: { APPROVE: 'approved' } },
503+
approved: { type: 'final' }
504+
}
503505
}
504506
}
505507
};
506508

507509
const result = ObjectSchema.parse(objectWithState);
508-
expect(result.stateMachine).toBeDefined();
509-
expect(result.stateMachine?.initial).toBe('draft');
510+
expect(result.stateMachines).toBeDefined();
511+
expect(result.stateMachines!.leave_flow.initial).toBe('draft');
510512
});
511513

512514
it('should support multiple parallel state machines via stateMachines', () => {
@@ -559,21 +561,19 @@ describe('ObjectSchema', () => {
559561
expect(result.stateMachines!.approval.initial).toBe('pending');
560562
});
561563

562-
it('should allow both stateMachine and stateMachines to coexist', () => {
564+
it('should allow multiple stateMachines', () => {
563565
const obj = {
564566
name: 'contract',
565567
fields: { status: { type: 'text' } },
566-
// Legacy single shorthand
567-
stateMachine: {
568-
id: 'contract_lifecycle',
569-
initial: 'draft',
570-
states: {
571-
draft: { on: { ACTIVATE: 'active' } },
572-
active: { type: 'final' },
573-
}
574-
},
575-
// Additional parallel machines
576568
stateMachines: {
569+
contract_lifecycle: {
570+
id: 'contract_lifecycle',
571+
initial: 'draft',
572+
states: {
573+
draft: { on: { ACTIVATE: 'active' } },
574+
active: { type: 'final' },
575+
}
576+
},
577577
billing: {
578578
id: 'contract_billing',
579579
initial: 'unbilled',
@@ -587,7 +587,7 @@ describe('ObjectSchema', () => {
587587
};
588588

589589
const result = ObjectSchema.parse(obj);
590-
expect(result.stateMachine?.initial).toBe('draft');
590+
expect(result.stateMachines?.contract_lifecycle.initial).toBe('draft');
591591
expect(result.stateMachines?.billing.initial).toBe('unbilled');
592592
});
593593
});

packages/spec/src/data/object.zod.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,11 @@ const ObjectSchemaBase = z.object({
292292

293293
/**
294294
* State Machine(s)
295-
* Supports a single machine (legacy) or a named record of machines.
295+
* Named record of state machines, where each key is a unique machine identifier.
296296
* Multiple machines allow parallel lifecycles (e.g., status + payment_status + approval_status).
297297
*
298-
* @example Single: stateMachine: { id: 'lifecycle', initial: 'draft', states: {...} }
299-
* @example Multiple: stateMachines: { lifecycle: {...}, payment: {...}, approval: {...} }
298+
* @example stateMachines: { lifecycle: {...}, payment: {...}, approval: {...} }
300299
*/
301-
/** @deprecated Use `stateMachines` (plural) instead. Will be removed in v2.0.0 */
302-
stateMachine: StateMachineSchema.optional().describe('DEPRECATED: Use stateMachines (plural). Single state machine shorthand.'),
303300
stateMachines: z.record(z.string(), StateMachineSchema).optional().describe('Named state machines for parallel lifecycles (e.g., status, payment, approval)'),
304301

305302
/**

0 commit comments

Comments
 (0)