Skip to content

Commit ad4e6c5

Browse files
committed
remove datatype url
1 parent 411b6e8 commit ad4e6c5

File tree

8 files changed

+7
-32
lines changed

8 files changed

+7
-32
lines changed

apps/events/src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class Todo2 extends Entity.Class<Todo2>('Todo2')({
1717
due: Type.Date,
1818
amount: Type.Number,
1919
point: Type.Point,
20-
website: Type.Url,
20+
website: Type.Text,
2121
}) {}
2222

2323
export class JobOffer extends Entity.Class<JobOffer>('JobOffer')({

apps/typesync/client/src/Components/App/Schema/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function fieldToEntityString({
2121
return 'Type.Boolean';
2222
case type_name === 'Date':
2323
return 'Type.Date';
24-
case type_name === 'Url':
25-
return 'Type.Url';
2624
case type_name === 'Point':
2725
return 'Type.Point';
2826
case type_name.startsWith('Relation'):

apps/typesync/src/Generator.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { execSync } from 'node:child_process';
2-
import { readdirSync } from 'node:fs';
31
import { FileSystem, Path, type Error as PlatformError } from '@effect/platform';
42
import { NodeFileSystem } from '@effect/platform-node';
53
import { Doc } from '@effect/printer';
64
import { Mapping } from '@graphprotocol/typesync';
75
import { Cause, Console, Data, Effect, Array as EffectArray, String as EffectString } from 'effect';
6+
import { execSync } from 'node:child_process';
7+
import { readdirSync } from 'node:fs';
88

99
import type * as Domain from '../domain/Domain.js';
1010
import * as Utils from './Utils.js';
@@ -319,8 +319,6 @@ function fieldToEntityString({
319319
return 'Type.Checkbox';
320320
case dataType === 'Date':
321321
return 'Type.Date';
322-
case dataType === 'Url':
323-
return 'Type.Url';
324322
case dataType === 'Point':
325323
return 'Type.Point';
326324
case Mapping.isDataTypeRelation(dataType):

packages/hypergraph-react/src/internal/use-generate-update-ops.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ export function useGenerateUpdateOps<const S extends Entity.AnyNoContext>(type:
4343
// // @ts-expect-error: must be an array of numbers
4444
// value: rawValue.join(','),
4545
// };
46-
// } else if (type.fields[key] === Type.Url) {
47-
// value = {
48-
// type: 'URL',
49-
// // @ts-expect-error: must be a URL
50-
// value: rawValue.toString(),
51-
// };
5246
// } else if (type.fields[key] === Type.Date) {
5347
// value = {
5448
// type: 'TIME',

packages/hypergraph-react/src/internal/use-query-public.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ const convertPropertyValue = (
160160
if (type.fields[key] === Type.Point) {
161161
return property.value;
162162
}
163-
if (type.fields[key] === Type.Url) {
164-
return property.value;
165-
}
166163
if (type.fields[key] === Type.Date) {
167164
return property.value;
168165
}
@@ -178,7 +175,7 @@ const convertRelations = <S extends Entity.AnyNoContext>(
178175
mappingEntry: MappingEntry,
179176
mapping: Mapping,
180177
) => {
181-
const rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {};
178+
const rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {};
182179

183180
for (const [key, relationId] of Object.entries(mappingEntry?.relations ?? {})) {
184181
const properties = (queryEntity.relationsList ?? []).filter((a) => a.typeId === relationId);
@@ -212,7 +209,7 @@ const convertRelations = <S extends Entity.AnyNoContext>(
212209
// @ts-expect-error TODO: properly access the type.name
213210
const type = field.value;
214211

215-
let rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {
212+
let rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {
216213
id: propertyEntry.toEntity.id,
217214
name: propertyEntry.toEntity.name,
218215
// TODO: should be determined by the actual value
@@ -262,7 +259,7 @@ export const parseResult = <S extends Entity.AnyNoContext>(
262259
const invalidEntities: Record<string, unknown>[] = [];
263260

264261
for (const queryEntity of queryData.entities) {
265-
let rawEntity: Record<string, string | boolean | number | unknown[] | URL | Date> = {
262+
let rawEntity: Record<string, string | boolean | number | unknown[] | Date> = {
266263
id: queryEntity.id,
267264
};
268265

packages/hypergraph-react/src/use-query.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ const _getDiff = <S extends Entity.AnyNoContext>(
9999
new: localEntity[key],
100100
};
101101
}
102-
} else if (field === Type.Url) {
103-
if (entity[key].toString() !== localEntity[key].toString()) {
104-
diff[key] = {
105-
type: 'property',
106-
current: entity[key],
107-
new: localEntity[key],
108-
};
109-
}
110102
} else if (field === Type.Point) {
111103
if (entity[key].join(',') !== localEntity[key].join(',')) {
112104
diff[key] = {

packages/hypergraph/src/type/type.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const Number = Schema.Number;
88
export const Checkbox = Schema.Boolean;
99
// biome-ignore lint/suspicious/noShadowRestrictedNames: is part of a namespaces module and therefor ok
1010
export const Date = Schema.Date;
11-
export const Url = Schema.URL;
1211
export const Point = Schema.transform(Schema.String, Schema.Array(Number), {
1312
strict: true,
1413
decode: (str: string) => {

packages/typesync/src/Mapping.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type SchemaDataTypeRelation = typeof SchemaDataTypeRelation.Type;
9494
/**
9595
* @since 0.0.1
9696
*/
97-
export const SchemaDataTypePrimitive = EffectSchema.Literal('Text', 'Number', 'Checkbox', 'Date', 'Point', 'Url');
97+
export const SchemaDataTypePrimitive = EffectSchema.Literal('Text', 'Number', 'Checkbox', 'Date', 'Point');
9898
/**
9999
* @since 0.0.1
100100
*/
@@ -761,9 +761,6 @@ export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType):
761761
case dataType === 'Point': {
762762
return 'POINT';
763763
}
764-
case dataType === 'Url': {
765-
return 'TEXT';
766-
}
767764
case isDataTypeRelation(dataType): {
768765
return 'RELATION';
769766
}

0 commit comments

Comments
 (0)