Skip to content

Commit 262e76d

Browse files
authored
Merge pull request #137 from objectstack-ai/copilot/fix-action-step-issue-another-one
2 parents 9a30e52 + eb5d00d commit 262e76d

File tree

9 files changed

+355
-169
lines changed

9 files changed

+355
-169
lines changed

packages/spec/src/api/contract.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ describe('ExportRequestSchema', () => {
233233
const request = ExportRequestSchema.parse({
234234
object: 'account',
235235
fields: ['name', 'email'],
236-
filters: ['status', '=', 'active'],
236+
where: { status: 'active' },
237237
format: 'xlsx',
238238
});
239239

240240
expect(request.format).toBe('xlsx');
241-
expect(request.filters).toBeDefined();
241+
expect(request.where).toBeDefined();
242242
});
243243
});
244244

packages/spec/src/api/endpoint.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import {
33
ApiEndpointSchema,
44
RateLimitSchema,
55
ApiMappingSchema,
6-
HttpMethod,
76
ApiEndpoint,
8-
} from '../system/api.zod';
7+
} from './endpoint.zod';
8+
import { HttpMethod } from './router.zod';
99

1010
describe('HttpMethod', () => {
1111
it('should accept valid HTTP methods', () => {
12-
const validMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'];
12+
const validMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'];
1313

1414
validMethods.forEach(method => {
1515
expect(() => HttpMethod.parse(method)).not.toThrow();
1616
});
1717
});
1818

1919
it('should reject invalid HTTP methods', () => {
20-
expect(() => HttpMethod.parse('HEAD')).toThrow();
21-
expect(() => HttpMethod.parse('OPTIONS')).toThrow();
20+
expect(() => HttpMethod.parse('TRACE')).toThrow();
21+
expect(() => HttpMethod.parse('CONNECT')).toThrow();
2222
expect(() => HttpMethod.parse('get')).toThrow();
2323
});
2424
});

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ describe('ObjectCapabilities', () => {
99
expect(result.searchable).toBe(true);
1010
expect(result.apiEnabled).toBe(true);
1111
expect(result.files).toBe(false);
12-
expect(result.feedEnabled).toBe(false);
12+
expect(result.feeds).toBe(false);
13+
expect(result.activities).toBe(false);
1314
expect(result.trash).toBe(true);
15+
expect(result.mru).toBe(true);
16+
expect(result.clone).toBe(true);
1417
});
1518

1619
it('should accept custom capability values', () => {
@@ -19,8 +22,11 @@ describe('ObjectCapabilities', () => {
1922
searchable: false,
2023
apiEnabled: true,
2124
files: true,
22-
feedEnabled: true,
25+
feeds: true,
26+
activities: false,
2327
trash: false,
28+
mru: true,
29+
clone: true,
2430
};
2531

2632
const result = ObjectCapabilities.parse(capabilities);

0 commit comments

Comments
 (0)