@osdk/api 2.5.0-beta.2 → 2.5.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @osdk/api
2
2
 
3
+ ## 2.5.0-beta.4
4
+
5
+ ## 2.5.0-beta.3
6
+
7
+ ### Minor Changes
8
+
9
+ - 7bdac45: Update Platform SDK dependency
10
+ - 20962bc: Add a new experimental fetchPageByRidNoType method
11
+ - e48be06: Fix casting types with fully qualified property names.
12
+
3
13
  ## 2.5.0-beta.2
4
14
 
5
15
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type {\n NullabilityAdherence,\n ObjectSetArgs,\n} from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBase } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = \"$allBaseProperties\" extends OPTIONS\n ? PropertyKeys<FROM> extends P ? PropertyKeys<TO>\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>]\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = PropMapToInterface<\n FROM,\n TO\n>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];\n/**\n * Older version of this helper that allows for `$rid` and co in\n * the properties field.\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P, OPTIONS>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport type MaybeScore<\n T extends Osdk.Instance<any>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<any>,\n> = ORDER_BY_OPTIONS extends \"relevance\" ? T & { $score: number } : T;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBase<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P, OPTIONS>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n\n readonly $__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata: Q extends\n ObjectTypeDefinition ? {\n ObjectMetadata: Q;\n }\n : {\n ObjectMetadata: ObjectMetadata;\n InterfaceMetadata: InterfaceMetadata;\n };\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\nexport type ExtractAllPropertiesOption<T extends boolean> = // comment for readability\n IsNever<T> extends true ? never\n : DefaultToFalse<T> extends false ? never\n : \"$allBaseProperties\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AA0BA;AACA;AACA;AAFA,WA2BiBA,IAAI;AAsDrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type {\n NullabilityAdherence,\n ObjectSetArgs,\n} from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBase } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = \"$allBaseProperties\" extends OPTIONS\n ? PropertyKeys<FROM> extends P ? PropertyKeys<TO>\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>]\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\ntype NamespaceOf<S extends string> = S extends `${infer Before}.${infer After}`\n ? After extends `${string}.${string}` ? `${Before}.${NamespaceOf<After>}`\n : Before\n : never;\n\ntype MaybeStripNamespaces<S extends string, TO extends InterfaceDefinition> =\n S extends `${NamespaceOf<S>}.${infer Rest}`\n ? NamespaceOf<S> extends NamespaceOf<ApiNameAsString<TO>> ? Rest : S\n : S;\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = MaybeStripNamespaces<\n PropMapToInterface<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>],\n TO\n>;\n/**\n * Older version of this helper that allows for `$rid` and co in\n * the properties field.\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P, OPTIONS>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport type MaybeScore<\n T extends Osdk.Instance<any>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<any>,\n> = ORDER_BY_OPTIONS extends \"relevance\" ? T & { $score: number } : T;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBase<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P, OPTIONS>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n\n readonly $__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata: Q extends\n ObjectTypeDefinition ? {\n ObjectMetadata: Q;\n }\n : {\n ObjectMetadata: ObjectMetadata;\n InterfaceMetadata: InterfaceMetadata;\n };\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\nexport type ExtractAllPropertiesOption<T extends boolean> = // comment for readability\n IsNever<T> extends true ? never\n : DefaultToFalse<T> extends false ? never\n : \"$allBaseProperties\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0GA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AA0BA;AACA;AACA;AAFA,WA2BiBA,IAAI;AAsDrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}
@@ -193,5 +193,12 @@ describe("ExtractOptions", () => {
193
193
  expectTypeOf().branded.toEqualTypeOf();
194
194
  });
195
195
  });
196
+ describe("Interface casting works as intended", () => {
197
+ it("mapping as with fqn property names works", async () => {
198
+ expectTypeOf().toEqualTypeOf;
199
+ expectTypeOf().toEqualTypeOf;
200
+ expectTypeOf().toExtend();
201
+ });
202
+ });
196
203
  });
197
204
  //# sourceMappingURL=OsdkObjectFrom.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","createMockObjectSet","toEqualTypeOf","branded","fauxObjectSet","fetchPage"],"sources":["OsdkObjectFrom.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport { createMockObjectSet } from \"./objectSet/ObjectSet.test.js\";\nimport type { ExtractOptions, Osdk } from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: undefined;\n };\n };\n\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n\n it(\"Is assignable to Record<string, unknown>\", () => {\n // We encountered a break where this stopped being assignable. We need to continue to support this assignment.\n const a = {} as Osdk.Instance<quickAndDirty>;\n a as Record<string, unknown>;\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n const fauxObjectSet = createMockObjectSet<quickAndDirty>();\n\n it(\"is not $notStrict\", async () => {\n const page = await fauxObjectSet.fetchPage();\n\n expectTypeOf<typeof page[\"data\"]>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnD,SAASC,mBAAmB,QAAQ,+BAA+B;AAGnEH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BA,QAAQ,CAAC,8BAA8B,EAAE,MAAM;IAC7CE,EAAE,CA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8CAA8C,EAAE,MAAM;MACvDD,YAAY,CAAoC,CAAC,CAACI,OAAO,CACtDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,YAAY,CAAkC,CAAC,CAACI,OAAO,CACpDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACzDD,YAAY,CAAqC,CAAC,CAC/CG,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,2CAA2C,EAAE,MAAM;IAC1D,MAAMM,aAAa,GAAGH,mBAAmB,CAAgB,CAAC;IAE1DD,EAAE,CAAC,mBAAmB,EAAE,YAAY;MACrB,MAAMI,aAAa,CAACC,SAAS,CAAC,CAAC;MAE5CN,YAAY,CAAsB,CAAC,CAACI,OAAO,CACxCD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","createMockObjectSet","toEqualTypeOf","branded","fauxObjectSet","fetchPage","toExtend"],"sources":["OsdkObjectFrom.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport { createMockObjectSet } from \"./objectSet/ObjectSet.test.js\";\nimport type { PropertyKeys } from \"./ontology/ObjectOrInterface.js\";\nimport type {\n ConvertProps,\n ExtractOptions,\n MapPropNamesToInterface,\n Osdk,\n} from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: undefined;\n };\n };\n\n type quickerAndDirtier = {\n apiName: \"Bar\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n birthday: string;\n };\n strictProps: {\n name: string;\n foo: number;\n birthday: string;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {\n \"com.my.obscure.namespace.FooBarInterface\": {\n \"com.my.obscure.namespace.fooInterface\": \"foo\";\n \"com.my.obscure.namespace.id\": \"name\";\n \"com.my.even.more.obscure.namespace.originDate\": \"birthday\";\n };\n };\n inverseInterfaceMap: {\n \"com.my.obscure.namespace.FooBarInterface\": {\n \"foo\": \"com.my.obscure.namespace.fooInterface\";\n \"name\": \"com.my.obscure.namespace.id\";\n \"birthday\": \"com.my.even.more.obscure.namespace.originDate\";\n };\n };\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n description: \"\";\n };\n foo: {\n type: \"integer\";\n description: \"\";\n };\n birthday: {\n type: \"string\";\n description: \"\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: \"\";\n };\n };\n\n type quickerAndDirtierInterface = {\n apiName: \"com.my.obscure.namespace.FooBarInterface\";\n type: \"interface\";\n __DefinitionMetadata: {\n props: {\n id: string;\n \"com.my.even.more.obscure.namespace.originDate\": string | undefined;\n fooInterface: number;\n };\n strictProps: {\n id: string;\n \"com.my.even.more.obscure.namespace.originDate\": string;\n fooInterface: number;\n };\n apiName: \"com.my.obscure.namespace.FooBarInterface\";\n displayName: \"\";\n implements: [];\n implementedBy: [\"Bar\"];\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n properties: {\n id: {\n type: \"string\";\n description: \"\";\n };\n \"com.my.even.more.obscure.namespace.originDate\": {\n type: \"string\";\n description: \"\";\n };\n fooInterface: {\n type: \"integer\";\n description: \"\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"interface\";\n icon: undefined;\n visibility: undefined;\n description: \"\";\n };\n };\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n\n it(\"Is assignable to Record<string, unknown>\", () => {\n // We encountered a break where this stopped being assignable. We need to continue to support this assignment.\n const a = {} as Osdk.Instance<quickAndDirty>;\n a as Record<string, unknown>;\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n const fauxObjectSet = createMockObjectSet<quickAndDirty>();\n\n it(\"is not $notStrict\", async () => {\n const page = await fauxObjectSet.fetchPage();\n\n expectTypeOf<typeof page[\"data\"]>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n\n describe(\"Interface casting works as intended\", () => {\n it(\"mapping as with fqn property names works\", async () => {\n expectTypeOf<\n MapPropNamesToInterface<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>\n >\n >().toEqualTypeOf<PropertyKeys<quickerAndDirtierInterface>>;\n\n expectTypeOf<\n ConvertProps<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>,\n never\n >\n >().toEqualTypeOf<PropertyKeys<quickerAndDirtierInterface>>;\n\n expectTypeOf<\n Osdk.Instance<\n quickerAndDirtierInterface,\n never,\n PropertyKeys<quickerAndDirtierInterface>,\n {}\n >\n >()\n .toExtend<\n Osdk.Instance<\n quickerAndDirtierInterface,\n never,\n ConvertProps<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>,\n never\n >\n >\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnD,SAASC,mBAAmB,QAAQ,+BAA+B;AASnEH,QAAQ,CAAC,gBAAgB,EAAE,MA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AACG,aAAa,CAAQ,CAAC;IAC/D,CAAC,CAAC;IAEFF,EAAE,CAAC,8CAA8C,EAAE,MAAM;MACvDD,YAAY,CAAoC,CAAC,CAACI,OAAO,CACtDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDD,YAAY,CAAkC,CAAC,CAACI,OAAO,CACpDD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;IAEFF,EAAE,CAAC,gDAAgD,EAAE,MAAM;MACzDD,YAAY,CAAqC,CAAC,CAC/CG,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,2CAA2C,EAAE,MAAM;IAC1D,MAAMM,aAAa,GAAGH,mBAAmB,CAAgB,CAAC;IAE1DD,EAAE,CAAC,mBAAmB,EAAE,YAAY;MACrB,MAAMI,aAAa,CAACC,SAAS,CAAC,CAAC;MAE5CN,YAAY,CAAsB,CAAC,CAACI,OAAO,CACxCD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,qCAAqC,EAAE,MAAM;IACpDE,EAAE,CAAC,0CAA0C,EAAE,YAAY;MACzDD,YAAY,CAMV,CAAC,CAACG,aAAa;MAEjBH,YAAY,CAOV,CAAC,CAACG,aAAa;MAEjBH,YAAY,CAOV,CAAC,CACAO,QAAQ,CAWP,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchPageByRid.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","name","type","version"],"sources":["fetchPageByRid.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchPageArgs,\n NullabilityAdherence,\n} from \"../object/FetchPageArgs.js\";\nimport type { FetchPageResult } from \"../object/FetchPageResult.js\";\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype fetchPageByRidFn = <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n objectType: Q,\n rids: string[],\n options?: FetchPageArgs<Q, L, R, any, S, T>,\n) => Promise<FetchPageResult<Q, L, R, S, T>>;\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n { fetchPageByRid: fetchPageByRidFn }\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n type: \"experiment\",\n version: \"2.2.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA,OAAO,MAAMA,iDAIZ,GAAG;EACFC,IAAI,EAAE,mDAAmD;EACzDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"fetchPageByRid.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","name","type","version"],"sources":["fetchPageByRid.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchPageArgs,\n NullabilityAdherence,\n} from \"../object/FetchPageArgs.js\";\nimport type { FetchPageResult } from \"../object/FetchPageResult.js\";\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype fetchPageByRidFn = <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n objectType: Q,\n rids: string[],\n options?: FetchPageArgs<Q, L, R, any, S, T>,\n) => Promise<FetchPageResult<Q, L, R, S, T>>;\n\nexport type FetchPageByRidPayload = {\n fetchPageByRid: fetchPageByRidFn;\n fetchPageByRidNoType: fetchPageByRidNoTypeFn;\n};\n\ntype fetchPageByRidNoTypeFn = <\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n rids: readonly string[],\n options?: FetchPageArgs<ObjectOrInterfaceDefinition, any, R, any, S, T>,\n) => Promise<FetchPageResult<ObjectOrInterfaceDefinition, any, R, S, T>>;\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n FetchPageByRidPayload\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n type: \"experiment\",\n version: \"2.2.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA,OAAO,MAAMA,iDAIZ,GAAG;EACFC,IAAI,EAAE,mDAAmD;EACzDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTypeDefinition.js","names":["ObjectMetadata"],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ObjectOrInterface.js\";\nimport type { PrimaryKeyTypes } from \"./PrimaryKeyTypes.js\";\nimport type { VersionString } from \"./VersionString.js\";\nimport type { WirePropertyTypes } from \"./WirePropertyTypes.js\";\n\nexport type CompileTimeMetadata<T extends { __DefinitionMetadata?: {} }> =\n NonNullable<\n T[\"__DefinitionMetadata\"]\n >;\n\nexport type ObjectTypePropertyDefinitionFrom2<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P];\n\nexport type ObjectInterfaceBaseMetadata = {\n type: \"object\" | \"interface\";\n apiName: string;\n displayName: string;\n description: string | undefined;\n properties: Record<any, ObjectMetadata.Property>;\n rid: string;\n /**\n * Represents the \"super interfaces\" of this object.\n *\n * Optional because they may not exist on legacy.\n */\n implements?: ReadonlyArray<string>;\n};\n\nexport interface ObjectInterfaceCompileDefinition {\n type: \"object\" | \"interface\";\n objectSet?: any;\n props?: any;\n strictProps?: any;\n linksType?: any;\n}\n\nexport interface VersionBound<V extends VersionString<any, any, any>> {\n __expectedClientVersion?: V;\n}\n\nexport interface ObjectMetadata extends ObjectInterfaceBaseMetadata {\n type: \"object\";\n primaryKeyApiName: keyof this[\"properties\"];\n titleProperty: keyof this[\"properties\"];\n links: Record<\n string,\n ObjectMetadata.Link<any, any>\n >;\n primaryKeyType: PrimaryKeyTypes;\n icon: Icon | undefined;\n visibility: ObjectTypeVisibility | undefined;\n pluralDisplayName: string;\n status: ReleaseStatus | undefined;\n interfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* InterfaceType property api name */ string,\n /* ObjectType property api name */ string\n >\n >;\n inverseInterfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* ObjectType property api name */ string,\n /* InterfaceType property api name */ string\n >\n >;\n}\n\nexport namespace ObjectMetadata {\n export interface Property {\n readonly?: boolean;\n displayName?: string;\n description?: string;\n type: WirePropertyTypes;\n multiplicity?: boolean;\n nullable?: boolean;\n }\n\n export interface Link<\n Q extends ObjectTypeDefinition,\n M extends boolean,\n > {\n __OsdkLinkTargetType?: Q;\n targetType: Q[\"apiName\"];\n multiplicity: M;\n }\n}\n\nexport interface ObjectTypeDefinition {\n type: \"object\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ObjectMetadata\n & ObjectInterfaceCompileDefinition;\n}\n\nexport type ObjectTypeLinkKeysFrom2<\n Q extends ObjectTypeDefinition,\n> =\n & keyof CompileTimeMetadata<Q>[\"links\"]\n & string;\n\nexport interface PropertyDef<\n T extends WirePropertyTypes,\n N extends \"nullable\" | \"non-nullable\" = \"nullable\",\n M extends \"array\" | \"single\" = \"single\",\n> extends ObjectMetadata.Property {\n type: T;\n multiplicity: M extends \"array\" ? true : false;\n nullable: N extends \"nullable\" ? true : false;\n}\n\nexport type ReleaseStatus =\n | \"ACTIVE\"\n | \"EXPERIMENTAL\"\n | \"DEPRECATED\"\n | \"ENDORSED\";\n\ntype ObjectTypeVisibility = \"NORMAL\" | \"PROMINENT\" | \"HIDDEN\";\n\ntype BlueprintIcon = {\n type: \"blueprint\";\n color: string;\n name: string;\n};\n\ntype Icon = BlueprintIcon;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA2FiBA,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTypeDefinition.js","names":["ObjectMetadata"],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ObjectOrInterface.js\";\nimport type { PrimaryKeyTypes } from \"./PrimaryKeyTypes.js\";\nimport type { VersionString } from \"./VersionString.js\";\nimport type { WirePropertyTypes } from \"./WirePropertyTypes.js\";\n\nexport type CompileTimeMetadata<T extends { __DefinitionMetadata?: {} }> =\n NonNullable<\n T[\"__DefinitionMetadata\"]\n >;\n\nexport type ObjectTypePropertyDefinitionFrom2<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P];\n\nexport type ObjectInterfaceBaseMetadata = {\n type: \"object\" | \"interface\";\n apiName: string;\n displayName: string;\n description: string | undefined;\n properties: Record<any, ObjectMetadata.Property>;\n rid: string;\n /**\n * Represents the \"super interfaces\" of this object.\n *\n * Optional because they may not exist on legacy.\n */\n implements?: ReadonlyArray<string>;\n};\n\nexport interface ObjectInterfaceCompileDefinition {\n type: \"object\" | \"interface\";\n objectSet?: any;\n props?: any;\n strictProps?: any;\n linksType?: any;\n}\n\nexport interface VersionBound<V extends VersionString<any, any, any>> {\n __expectedClientVersion?: V;\n}\n\nexport interface ObjectMetadata extends ObjectInterfaceBaseMetadata {\n type: \"object\";\n primaryKeyApiName: keyof this[\"properties\"];\n titleProperty: keyof this[\"properties\"];\n links: Record<\n string,\n ObjectMetadata.Link<any, any>\n >;\n primaryKeyType: PrimaryKeyTypes;\n icon: Icon | undefined;\n visibility: ObjectTypeVisibility | undefined;\n pluralDisplayName: string;\n status: ReleaseStatus | undefined;\n interfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* InterfaceType property api name */ string,\n /* ObjectType property api name */ string\n >\n >;\n inverseInterfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* ObjectType property api name */ string,\n /* InterfaceType property api name */ string\n >\n >;\n}\n\nexport namespace ObjectMetadata {\n export interface Property {\n readonly?: boolean;\n displayName?: string;\n description?: string;\n type: WirePropertyTypes;\n multiplicity?: boolean;\n nullable?: boolean;\n valueTypeApiName?: string;\n }\n\n export interface Link<\n Q extends ObjectTypeDefinition,\n M extends boolean,\n > {\n __OsdkLinkTargetType?: Q;\n targetType: Q[\"apiName\"];\n multiplicity: M;\n }\n}\n\nexport interface ObjectTypeDefinition {\n type: \"object\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ObjectMetadata\n & ObjectInterfaceCompileDefinition;\n}\n\nexport type ObjectTypeLinkKeysFrom2<\n Q extends ObjectTypeDefinition,\n> =\n & keyof CompileTimeMetadata<Q>[\"links\"]\n & string;\n\nexport interface PropertyDef<\n T extends WirePropertyTypes,\n N extends \"nullable\" | \"non-nullable\" = \"nullable\",\n M extends \"array\" | \"single\" = \"single\",\n> extends ObjectMetadata.Property {\n type: T;\n multiplicity: M extends \"array\" ? true : false;\n nullable: N extends \"nullable\" ? true : false;\n}\n\nexport type ReleaseStatus =\n | \"ACTIVE\"\n | \"EXPERIMENTAL\"\n | \"DEPRECATED\"\n | \"ENDORSED\";\n\ntype ObjectTypeVisibility = \"NORMAL\" | \"PROMINENT\" | \"HIDDEN\";\n\ntype BlueprintIcon = {\n type: \"blueprint\";\n color: string;\n name: string;\n};\n\ntype Icon = BlueprintIcon;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA2FiBA,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid } from \"../experimental/fetchPageByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SAASC,iDAAiD,QAAQ,mCAAmC;AACrG,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
1
+ {"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n type FetchPageByRidPayload,\n} from \"../experimental/fetchPageByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SACEC,iDAAiD,QAE5C,mCAAmC;AAC1C,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
@@ -350,6 +350,7 @@ declare namespace ObjectMetadata {
350
350
  type: WirePropertyTypes;
351
351
  multiplicity?: boolean;
352
352
  nullable?: boolean;
353
+ valueTypeApiName?: string;
353
354
  }
354
355
  interface Link<Q extends ObjectTypeDefinition, M extends boolean> {
355
356
  __OsdkLinkTargetType?: Q;
@@ -737,8 +738,10 @@ type ApiNameAsString<T extends ObjectOrInterfaceDefinition> = CompileTimeMetadat
737
738
  type JustProps<T extends ObjectOrInterfaceDefinition, P extends ValidOsdkPropParams<T>> = P extends "$all" ? PropertyKeys<T> : Exclude<P, SpecialOsdkPropParams>;
738
739
  type PropMapToObject<FROM extends ObjectOrInterfaceDefinition, TO extends ObjectTypeDefinition> = NonNullable<CompileTimeMetadata<TO>["interfaceMap"]>[ApiNameAsString<FROM>];
739
740
  type MapPropNamesToObjectType<FROM extends ObjectOrInterfaceDefinition, TO extends ObjectTypeDefinition, P extends ValidOsdkPropParams<FROM>, OPTIONS extends never | "$rid" | "$allBaseProperties" = never> = "$allBaseProperties" extends OPTIONS ? PropertyKeys<FROM> extends P ? PropertyKeys<TO> : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>] : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];
741
+ type NamespaceOf<S extends string> = S extends `${infer Before}.${infer After}` ? After extends `${string}.${string}` ? `${Before}.${NamespaceOf<After>}` : Before : never;
742
+ type MaybeStripNamespaces<S extends string, TO extends InterfaceDefinition> = S extends `${NamespaceOf<S>}.${infer Rest}` ? NamespaceOf<S> extends NamespaceOf<ApiNameAsString<TO>> ? Rest : S : S;
740
743
  type PropMapToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition> = NonNullable<CompileTimeMetadata<FROM>["inverseInterfaceMap"]>[ApiNameAsString<TO>];
741
- type MapPropNamesToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition, P extends ValidOsdkPropParams<FROM>> = PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];
744
+ type MapPropNamesToInterface<FROM extends ObjectTypeDefinition, TO extends InterfaceDefinition, P extends ValidOsdkPropParams<FROM>> = MaybeStripNamespaces<PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>], TO>;
742
745
  /**
743
746
  * Older version of this helper that allows for `$rid` and co in
744
747
  * the properties field.
@@ -1,5 +1,5 @@
1
- import { A as AttachmentUpload, M as MediaReference, a as MediaUpload, b as Attachment, O as ObjectTypeDefinition, c as ObjectIdentifiers, d as OsdkObjectPrimaryKeyType, e as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, f as OsdkMetadata, R as ReleaseStatus, g as ObjectOrInterfaceDefinition, P as PropertyValueWireToClient, h as PrimaryKeyTypes, i as OsdkBase } from './ObjectSet-D7TbKiih.cjs';
2
- export { j as AggregateOpts, k as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, n as AggregationClause, l as AggregationResultsWithGroups, m as AggregationResultsWithoutGroups, o as AggregationsResults, x as AllGroupByValues, B as AsyncIterArgs, E as Augment, F as Augments, _ as BaseObjectSet, a6 as BaseWirePropertyTypes, a9 as ConvertProps, v as DerivedProperty, D as DistanceUnitMapping, w as DurationMapping, H as FetchPageArgs, Q as FetchPageResult, G as GeoFilterOptions, p as GeoFilter_Intersects, q as GeoFilter_Within, ae as GeotimeSeriesProperty, y as GroupByClause, z as GroupByRange, a0 as InterfaceMetadata, aj as LinkNames, ai as LinkedType, aa as MaybeScore, U as Media, X as MediaMetadata, N as NullabilityAdherence, a3 as ObjectMetadata, J as ObjectSetArgs, $ as ObjectSetSubscription, a2 as ObjectSpecifier, ab as Osdk, s as OsdkObjectCreatePropertyType, u as OsdkObjectLinksObject, t as OsdkObjectPropertyType, ac as PageResult, r as PossibleWhereClauseFilters, a8 as PrimaryKeyType, a4 as PropertyDef, a1 as PropertyKeys, Z as Result, K as SelectArg, L as SelectArgToKeys, S as SingleLinkAccessor, T as SingleOsdkResult, af as TimeSeriesPoint, ag as TimeSeriesProperty, ah as TimeSeriesQuery, ad as TimeseriesDurationMapping, V as ValidAggregationKeys, a5 as VersionBound, W as WhereClause, a7 as WirePropertyTypes, Y as isOk } from './ObjectSet-D7TbKiih.cjs';
1
+ import { A as AttachmentUpload, M as MediaReference, a as MediaUpload, b as Attachment, O as ObjectTypeDefinition, c as ObjectIdentifiers, d as OsdkObjectPrimaryKeyType, e as ObjectSet, I as InterfaceDefinition, C as CompileTimeMetadata, f as OsdkMetadata, R as ReleaseStatus, g as ObjectOrInterfaceDefinition, P as PropertyValueWireToClient, h as PrimaryKeyTypes, i as OsdkBase } from './ObjectSet-BL7ZX1K4.cjs';
2
+ export { j as AggregateOpts, k as AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy, n as AggregationClause, l as AggregationResultsWithGroups, m as AggregationResultsWithoutGroups, o as AggregationsResults, x as AllGroupByValues, B as AsyncIterArgs, E as Augment, F as Augments, _ as BaseObjectSet, a6 as BaseWirePropertyTypes, a9 as ConvertProps, v as DerivedProperty, D as DistanceUnitMapping, w as DurationMapping, H as FetchPageArgs, Q as FetchPageResult, G as GeoFilterOptions, p as GeoFilter_Intersects, q as GeoFilter_Within, ae as GeotimeSeriesProperty, y as GroupByClause, z as GroupByRange, a0 as InterfaceMetadata, aj as LinkNames, ai as LinkedType, aa as MaybeScore, U as Media, X as MediaMetadata, N as NullabilityAdherence, a3 as ObjectMetadata, J as ObjectSetArgs, $ as ObjectSetSubscription, a2 as ObjectSpecifier, ab as Osdk, s as OsdkObjectCreatePropertyType, u as OsdkObjectLinksObject, t as OsdkObjectPropertyType, ac as PageResult, r as PossibleWhereClauseFilters, a8 as PrimaryKeyType, a4 as PropertyDef, a1 as PropertyKeys, Z as Result, K as SelectArg, L as SelectArgToKeys, S as SingleLinkAccessor, T as SingleOsdkResult, af as TimeSeriesPoint, ag as TimeSeriesProperty, ah as TimeSeriesQuery, ad as TimeseriesDurationMapping, V as ValidAggregationKeys, a5 as VersionBound, W as WhereClause, a7 as WirePropertyTypes, Y as isOk } from './ObjectSet-BL7ZX1K4.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -1,5 +1,5 @@
1
- import { g as ObjectOrInterfaceDefinition, a1 as PropertyKeys, M as MediaReference, O as ObjectTypeDefinition, N as NullabilityAdherence, K as SelectArg, ab as Osdk, ak as ExtractOptions, H as FetchPageArgs, Q as FetchPageResult, i as OsdkBase } from '../ObjectSet-D7TbKiih.cjs';
2
- export { al as MinimalObjectSet } from '../ObjectSet-D7TbKiih.cjs';
1
+ import { g as ObjectOrInterfaceDefinition, a1 as PropertyKeys, M as MediaReference, O as ObjectTypeDefinition, N as NullabilityAdherence, K as SelectArg, ab as Osdk, ak as ExtractOptions, H as FetchPageArgs, Q as FetchPageResult, i as OsdkBase } from '../ObjectSet-BL7ZX1K4.cjs';
2
+ export { al as MinimalObjectSet } from '../ObjectSet-BL7ZX1K4.cjs';
3
3
  import 'type-fest';
4
4
  import 'geojson';
5
5
 
@@ -39,9 +39,12 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid: Experiment<"2.1.
39
39
  }>;
40
40
 
41
41
  type fetchPageByRidFn = <Q extends ObjectOrInterfaceDefinition, const L extends PropertyKeys<Q>, const R extends boolean, const S extends NullabilityAdherence, const T extends boolean>(objectType: Q, rids: string[], options?: FetchPageArgs<Q, L, R, any, S, T>) => Promise<FetchPageResult<Q, L, R, S, T>>;
42
- declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid", {
42
+ type FetchPageByRidPayload = {
43
43
  fetchPageByRid: fetchPageByRidFn;
44
- }>;
44
+ fetchPageByRidNoType: fetchPageByRidNoTypeFn;
45
+ };
46
+ type fetchPageByRidNoTypeFn = <const R extends boolean, const S extends NullabilityAdherence, const T extends boolean>(rids: readonly string[], options?: FetchPageArgs<ObjectOrInterfaceDefinition, any, R, any, S, T>) => Promise<FetchPageResult<ObjectOrInterfaceDefinition, any, R, S, T>>;
47
+ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid", FetchPageByRidPayload>;
45
48
 
46
49
  interface EXPERIMENTAL_BulkLinkResult {
47
50
  object: OsdkBase<any>;
@@ -55,4 +58,4 @@ declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks: Experiment<"2.0.8
55
58
  getBulkLinks: getBulkLinksFn;
56
59
  }>;
57
60
 
58
- export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks };
61
+ export { type EXPERIMENTAL_BulkLinkResult, type Experiment, type ExperimentFns, type FetchPageByRidPayload, __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks };
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type {\n NullabilityAdherence,\n ObjectSetArgs,\n} from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBase } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = \"$allBaseProperties\" extends OPTIONS\n ? PropertyKeys<FROM> extends P ? PropertyKeys<TO>\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>]\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = PropMapToInterface<\n FROM,\n TO\n>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];\n/**\n * Older version of this helper that allows for `$rid` and co in\n * the properties field.\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P, OPTIONS>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport type MaybeScore<\n T extends Osdk.Instance<any>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<any>,\n> = ORDER_BY_OPTIONS extends \"relevance\" ? T & { $score: number } : T;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBase<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P, OPTIONS>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n\n readonly $__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata: Q extends\n ObjectTypeDefinition ? {\n ObjectMetadata: Q;\n }\n : {\n ObjectMetadata: ObjectMetadata;\n InterfaceMetadata: InterfaceMetadata;\n };\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\nexport type ExtractAllPropertiesOption<T extends boolean> = // comment for readability\n IsNever<T> extends true ? never\n : DefaultToFalse<T> extends false ? never\n : \"$allBaseProperties\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AA0BA;AACA;AACA;AAFA,WA2BiBA,IAAI;AAsDrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.js","names":["Osdk"],"sources":["OsdkObjectFrom.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n DefaultToFalse,\n OsdkObjectLinksObject,\n} from \"./definitions/LinkDefinitions.js\";\nimport type {\n NullabilityAdherence,\n ObjectSetArgs,\n} from \"./object/FetchPageArgs.js\";\nimport type { UnionIfTrue } from \"./object/FetchPageResult.js\";\nimport type {\n InterfaceDefinition,\n InterfaceMetadata,\n} from \"./ontology/InterfaceDefinition.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ontology/ObjectOrInterface.js\";\nimport type {\n CompileTimeMetadata,\n ObjectMetadata,\n ObjectTypeDefinition,\n} from \"./ontology/ObjectTypeDefinition.js\";\nimport type { SimplePropertyDef } from \"./ontology/SimplePropertyDef.js\";\nimport type { OsdkBase } from \"./OsdkBase.js\";\n\ntype DropDollarOptions<T extends string> = Exclude<\n T,\n \"$rid\" | \"$all\" | \"$notStrict\"\n>;\n\ntype DropDollarAll<T extends string> = Exclude<\n T,\n \"$all\"\n>;\n\ntype SpecialOsdkPropParams =\n | \"$all\"\n | \"$rid\"\n | \"$strict\"\n | \"$notStrict\";\n\ntype ValidOsdkPropParams<Q extends ObjectOrInterfaceDefinition> =\n | SpecialOsdkPropParams\n | PropertyKeys<Q>;\n\nexport type ApiNameAsString<\n T extends ObjectOrInterfaceDefinition,\n> = CompileTimeMetadata<T>[\"apiName\"];\n\nexport type JustProps<\n T extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<T>,\n> = P extends \"$all\" ? PropertyKeys<T>\n : Exclude<P, SpecialOsdkPropParams>;\n\nexport type PropMapToObject<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n> = NonNullable<CompileTimeMetadata<TO>[\"interfaceMap\"]>[ApiNameAsString<FROM>];\n\nexport type MapPropNamesToObjectType<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ObjectTypeDefinition,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = \"$allBaseProperties\" extends OPTIONS\n ? PropertyKeys<FROM> extends P ? PropertyKeys<TO>\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>]\n : PropMapToObject<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];\n\ntype NamespaceOf<S extends string> = S extends `${infer Before}.${infer After}`\n ? After extends `${string}.${string}` ? `${Before}.${NamespaceOf<After>}`\n : Before\n : never;\n\ntype MaybeStripNamespaces<S extends string, TO extends InterfaceDefinition> =\n S extends `${NamespaceOf<S>}.${infer Rest}`\n ? NamespaceOf<S> extends NamespaceOf<ApiNameAsString<TO>> ? Rest : S\n : S;\n\nexport type PropMapToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n> = NonNullable<\n CompileTimeMetadata<FROM>[\"inverseInterfaceMap\"]\n>[ApiNameAsString<TO>];\n\nexport type MapPropNamesToInterface<\n FROM extends ObjectTypeDefinition,\n TO extends InterfaceDefinition,\n P extends ValidOsdkPropParams<FROM>,\n> = MaybeStripNamespaces<\n PropMapToInterface<\n FROM,\n TO\n >[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>],\n TO\n>;\n/**\n * Older version of this helper that allows for `$rid` and co in\n * the properties field.\n * @param FROM - the interface or object type to convert from\n * @param TO - the interface or object type to convert to\n * @param P - the property(s) to convert\n */\nexport type ConvertProps<\n FROM extends ObjectOrInterfaceDefinition,\n TO extends ValidToFrom<FROM>,\n P extends ValidOsdkPropParams<FROM>,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n> = TO extends FROM ? P\n : TO extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToObjectType<FROM, TO, P, OPTIONS>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : TO extends InterfaceDefinition ? FROM extends ObjectTypeDefinition ? (\n UnionIfTrue<\n MapPropNamesToInterface<FROM, TO, P>,\n P extends \"$rid\" ? true : false,\n \"$rid\"\n >\n )\n : never\n : never;\n\n/** DO NOT EXPORT FROM PACKAGE */\nexport type ValidToFrom<\n FROM extends ObjectOrInterfaceDefinition,\n> = FROM extends InterfaceDefinition ? ObjectOrInterfaceDefinition\n : InterfaceDefinition;\n\nexport type IsNever<T> = [T] extends [never] ? true : false;\n\ntype ExtractPropsKeysFromOldPropsStyle<\n Q extends ObjectOrInterfaceDefinition,\n P extends ValidOsdkPropParams<Q>,\n> = P extends \"$all\" ? PropertyKeys<Q>\n : Exclude<P, \"$strict\" | \"$notStrict\" | \"$rid\">;\n\nexport type IsAny<T> = unknown extends T\n ? [keyof T] extends [never] ? false : true\n : false;\n\nexport type GetPropsKeys<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n N extends boolean = false,\n> = IsNever<P> extends true ? N extends true ? never : PropertyKeys<Q>\n : IsAny<P> extends true ? PropertyKeys<Q>\n : P;\n\n/**\n * Use `Osdk.Instance` or `YourType.OsdkInstance`\n */\nexport type Osdk<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends string = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n> =\n // no middle options is simplest\n IsNever<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n : IsAny<OPTIONS> extends true ? Osdk.Instance<Q, never, P>\n // Options only includes the two allowed in the new style\n : (IsNever<Exclude<OPTIONS, \"$rid\">>) extends true\n ? Osdk.Instance<Q, OPTIONS & \"$rid\", P>\n // else we are in the old style which was just Q and OPTIONS\n // and OPTIONS was $things + prop names\n : Osdk.Instance<\n Q,\n (\"$rid\" extends OPTIONS ? \"$rid\" : never),\n ExtractPropsKeysFromOldPropsStyle<Q, OPTIONS>\n >;\n\nexport type MaybeScore<\n T extends Osdk.Instance<any>,\n ORDER_BY_OPTIONS extends ObjectSetArgs.OrderByOptions<any>,\n> = ORDER_BY_OPTIONS extends \"relevance\" ? T & { $score: number } : T;\n\nexport namespace Osdk {\n export type Instance<\n Q extends ObjectOrInterfaceDefinition,\n OPTIONS extends never | \"$rid\" | \"$allBaseProperties\" = never,\n P extends PropertyKeys<Q> = PropertyKeys<Q>,\n R extends Record<string, SimplePropertyDef> = {},\n > =\n & OsdkBase<Q>\n & Pick<\n CompileTimeMetadata<Q>[\"props\"],\n // If there aren't any additional properties, then we want GetPropsKeys to default to PropertyKeys<Q>\n GetPropsKeys<Q, P, [R] extends [{}] ? false : true>\n >\n & ([R] extends [never] ? {}\n : { [A in keyof R]: SimplePropertyDef.ToRuntimeProperty<R[A]> })\n & {\n readonly $link: Q extends { linksType?: any } ? Q[\"linksType\"]\n : Q extends ObjectTypeDefinition ? OsdkObjectLinksObject<Q>\n : never;\n\n readonly $as: <NEW_Q extends ValidToFrom<Q>>(\n type: NEW_Q | string,\n ) => Osdk.Instance<\n NEW_Q,\n OPTIONS,\n ConvertProps<Q, NEW_Q, P, OPTIONS>\n >;\n\n readonly $clone: <NEW_PROPS extends PropertyKeys<Q>>(\n updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n },\n ) => Osdk.Instance<Q, OPTIONS, P | NEW_PROPS>;\n\n readonly $__EXPERIMENTAL__NOT_SUPPORTED_YET__metadata: Q extends\n ObjectTypeDefinition ? {\n ObjectMetadata: Q;\n }\n : {\n ObjectMetadata: ObjectMetadata;\n InterfaceMetadata: InterfaceMetadata;\n };\n }\n // We are hiding the $rid field if it wasn't requested as we want to discourage its use\n & (IsNever<OPTIONS> extends true ? {}\n : IsAny<OPTIONS> extends true ? {}\n : \"$rid\" extends OPTIONS ? { readonly $rid: string }\n : {});\n}\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not `false` should always be `never`.\n *\n * This is structured in a way that it should always short circuit to never early.\n */\nexport type ExtractStrictOption<S extends NullabilityAdherence> =\n IsNever<S> extends true ? never\n : \"throw\" extends S ? never // catches any time \"throw\" still exists (including any)\n : \"drop\" extends S ? never // catches any time \"drop\" still exists (including any)\n : \"$notStrict\";\n\n/**\n * NOT EXPORTED FROM PACKAGE\n *\n * Anything you throw at this that is not exactly `true` should always be `never`.\n */\nexport type ExtractRidOption<R extends boolean> = // comment for readability\n IsNever<R> extends true ? never\n : DefaultToFalse<R> extends false ? never\n : \"$rid\";\n\nexport type ExtractAllPropertiesOption<T extends boolean> = // comment for readability\n IsNever<T> extends true ? never\n : DefaultToFalse<T> extends false ? never\n : \"$allBaseProperties\";\n\n// not exported from package\nexport type ExtractOptions<\n R extends boolean,\n S extends NullabilityAdherence = NullabilityAdherence.Default,\n T extends boolean = false,\n> = ExtractRidOption<R> | ExtractAllPropertiesOption<T>;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0GA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA;AA0BA;AACA;AACA;AAFA,WA2BiBA,IAAI;AAsDrB;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AAWA","ignoreList":[]}
@@ -193,5 +193,12 @@ describe("ExtractOptions", () => {
193
193
  expectTypeOf().branded.toEqualTypeOf();
194
194
  });
195
195
  });
196
+ describe("Interface casting works as intended", () => {
197
+ it("mapping as with fqn property names works", async () => {
198
+ expectTypeOf().toEqualTypeOf;
199
+ expectTypeOf().toEqualTypeOf;
200
+ expectTypeOf().toExtend();
201
+ });
202
+ });
196
203
  });
197
204
  //# sourceMappingURL=OsdkObjectFrom.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","createMockObjectSet","toEqualTypeOf","branded","fauxObjectSet","fetchPage"],"sources":["OsdkObjectFrom.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport { createMockObjectSet } from \"./objectSet/ObjectSet.test.js\";\nimport type { ExtractOptions, Osdk } from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: undefined;\n };\n };\n\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n\n it(\"Is assignable to Record<string, unknown>\", () => {\n // We encountered a break where this stopped being assignable. We need to continue to support this assignment.\n const a = {} as Osdk.Instance<quickAndDirty>;\n a as Record<string, unknown>;\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n const fauxObjectSet = createMockObjectSet<quickAndDirty>();\n\n it(\"is not $notStrict\", async () => {\n const page = await fauxObjectSet.fetchPage();\n\n expectTypeOf<typeof page[\"data\"]>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnD,SAASC,mBAAmB,QAAQ,+BAA+B;AAGnEH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BA,QAAQ,CAAC,8BAA8B,EAAE,MAAM;IAC7CE,EAAE,CAAC,iCAAiC,EAAE,MAAM;MAC1CD,YAAY,CAA2B,CAAC,CACrCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA+B,CAAC,CACzCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,kCAAkC,EAAE,MAAM;MA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YAAY;MACrB,MAAMI,aAAa,CAACC,SAAS,CAAC,CAAC;MAE5CN,YAAY,CAAsB,CAAC,CAACI,OAAO,CACxCD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"OsdkObjectFrom.test.js","names":["describe","expectTypeOf","it","createMockObjectSet","toEqualTypeOf","branded","fauxObjectSet","fetchPage","toExtend"],"sources":["OsdkObjectFrom.test.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { describe, expectTypeOf, it } from \"vitest\";\nimport type { NullabilityAdherence } from \"./object/FetchPageArgs.js\";\nimport { createMockObjectSet } from \"./objectSet/ObjectSet.test.js\";\nimport type { PropertyKeys } from \"./ontology/ObjectOrInterface.js\";\nimport type {\n ConvertProps,\n ExtractOptions,\n MapPropNamesToInterface,\n Osdk,\n} from \"./OsdkObjectFrom.js\";\n\ndescribe(\"ExtractOptions\", () => {\n describe(\"NullabilityAdherence Generic\", () => {\n it(\"does not add $notStrict for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for never\", () => {\n expectTypeOf<ExtractOptions<any, never>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for false\", () => {\n expectTypeOf<ExtractOptions<any, false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for throw\", () => {\n expectTypeOf<ExtractOptions<any, \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | false>>()\n .toEqualTypeOf<never>();\n });\n it(\"does not add $notStrict for false | throw\", () => {\n expectTypeOf<ExtractOptions<any, false | \"throw\">>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for drop | throw | false\", () => {\n expectTypeOf<ExtractOptions<any, \"drop\" | \"throw\" | false>>()\n .toEqualTypeOf<never>();\n });\n\n it(\"does not add $notStrict for NullabilityAdherence\", () => {\n expectTypeOf<ExtractOptions<any, NullabilityAdherence>>()\n .toEqualTypeOf<never>();\n });\n });\n\n describe(\"Rid Generic\", () => {\n it(\"does not add $rid for false\", () => {\n expectTypeOf<ExtractOptions<false, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does add $rid for true\", () => {\n expectTypeOf<ExtractOptions<true, any>>().toEqualTypeOf<\"$rid\">();\n });\n\n it(\"does not add $rid for any\", () => {\n expectTypeOf<ExtractOptions<any, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for never\", () => {\n expectTypeOf<ExtractOptions<never, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for boolean\", () => {\n expectTypeOf<ExtractOptions<boolean, any>>().toEqualTypeOf<never>();\n });\n\n it(\"does not add $rid for true | false\", () => {\n expectTypeOf<ExtractOptions<true | false, any>>().toEqualTypeOf<never>();\n });\n });\n\n type quickAndDirty = {\n apiName: \"Foo\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n };\n strictProps: {\n name: string;\n foo: number;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {};\n inverseInterfaceMap: {};\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n };\n foo: {\n type: \"integer\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: undefined;\n };\n };\n\n type quickerAndDirtier = {\n apiName: \"Bar\";\n type: \"object\";\n __DefinitionMetadata: {\n props: {\n name: string;\n foo: number | undefined;\n birthday: string;\n };\n strictProps: {\n name: string;\n foo: number;\n birthday: string;\n };\n apiName: \"Foo\";\n displayName: \"\";\n interfaceMap: {\n \"com.my.obscure.namespace.FooBarInterface\": {\n \"com.my.obscure.namespace.fooInterface\": \"foo\";\n \"com.my.obscure.namespace.id\": \"name\";\n \"com.my.even.more.obscure.namespace.originDate\": \"birthday\";\n };\n };\n inverseInterfaceMap: {\n \"com.my.obscure.namespace.FooBarInterface\": {\n \"foo\": \"com.my.obscure.namespace.fooInterface\";\n \"name\": \"com.my.obscure.namespace.id\";\n \"birthday\": \"com.my.even.more.obscure.namespace.originDate\";\n };\n };\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n primaryKeyType: \"string\";\n properties: {\n name: {\n type: \"string\";\n description: \"\";\n };\n foo: {\n type: \"integer\";\n description: \"\";\n };\n birthday: {\n type: \"string\";\n description: \"\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"object\";\n icon: undefined;\n visibility: undefined;\n description: \"\";\n };\n };\n\n type quickerAndDirtierInterface = {\n apiName: \"com.my.obscure.namespace.FooBarInterface\";\n type: \"interface\";\n __DefinitionMetadata: {\n props: {\n id: string;\n \"com.my.even.more.obscure.namespace.originDate\": string | undefined;\n fooInterface: number;\n };\n strictProps: {\n id: string;\n \"com.my.even.more.obscure.namespace.originDate\": string;\n fooInterface: number;\n };\n apiName: \"com.my.obscure.namespace.FooBarInterface\";\n displayName: \"\";\n implements: [];\n implementedBy: [\"Bar\"];\n links: {};\n pluralDisplayName: \"\";\n primaryKeyApiName: \"\";\n properties: {\n id: {\n type: \"string\";\n description: \"\";\n };\n \"com.my.even.more.obscure.namespace.originDate\": {\n type: \"string\";\n description: \"\";\n };\n fooInterface: {\n type: \"integer\";\n description: \"\";\n };\n };\n rid: \"\";\n status: \"ACTIVE\";\n titleProperty: \"name\";\n type: \"interface\";\n icon: undefined;\n visibility: undefined;\n description: \"\";\n };\n };\n describe(\"Osdk.Instance\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk.Instance<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk.Instance<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"Cannot use $notStrict\", () => {\n // @ts-expect-error\n type toCheck = Osdk.Instance<quickAndDirty, \"$notStrict\">;\n\n expectTypeOf<toCheck>().branded\n // @ts-expect-error\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, \"$notStrict\">>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk.Instance<quickAndDirty, never, \"name\">>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n\n it(\"Is assignable to Record<string, unknown>\", () => {\n // We encountered a break where this stopped being assignable. We need to continue to support this assignment.\n const a = {} as Osdk.Instance<quickAndDirty>;\n a as Record<string, unknown>;\n });\n });\n\n describe(\"Osdk<>\", () => {\n it(\"defaults to second argument never if omitted\", () => {\n type toCheck = Osdk<quickAndDirty>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"returns $rid if only thing specified\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: $rid and name\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"name\">;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the strict type\n expectTypeOf<Pick<toCheck, \"name\">>().toEqualTypeOf<{\n name: quickAndDirty[\"__DefinitionMetadata\"][\"strictProps\"][\"name\"];\n }>();\n });\n\n it(\"handles legacy properly: $rid and $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$rid\" | \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, \"$rid\", \"name\" | \"foo\">\n >();\n\n // expect rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<\"$rid\">();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"handles legacy properly: just $all\", () => {\n type toCheck = Osdk<quickAndDirty, \"$all\">;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n });\n\n it(\"defaults to second argument never if never\", () => {\n type toCheck = Osdk<quickAndDirty, never>;\n expectTypeOf<toCheck>().toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to second argument never if any\", () => {\n type toCheck = Osdk<quickAndDirty, any>;\n expectTypeOf<toCheck>().branded.toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never>\n >();\n // ensure its the normal props\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"Does not use $notStrict if requested with old type\", () => {\n type toCheck = Osdk<quickAndDirty, \"$notStrict\">;\n expectTypeOf<toCheck>().branded\n .toEqualTypeOf<Osdk.Instance<quickAndDirty, never>>();\n // ensure its not the strict type\n expectTypeOf<Pick<toCheck, \"name\" | \"foo\">>().toEqualTypeOf<\n quickAndDirty[\"__DefinitionMetadata\"][\"props\"]\n >();\n\n // expect no rid\n expectTypeOf<keyof toCheck & \"$rid\">().toEqualTypeOf<never>();\n });\n\n it(\"defaults to last argument all props if never\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, never>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument all props if any\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, any>>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\" | \"foo\">\n >();\n });\n\n it(\"defaults to last argument exactly if specified\", () => {\n expectTypeOf<Osdk<quickAndDirty, never, \"name\">>()\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty, never, \"name\">\n >();\n });\n });\n\n describe(\"Inferred return types from fetchPage work\", () => {\n const fauxObjectSet = createMockObjectSet<quickAndDirty>();\n\n it(\"is not $notStrict\", async () => {\n const page = await fauxObjectSet.fetchPage();\n\n expectTypeOf<typeof page[\"data\"]>().branded\n .toEqualTypeOf<\n Osdk.Instance<quickAndDirty>[]\n >();\n });\n });\n\n describe(\"Interface casting works as intended\", () => {\n it(\"mapping as with fqn property names works\", async () => {\n expectTypeOf<\n MapPropNamesToInterface<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>\n >\n >().toEqualTypeOf<PropertyKeys<quickerAndDirtierInterface>>;\n\n expectTypeOf<\n ConvertProps<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>,\n never\n >\n >().toEqualTypeOf<PropertyKeys<quickerAndDirtierInterface>>;\n\n expectTypeOf<\n Osdk.Instance<\n quickerAndDirtierInterface,\n never,\n PropertyKeys<quickerAndDirtierInterface>,\n {}\n >\n >()\n .toExtend<\n Osdk.Instance<\n quickerAndDirtierInterface,\n never,\n ConvertProps<\n quickerAndDirtier,\n quickerAndDirtierInterface,\n PropertyKeys<quickerAndDirtier>,\n never\n >\n >\n >();\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,YAAY,EAAEC,EAAE,QAAQ,QAAQ;AAEnD,SAASC,mBAAmB,QAAQ,+BAA+B;AASnEH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC/BA,QAAQ,CAAC,8BAA8B,EAAE,MAAM;IAC7CE,EAAE,CAAC,iCAAiC,EAAE,MAAM;MAC1CD,YAAY,CAA2B,CAAC,CACrCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA6B,CAAC,CACvCG,aAAa,CAAQ,CAAC;IAC3B,CAAC,CAAC;IAEFF,EAAE,CAAC,mCAAmC,EAAE,MAAM;MAC5CD,YAAY,CAA+B,CAAC,CACzCG,aAAa,CAAQ,CAAC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AAGH,mBAAmB,CAAgB,CAAC;IAE1DD,EAAE,CAAC,mBAAmB,EAAE,YAAY;MACrB,MAAMI,aAAa,CAACC,SAAS,CAAC,CAAC;MAE5CN,YAAY,CAAsB,CAAC,CAACI,OAAO,CACxCD,aAAa,CAEZ,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFJ,QAAQ,CAAC,qCAAqC,EAAE,MAAM;IACpDE,EAAE,CAAC,0CAA0C,EAAE,YAAY;MACzDD,YAAY,CAMV,CAAC,CAACG,aAAa;MAEjBH,YAAY,CAOV,CAAC,CAACG,aAAa;MAEjBH,YAAY,CAOV,CAAC,CACAO,QAAQ,CAWP,CAAC;IACP,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"fetchPageByRid.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","name","type","version"],"sources":["fetchPageByRid.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchPageArgs,\n NullabilityAdherence,\n} from \"../object/FetchPageArgs.js\";\nimport type { FetchPageResult } from \"../object/FetchPageResult.js\";\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype fetchPageByRidFn = <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n objectType: Q,\n rids: string[],\n options?: FetchPageArgs<Q, L, R, any, S, T>,\n) => Promise<FetchPageResult<Q, L, R, S, T>>;\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n { fetchPageByRid: fetchPageByRidFn }\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n type: \"experiment\",\n version: \"2.2.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA,OAAO,MAAMA,iDAIZ,GAAG;EACFC,IAAI,EAAE,mDAAmD;EACzDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"fetchPageByRid.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","name","type","version"],"sources":["fetchPageByRid.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n FetchPageArgs,\n NullabilityAdherence,\n} from \"../object/FetchPageArgs.js\";\nimport type { FetchPageResult } from \"../object/FetchPageResult.js\";\n\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"../ontology/ObjectOrInterface.js\";\nimport type { Experiment } from \"./Experiment.js\";\n\ntype fetchPageByRidFn = <\n Q extends ObjectOrInterfaceDefinition,\n const L extends PropertyKeys<Q>,\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n objectType: Q,\n rids: string[],\n options?: FetchPageArgs<Q, L, R, any, S, T>,\n) => Promise<FetchPageResult<Q, L, R, S, T>>;\n\nexport type FetchPageByRidPayload = {\n fetchPageByRid: fetchPageByRidFn;\n fetchPageByRidNoType: fetchPageByRidNoTypeFn;\n};\n\ntype fetchPageByRidNoTypeFn = <\n const R extends boolean,\n const S extends NullabilityAdherence,\n const T extends boolean,\n>(\n rids: readonly string[],\n options?: FetchPageArgs<ObjectOrInterfaceDefinition, any, R, any, S, T>,\n) => Promise<FetchPageResult<ObjectOrInterfaceDefinition, any, R, S, T>>;\n\nexport const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n FetchPageByRidPayload\n> = {\n name: \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n type: \"experiment\",\n version: \"2.2.0\",\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwCA,OAAO,MAAMA,iDAIZ,GAAG;EACFC,IAAI,EAAE,mDAAmD;EACzDC,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE;AACX,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectTypeDefinition.js","names":["ObjectMetadata"],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ObjectOrInterface.js\";\nimport type { PrimaryKeyTypes } from \"./PrimaryKeyTypes.js\";\nimport type { VersionString } from \"./VersionString.js\";\nimport type { WirePropertyTypes } from \"./WirePropertyTypes.js\";\n\nexport type CompileTimeMetadata<T extends { __DefinitionMetadata?: {} }> =\n NonNullable<\n T[\"__DefinitionMetadata\"]\n >;\n\nexport type ObjectTypePropertyDefinitionFrom2<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P];\n\nexport type ObjectInterfaceBaseMetadata = {\n type: \"object\" | \"interface\";\n apiName: string;\n displayName: string;\n description: string | undefined;\n properties: Record<any, ObjectMetadata.Property>;\n rid: string;\n /**\n * Represents the \"super interfaces\" of this object.\n *\n * Optional because they may not exist on legacy.\n */\n implements?: ReadonlyArray<string>;\n};\n\nexport interface ObjectInterfaceCompileDefinition {\n type: \"object\" | \"interface\";\n objectSet?: any;\n props?: any;\n strictProps?: any;\n linksType?: any;\n}\n\nexport interface VersionBound<V extends VersionString<any, any, any>> {\n __expectedClientVersion?: V;\n}\n\nexport interface ObjectMetadata extends ObjectInterfaceBaseMetadata {\n type: \"object\";\n primaryKeyApiName: keyof this[\"properties\"];\n titleProperty: keyof this[\"properties\"];\n links: Record<\n string,\n ObjectMetadata.Link<any, any>\n >;\n primaryKeyType: PrimaryKeyTypes;\n icon: Icon | undefined;\n visibility: ObjectTypeVisibility | undefined;\n pluralDisplayName: string;\n status: ReleaseStatus | undefined;\n interfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* InterfaceType property api name */ string,\n /* ObjectType property api name */ string\n >\n >;\n inverseInterfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* ObjectType property api name */ string,\n /* InterfaceType property api name */ string\n >\n >;\n}\n\nexport namespace ObjectMetadata {\n export interface Property {\n readonly?: boolean;\n displayName?: string;\n description?: string;\n type: WirePropertyTypes;\n multiplicity?: boolean;\n nullable?: boolean;\n }\n\n export interface Link<\n Q extends ObjectTypeDefinition,\n M extends boolean,\n > {\n __OsdkLinkTargetType?: Q;\n targetType: Q[\"apiName\"];\n multiplicity: M;\n }\n}\n\nexport interface ObjectTypeDefinition {\n type: \"object\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ObjectMetadata\n & ObjectInterfaceCompileDefinition;\n}\n\nexport type ObjectTypeLinkKeysFrom2<\n Q extends ObjectTypeDefinition,\n> =\n & keyof CompileTimeMetadata<Q>[\"links\"]\n & string;\n\nexport interface PropertyDef<\n T extends WirePropertyTypes,\n N extends \"nullable\" | \"non-nullable\" = \"nullable\",\n M extends \"array\" | \"single\" = \"single\",\n> extends ObjectMetadata.Property {\n type: T;\n multiplicity: M extends \"array\" ? true : false;\n nullable: N extends \"nullable\" ? true : false;\n}\n\nexport type ReleaseStatus =\n | \"ACTIVE\"\n | \"EXPERIMENTAL\"\n | \"DEPRECATED\"\n | \"ENDORSED\";\n\ntype ObjectTypeVisibility = \"NORMAL\" | \"PROMINENT\" | \"HIDDEN\";\n\ntype BlueprintIcon = {\n type: \"blueprint\";\n color: string;\n name: string;\n};\n\ntype Icon = BlueprintIcon;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA2FiBA,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"ObjectTypeDefinition.js","names":["ObjectMetadata"],"sources":["ObjectTypeDefinition.ts"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { OsdkMetadata } from \"../OsdkMetadata.js\";\nimport type {\n ObjectOrInterfaceDefinition,\n PropertyKeys,\n} from \"./ObjectOrInterface.js\";\nimport type { PrimaryKeyTypes } from \"./PrimaryKeyTypes.js\";\nimport type { VersionString } from \"./VersionString.js\";\nimport type { WirePropertyTypes } from \"./WirePropertyTypes.js\";\n\nexport type CompileTimeMetadata<T extends { __DefinitionMetadata?: {} }> =\n NonNullable<\n T[\"__DefinitionMetadata\"]\n >;\n\nexport type ObjectTypePropertyDefinitionFrom2<\n Q extends ObjectOrInterfaceDefinition,\n P extends PropertyKeys<Q>,\n> = CompileTimeMetadata<Q>[\"properties\"][P];\n\nexport type ObjectInterfaceBaseMetadata = {\n type: \"object\" | \"interface\";\n apiName: string;\n displayName: string;\n description: string | undefined;\n properties: Record<any, ObjectMetadata.Property>;\n rid: string;\n /**\n * Represents the \"super interfaces\" of this object.\n *\n * Optional because they may not exist on legacy.\n */\n implements?: ReadonlyArray<string>;\n};\n\nexport interface ObjectInterfaceCompileDefinition {\n type: \"object\" | \"interface\";\n objectSet?: any;\n props?: any;\n strictProps?: any;\n linksType?: any;\n}\n\nexport interface VersionBound<V extends VersionString<any, any, any>> {\n __expectedClientVersion?: V;\n}\n\nexport interface ObjectMetadata extends ObjectInterfaceBaseMetadata {\n type: \"object\";\n primaryKeyApiName: keyof this[\"properties\"];\n titleProperty: keyof this[\"properties\"];\n links: Record<\n string,\n ObjectMetadata.Link<any, any>\n >;\n primaryKeyType: PrimaryKeyTypes;\n icon: Icon | undefined;\n visibility: ObjectTypeVisibility | undefined;\n pluralDisplayName: string;\n status: ReleaseStatus | undefined;\n interfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* InterfaceType property api name */ string,\n /* ObjectType property api name */ string\n >\n >;\n inverseInterfaceMap: Record<\n /* InterfaceType api name */ string,\n Record<\n /* ObjectType property api name */ string,\n /* InterfaceType property api name */ string\n >\n >;\n}\n\nexport namespace ObjectMetadata {\n export interface Property {\n readonly?: boolean;\n displayName?: string;\n description?: string;\n type: WirePropertyTypes;\n multiplicity?: boolean;\n nullable?: boolean;\n valueTypeApiName?: string;\n }\n\n export interface Link<\n Q extends ObjectTypeDefinition,\n M extends boolean,\n > {\n __OsdkLinkTargetType?: Q;\n targetType: Q[\"apiName\"];\n multiplicity: M;\n }\n}\n\nexport interface ObjectTypeDefinition {\n type: \"object\";\n apiName: string;\n osdkMetadata?: OsdkMetadata;\n __DefinitionMetadata?:\n & ObjectMetadata\n & ObjectInterfaceCompileDefinition;\n}\n\nexport type ObjectTypeLinkKeysFrom2<\n Q extends ObjectTypeDefinition,\n> =\n & keyof CompileTimeMetadata<Q>[\"links\"]\n & string;\n\nexport interface PropertyDef<\n T extends WirePropertyTypes,\n N extends \"nullable\" | \"non-nullable\" = \"nullable\",\n M extends \"array\" | \"single\" = \"single\",\n> extends ObjectMetadata.Property {\n type: T;\n multiplicity: M extends \"array\" ? true : false;\n nullable: N extends \"nullable\" ? true : false;\n}\n\nexport type ReleaseStatus =\n | \"ACTIVE\"\n | \"EXPERIMENTAL\"\n | \"DEPRECATED\"\n | \"ENDORSED\";\n\ntype ObjectTypeVisibility = \"NORMAL\" | \"PROMINENT\" | \"HIDDEN\";\n\ntype BlueprintIcon = {\n type: \"blueprint\";\n color: string;\n name: string;\n};\n\ntype Icon = BlueprintIcon;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,WA2FiBA,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid } from \"../experimental/fetchPageByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SAASC,iDAAiD,QAAQ,mCAAmC;AACrG,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
1
+ {"version":3,"file":"unstable.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks"],"sources":["unstable.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport type { Experiment, ExperimentFns } from \"../experimental/Experiment.js\";\n\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from \"../experimental/createMediaReference.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from \"../experimental/fetchOneByRid.js\";\nexport {\n __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid,\n type FetchPageByRidPayload,\n} from \"../experimental/fetchPageByRid.js\";\nexport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from \"../experimental/getBulkLinks.js\";\n\nexport type { EXPERIMENTAL_BulkLinkResult } from \"../objectSet/BulkLinkResult.js\";\nexport type { MinimalObjectSet } from \"../objectSet/ObjectSet.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,uDAAuD,QAAQ,yCAAyC;AACjH,SAASC,gDAAgD,QAAQ,kCAAkC;AACnG,SACEC,iDAAiD,QAE5C,mCAAmC;AAC1C,SAASC,+CAA+C,QAAQ,iCAAiC","ignoreList":[]}
@@ -23,6 +23,11 @@ export type MapPropNamesToObjectType<
23
23
  P extends ValidOsdkPropParams<FROM>,
24
24
  OPTIONS extends never | "$rid" | "$allBaseProperties" = never
25
25
  > = "$allBaseProperties" extends OPTIONS ? PropertyKeys<FROM> extends P ? PropertyKeys<TO> : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>] : PropMapToObject<FROM, TO>[JustProps<FROM, P> & keyof PropMapToObject<FROM, TO>];
26
+ type NamespaceOf<S extends string> = S extends `${infer Before}.${infer After}` ? After extends `${string}.${string}` ? `${Before}.${NamespaceOf<After>}` : Before : never;
27
+ type MaybeStripNamespaces<
28
+ S extends string,
29
+ TO extends InterfaceDefinition
30
+ > = S extends `${NamespaceOf<S>}.${infer Rest}` ? NamespaceOf<S> extends NamespaceOf<ApiNameAsString<TO>> ? Rest : S : S;
26
31
  export type PropMapToInterface<
27
32
  FROM extends ObjectTypeDefinition,
28
33
  TO extends InterfaceDefinition
@@ -31,7 +36,7 @@ export type MapPropNamesToInterface<
31
36
  FROM extends ObjectTypeDefinition,
32
37
  TO extends InterfaceDefinition,
33
38
  P extends ValidOsdkPropParams<FROM>
34
- > = PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>];
39
+ > = MaybeStripNamespaces<PropMapToInterface<FROM, TO>[JustProps<FROM, P> & keyof PropMapToInterface<FROM, TO>], TO>;
35
40
  /**
36
41
  * Older version of this helper that allows for `$rid` and co in
37
42
  * the properties field.
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,gBACA,6BACK,kCAAmC;AAC1C,cACE,sBACA,qBACK,2BAA4B;AACnC,cAAc,mBAAmB,6BAA8B;AAC/D,cACE,qBACA,yBACK,mCAAoC;AAC3C,cACE,6BACA,oBACK,iCAAkC;AACzC,cACE,qBACA,gBACA,4BACK,oCAAqC;AAC5C,cAAc,yBAAyB,iCAAkC;AACzE,cAAc,gBAAgB,eAAgB;KAYzC,wBACD,SACA,SACA,YACA;KAEC,oBAAoB,UAAU,+BAC/B,wBACA,aAAa;AAEjB,YAAY,gBACV,UAAU,+BACR,oBAAoB,GAAG;AAE3B,YAAY;CACV,UAAU;CACV,UAAU,oBAAoB;IAC5B,UAAU,SAAS,aAAa,KAChC,QAAQ,GAAG;AAEf,YAA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2BAA2B,qBACrC,QAAQ,WAAW,eACf,eAAe,WAAW,gBAC1B;AAGN,YAAY;CACV;CACA,UAAU,uBAAuB,qBAAqB;CACtD,oBAAoB;IAClB,iBAAiB,KAAK,2BAA2B","names":["type: NEW_Q | string","updatedObject?:\n | Osdk.Instance<Q, any, NEW_PROPS>\n | {\n [K in NEW_PROPS]?: CompileTimeMetadata<\n Q\n >[\"props\"][K];\n }"],"sources":["../../src/OsdkObjectFrom.ts"],"version":3,"file":"OsdkObjectFrom.d.ts"}
1
+ {"mappings":"AAgBA,cACE,gBACA,6BACK,kCAAmC;AAC1C,cACE,sBACA,qBACK,2BAA4B;AACnC,cAAc,mBAAmB,6BAA8B;AAC/D,cACE,qBACA,yBACK,mCAAoC;AAC3C,cACE,6BACA,oBACK,iCAAkC;AACzC,cACE,qBACA,gBACA,4BACK,oCAAqC;AAC5C,cAAc,yBAAyB,iCAAkC;AACzE,cAAc,gBAAgB,eAAgB;KAYzC,wBACD,SACA,SACA,YACA;KAEC,oBAAoB,UAAU,+BAC/B,wBACA,aAAa;AAEjB,YAAY,gBACV,UAAU,+BACR,oBAAoB,GAAG;AAE3B,YAAY;CACV,UAAU;CACV,UAAU,oBAAoB;IAC5B,UAAU,SAAS,aAAa,KAChC,QAAQ,GAAG;AAEf,YAAY;CACV,aAAa;CACb,WAAW;IACT,YAAY,oBAAoB,IAAI,iBAAiB,gBAAgB;AAEzE,YAAY;CACV,aAAa;CACb,WAAW;CACX,UAAU,oBAAoB;CAC9B,wBAAwB,SAAS;IAC/B,6BAA6B,UAC7B,aAAa,cAAc,IAAI,aAAa,MAC5C,gBACA,MACA,IACA,UAAU,MAAM,WAAW,gBAAgB,MAAM,OACjD,gBACA,MACA,IACA,UAAU,MAAM,WAAW,gBAAgB,MAAM;KAEhD,YAAY,oBAAoB,mBAAmB,gBAAgB,UACpE,yCAAyC,UAAU,YAAY,WAC/D;KAGC;CAAqB;CAAkB,WAAW;IACrD,aAAa,YAAY,YAAY,SACjC,YAA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props\"][K];\n }"],"sources":["../../src/OsdkObjectFrom.ts"],"version":3,"file":"OsdkObjectFrom.d.ts"}
@@ -9,7 +9,14 @@ type fetchPageByRidFn = <
9
9
  const S extends NullabilityAdherence,
10
10
  const T extends boolean
11
11
  >(objectType: Q, rids: string[], options?: FetchPageArgs<Q, L, R, any, S, T>) => Promise<FetchPageResult<Q, L, R, S, T>>;
12
- export declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid", {
12
+ export type FetchPageByRidPayload = {
13
13
  fetchPageByRid: fetchPageByRidFn
14
- }>;
14
+ fetchPageByRidNoType: fetchPageByRidNoTypeFn
15
+ };
16
+ type fetchPageByRidNoTypeFn = <
17
+ const R extends boolean,
18
+ const S extends NullabilityAdherence,
19
+ const T extends boolean
20
+ >(rids: readonly string[], options?: FetchPageArgs<ObjectOrInterfaceDefinition, any, R, any, S, T>) => Promise<FetchPageResult<ObjectOrInterfaceDefinition, any, R, S, T>>;
21
+ export declare const __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<"2.2.0", "__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid", FetchPageByRidPayload>;
15
22
  export {};
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cACE,eACA,4BACK,4BAA6B;AACpC,cAAc,uBAAuB,8BAA+B;AAEpE,cACE,6BACA,oBACK,kCAAmC;AAC1C,cAAc,kBAAkB,iBAAkB;KAE7C;CACH,UAAU;OACJ,UAAU,aAAa;OACvB;OACA,UAAU;OACV;EAENA,YAAY,GACZC,gBACAC,UAAU,cAAc,GAAG,GAAG,QAAQ,GAAG,OACtC,QAAQ,gBAAgB,GAAG,GAAG,GAAG,GAAG;AAEzC,OAAO,cAAMC,mDAAmD,WAC9D,SACA,qDACA;CAAE,gBAAgB;AAAkB","names":["objectType: Q","rids: string[]","options?: FetchPageArgs<Q, L, R, any, S, T>","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n { fetchPageByRid: fetchPageByRidFn }\n>"],"sources":["../../../src/experimental/fetchPageByRid.ts"],"version":3,"file":"fetchPageByRid.d.ts"}
1
+ {"mappings":"AAgBA,cACE,eACA,4BACK,4BAA6B;AACpC,cAAc,uBAAuB,8BAA+B;AAEpE,cACE,6BACA,oBACK,kCAAmC;AAC1C,cAAc,kBAAkB,iBAAkB;KAE7C;CACH,UAAU;OACJ,UAAU,aAAa;OACvB;OACA,UAAU;OACV;EAENA,YAAY,GACZC,gBACAC,UAAU,cAAc,GAAG,GAAG,QAAQ,GAAG,OACtC,QAAQ,gBAAgB,GAAG,GAAG,GAAG,GAAG;AAEzC,YAAY,wBAAwB;CAClC,gBAAgB;CAChB,sBAAsB;AACvB;KAEI;OACG;OACA,UAAU;OACV;EAENC,yBACAC,UAAU,cAAc,kCAAkC,QAAQ,GAAG,OAClE,QAAQ,gBAAgB,kCAAkC,GAAG,GAAG;AAErE,OAAO,cAAMC,mDAAmD,WAC9D,SACA,qDACA","names":["objectType: Q","rids: string[]","options?: FetchPageArgs<Q, L, R, any, S, T>","rids: readonly string[]","options?: FetchPageArgs<ObjectOrInterfaceDefinition, any, R, any, S, T>","__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid: Experiment<\n \"2.2.0\",\n \"__EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid\",\n FetchPageByRidPayload\n>"],"sources":["../../../src/experimental/fetchPageByRid.ts"],"version":3,"file":"fetchPageByRid.d.ts"}
@@ -55,6 +55,7 @@ export declare namespace ObjectMetadata {
55
55
  type: WirePropertyTypes;
56
56
  multiplicity?: boolean;
57
57
  nullable?: boolean;
58
+ valueTypeApiName?: string;
58
59
  }
59
60
  interface Link<
60
61
  Q extends ObjectTypeDefinition,
@@ -1 +1 @@
1
- {"mappings":"AAgBA,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D;KAEI,OAAO","names":[],"sources":["../../../src/ontology/ObjectTypeDefinition.ts"],"version":3,"file":"ObjectTypeDefinition.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,oBAAoB,oBAAqB;AACvD,cACE,6BACA,oBACK,wBAAyB;AAChC,cAAc,uBAAuB,sBAAuB;AAC5D,cAAc,qBAAqB,oBAAqB;AACxD,cAAc,yBAAyB,wBAAyB;AAEhE,YAAY,oBAAoB,UAAU;CAAE,uBAAuB,CAAE;AAAE,KACrE,YACE,EAAE;AAGN,YAAY;CACV,UAAU;CACV,UAAU,aAAa;IACrB,oBAAoB,GAAG,cAAc;AAEzC,YAAY,8BAA8B;CACxC,MAAM,WAAW;CACjB;CACA;CACA;CACA,YAAY,YAAY,eAAe;CACvC;;;;;;CAMA,aAAa;AACd;AAED,iBAAiB,iCAAiC;CAChD,MAAM,WAAW;CACjB;CACA;CACA;CACA;AACD;AAED,iBAAiB,aAAa,UAAU,8BAA8B;CACpE,0BAA0B;AAC3B;AAED,iBAAiB,uBAAuB,4BAA4B;CAClE,MAAM;CACN,8BAA8B;CAC9B,0BAA0B;CAC1B,OAAO,eAEL,eAAe;CAEjB,gBAAgB;CAChB,MAAM;CACN,YAAY;CACZ;CACA,QAAQ;CACR,cAAc,eAEZ;CAKF,qBAAqB,eAEnB;AAKH;AAED,yBAAiB;WACE,SAAS;EACxB;EACA;EACA;EACA,MAAM;EACN;EACA;EACA;CACD;WAEgB;EACf,UAAU;EACV;GACA;EACA,uBAAuB;EACvB,YAAY,EAAE;EACd,cAAc;CACf;;AAGH,iBAAiB,qBAAqB;CACpC,MAAM;CACN;CACA,eAAe;CACf,uBACI,iBACA;AACL;AAED,YAAY,wBACV,UAAU,8BAEF,oBAAoB,GAAG;AAGjC,iBAAiB;CACf,UAAU;CACV,UAAU,aAAa,iBAAiB;CACxC,UAAU,UAAU,WAAW;UACvB,eAAe,SAAS;CAChC,MAAM;CACN,cAAc,UAAU,UAAU,OAAO;CACzC,UAAU,UAAU,aAAa,OAAO;AACzC;AAED,YAAY,gBACR,WACA,iBACA,eACA;KAEC,uBAAuB,WAAW,cAAc;KAEhD,gBAAgB;CACnB,MAAM;CACN;CACA;AACD;KAEI,OAAO","names":[],"sources":["../../../src/ontology/ObjectTypeDefinition.ts"],"version":3,"file":"ObjectTypeDefinition.d.ts"}
@@ -1,7 +1,7 @@
1
1
  export type { Experiment, ExperimentFns } from "../experimental/Experiment.js";
2
2
  export { __EXPERIMENTAL__NOT_SUPPORTED_YET__createMediaReference } from "../experimental/createMediaReference.js";
3
3
  export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchOneByRid } from "../experimental/fetchOneByRid.js";
4
- export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid } from "../experimental/fetchPageByRid.js";
4
+ export { __EXPERIMENTAL__NOT_SUPPORTED_YET__fetchPageByRid, type FetchPageByRidPayload } from "../experimental/fetchPageByRid.js";
5
5
  export { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks } from "../experimental/getBulkLinks.js";
6
6
  export type { EXPERIMENTAL_BulkLinkResult } from "../objectSet/BulkLinkResult.js";
7
7
  export type { MinimalObjectSet } from "../objectSet/ObjectSet.js";
@@ -1 +1 @@
1
- {"mappings":"AAgBA,cAAc,YAAY,qBAAqB;AAE/C,SAAS,+DAA+D;AACxE,SAAS,wDAAwD;AACjE,SAAS,yDAAyD;AAClE,SAAS,uDAAuD;AAEhE,cAAc,mCAAmC;AACjD,cAAc,wBAAwB","names":[],"sources":["../../../src/public/unstable.ts"],"version":3,"file":"unstable.d.ts"}
1
+ {"mappings":"AAgBA,cAAc,YAAY,qBAAqB;AAE/C,SAAS,+DAA+D;AACxE,SAAS,wDAAwD;AACjE,SACE,wDACK,6BACA;AACP,SAAS,uDAAuD;AAEhE,cAAc,mCAAmC;AACjD,cAAc,wBAAwB","names":[],"sources":["../../../src/public/unstable.ts"],"version":3,"file":"unstable.d.ts"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/api",
3
- "version": "2.5.0-beta.2",
3
+ "version": "2.5.0-beta.4",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -48,8 +48,8 @@
48
48
  "@microsoft/api-extractor": "^7.52.7",
49
49
  "ts-expect": "^1.3.0",
50
50
  "typescript": "~5.5.4",
51
- "@osdk/monorepo.api-extractor": "~0.4.0-beta.1",
52
- "@osdk/monorepo.tsconfig": "~0.4.0-beta.1"
51
+ "@osdk/monorepo.tsconfig": "~0.4.0-beta.1",
52
+ "@osdk/monorepo.api-extractor": "~0.4.0-beta.1"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"