diff --git a/.changeset/kind-penguins-try.md b/.changeset/kind-penguins-try.md new file mode 100644 index 000000000..5cf82b3ad --- /dev/null +++ b/.changeset/kind-penguins-try.md @@ -0,0 +1,7 @@ +--- +"@osdk/generator": patch +"@osdk/client": patch +"@osdk/api": patch +--- + +Remove experimental non null for now. diff --git a/etc/api.report.api.md b/etc/api.report.api.md index 980e0de8d..4f00b6958 100644 --- a/etc/api.report.api.md +++ b/etc/api.report.api.md @@ -629,15 +629,14 @@ export interface OntologyMetadata<_NEVER_USED_KEPT_FOR_BACKCOMPAT = any> { // Warning: (ae-forgotten-export) The symbol "ExtractPropsKeysFromOldPropsStyle" needs to be exported by the entry point index.d.ts // // @public -export type Osdk = PropertyKeys> = IsNever extends true ? Osdk.Instance : IsAny extends true ? Osdk.Instance : (IsNever>) extends true ? Osdk.Instance : Osdk.Instance>; +export type Osdk = PropertyKeys> = IsNever extends true ? Osdk.Instance : IsAny extends true ? Osdk.Instance : (IsNever>) extends true ? Osdk.Instance : Osdk.Instance>; // @public (undocumented) export namespace Osdk { - // Warning: (ae-forgotten-export) The symbol "GetProps" needs to be exported by the entry point index.d.ts // Warning: (ae-forgotten-export) The symbol "GetPropsKeys" needs to be exported by the entry point index.d.ts // // (undocumented) - export type Instance = PropertyKeys> = OsdkBase & Pick, GetPropsKeys> & { + export type Instance = PropertyKeys> = OsdkBase & Pick["props"], GetPropsKeys> & { readonly $link: Q extends { linksType?: any; } ? Q["linksType"] : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject : never; @@ -825,8 +824,6 @@ export type Result = OkResult | ErrorResult; // @public (undocumented) export interface SelectArg = PropertyKeys, R extends boolean = false, S extends NullabilityAdherence = NullabilityAdherence.Default> { - // (undocumented) - $__EXPERIMENTAL_strictNonNull?: S; // (undocumented) $includeRid?: R; // (undocumented) diff --git a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Employee.ts b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Employee.ts index 25c4e45cb..c2d09e57b 100644 --- a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Employee.ts +++ b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Employee.ts @@ -23,14 +23,6 @@ export namespace Employee { } export interface Props { - readonly class: $PropType['string'] | undefined; - readonly employeeId: $PropType['integer'] | undefined; - readonly employeeStatus: $PropType['numericTimeseries'] | undefined; - readonly fullName: $PropType['string'] | undefined; - readonly office: $PropType['integer'] | undefined; - readonly startDate: $PropType['datetime'] | undefined; - } - export interface StrictProps { readonly class: $PropType['string'] | undefined; readonly employeeId: $PropType['integer']; readonly employeeStatus: $PropType['numericTimeseries'] | undefined; @@ -38,17 +30,18 @@ export namespace Employee { readonly office: $PropType['integer'] | undefined; readonly startDate: $PropType['datetime'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Employee.Props = keyof Employee.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Employee.Props = keyof Employee.Props, > = OsdkInstance; } diff --git a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Office.ts b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Office.ts index 5d065e05c..56f815e37 100644 --- a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Office.ts +++ b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Office.ts @@ -26,14 +26,6 @@ export namespace Office { export type Links = {}; export interface Props { - readonly entrance: $PropType['geopoint'] | undefined; - readonly meetingRoomCapacities: $PropType['integer'][] | undefined; - readonly meetingRooms: $PropType['string'][] | undefined; - readonly name: $PropType['string'] | undefined; - readonly occupiedArea: $PropType['geoshape'] | undefined; - readonly officeId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly entrance: $PropType['geopoint'] | undefined; readonly meetingRoomCapacities: $PropType['integer'][] | undefined; readonly meetingRooms: $PropType['string'][] | undefined; @@ -41,17 +33,18 @@ export namespace Office { readonly occupiedArea: $PropType['geoshape'] | undefined; readonly officeId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Office.Props = keyof Office.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Office.Props = keyof Office.Props, > = OsdkInstance; } diff --git a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Todo.ts b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Todo.ts index 34aa6e5eb..93a1372a6 100644 --- a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Todo.ts +++ b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/Todo.ts @@ -20,26 +20,22 @@ export namespace Todo { export type Links = {}; export interface Props { - readonly id: $PropType['string'] | undefined; - readonly isComplete: $PropType['boolean'] | undefined; - readonly title: $PropType['string'] | undefined; - } - export interface StrictProps { readonly id: $PropType['string']; readonly isComplete: $PropType['boolean'] | undefined; readonly title: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = OsdkInstance; } diff --git a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/equipment.ts b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/equipment.ts index d539092eb..f628bdae7 100644 --- a/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/equipment.ts +++ b/examples-extra/docs_example/src/generatedNoCheck/ontology/objects/equipment.ts @@ -20,24 +20,21 @@ export namespace equipment { export type Links = {}; export interface Props { - readonly equipmentId: $PropType['string'] | undefined; - readonly type: $PropType['string'] | undefined; - } - export interface StrictProps { readonly equipmentId: $PropType['string']; readonly type: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof equipment.Props = keyof equipment.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof equipment.Props = keyof equipment.Props, > = OsdkInstance; } diff --git a/packages/api/src/OsdkObjectFrom.test.ts b/packages/api/src/OsdkObjectFrom.test.ts index d0c5463a8..49a770b32 100644 --- a/packages/api/src/OsdkObjectFrom.test.ts +++ b/packages/api/src/OsdkObjectFrom.test.ts @@ -32,9 +32,9 @@ describe("ExtractOptions", () => { .toEqualTypeOf(); }); - it("does add add $notStrict for false", () => { + it("does not add $notStrict for false", () => { expectTypeOf>() - .toEqualTypeOf<"$notStrict">(); + .toEqualTypeOf(); }); it("does not add $notStrict for throw", () => { @@ -140,9 +140,9 @@ describe("ExtractOptions", () => { Osdk.Instance >(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -151,9 +151,9 @@ describe("ExtractOptions", () => { expectTypeOf().toEqualTypeOf< Osdk.Instance >(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -162,15 +162,18 @@ describe("ExtractOptions", () => { expectTypeOf().branded.toEqualTypeOf< Osdk.Instance >(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); - it("uses not strict if requested", () => { + it("Cannot use $notStrict", () => { + // @ts-expect-error type toCheck = Osdk.Instance; + expectTypeOf().branded + // @ts-expect-error .toEqualTypeOf>(); // ensure its not the strict type expectTypeOf>().toEqualTypeOf< @@ -210,9 +213,9 @@ describe("ExtractOptions", () => { // expect no rid expectTypeOf().toEqualTypeOf(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -225,9 +228,9 @@ describe("ExtractOptions", () => { // expect rid expectTypeOf().toEqualTypeOf<"$rid">(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -255,9 +258,9 @@ describe("ExtractOptions", () => { // expect rid expectTypeOf().toEqualTypeOf<"$rid">(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -270,9 +273,9 @@ describe("ExtractOptions", () => { // expect no rid expectTypeOf().toEqualTypeOf(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); }); @@ -281,9 +284,9 @@ describe("ExtractOptions", () => { expectTypeOf().toEqualTypeOf< Osdk.Instance >(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); // expect no rid @@ -295,19 +298,19 @@ describe("ExtractOptions", () => { expectTypeOf().branded.toEqualTypeOf< Osdk.Instance >(); - // ensure its the strict type + // ensure its the normal props expectTypeOf>().toEqualTypeOf< - quickAndDirty["__DefinitionMetadata"]["strictProps"] + quickAndDirty["__DefinitionMetadata"]["props"] >(); // expect no rid expectTypeOf().toEqualTypeOf(); }); - it("uses not strict if requested", () => { + it("Does not use $notStrict if requested with old type", () => { type toCheck = Osdk; expectTypeOf().branded - .toEqualTypeOf>(); + .toEqualTypeOf>(); // ensure its not the strict type expectTypeOf>().toEqualTypeOf< quickAndDirty["__DefinitionMetadata"]["props"] diff --git a/packages/api/src/OsdkObjectFrom.ts b/packages/api/src/OsdkObjectFrom.ts index dd37274f6..82829ecf4 100644 --- a/packages/api/src/OsdkObjectFrom.ts +++ b/packages/api/src/OsdkObjectFrom.ts @@ -158,14 +158,6 @@ export type GetPropsKeys< : IsAny

extends true ? PropertyKeys : P; -export type GetProps< - Q extends ObjectOrInterfaceDefinition, - OPTIONS extends never | "$notStrict" | "$rid" = never, -> = IsNever extends true ? CompileTimeMetadata["strictProps"] - : IsAny extends true ? CompileTimeMetadata["strictProps"] - : (OPTIONS extends "$notStrict" ? CompileTimeMetadata["props"] - : CompileTimeMetadata["strictProps"]); - /** * Use `Osdk.Instance` or `YourType.OsdkInstance` */ @@ -178,26 +170,25 @@ export type Osdk< IsNever extends true ? Osdk.Instance : IsAny extends true ? Osdk.Instance // Options only includes the two allowed in the new style - : (IsNever>) extends true - ? Osdk.Instance + : (IsNever>) extends true + ? Osdk.Instance // else we are in the old style which was just Q and OPTIONS // and OPTIONS was $things + prop names : Osdk.Instance< Q, - | ("$notStrict" extends OPTIONS ? "$notStrict" : never) - | ("$rid" extends OPTIONS ? "$rid" : never), + ("$rid" extends OPTIONS ? "$rid" : never), ExtractPropsKeysFromOldPropsStyle >; export namespace Osdk { export type Instance< Q extends ObjectOrInterfaceDefinition, - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, P extends PropertyKeys = PropertyKeys, > = & OsdkBase & Pick< - GetProps, + CompileTimeMetadata["props"], GetPropsKeys > & { @@ -247,4 +238,4 @@ export type ExtractRidOption = // comment for readability export type ExtractOptions< R extends boolean, S extends NullabilityAdherence = NullabilityAdherence.Default, -> = ExtractStrictOption | ExtractRidOption; +> = ExtractRidOption; diff --git a/packages/api/src/object/FetchPageArgs.ts b/packages/api/src/object/FetchPageArgs.ts index 877aba843..7dcbde276 100644 --- a/packages/api/src/object/FetchPageArgs.ts +++ b/packages/api/src/object/FetchPageArgs.ts @@ -34,7 +34,6 @@ export interface SelectArg< > { $select?: readonly L[]; $includeRid?: R; - $__EXPERIMENTAL_strictNonNull?: S; } export interface OrderByArg< diff --git a/packages/client/src/object/convertWireToOsdkObjects.test.ts b/packages/client/src/object/convertWireToOsdkObjects.test.ts index 05906abaf..3f08ad0c0 100644 --- a/packages/client/src/object/convertWireToOsdkObjects.test.ts +++ b/packages/client/src/object/convertWireToOsdkObjects.test.ts @@ -515,7 +515,7 @@ describe("Osdk.Instance", () => { }); it("is assignable to Osdk<> with $notStrict", () => { - const instance: Osdk.Instance = {} as any; + const instance: Osdk.Instance = {} as any; const osdk: Osdk = instance; const osdk2: Osdk = instance; }); @@ -523,17 +523,16 @@ describe("Osdk.Instance", () => { it("is assignable from Osdk<> with $notStrict", () => { const osdk: Osdk = {} as any; const osdk2: Osdk = osdk; - const instance: Osdk.Instance = osdk; - const instance2: Osdk.Instance = osdk2; + const instance: Osdk.Instance = osdk; + const instance2: Osdk.Instance = osdk2; }); it("object with any for props is assignable to its normal self", () => { - const foo: readonly Osdk.Instance[] = - {} as any; + const foo: readonly Osdk.Instance[] = {} as any; const bar: readonly Osdk.Instance< Employee, - "$notStrict", + never, PropertyKeys >[] = foo; }); diff --git a/packages/client/src/object/fetchPage.ts b/packages/client/src/object/fetchPage.ts index ddffe1710..9b9c73822 100644 --- a/packages/client/src/object/fetchPage.ts +++ b/packages/client/src/object/fetchPage.ts @@ -274,7 +274,6 @@ export async function fetchObjectPage< undefined, undefined, args.$select, - args.$__EXPERIMENTAL_strictNonNull, ), nextPageToken: r.nextPageToken, totalCount: r.totalCount, diff --git a/packages/client/src/objectSet/ObjectSet.test.ts b/packages/client/src/objectSet/ObjectSet.test.ts index 37e4ddf15..02983af46 100644 --- a/packages/client/src/objectSet/ObjectSet.test.ts +++ b/packages/client/src/objectSet/ObjectSet.test.ts @@ -15,8 +15,10 @@ */ import type { + Augments, CompileTimeMetadata, ConvertProps, + FetchPageArgs, InterfaceDefinition, ObjectSet, Osdk, @@ -295,48 +297,48 @@ describe("ObjectSet", () => { }); describe.each(["fetchPage", "fetchPageWithErrors"] as const)("%s", (k) => { - describe("strictNonNull: \"drop\"", () => { - describe("includeRid: true", () => { - it("drops bad data", async () => { - const opts = { - $__EXPERIMENTAL_strictNonNull: "drop", - $includeRid: true, - } as const; - const result = k === "fetchPage" - ? await client(Employee).fetchPage(opts) - : (await client(Employee).fetchPageWithErrors(opts)).value!; - - expect(result.data).toHaveLength(3); - expectTypeOf(result.data[0]).branded.toEqualTypeOf< - Osdk - >(); - expectTypeOf(result.data[0]).branded.toEqualTypeOf< - Employee.OsdkObject<"$rid"> - >(); - }); - }); - - describe("includeRid: false", () => { - it("drops bad data", async () => { - const opts = { - $__EXPERIMENTAL_strictNonNull: "drop", - $includeRid: false, - } as const; - const result = k === "fetchPage" - ? await client(Employee).fetchPage(opts) - : (await client(Employee).fetchPageWithErrors(opts)).value!; - - expect(result.data).toHaveLength(3); - expectTypeOf(result.data[0]).branded.toEqualTypeOf>(); - expectTypeOf(result.data[0]).branded.toEqualTypeOf< - Employee.OsdkObject - >(); - expectTypeOf(result.data[0]).branded.toEqualTypeOf< - Employee.OsdkObject - >(); - }); - }); - }); + // describe("strictNonNull: \"drop\"", () => { + // describe("includeRid: true", () => { + // it("drops bad data", async () => { + // const opts = { + // $__EXPERIMENTAL_strictNonNull: "drop", + // $includeRid: true, + // } as const; + // const result = k === "fetchPage" + // ? await client(Employee).fetchPage(opts) + // : (await client(Employee).fetchPageWithErrors(opts)).value!; + + // expect(result.data).toHaveLength(3); + // expectTypeOf(result.data[0]).branded.toEqualTypeOf< + // Osdk + // >(); + // expectTypeOf(result.data[0]).branded.toEqualTypeOf< + // Employee.OsdkObject<"$rid"> + // >(); + // }); + // }); + + // describe("includeRid: false", () => { + // it("drops bad data", async () => { + // const opts = { + // $__EXPERIMENTAL_strictNonNull: "drop", + // $includeRid: false, + // } as const; + // const result = k === "fetchPage" + // ? await client(Employee).fetchPage(opts) + // : (await client(Employee).fetchPageWithErrors(opts)).value!; + + // expect(result.data).toHaveLength(3); + // expectTypeOf(result.data[0]).branded.toEqualTypeOf>(); + // expectTypeOf(result.data[0]).branded.toEqualTypeOf< + // Employee.OsdkObject + // >(); + // expectTypeOf(result.data[0]).branded.toEqualTypeOf< + // Employee.OsdkObject + // >(); + // }); + // }); + // }); describe("strictNonNull: false", () => { describe("includeRid: true", () => { @@ -359,8 +361,7 @@ describe("ObjectSet", () => { describe("includeRid: false", () => { it("returns bad data", async () => { const opts = { - $__EXPERIMENTAL_strictNonNull: false, - includeRid: false, + $includeRid: false, } as const; const result = k === "fetchPage" ? await client(Employee).fetchPage(opts) @@ -375,22 +376,11 @@ describe("ObjectSet", () => { }); }); - describe("strictNonNull: \"throw\"", () => { - it("throws when getting bad data", () => { - expect(() => - client(Employee).fetchPage({ - $__EXPERIMENTAL_strictNonNull: "throw", - }) - ).rejects.toThrowErrorMatchingInlineSnapshot( - `[Error: Unable to safely convert objects as some non nullable properties are null]`, - ); - }); - }); - describe.each(["fetchOne", "fetchOneWithErrors"] as const)("%s", (k) => { describe("strictNonNull: false", () => { describe("includeRid: true", () => { it("returns bad data", async () => { + // Look at this const opts = { $__EXPERIMENTAL_strictNonNull: false, $includeRid: true, @@ -410,7 +400,7 @@ describe("ObjectSet", () => { it("returns bad data", async () => { const opts = { $__EXPERIMENTAL_strictNonNull: false, - includeRid: false, + $includeRid: false, } as const; const result = k === "fetchOne" ? await client(Employee).fetchOne(50033, opts) @@ -425,24 +415,10 @@ describe("ObjectSet", () => { }); }); - describe("strictNonNull: \"throw\"", () => { - it("throws when getting bad data", () => { - expect(() => - client(Employee).fetchPage({ - $__EXPERIMENTAL_strictNonNull: "throw", - }) - ).rejects.toThrowErrorMatchingInlineSnapshot( - `[Error: Unable to safely convert objects as some non nullable properties are null]`, - ); - }); - }); - describe("conversions", () => { describe("strictNonNull: false", () => { it("returns bad data", async () => { - const result = await client(Employee).fetchPage({ - $__EXPERIMENTAL_strictNonNull: false, - }); + const result = await client(Employee).fetchPage({}); const empNotStrict = result.data[0]; const empNotStrict2: Osdk = @@ -451,18 +427,18 @@ describe("ObjectSet", () => { Osdk >(); expectTypeOf(empNotStrict).branded.toEqualTypeOf< - Employee.OsdkObject<"$notStrict", Employee.PropertyKeys> + Employee.OsdkObject >(); expectTypeOf(empNotStrict).branded.toEqualTypeOf< - Employee.OsdkObject<"$notStrict"> + Employee.OsdkObject >(); expectTypeOf(empNotStrict.employeeId).toEqualTypeOf< - number | undefined + number >(); expectTypeOf(empNotStrict2.employeeId).toEqualTypeOf< - number | undefined + number >(); expectTypeOf>() diff --git a/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts b/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts index ca7005694..c8ff747ce 100644 --- a/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts +++ b/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts @@ -16,20 +16,18 @@ export namespace SomeInterface { export interface Props { readonly spt: $PropType['string'] | undefined; } - export interface StrictProps { - readonly spt: $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/objects/Task.ts b/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/objects/Task.ts index 142c9ee08..fa26aee88 100644 --- a/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/objects/Task.ts +++ b/packages/e2e.generated.api-namespace.dep/src/generatedNoCheck/ontology/objects/Task.ts @@ -20,24 +20,21 @@ export namespace Task { export type Links = {}; export interface Props { - readonly body: $PropType['string'] | undefined; - readonly taskId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly taskId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Task.Props = keyof Task.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Task.Props = keyof Task.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts index 388f647db..478b0abe4 100644 --- a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts +++ b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/interfaces/SomeInterface.ts @@ -16,20 +16,18 @@ export namespace SomeInterface { export interface Props { readonly 'com.example.dep.spt': $PropType['string'] | undefined; } - export interface StrictProps { - readonly 'com.example.dep.spt': $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/Thing.ts b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/Thing.ts index 17f64c7d7..917788df9 100644 --- a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/Thing.ts +++ b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/Thing.ts @@ -20,24 +20,21 @@ export namespace Thing { export type Links = {}; export interface Props { - readonly body: $PropType['string'] | undefined; - readonly id: $PropType['integer'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly id: $PropType['integer']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Thing.Props = keyof Thing.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Thing.Props = keyof Thing.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/UsesForeignSpt.ts b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/UsesForeignSpt.ts index f25b90e2e..1260c2bad 100644 --- a/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/UsesForeignSpt.ts +++ b/packages/e2e.generated.api-namespace.local/src/generatedNoCheck/ontology/objects/UsesForeignSpt.ts @@ -20,24 +20,21 @@ export namespace UsesForeignSpt { export type Links = {}; export interface Props { - readonly body: $PropType['string'] | undefined; - readonly id: $PropType['integer'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly id: $PropType['integer']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof UsesForeignSpt.Props = keyof UsesForeignSpt.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof UsesForeignSpt.Props = keyof UsesForeignSpt.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/interfaces/FooInterface.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/interfaces/FooInterface.ts index 60cd77d5a..389f01a82 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/interfaces/FooInterface.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/interfaces/FooInterface.ts @@ -17,21 +17,18 @@ export namespace FooInterface { readonly description: $PropType['string'] | undefined; readonly name: $PropType['string'] | undefined; } - export interface StrictProps { - readonly description: $PropType['string'] | undefined; - readonly name: $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof FooInterface.Props = keyof FooInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof FooInterface.Props = keyof FooInterface.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BoundariesUsState.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BoundariesUsState.ts index b8d4636fc..509d65532 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BoundariesUsState.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BoundariesUsState.ts @@ -20,28 +20,23 @@ export namespace BoundariesUsState { export type Links = {}; export interface Props { - readonly geometry10M: $PropType['geoshape'] | undefined; - readonly latitude: $PropType['double'] | undefined; - readonly longitude: $PropType['double'] | undefined; - readonly usState: $PropType['string'] | undefined; - } - export interface StrictProps { readonly geometry10M: $PropType['geoshape'] | undefined; readonly latitude: $PropType['double'] | undefined; readonly longitude: $PropType['double'] | undefined; readonly usState: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof BoundariesUsState.Props = keyof BoundariesUsState.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof BoundariesUsState.Props = keyof BoundariesUsState.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BuilderDeploymentState.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BuilderDeploymentState.ts index e3198875d..5a81a3a07 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BuilderDeploymentState.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/BuilderDeploymentState.ts @@ -20,26 +20,22 @@ export namespace BuilderDeploymentState { export type Links = {}; export interface Props { - readonly currentTimestamp: $PropType['timestamp'] | undefined; - readonly date: $PropType['datetime'] | undefined; - readonly skuId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly currentTimestamp: $PropType['timestamp'] | undefined; readonly date: $PropType['datetime'] | undefined; readonly skuId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof BuilderDeploymentState.Props = keyof BuilderDeploymentState.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof BuilderDeploymentState.Props = keyof BuilderDeploymentState.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/DherlihyComplexObject.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/DherlihyComplexObject.ts index ec0b33bd8..4871eb5db 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/DherlihyComplexObject.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/DherlihyComplexObject.ts @@ -20,26 +20,22 @@ export namespace DherlihyComplexObject { export type Links = {}; export interface Props { - readonly id: $PropType['string'] | undefined; - readonly secret: $PropType['string'] | undefined; - readonly seriesId: $PropType['numericTimeseries'] | undefined; - } - export interface StrictProps { readonly id: $PropType['string']; readonly secret: $PropType['string'] | undefined; readonly seriesId: $PropType['numericTimeseries'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof DherlihyComplexObject.Props = keyof DherlihyComplexObject.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof DherlihyComplexObject.Props = keyof DherlihyComplexObject.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Employee.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Employee.ts index fb1d0c7a0..4f6679ac4 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Employee.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Employee.ts @@ -37,20 +37,6 @@ export namespace Employee { } export interface Props { - readonly adUsername: $PropType['string'] | undefined; - readonly businessTitle: $PropType['string'] | undefined; - readonly email: $PropType['string'] | undefined; - readonly employeeNumber: $PropType['double'] | undefined; - readonly favPlace: $PropType['geopoint'] | undefined; - readonly firstFullTimeStartDate: $PropType['datetime'] | undefined; - readonly firstName: $PropType['string'] | undefined; - readonly id: $PropType['string'] | undefined; - readonly jobProfile: $PropType['string'] | undefined; - readonly locationCity: $PropType['string'] | undefined; - readonly locationName: $PropType['string'] | undefined; - readonly locationType: $PropType['string'] | undefined; - } - export interface StrictProps { readonly adUsername: $PropType['string'] | undefined; readonly businessTitle: $PropType['string'] | undefined; readonly email: $PropType['string'] | undefined; @@ -64,17 +50,18 @@ export namespace Employee { readonly locationName: $PropType['string'] | undefined; readonly locationType: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Employee.Props = keyof Employee.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Employee.Props = keyof Employee.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/FintrafficAis.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/FintrafficAis.ts index 5cc3abf70..41b46018f 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/FintrafficAis.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/FintrafficAis.ts @@ -20,15 +20,6 @@ export namespace FintrafficAis { export type Links = {}; export interface Props { - readonly centroid: $PropType['geopoint'] | undefined; - readonly geometry: $PropType['geoshape'] | undefined; - readonly mmsi: $PropType['string'] | undefined; - readonly name: $PropType['string'] | undefined; - readonly seriesId: $PropType['geotimeSeriesReference'] | undefined; - readonly shipType: $PropType['string'] | undefined; - readonly timestamp: $PropType['timestamp'] | undefined; - } - export interface StrictProps { readonly centroid: $PropType['geopoint'] | undefined; readonly geometry: $PropType['geoshape'] | undefined; readonly mmsi: $PropType['string']; @@ -37,17 +28,18 @@ export namespace FintrafficAis { readonly shipType: $PropType['string'] | undefined; readonly timestamp: $PropType['timestamp'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof FintrafficAis.Props = keyof FintrafficAis.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof FintrafficAis.Props = keyof FintrafficAis.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/GtfsTripTrackObject.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/GtfsTripTrackObject.ts index 1142ec041..a22d19f1c 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/GtfsTripTrackObject.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/GtfsTripTrackObject.ts @@ -20,26 +20,22 @@ export namespace GtfsTripTrackObject { export type Links = {}; export interface Props { - readonly entityId: $PropType['string'] | undefined; - readonly geotimeSeriesReferences: $PropType['geotimeSeriesReference'] | undefined; - readonly timestamp: $PropType['timestamp'] | undefined; - } - export interface StrictProps { readonly entityId: $PropType['string']; readonly geotimeSeriesReferences: $PropType['geotimeSeriesReference'] | undefined; readonly timestamp: $PropType['timestamp'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof GtfsTripTrackObject.Props = keyof GtfsTripTrackObject.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof GtfsTripTrackObject.Props = keyof GtfsTripTrackObject.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/MtaBus.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/MtaBus.ts index 5a8c46372..6bca2228e 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/MtaBus.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/MtaBus.ts @@ -20,28 +20,23 @@ export namespace MtaBus { export type Links = {}; export interface Props { - readonly nextStopId: $PropType['string'] | undefined; - readonly positionId: $PropType['geotimeSeriesReference'] | undefined; - readonly routeId: $PropType['string'] | undefined; - readonly vehicleId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly nextStopId: $PropType['string'] | undefined; readonly positionId: $PropType['geotimeSeriesReference'] | undefined; readonly routeId: $PropType['string'] | undefined; readonly vehicleId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof MtaBus.Props = keyof MtaBus.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof MtaBus.Props = keyof MtaBus.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/ObjectTypeWithAllPropertyTypes.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/ObjectTypeWithAllPropertyTypes.ts index f4296672c..6e6497ae2 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/ObjectTypeWithAllPropertyTypes.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/ObjectTypeWithAllPropertyTypes.ts @@ -51,39 +51,6 @@ export namespace ObjectTypeWithAllPropertyTypes { export type Links = {}; export interface Props { - readonly attachment: $PropType['attachment'] | undefined; - readonly attachmentArray: $PropType['attachment'][] | undefined; - readonly boolean: $PropType['boolean'] | undefined; - readonly booleanArray: $PropType['boolean'][] | undefined; - readonly byte: $PropType['byte'] | undefined; - readonly byteArray: $PropType['byte'][] | undefined; - readonly date: $PropType['datetime'] | undefined; - readonly dateArray: $PropType['datetime'][] | undefined; - readonly dateTime: $PropType['timestamp'] | undefined; - readonly dateTimeArray: $PropType['timestamp'][] | undefined; - readonly decimal: $PropType['decimal'] | undefined; - readonly decimalArray: $PropType['decimal'][] | undefined; - readonly double: $PropType['double'] | undefined; - readonly doubleArray: $PropType['double'][] | undefined; - readonly float: $PropType['float'] | undefined; - readonly floatArray: $PropType['float'][] | undefined; - readonly geoPoint: $PropType['geopoint'] | undefined; - readonly geoPointArray: $PropType['geopoint'][] | undefined; - readonly geoShape: $PropType['geoshape'] | undefined; - readonly geoShapeArray: $PropType['geoshape'][] | undefined; - readonly id: $PropType['integer'] | undefined; - readonly integer: $PropType['integer'] | undefined; - readonly integerArray: $PropType['integer'][] | undefined; - readonly long: $PropType['long'] | undefined; - readonly longArray: $PropType['long'][] | undefined; - readonly numericTimeseries: $PropType['numericTimeseries'] | undefined; - readonly short: $PropType['short'] | undefined; - readonly shortArray: $PropType['short'][] | undefined; - readonly string: $PropType['string'] | undefined; - readonly stringArray: $PropType['string'][] | undefined; - readonly stringTimeseries: $PropType['stringTimeseries'] | undefined; - } - export interface StrictProps { readonly attachment: $PropType['attachment'] | undefined; readonly attachmentArray: $PropType['attachment'][] | undefined; readonly boolean: $PropType['boolean'] | undefined; @@ -116,18 +83,19 @@ export namespace ObjectTypeWithAllPropertyTypes { readonly stringArray: $PropType['string'][] | undefined; readonly stringTimeseries: $PropType['stringTimeseries'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof ObjectTypeWithAllPropertyTypes.Props = keyof ObjectTypeWithAllPropertyTypes.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof ObjectTypeWithAllPropertyTypes.Props = keyof ObjectTypeWithAllPropertyTypes.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/OsdkTestObject.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/OsdkTestObject.ts index 52124774d..5778a186f 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/OsdkTestObject.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/OsdkTestObject.ts @@ -20,24 +20,21 @@ export namespace OsdkTestObject { export type Links = {}; export interface Props { - readonly primaryKey_: $PropType['string'] | undefined; - readonly stringProperty: $PropType['string'] | undefined; - } - export interface StrictProps { readonly primaryKey_: $PropType['string']; readonly stringProperty: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof OsdkTestObject.Props = keyof OsdkTestObject.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof OsdkTestObject.Props = keyof OsdkTestObject.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Person.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Person.ts index 50a8d0941..8ead87e03 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Person.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Person.ts @@ -24,22 +24,20 @@ export namespace Person { } export interface Props { - readonly email: $PropType['string'] | undefined; - } - export interface StrictProps { readonly email: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/RhemmingsObjectWithGtsrProperty2.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/RhemmingsObjectWithGtsrProperty2.ts index 55f226a57..793d440bc 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/RhemmingsObjectWithGtsrProperty2.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/RhemmingsObjectWithGtsrProperty2.ts @@ -20,31 +20,25 @@ export namespace RhemmingsObjectWithGtsrProperty2 { export type Links = {}; export interface Props { - readonly gtsr: $PropType['geotimeSeriesReference'] | undefined; - readonly id: $PropType['string'] | undefined; - readonly location: $PropType['geopoint'] | undefined; - readonly timestamp: $PropType['timestamp'] | undefined; - readonly type: $PropType['string'] | undefined; - } - export interface StrictProps { readonly gtsr: $PropType['geotimeSeriesReference'] | undefined; readonly id: $PropType['string']; readonly location: $PropType['geopoint'] | undefined; readonly timestamp: $PropType['timestamp'] | undefined; readonly type: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof RhemmingsObjectWithGtsrProperty2.Props = keyof RhemmingsObjectWithGtsrProperty2.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof RhemmingsObjectWithGtsrProperty2.Props = keyof RhemmingsObjectWithGtsrProperty2.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Todo.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Todo.ts index 7b36483e2..86f5cce58 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Todo.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Todo.ts @@ -23,30 +23,24 @@ export namespace Todo { } export interface Props { - readonly body: $PropType['string'] | undefined; - readonly complete: $PropType['boolean'] | undefined; - readonly id: $PropType['integer'] | undefined; - readonly priority: $PropType['integer'] | undefined; - readonly text: $PropType['string'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly complete: $PropType['boolean'] | undefined; readonly id: $PropType['integer']; readonly priority: $PropType['integer'] | undefined; readonly text: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Venture.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Venture.ts index ed815b53c..b4bddfda0 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Venture.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/Venture.ts @@ -23,26 +23,22 @@ export namespace Venture { } export interface Props { - readonly ventureId: $PropType['string'] | undefined; - readonly ventureName: $PropType['string'] | undefined; - readonly ventureStart: $PropType['datetime'] | undefined; - } - export interface StrictProps { readonly ventureId: $PropType['string']; readonly ventureName: $PropType['string'] | undefined; readonly ventureStart: $PropType['datetime'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Venture.Props = keyof Venture.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Venture.Props = keyof Venture.Props, > = OsdkInstance; } diff --git a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/WeatherStation.ts b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/WeatherStation.ts index 3577aae5b..873529d05 100644 --- a/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/WeatherStation.ts +++ b/packages/e2e.generated.catchall/src/generatedNoCheck/ontology/objects/WeatherStation.ts @@ -20,24 +20,21 @@ export namespace WeatherStation { export type Links = {}; export interface Props { - readonly geohash: $PropType['geopoint'] | undefined; - readonly stationId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly geohash: $PropType['geopoint'] | undefined; readonly stationId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof WeatherStation.Props = keyof WeatherStation.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof WeatherStation.Props = keyof WeatherStation.Props, > = OsdkInstance; } diff --git a/packages/e2e.sandbox.catchall/src/demoStrictness.ts b/packages/e2e.sandbox.catchall/src/demoStrictness.ts index e7ab4e0f3..8f513478b 100644 --- a/packages/e2e.sandbox.catchall/src/demoStrictness.ts +++ b/packages/e2e.sandbox.catchall/src/demoStrictness.ts @@ -28,33 +28,33 @@ export async function demoStrictnessObject() { .fetchPage(); expectType(defaultResults[0].usState); - const { data: dropResults } = await client(BoundariesUsState) - .fetchPage({ $__EXPERIMENTAL_strictNonNull: "drop" }); - expectType(dropResults[0].usState); + // const { data: dropResults } = await client(BoundariesUsState) + // .fetchPage({ $__EXPERIMENTAL_strictNonNull: "drop" }); + // expectType(dropResults[0].usState); - const { data: notStrictResults } = await client(BoundariesUsState) - .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); - expectType(notStrictResults[0].usState); + // const { data: notStrictResults } = await client(BoundariesUsState) + // .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); + // expectType(notStrictResults[0].usState); - const { data: throwResults } = await client(BoundariesUsState) - .fetchPage({ $__EXPERIMENTAL_strictNonNull: "throw" }); - expectType(throwResults[0].usState); + // const { data: throwResults } = await client(BoundariesUsState) + // .fetchPage({ $__EXPERIMENTAL_strictNonNull: "throw" }); + // expectType(throwResults[0].usState); - const { data: fooDataNotStrict } = await client(FooInterface) - .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); + // const { data: fooDataNotStrict } = await client(FooInterface) + // .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); - const employeeNotStrict = fooDataNotStrict[0].$as(Employee); + // const employeeNotStrict = fooDataNotStrict[0].$as(Employee); } export async function demoStrictnessInterface() { - const { data: fooDataNotStrict } = await client(FooInterface) - .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); - - const employeeNotStrict = fooDataNotStrict[0].$as(Employee); - expectType< - Osdk< - Employee, - "$notStrict" | "firstName" | "email" - > - >(employeeNotStrict); + // const { data: fooDataNotStrict } = await client(FooInterface) + // .fetchPage({ $__EXPERIMENTAL_strictNonNull: false }); + + // const employeeNotStrict = fooDataNotStrict[0].$as(Employee); + // expectType< + // Osdk< + // Employee, + // "$notStrict" | "firstName" | "email" + // > + // >(employeeNotStrict); } diff --git a/packages/e2e.sandbox.todoapp/src/generatedNoCheck2/ontology/objects/Todo.ts b/packages/e2e.sandbox.todoapp/src/generatedNoCheck2/ontology/objects/Todo.ts index cf87e1dfe..5e7073294 100644 --- a/packages/e2e.sandbox.todoapp/src/generatedNoCheck2/ontology/objects/Todo.ts +++ b/packages/e2e.sandbox.todoapp/src/generatedNoCheck2/ontology/objects/Todo.ts @@ -20,26 +20,22 @@ export namespace Todo { export type Links = {}; export interface Props { - readonly id: $PropType['string'] | undefined; - readonly isComplete: $PropType['boolean'] | undefined; - readonly title: $PropType['string'] | undefined; - } - export interface StrictProps { readonly id: $PropType['string']; readonly isComplete: $PropType['boolean'] | undefined; readonly title: $PropType['string'] | undefined; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = OsdkInstance; } diff --git a/packages/generator/src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts b/packages/generator/src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts index 2dc587833..6c240fa8c 100644 --- a/packages/generator/src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts +++ b/packages/generator/src/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts @@ -131,20 +131,18 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => { export interface Props { readonly bar: $PropType["integer"] | undefined; } - export interface StrictProps { - readonly bar: $PropType["integer"] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Bar.Props = keyof Bar.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Bar.Props = keyof Bar.Props, > = OsdkInstance; } @@ -223,20 +221,18 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => { export interface Props { readonly foo: $PropType["integer"] | undefined; } - export interface StrictProps { - readonly foo: $PropType["integer"] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Foo.Props = keyof Foo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Foo.Props = keyof Foo.Props, > = OsdkInstance; } @@ -317,21 +313,18 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => { readonly bar: $PropType["integer"] | undefined; readonly foo: $PropType["integer"] | undefined; } - export interface StrictProps { - readonly bar: $PropType["integer"] | undefined; - readonly foo: $PropType["integer"] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Foo.Props = keyof Foo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof Foo.Props = keyof Foo.Props, > = OsdkInstance; } diff --git a/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts b/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts index 7a95de7bd..f302dc815 100644 --- a/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts +++ b/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts @@ -686,20 +686,18 @@ describe("generator", () => { export interface Props { readonly SomeProperty: $PropType['string'] | undefined; } - export interface StrictProps { - readonly SomeProperty: $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = OsdkInstance; } @@ -764,22 +762,20 @@ describe("generator", () => { } export interface Props { - readonly email: $PropType['string'] | undefined; - } - export interface StrictProps { readonly email: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = OsdkInstance; } @@ -854,26 +850,22 @@ describe("generator", () => { } export interface Props { - readonly body: $PropType['string'] | undefined; - readonly complete: $PropType['boolean'] | undefined; - readonly id: $PropType['integer'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly complete: $PropType['boolean'] | undefined; readonly id: $PropType['integer']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = OsdkInstance; } @@ -1306,20 +1298,18 @@ describe("generator", () => { export interface Props { readonly SomeProperty: $PropType['string'] | undefined; } - export interface StrictProps { - readonly SomeProperty: $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = OsdkInstance; } @@ -1384,22 +1374,20 @@ describe("generator", () => { } export interface Props { - readonly email: $PropType['string'] | undefined; - } - export interface StrictProps { readonly email: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Person.Props = keyof Person.Props, > = OsdkInstance; } @@ -1474,26 +1462,22 @@ describe("generator", () => { } export interface Props { - readonly body: $PropType['string'] | undefined; - readonly complete: $PropType['boolean'] | undefined; - readonly id: $PropType['integer'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly complete: $PropType['boolean'] | undefined; readonly id: $PropType['integer']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Todo.Props = keyof Todo.Props, > = OsdkInstance; } @@ -1883,24 +1867,21 @@ describe("generator", () => { export type Links = {}; export interface Props { - readonly body: $PropType['string'] | undefined; - readonly id: $PropType['integer'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly id: $PropType['integer']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof UsesForeignSpt.Props = keyof UsesForeignSpt.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof UsesForeignSpt.Props = keyof UsesForeignSpt.Props, > = OsdkInstance; } @@ -2104,20 +2085,18 @@ describe("generator", () => { export interface Props { readonly spt: $PropType['string'] | undefined; } - export interface StrictProps { - readonly spt: $PropType['string'] | undefined; - } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof SomeInterface.Props = keyof SomeInterface.Props, > = OsdkInstance; } @@ -2176,24 +2155,21 @@ describe("generator", () => { export type Links = {}; export interface Props { - readonly body: $PropType['string'] | undefined; - readonly taskId: $PropType['string'] | undefined; - } - export interface StrictProps { readonly body: $PropType['string'] | undefined; readonly taskId: $PropType['string']; } + export type StrictProps = Props; export interface ObjectSet extends $ObjectSet {} export type OsdkInstance< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Task.Props = keyof Task.Props, > = $Osdk.Instance; /** @deprecated use OsdkInstance */ export type OsdkObject< - OPTIONS extends never | '$notStrict' | '$rid' = never, + OPTIONS extends never | '$rid' = never, K extends keyof Task.Props = keyof Task.Props, > = OsdkInstance; } diff --git a/packages/generator/src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts b/packages/generator/src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts index c454b85f4..b91bd160c 100644 --- a/packages/generator/src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts +++ b/packages/generator/src/v2.0/wireObjectTypeV2ToSdkObjectConstV2.ts @@ -154,7 +154,7 @@ export function createOsdkObject( const definition = object.getCleanedUpDefinition(true); return ` export type ${identifier}< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier}, > = $Osdk.Instance< @@ -166,7 +166,7 @@ export function createOsdkObject( /** @deprecated use ${identifier} */ export type OsdkObject< - OPTIONS extends never | "$notStrict" | "$rid" = never, + OPTIONS extends never | "$rid" = never, K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier}, > = ${identifier}; ; @@ -212,6 +212,9 @@ export function createProps( identifier: string, strict: boolean, ) { + if (identifier === "StrictProps") { + return `export type StrictProps = Props`; + } const definition = type.getCleanedUpDefinition(true); return `export interface ${identifier} { ${ @@ -224,7 +227,14 @@ ${ ""}`, `$PropType[${JSON.stringify(propertyDefinition.type)}]${ propertyDefinition.multiplicity ? "[]" : "" - }${propertyDefinition.nullable || !strict ? `| undefined` : ""}`, + }${ + propertyDefinition.nullable + || (!strict + && !(definition.type === "object" + && definition.primaryKeyApiName === apiName)) + ? `| undefined` + : "" + }`, ] as [string, string]; }, })