@osdk/client 2.2.0-rc.25 → 2.2.0-rc.26

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,14 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.2.0-rc.26
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [3d0ab11]
8
+ - @osdk/generator-converters@2.2.0-rc.26
9
+ - @osdk/api@2.2.0-rc.26
10
+ - @osdk/client.unstable@2.2.0-rc.26
11
+
3
12
  ## 2.2.0-rc.25
4
13
 
5
14
  ### Patch Changes
@@ -22,19 +22,7 @@ describe(modernToLegacyWhereClause, () => {
22
22
  describe("api namespaces", () => {
23
23
  describe("interfaces", () => {
24
24
  it("properly converts shortname to fqApiName", () => {
25
- const r = modernToLegacyWhereClause({
26
- $and: [{
27
- prop: {
28
- $eq: 5
29
- }
30
- }, {
31
- prop2: {
32
- innerProp1: {
33
- $eq: "myProp"
34
- }
35
- }
36
- }]
37
- }, {
25
+ const T = {
38
26
  type: "interface",
39
27
  apiName: "a.Foo",
40
28
  __DefinitionMetadata: {
@@ -53,9 +41,23 @@ describe(modernToLegacyWhereClause, () => {
53
41
  apiName: "a.Foo",
54
42
  displayName: "",
55
43
  links: {},
56
- rid: ""
44
+ rid: "",
45
+ description: undefined
57
46
  }
58
- });
47
+ };
48
+ const r = modernToLegacyWhereClause({
49
+ $and: [{
50
+ prop: {
51
+ $eq: 5
52
+ }
53
+ }, {
54
+ prop2: {
55
+ innerProp1: {
56
+ $eq: "myProp"
57
+ }
58
+ }
59
+ }]
60
+ }, T);
59
61
  expect(r).toMatchInlineSnapshot(`
60
62
  {
61
63
  "type": "and",
@@ -80,15 +82,7 @@ describe(modernToLegacyWhereClause, () => {
80
82
  `);
81
83
  });
82
84
  it("properly does not convert when interface has no apiNamespace", () => {
83
- const r = modernToLegacyWhereClause({
84
- "b.prop": 5,
85
- foo: 6,
86
- "c.prop2": {
87
- innerProp1: {
88
- $eq: "myProp"
89
- }
90
- }
91
- }, {
85
+ const T = {
92
86
  type: "interface",
93
87
  apiName: "Foo",
94
88
  __DefinitionMetadata: {
@@ -113,9 +107,19 @@ describe(modernToLegacyWhereClause, () => {
113
107
  apiName: "Foo",
114
108
  displayName: "",
115
109
  links: {},
116
- rid: ""
110
+ rid: "",
111
+ description: undefined
117
112
  }
118
- });
113
+ };
114
+ const r = modernToLegacyWhereClause({
115
+ "b.prop": 5,
116
+ foo: 6,
117
+ "c.prop2": {
118
+ innerProp1: {
119
+ $eq: "myProp"
120
+ }
121
+ }
122
+ }, T);
119
123
  expect(r).toMatchInlineSnapshot(`
120
124
  {
121
125
  "type": "and",
@@ -145,15 +149,7 @@ describe(modernToLegacyWhereClause, () => {
145
149
  `);
146
150
  });
147
151
  it("gracefully handles redundant apiNamespace in property", () => {
148
- const r = modernToLegacyWhereClause({
149
- "b.prop": 5,
150
- "a.foo": 6,
151
- "c.prop2": {
152
- innerProp1: {
153
- $eq: "myProp"
154
- }
155
- }
156
- }, {
152
+ const T = {
157
153
  type: "interface",
158
154
  apiName: "a.Foo",
159
155
  __DefinitionMetadata: {
@@ -178,9 +174,19 @@ describe(modernToLegacyWhereClause, () => {
178
174
  apiName: "a.Foo",
179
175
  displayName: "",
180
176
  links: {},
181
- rid: ""
177
+ rid: "",
178
+ description: undefined
182
179
  }
183
- });
180
+ };
181
+ const r = modernToLegacyWhereClause({
182
+ "b.prop": 5,
183
+ "a.foo": 6,
184
+ "c.prop2": {
185
+ innerProp1: {
186
+ $eq: "myProp"
187
+ }
188
+ }
189
+ }, T);
184
190
  expect(r).toMatchInlineSnapshot(`
185
191
  {
186
192
  "type": "and",
@@ -210,9 +216,7 @@ describe(modernToLegacyWhereClause, () => {
210
216
  `);
211
217
  });
212
218
  it("properly does not convert different apiNamespaces", () => {
213
- expect(modernToLegacyWhereClause({
214
- "b.prop": 5
215
- }, {
219
+ const T = {
216
220
  type: "interface",
217
221
  apiName: "a.Foo",
218
222
  __DefinitionMetadata: {
@@ -231,9 +235,13 @@ describe(modernToLegacyWhereClause, () => {
231
235
  apiName: "a.Foo",
232
236
  displayName: "",
233
237
  links: {},
234
- rid: ""
238
+ rid: "",
239
+ description: undefined
235
240
  }
236
- })).toMatchInlineSnapshot(`
241
+ };
242
+ expect(modernToLegacyWhereClause({
243
+ "b.prop": 5
244
+ }, T)).toMatchInlineSnapshot(`
237
245
  {
238
246
  "field": "b.prop",
239
247
  "type": "eq",
@@ -244,9 +252,7 @@ describe(modernToLegacyWhereClause, () => {
244
252
  });
245
253
  describe("objects", () => {
246
254
  it("does not convert object short property names to fq", () => {
247
- const r = modernToLegacyWhereClause({
248
- prop: 5
249
- }, {
255
+ const T = {
250
256
  type: "interface",
251
257
  apiName: "a.Foo",
252
258
  __DefinitionMetadata: {
@@ -262,9 +268,13 @@ describe(modernToLegacyWhereClause, () => {
262
268
  apiName: "a.Foo",
263
269
  displayName: "",
264
270
  links: {},
265
- rid: ""
271
+ rid: "",
272
+ description: undefined
266
273
  }
267
- });
274
+ };
275
+ const r = modernToLegacyWhereClause({
276
+ prop: 5
277
+ }, T);
268
278
  expect(r).toMatchInlineSnapshot(`
269
279
  {
270
280
  "field": "a.prop",
@@ -1 +1 @@
1
- {"version":3,"file":"modernToLegacyWhereClause.test.js","names":["BgaoNflPlayer","objectTypeWithAllPropertyTypes","expectType","describe","expect","it","modernToLegacyWhereClause","r","$and","prop","$eq","prop2","innerProp1","type","apiName","__DefinitionMetadata","properties","displayName","links","rid","toMatchInlineSnapshot","foo","geoPoint","$within","$bbox","$distance","$of","coordinates","$polygon","geoShape","$intersects","integer","$ne","string","$containsAllTerms","term","fuzzySearch","$containsAnyTerm","address","state","city","$or","gamesPlayed","$gt","decimal"],"sources":["modernToLegacyWhereClause.test.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 { ObjectOrInterfaceDefinition, WhereClause } from \"@osdk/api\";\nimport {\n BgaoNflPlayer,\n objectTypeWithAllPropertyTypes,\n} from \"@osdk/client.test.ontology\";\nimport type { Point } from \"geojson\";\nimport { expectType } from \"ts-expect\";\nimport { describe, expect, it } from \"vitest\";\nimport { modernToLegacyWhereClause } from \"./modernToLegacyWhereClause.js\";\n\ntype ObjAllProps = objectTypeWithAllPropertyTypes;\ntype structObj = BgaoNflPlayer;\ndescribe(modernToLegacyWhereClause, () => {\n describe(\"api namespaces\", () => {\n describe(\"interfaces\", () => {\n it(\"properly converts shortname to fqApiName\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"prop\": { type: \"integer\" },\n \"prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n $and: [\n { prop: { $eq: 5 } },\n { prop2: { innerProp1: { $eq: \"myProp\" } } },\n ],\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"a.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert when interface has no apiNamespace\", () => {\n const T = {\n type: \"interface\",\n apiName: \"Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n foo: 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"gracefully handles redundant apiNamespace in property\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n \"a.foo\": 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"a.foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert different apiNamespaces\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n expect(modernToLegacyWhereClause({\n \"b.prop\": 5,\n }, T)).toMatchInlineSnapshot(`\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n\n describe(\"objects\", () => {\n it(\"does not convert object short property names to fq\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n const r = modernToLegacyWhereClause({\n prop: 5,\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n });\n\n describe(\"single checks\", () => {\n describe(\"$within\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: [-5, 5] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius of geopoint\", async () => {\n // suppose you loaded an object with a geopoint field\n // and you want to find all objects within 5 km of that point\n const pointAsGeoJsonPoint: Point = {\n type: \"Point\",\n coordinates: [-5, 5],\n };\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: pointAsGeoJsonPoint },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n it(\"check types\", async () => {\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $distance: [2, \"centimeter\"], $of: [2, 2] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $bbox: [-5, 5, -10, 10] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n // @ts-expect-error\n $distance: [2, \"centimeter\"],\n // @ts-expect-error\n $of: [2, 2],\n },\n },\n });\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $polygon: [[[0, 1], [3, 2], [0, 1]]],\n // @ts-expect-error\n $bbox: [2, 2, 2, 2],\n },\n },\n });\n });\n describe(\"$intersects\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates intersects polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n });\n\n it(\"inverts ne short hand properly\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n integer: { $ne: 5 },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n }\n `);\n });\n it(\"converts $containsAllTerms correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAllTerms correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts $containsAnyTerm correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAnyTerm correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts struct where clauses correctly\", () => {\n expect(modernToLegacyWhereClause<structObj>({\n address: { state: { $eq: \"NJ\" } },\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $and: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n ],\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $or: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n { gamesPlayed: { $gt: 5 } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n {\n \"field\": \"gamesPlayed\",\n \"type\": \"gt\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n });\n\n describe(\"multiple checks\", () => {\n it(\"properly handles multiple simple where checks\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n decimal: 5,\n integer: 10,\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $and\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $and: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $or\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $or: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,aAAa,EACbC,8BAA8B,QACzB,4BAA4B;AAEnC,SAASC,UAAU,QAAQ,WAAW;AACtC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,yBAAyB,QAAQ,gCAAgC;AAI1EH,QAAQ,CAACG,yBAAyB,EAAE,MAAM;EACxCH,QAAQ,CAAC,gBAAgB,EAAE,MAAM;IAC/BA,QAAQ,CAAC,YAAY,EAAE,MAAM;MAC3BE,EAAE,CAAC,0CAA0C,EAAE,MAAM;QAmBnD,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BAAiB,EAAE,MAAM;MAChCE,EAAE,CAAC,+CAA+C,EAAE,MAAM;QACxDD,MAAM,CAACE,yBAAyB,CAC9B;UACEsC,OAAO,EAAE,CAAC;UACVb,OAAO,EAAE;QACX,CAAC,EACD9B,8BACF,CAAC,CAAC,CAACmB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC;MACF,CAAC,CAAC;MAEFf,EAAE,CAAC,uBAAuB,EAAE,MAAM;QAChCD,MAAM,CAACE,yBAAyB,CAC9B;UACEE,IAAI,EAAE,CAAC;YACLoC,OAAO,EAAE;UACX,CAAC,EAAE;YACDb,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACD9B,8BACF,CAAC,CAAC,CAACmB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC;MACJ,CAAC,CAAC;MAEFf,EAAE,CAAC,sBAAsB,EAAE,MAAM;QAC/BD,MAAM,CAACE,yBAAyB,CAC9B;UACEmC,GAAG,EAAE,CAAC;YACJG,OAAO,EAAE;UACX,CAAC,EAAE;YACDb,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACD9B,8BACF,CAAC,CAAC,CAACmB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modernToLegacyWhereClause.test.js","names":["BgaoNflPlayer","objectTypeWithAllPropertyTypes","expectType","describe","expect","it","modernToLegacyWhereClause","T","type","apiName","__DefinitionMetadata","properties","displayName","links","rid","description","undefined","r","$and","prop","$eq","prop2","innerProp1","toMatchInlineSnapshot","foo","geoPoint","$within","$bbox","$distance","$of","coordinates","$polygon","geoShape","$intersects","integer","$ne","string","$containsAllTerms","term","fuzzySearch","$containsAnyTerm","address","state","city","$or","gamesPlayed","$gt","decimal"],"sources":["modernToLegacyWhereClause.test.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 { ObjectOrInterfaceDefinition, WhereClause } from \"@osdk/api\";\nimport {\n BgaoNflPlayer,\n objectTypeWithAllPropertyTypes,\n} from \"@osdk/client.test.ontology\";\nimport type { Point } from \"geojson\";\nimport { expectType } from \"ts-expect\";\nimport { describe, expect, it } from \"vitest\";\nimport { modernToLegacyWhereClause } from \"./modernToLegacyWhereClause.js\";\n\ntype ObjAllProps = objectTypeWithAllPropertyTypes;\ntype structObj = BgaoNflPlayer;\ndescribe(modernToLegacyWhereClause, () => {\n describe(\"api namespaces\", () => {\n describe(\"interfaces\", () => {\n it(\"properly converts shortname to fqApiName\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"prop\": { type: \"integer\" },\n \"prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n $and: [\n { prop: { $eq: 5 } },\n { prop2: { innerProp1: { $eq: \"myProp\" } } },\n ],\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"a.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert when interface has no apiNamespace\", () => {\n const T = {\n type: \"interface\",\n apiName: \"Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n foo: 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"gracefully handles redundant apiNamespace in property\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n \"c.prop2\": {\n type: { \"innerProp1\": \"string\", \"innerProp2\": \"float\" },\n },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n const r = modernToLegacyWhereClause({\n \"b.prop\": 5,\n \"a.foo\": 6,\n \"c.prop2\": { innerProp1: { $eq: \"myProp\" } },\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"a.foo\",\n \"type\": \"eq\",\n \"value\": 6,\n },\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"c.prop2\",\n \"structFieldApiName\": \"innerProp1\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"myProp\",\n },\n ],\n }\n `);\n });\n\n it(\"properly does not convert different apiNamespaces\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"b.prop\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n\n expect(modernToLegacyWhereClause({\n \"b.prop\": 5,\n }, T)).toMatchInlineSnapshot(`\n {\n \"field\": \"b.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n\n describe(\"objects\", () => {\n it(\"does not convert object short property names to fq\", () => {\n const T = {\n type: \"interface\",\n apiName: \"a.Foo\",\n __DefinitionMetadata: {\n type: \"interface\",\n properties: {\n \"a.foo\": { type: \"integer\" },\n \"prop\": { type: \"integer\" },\n },\n apiName: \"a.Foo\",\n displayName: \"\",\n links: {},\n rid: \"\",\n description: undefined,\n },\n } as const satisfies ObjectOrInterfaceDefinition;\n const r = modernToLegacyWhereClause({\n prop: 5,\n }, T);\n\n expect(r).toMatchInlineSnapshot(`\n {\n \"field\": \"a.prop\",\n \"type\": \"eq\",\n \"value\": 5,\n }\n `);\n });\n });\n });\n\n describe(\"single checks\", () => {\n describe(\"$within\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: [-5, 5] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within radius of geopoint\", async () => {\n // suppose you loaded an object with a geopoint field\n // and you want to find all objects within 5 km of that point\n const pointAsGeoJsonPoint: Point = {\n type: \"Point\",\n coordinates: [-5, 5],\n };\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $distance: [5, \"km\"], $of: pointAsGeoJsonPoint },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinDistanceOf\",\n \"value\": {\n \"center\": {\n \"coordinates\": [\n -5,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"distance\": {\n \"unit\": \"KILOMETERS\",\n \"value\": 5,\n },\n },\n }\n `);\n });\n\n it(\"properly generates within polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoPoint\",\n \"type\": \"withinPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n it(\"check types\", async () => {\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: [-5, 5, -10, 10],\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $distance: [2, \"centimeter\"], $of: [2, 2] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: { $bbox: [-5, 5, -10, 10] },\n },\n });\n\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $bbox: [-5, 5, -10, 10],\n // @ts-expect-error\n $distance: [2, \"centimeter\"],\n // @ts-expect-error\n $of: [2, 2],\n },\n },\n });\n expectType<WhereClause<ObjAllProps>>({\n geoPoint: {\n $within: {\n $polygon: [[[0, 1], [3, 2], [0, 1]]],\n // @ts-expect-error\n $bbox: [2, 2, 2, 2],\n },\n },\n });\n });\n describe(\"$intersects\", () => {\n it(\"properly generates bbox shortcut\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: [-5, 5, -10, 10],\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n it(\"properly generates bbox long form\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n $bbox: [-5, 5, -10, 10],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsBoundingBox\",\n \"value\": {\n \"bottomRight\": {\n \"coordinates\": [\n -10,\n 5,\n ],\n \"type\": \"Point\",\n },\n \"topLeft\": {\n \"coordinates\": [\n -5,\n 10,\n ],\n \"type\": \"Point\",\n },\n },\n }\n `);\n });\n\n it(\"properly generates intersects polygon\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: { $polygon: [[[0, 1], [3, 2], [0, 1]]] },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n\n it(\"properly generates within polygon geojson\", async () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n geoShape: {\n $intersects: {\n type: \"Polygon\",\n coordinates: [[[0, 1], [3, 2], [0, 1]]],\n },\n },\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"field\": \"geoShape\",\n \"type\": \"intersectsPolygon\",\n \"value\": {\n \"coordinates\": [\n [\n [\n 0,\n 1,\n ],\n [\n 3,\n 2,\n ],\n [\n 0,\n 1,\n ],\n ],\n ],\n \"type\": \"Polygon\",\n },\n }\n `);\n });\n });\n\n it(\"inverts ne short hand properly\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n integer: { $ne: 5 },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"type\": \"not\",\n \"value\": {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n }\n `);\n });\n it(\"converts $containsAllTerms correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAllTerms correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAllTerms: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAllTerms\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts $containsAnyTerm correctly if using new type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: true } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": true,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\", fuzzySearch: false } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: { term: \"test\" } },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n\n it(\"converts $containsAnyTerm correctly if using old type\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>({\n string: { $containsAnyTerm: \"test\" },\n }, objectTypeWithAllPropertyTypes)).toMatchInlineSnapshot(`\n {\n \"field\": \"string\",\n \"fuzzy\": false,\n \"type\": \"containsAnyTerm\",\n \"value\": \"test\",\n }\n `);\n });\n it(\"converts struct where clauses correctly\", () => {\n expect(modernToLegacyWhereClause<structObj>({\n address: { state: { $eq: \"NJ\" } },\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $and: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n ],\n }\n `);\n\n expect(modernToLegacyWhereClause<structObj>({\n $or: [\n { address: { state: { $eq: \"NJ\" } } },\n { address: { city: { $containsAnyTerm: \"N\" } } },\n { gamesPlayed: { $gt: 5 } },\n ],\n }, BgaoNflPlayer)).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": undefined,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"state\",\n \"type\": \"structField\",\n },\n \"type\": \"eq\",\n \"value\": \"NJ\",\n },\n {\n \"field\": undefined,\n \"fuzzy\": false,\n \"propertyIdentifier\": {\n \"propertyApiName\": \"address\",\n \"structFieldApiName\": \"city\",\n \"type\": \"structField\",\n },\n \"type\": \"containsAnyTerm\",\n \"value\": \"N\",\n },\n {\n \"field\": \"gamesPlayed\",\n \"type\": \"gt\",\n \"value\": 5,\n },\n ],\n }\n `);\n });\n });\n\n describe(\"multiple checks\", () => {\n it(\"properly handles multiple simple where checks\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n decimal: 5,\n integer: 10,\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $and\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $and: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"and\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n\n it(\"properly handles $or\", () => {\n expect(modernToLegacyWhereClause<ObjAllProps>(\n {\n $or: [{\n decimal: 5,\n }, {\n integer: 10,\n }],\n },\n objectTypeWithAllPropertyTypes,\n )).toMatchInlineSnapshot(`\n {\n \"type\": \"or\",\n \"value\": [\n {\n \"field\": \"decimal\",\n \"type\": \"eq\",\n \"value\": 5,\n },\n {\n \"field\": \"integer\",\n \"type\": \"eq\",\n \"value\": 10,\n },\n ],\n }\n `);\n });\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,aAAa,EACbC,8BAA8B,QACzB,4BAA4B;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CAAC;MACJ,CAAC,CAAC;MAEFlB,EAAE,CAAC,sBAAsB,EAAE,MAAM;QAC/BD,MAAM,CAACE,yBAAyB,CAC9B;UACEsC,GAAG,EAAE,CAAC;YACJG,OAAO,EAAE;UACX,CAAC,EAAE;YACDb,OAAO,EAAE;UACX,CAAC;QACH,CAAC,EACDjC,8BACF,CAAC,CAAC,CAACsB,qBAAqB,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,CAAC;MACN,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -20,7 +20,7 @@ import { createOsdkInterface } from "./createOsdkInterface.js";
20
20
  import { ObjectDefRef } from "./InternalSymbols.js";
21
21
  describe(createOsdkInterface, () => {
22
22
  it("works in the normal case", () => {
23
- const iface = createOsdkInterface({
23
+ const underlying = {
24
24
  "foo": "hi mom",
25
25
  [ObjectDefRef]: {
26
26
  [InterfaceDefinitions]: {},
@@ -44,9 +44,13 @@ describe(createOsdkInterface, () => {
44
44
  type: "object",
45
45
  titleProperty: "foo",
46
46
  rid: "",
47
- status: "ACTIVE"
47
+ status: "ACTIVE",
48
+ icon: undefined,
49
+ visibility: undefined,
50
+ description: undefined
48
51
  }
49
- }, {
52
+ };
53
+ const iface = createOsdkInterface(underlying, {
50
54
  "apiName": "IFoo",
51
55
  displayName: "",
52
56
  links: {},
@@ -57,7 +61,8 @@ describe(createOsdkInterface, () => {
57
61
  },
58
62
  rid: "",
59
63
  type: "interface",
60
- implements: []
64
+ implements: [],
65
+ description: undefined
61
66
  });
62
67
  expect(Object.keys(iface)).toMatchInlineSnapshot(`
63
68
  [
@@ -74,7 +79,7 @@ describe(createOsdkInterface, () => {
74
79
  `);
75
80
  });
76
81
  it("properly maps apiNamespace", () => {
77
- const iface = createOsdkInterface({
82
+ const underlying = {
78
83
  "foo": "hi mom",
79
84
  [ObjectDefRef]: {
80
85
  [InterfaceDefinitions]: {},
@@ -98,9 +103,13 @@ describe(createOsdkInterface, () => {
98
103
  type: "object",
99
104
  titleProperty: "foo",
100
105
  rid: "",
101
- status: "ACTIVE"
106
+ status: "ACTIVE",
107
+ icon: undefined,
108
+ visibility: undefined,
109
+ description: undefined
102
110
  }
103
- }, {
111
+ };
112
+ const iface = createOsdkInterface(underlying, {
104
113
  "apiName": "a.IFoo",
105
114
  displayName: "",
106
115
  links: {},
@@ -111,7 +120,8 @@ describe(createOsdkInterface, () => {
111
120
  },
112
121
  rid: "",
113
122
  type: "interface",
114
- implements: []
123
+ implements: [],
124
+ description: undefined
115
125
  });
116
126
  expect(Object.keys(iface)).toMatchInlineSnapshot(`
117
127
  [
@@ -128,7 +138,7 @@ describe(createOsdkInterface, () => {
128
138
  `);
129
139
  });
130
140
  it("works with mixed namespaces", () => {
131
- const iface = createOsdkInterface({
141
+ const underlying = {
132
142
  "foo": "hi mom",
133
143
  [ObjectDefRef]: {
134
144
  [InterfaceDefinitions]: {},
@@ -152,9 +162,13 @@ describe(createOsdkInterface, () => {
152
162
  type: "object",
153
163
  titleProperty: "foo",
154
164
  rid: "",
155
- status: "ACTIVE"
165
+ status: "ACTIVE",
166
+ icon: undefined,
167
+ visibility: undefined,
168
+ description: undefined
156
169
  }
157
- }, {
170
+ };
171
+ const iface = createOsdkInterface(underlying, {
158
172
  "apiName": "a.IFoo",
159
173
  displayName: "",
160
174
  links: {},
@@ -165,7 +179,8 @@ describe(createOsdkInterface, () => {
165
179
  },
166
180
  rid: "",
167
181
  type: "interface",
168
- implements: []
182
+ implements: [],
183
+ description: undefined
169
184
  });
170
185
  expect(Object.keys(iface)).toMatchInlineSnapshot(`
171
186
  [
@@ -1 +1 @@
1
- {"version":3,"file":"createOsdkInterface.test.js","names":["describe","expect","it","InterfaceDefinitions","createOsdkInterface","ObjectDefRef","iface","apiName","displayName","interfaceMap","inverseInterfaceMap","links","pluralDisplayName","primaryKeyApiName","primaryKeyType","properties","type","titleProperty","rid","status","implements","Object","keys","toMatchInlineSnapshot","asdf","toBe","JSON","stringify","undefined"],"sources":["createOsdkInterface.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, expect, it } from \"vitest\";\nimport {\n type FetchedObjectTypeDefinition,\n InterfaceDefinitions,\n} from \"../../ontology/OntologyProvider.js\";\nimport { createOsdkInterface } from \"./createOsdkInterface.js\";\nimport { ObjectDefRef } from \"./InternalSymbols.js\";\n\ndescribe(createOsdkInterface, () => {\n it(\"works in the normal case\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"IFoo\": {\n \"asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"asdf\",\n ]\n `);\n\n expect((iface as any).asdf).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"IFoo\",\n \"asdf\": \"hi mom\"\n }\"\n `);\n });\n\n it(\"properly maps apiNamespace\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"a.IFoo\": {\n \"a.asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"a.IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"a.asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"asdf\",\n ]\n `);\n\n expect((iface as any).asdf).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"a.IFoo\",\n \"asdf\": \"hi mom\"\n }\"\n `);\n });\n\n it(\"works with mixed namespaces\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"a.IFoo\": {\n \"b.asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"a.IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"b.asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"b.asdf\",\n ]\n `);\n\n expect((iface as any)[\"b.asdf\"]).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"a.IFoo\",\n \"b.asdf\": \"hi mom\"\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,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAEEC,oBAAoB,QACf,oCAAoC;AAC3C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,YAAY,QAAQ,sBAAsB;AAEnDL,QAAQ,CAACI,mBAAmB,EAAE,MAAM;EAClCF,EAAE,CAAC,0BAA0B,EAAE,MAAM;IA8BnC,MAAMI,KAAK,GAAGF,mBAAmB,CA7Bd;MACjB,KAAK,EAAE,QAAQ;MAEf,CAACC,YAAY,GAAG;QACd,CAACF,oBAAoB,GAAG,CAAC,CAAC;QAC1BI,OAAO,EAAE,KAAK;QACdC,WAAW,EAAE,EAAE;QACfC,YAAY,EAAE;UACZ,MAAM,EAAE;YACN,MAAM,EAAE;UACV;QACF,CAAC;QACDC,mBAAmB,EAAE,CAAC,CAAC;QACvBC,KAAK,EAAE,CAAC,CAAC;QACTC,iBAAiB,EAAE,EAAE;QACrBC,iBAAiB,EAAE,EAAE;QACrBC,cAAc,EAAE,QAAQ;QACxBC,UAAU,EAAE;UACV,KAAK,EAAE;YACLC,IAAI,EAAE;UACR;QACF,CAAC;QACDA,IAAI,EAAE,QAAQ;QACdC,aAAa,EAAE,KAAK;QACpBC,G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EAAE,EAAE;QACPC,MAAM,EAAE;MACV;IACF,CAAC,EAEoD;MACnD,SAAS,EAAE,QAAQ;MACnBX,WAAW,EAAE,EAAE;MACfG,KAAK,EAAE,CAAC,CAAC;MACTI,UAAU,EAAE;QACV,QAAQ,EAAE;UACRC,IAAI,EAAE;QACR;MACF,CAAC;MACDE,GAAG,EAAE,EAAE;MACPF,IAAI,EAAE,WAAW;MACjBI,UAAU,EAAE;IACd,CAAC,CAAC;IAEFnB,MAAM,CAACoB,MAAM,CAACC,IAAI,CAAChB,KAAK,CAAC,CAAC,CAACiB,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA,KAAK,CAAC;IAEFtB,MAAM,CAAEK,KAAK,CAAS,QAAQ,CAAC,CAAC,CAACmB,IAAI,CAAC,QAAQ,CAAC;IAE/CxB,MAAM,CAACyB,IAAI,CAACC,SAAS,CAACrB,KAAK,EAAEsB,SAAS,EAAE,CAAC,CAAC,CAAC,CAACL,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"createOsdkInterface.test.js","names":["describe","expect","it","InterfaceDefinitions","createOsdkInterface","ObjectDefRef","underlying","apiName","displayName","interfaceMap","inverseInterfaceMap","links","pluralDisplayName","primaryKeyApiName","primaryKeyType","properties","type","titleProperty","rid","status","icon","undefined","visibility","description","iface","implements","Object","keys","toMatchInlineSnapshot","asdf","toBe","JSON","stringify"],"sources":["createOsdkInterface.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, expect, it } from \"vitest\";\nimport {\n type FetchedObjectTypeDefinition,\n InterfaceDefinitions,\n} from \"../../ontology/OntologyProvider.js\";\nimport { createOsdkInterface } from \"./createOsdkInterface.js\";\nimport { ObjectDefRef } from \"./InternalSymbols.js\";\n\ndescribe(createOsdkInterface, () => {\n it(\"works in the normal case\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"IFoo\": {\n \"asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n icon: undefined,\n visibility: undefined,\n description: undefined,\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n description: undefined,\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"asdf\",\n ]\n `);\n\n expect((iface as any).asdf).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"IFoo\",\n \"asdf\": \"hi mom\"\n }\"\n `);\n });\n\n it(\"properly maps apiNamespace\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"a.IFoo\": {\n \"a.asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n icon: undefined,\n visibility: undefined,\n description: undefined,\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"a.IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"a.asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n description: undefined,\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"asdf\",\n ]\n `);\n\n expect((iface as any).asdf).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"a.IFoo\",\n \"asdf\": \"hi mom\"\n }\"\n `);\n });\n\n it(\"works with mixed namespaces\", () => {\n const underlying = {\n \"foo\": \"hi mom\",\n\n [ObjectDefRef]: {\n [InterfaceDefinitions]: {},\n apiName: \"Obj\",\n displayName: \"\",\n interfaceMap: {\n \"a.IFoo\": {\n \"b.asdf\": \"foo\",\n },\n },\n inverseInterfaceMap: {},\n links: {},\n pluralDisplayName: \"\",\n primaryKeyApiName: \"\",\n primaryKeyType: \"string\",\n properties: {\n \"foo\": {\n type: \"string\",\n },\n },\n type: \"object\",\n titleProperty: \"foo\",\n rid: \"\",\n status: \"ACTIVE\",\n icon: undefined,\n visibility: undefined,\n description: undefined,\n } satisfies FetchedObjectTypeDefinition,\n };\n\n const iface = createOsdkInterface(underlying as any, {\n \"apiName\": \"a.IFoo\",\n displayName: \"\",\n links: {},\n properties: {\n \"b.asdf\": {\n type: \"string\",\n },\n },\n rid: \"\",\n type: \"interface\",\n implements: [],\n description: undefined,\n });\n\n expect(Object.keys(iface)).toMatchInlineSnapshot(`\n [\n \"$apiName\",\n \"b.asdf\",\n ]\n `);\n\n expect((iface as any)[\"b.asdf\"]).toBe(\"hi mom\");\n\n expect(JSON.stringify(iface, undefined, 2)).toMatchInlineSnapshot(`\n \"{\n \"$apiName\": \"a.IFoo\",\n \"b.asdf\": \"hi mom\"\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,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAEEC,oBAAoB,QACf,oCAAoC;AAC3C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,YAAY,QAAQ,sBAAsB;AAEnDL,QAAQ,CAACI,mBAAmB,EAAE,MAAM;EAClCF,EAAE,CAAC,0BAA0B,EAAE,MAAM;IACnC,MAAMI,UAAU,GAAG;MACjB,KAAK,EAAE,QAAQ;MAEf,CAACD,YAAY,GAAG;QACd,CAACF,oBAAoB,GAAG,CAAC,CAAC;QAC1BI,OAAO,EAAE,KAAK;QACdC,WAAW,EAAE,EAAE;QACfC,YAAY,EAAE;UACZ,MAAM,EAAE;YACN,MAAM,EAAE;UACV;QACF,CAAC;QACDC,mBAAmB,EAAE,CAAC,CAAC;QACvBC,KAAK,EAAE,CAAC,CAAC;QACTC,iBAAiB,EAAE,EAAE;QACrBC,iBAAiB,EAAE,EAAE;QACrBC,cAAc,EAAE,QAAQ;QACxBC,UAAU,EAAE;UACV,KAAK,EAAE;YACLC,IAAI,EAAE;UACR;QACF,CAAC;QACDA,IAAI,EAAE,QAAQ;QACdC,aAAa,EAAE,KAAK;QACpBC,GAAG,EAAE,EAAE;QACPC,MAAM,EAAE,QAAQ;QAChBC,IAAI,EAAEC,SAAS;QACfC,UAAU,EAAED,SAAS;QACrBE,WAAW,EAAEF;MACf;IACF,CAAC;IAED,MAAMG,KAAK,GAAGpB,mBAAmB,CAACE,UAAU,EAAS;MACnD,SAAS,EAAE,MAAM;MACjBE,WAAW,EAAE,EAAE;MACfG,KAAK,EAAE,CAAC,CAAC;M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QACPC,MAAM,EAAE,QAAQ;QAChBC,IAAI,EAAEC,SAAS;QACfC,UAAU,EAAED,SAAS;QACrBE,WAAW,EAAEF;MACf;IACF,CAAC;IAED,MAAMG,KAAK,GAAGpB,mBAAmB,CAACE,UAAU,EAAS;MACnD,SAAS,EAAE,QAAQ;MACnBE,WAAW,EAAE,EAAE;MACfG,KAAK,EAAE,CAAC,CAAC;MACTI,UAAU,EAAE;QACV,QAAQ,EAAE;UACRC,IAAI,EAAE;QACR;MACF,CAAC;MACDE,GAAG,EAAE,EAAE;MACPF,IAAI,EAAE,WAAW;MACjBS,UAAU,EAAE,EAAE;MACdF,WAAW,EAAEF;IACf,CAAC,CAAC;IAEFpB,MAAM,CAACyB,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAAC,CAACI,qBAAqB,CAAC;AACrD;AACA;AACA;AACA;AACA,KAAK,CAAC;IAEF3B,MAAM,CAAEuB,KAAK,CAAS,QAAQ,CAAC,CAAC,CAACM,IAAI,CAAC,QAAQ,CAAC;IAE/C7B,MAAM,CAAC8B,IAAI,CAACC,SAAS,CAACR,KAAK,EAAEH,SAAS,EAAE,CAAC,CAAC,CAAC,CAACO,qBAAqB,CAAC;AACtE;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -343,7 +343,8 @@ describe.each(["https://stack.palantir.com", "https://stack.palantirCustom.com/f
343
343
  },
344
344
  rid: "",
345
345
  type: "interface",
346
- implements: []
346
+ implements: [],
347
+ description: undefined
347
348
  };
348
349
  const fooInterfaceOsdkDef = {
349
350
  apiName: "FooInterface",
@@ -383,7 +384,10 @@ describe.each(["https://stack.palantir.com", "https://stack.palantirCustom.com/f
383
384
  status: "ACTIVE",
384
385
  displayName: "",
385
386
  links: {},
386
- rid: ""
387
+ rid: "",
388
+ icon: undefined,
389
+ visibility: undefined,
390
+ description: undefined
387
391
  };
388
392
  it("Correctly updates the interface and underlying object", () => {
389
393
  const employeeOsdkObject = createOsdkObject(client[additionalContext], EmployeeFetchedMetadata, {