From bffa0af622f48a3fc856206e93208d45a4a49d91 Mon Sep 17 00:00:00 2001 From: Saurav Date: Tue, 10 Dec 2024 11:34:24 -0600 Subject: [PATCH] fix merge conflicts --- etc/api.report.api.md | 4 +- .../api/src/mapping/PropertyValueMapping.ts | 4 + .../api/src/ontology/WirePropertyTypes.ts | 3 +- packages/e2e.generated.catchall/ontology.json | 83 +++++++++++++++++++ .../src/runInterfacesTest.ts | 1 + packages/generator-converters/package.json | 3 +- ...PropertyV2ToSdkPrimaryKeyTypeDefinition.ts | 2 +- .../wirePropertyV2ToSdkPropertyDefinition.ts | 42 +++++++--- packages/maker/src/api/defineObject.ts | 2 +- packages/monorepo.cspell/dict.osdk.txt | 1 + pnpm-lock.yaml | 3 + 11 files changed, 132 insertions(+), 16 deletions(-) diff --git a/etc/api.report.api.md b/etc/api.report.api.md index 49415d825..a7c54956c 100644 --- a/etc/api.report.api.md +++ b/etc/api.report.api.md @@ -769,6 +769,8 @@ export interface PropertyValueWireToClient { stringTimeseries: TimeSeriesProperty; // (undocumented) timestamp: string; + // (undocumented) + unknown: never; } // Warning: (ae-forgotten-export) The symbol "PrimitiveDataType" needs to be exported by the entry point index.d.ts @@ -851,7 +853,7 @@ export interface SelectArg> = A extends SelectArg ? PropertyKeys : A["$select"] extends readonly string[] ? A["$select"][number] : PropertyKeys; // @public (undocumented) -export type SimpleWirePropertyTypes = "string" | "datetime" | "double" | "boolean" | "integer" | "timestamp" | "short" | "long" | "float" | "decimal" | "byte" | "marking" | "numericTimeseries" | "stringTimeseries" | "sensorTimeseries" | "attachment" | "geopoint" | "geoshape" | "geotimeSeriesReference"; +export type SimpleWirePropertyTypes = "string" | "datetime" | "double" | "boolean" | "integer" | "timestamp" | "short" | "long" | "float" | "decimal" | "byte" | "marking" | "numericTimeseries" | "stringTimeseries" | "sensorTimeseries" | "attachment" | "geopoint" | "geoshape" | "geotimeSeriesReference" | "unknown"; // @public (undocumented) export interface SingleLinkAccessor { diff --git a/packages/api/src/mapping/PropertyValueMapping.ts b/packages/api/src/mapping/PropertyValueMapping.ts index fb9bd87a6..267da074a 100644 --- a/packages/api/src/mapping/PropertyValueMapping.ts +++ b/packages/api/src/mapping/PropertyValueMapping.ts @@ -44,6 +44,8 @@ export interface PropertyValueWireToClient { stringTimeseries: TimeSeriesProperty; sensorTimeseries: TimeSeriesProperty; geotimeSeriesReference: GeotimeSeriesProperty; + + unknown: never; } export type getClientPropertyValueFromWire< @@ -77,6 +79,8 @@ export interface PropertyValueClientToWire { stringTimeseries: TimeSeriesProperty; sensorTimeseries: TimeSeriesProperty; geotimeSeriesReference: GeotimeSeriesProperty; + + unknown: never; } export type getWirePropertyValueFromClient< T extends diff --git a/packages/api/src/ontology/WirePropertyTypes.ts b/packages/api/src/ontology/WirePropertyTypes.ts index 173ce8c42..f73608b22 100644 --- a/packages/api/src/ontology/WirePropertyTypes.ts +++ b/packages/api/src/ontology/WirePropertyTypes.ts @@ -37,4 +37,5 @@ export type SimpleWirePropertyTypes = | "attachment" | "geopoint" | "geoshape" - | "geotimeSeriesReference"; + | "geotimeSeriesReference" + | "unknown"; diff --git a/packages/e2e.generated.catchall/ontology.json b/packages/e2e.generated.catchall/ontology.json index 3f53ff98d..99cf5eabe 100644 --- a/packages/e2e.generated.catchall/ontology.json +++ b/packages/e2e.generated.catchall/ontology.json @@ -631,6 +631,89 @@ }, "linkTypes": [] }, + "BgaoNflPlayer": { + "objectType": { + "apiName": "BgaoNflPlayer", + "primaryKey": "id", + "displayName": "BgaoNflPlayer", + "description": "BgaoNflPlayer", + "properties": { + "id": { + "dataType": { + "type": "string" + } + }, + "gamesPlayed": { + "dataType": { + "type": "integer" + } + }, + "name": { + "dataType": { + "type": "string" + } + }, + "number": { + "dataType": { + "type": "integer" + } + }, + "wikiUrl": { + "dataType": { + "type": "string" + } + }, + "address": { + "dataType": { + "type": "struct", + "structFieldTypes": [ + { + "apiName": "addressLine1", + "dataType": { + "type": "string" + } + }, + { + "apiName": "addressLine2", + "dataType": { + "type": "string" + } + }, + { + "apiName": "city", + "dataType": { + "type": "string" + } + }, + { + "apiName": "state", + "dataType": { + "type": "string" + } + }, + { + "apiName": "zipCode", + "dataType": { + "type": "integer" + } + } + ] + } + } + }, + + "status": "ACTIVE", + "rid": "ri.a.b.c.d", + "icon": { + "type": "blueprint", + "name": "traffic", + "color": "color" + }, + "titleProperty": "entityId", + "pluralDisplayName": "GtfsTripTrackObject" + }, + "linkTypes": [] + }, "SotSensor": { "objectType": { "apiName": "SotSensor", diff --git a/packages/e2e.sandbox.catchall/src/runInterfacesTest.ts b/packages/e2e.sandbox.catchall/src/runInterfacesTest.ts index 3edb4fe65..3c74af916 100644 --- a/packages/e2e.sandbox.catchall/src/runInterfacesTest.ts +++ b/packages/e2e.sandbox.catchall/src/runInterfacesTest.ts @@ -16,6 +16,7 @@ import type { ConvertProps, Osdk } from "@osdk/api"; import { + BgaoNflPlayer, Employee, FooInterface, OsdkTestObject, diff --git a/packages/generator-converters/package.json b/packages/generator-converters/package.json index 21cc909c5..166c19ed9 100644 --- a/packages/generator-converters/package.json +++ b/packages/generator-converters/package.json @@ -32,7 +32,8 @@ }, "dependencies": { "@osdk/api": "workspace:~", - "@osdk/internal.foundry.core": "2.8.0" + "@osdk/internal.foundry.core": "2.8.0", + "consola": "^3.2.3" }, "devDependencies": { "@osdk/monorepo.api-extractor": "workspace:~", diff --git a/packages/generator-converters/src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts b/packages/generator-converters/src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts index f0788bc93..c1ba647c7 100644 --- a/packages/generator-converters/src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts +++ b/packages/generator-converters/src/wirePropertyV2ToSdkPrimaryKeyTypeDefinition.ts @@ -46,8 +46,8 @@ export function wirePropertyV2ToSdkPrimaryKeyTypeDefinition( case "float": case "geotimeSeriesReference": case "mediaReference": - case "struct": case "cipherText": + case "struct": throw new Error( `Type not supported for primaryKey: ${input.dataType.type}`, ); diff --git a/packages/generator-converters/src/wirePropertyV2ToSdkPropertyDefinition.ts b/packages/generator-converters/src/wirePropertyV2ToSdkPropertyDefinition.ts index b5602d50e..c361b1b7c 100644 --- a/packages/generator-converters/src/wirePropertyV2ToSdkPropertyDefinition.ts +++ b/packages/generator-converters/src/wirePropertyV2ToSdkPropertyDefinition.ts @@ -24,6 +24,7 @@ import type { PropertyV2, SharedPropertyType, } from "@osdk/internal.foundry.core"; +import { consola } from "consola"; export function wirePropertyV2ToSdkPropertyDefinition( input: (PropertyV2 | SharedPropertyType) & { nullable?: boolean }, @@ -64,17 +65,33 @@ export function wirePropertyV2ToSdkPropertyDefinition( nullable: true, }; } - case "cipherText": - case "mediaReference": { - throw new Error( - `${input.dataType.type} not supported yet`, + + case "mediaReference": + case "cipherText": { + consola.info( + `${ + JSON.stringify(input.dataType.type) + } is not a supported property type`, ); + return { + displayName: input.displayName, + multiplicity: false, + description: input.description, + type: objectPropertyTypeToSdkPropertyDefinition(input.dataType), + nullable: true, + }; } default: - const _: never = input.dataType; - throw new Error( - `Unexpected data type ${JSON.stringify(input.dataType)}`, + consola.info( + `${JSON.stringify(input.dataType)} is not a supported property type`, ); + return { + displayName: input.displayName, + multiplicity: false, + description: input.description, + type: objectPropertyTypeToSdkPropertyDefinition(input.dataType), + nullable: true, + }; } } @@ -123,12 +140,15 @@ function objectPropertyTypeToSdkPropertyDefinition( case "mediaReference": case "cipherText": { - throw new Error( - `${propertyType.type} not supported yet`, + consola.info( + `${JSON.stringify(propertyType)} is not a supported property type`, ); + return "unknown"; } default: - const _: never = propertyType; - throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`); + consola.info( + `${JSON.stringify(propertyType)} is not a supported property type`, + ); + return "unknown"; } } diff --git a/packages/maker/src/api/defineObject.ts b/packages/maker/src/api/defineObject.ts index 0f29f29e4..a370b1013 100644 --- a/packages/maker/src/api/defineObject.ts +++ b/packages/maker/src/api/defineObject.ts @@ -135,7 +135,7 @@ function convertType( default: return { type: t.type, - }; + } as PropertyV2["dataType"]; } invariant(false); diff --git a/packages/monorepo.cspell/dict.osdk.txt b/packages/monorepo.cspell/dict.osdk.txt index 0b03804bc..b9548951f 100644 --- a/packages/monorepo.cspell/dict.osdk.txt +++ b/packages/monorepo.cspell/dict.osdk.txt @@ -7,3 +7,4 @@ paperplane Pressable Tamagui unistyles +Bgao diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87a08707b..01d7783e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3231,6 +3231,9 @@ importers: '@osdk/internal.foundry.core': specifier: 2.8.0 version: 2.8.0 + consola: + specifier: ^3.2.3 + version: 3.2.3 devDependencies: '@osdk/monorepo.api-extractor': specifier: workspace:~