@osdk/client 0.8.0 → 0.10.0

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.
Files changed (79) hide show
  1. package/build/js/{chunk-V77HHGVZ.cjs → chunk-MVO52VHK.cjs} +82 -28
  2. package/build/js/chunk-MVO52VHK.cjs.map +1 -0
  3. package/build/js/{chunk-TJNTUGSE.mjs → chunk-XI2O777X.mjs} +83 -29
  4. package/build/js/chunk-XI2O777X.mjs.map +1 -0
  5. package/build/js/index.cjs +33 -15
  6. package/build/js/index.cjs.map +1 -1
  7. package/build/js/index.mjs +29 -11
  8. package/build/js/index.mjs.map +1 -1
  9. package/build/js/public/objects.cjs +3 -3
  10. package/build/js/public/objects.mjs +1 -1
  11. package/build/types/Client.d.ts +3 -3
  12. package/build/types/ObjectSetCreator.d.ts +3 -3
  13. package/build/types/OsdkObject.d.ts +1 -1
  14. package/build/types/OsdkObjectFrom.d.ts +18 -23
  15. package/build/types/actions/Actions.d.ts +17 -13
  16. package/build/types/actions/applyAction.d.ts +3 -10
  17. package/build/types/actions/createActionInvoker.d.ts +2 -1
  18. package/build/types/definitions/LinkDefinitions.d.ts +12 -13
  19. package/build/types/generatedNoCheck/Ontology.d.ts +13 -477
  20. package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +22 -10
  21. package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +23 -13
  22. package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +40 -28
  23. package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +46 -34
  24. package/build/types/generatedNoCheck/ontology/actions/index.d.ts +7 -7
  25. package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +40 -28
  26. package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +32 -20
  27. package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +33 -23
  28. package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +20 -25
  29. package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +10 -7
  30. package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +16 -15
  31. package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +10 -7
  32. package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +38 -35
  33. package/build/types/index.d.ts +3 -1
  34. package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -1
  35. package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -2
  36. package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -2
  37. package/build/types/object/aggregateOrThrow.d.ts +3 -2
  38. package/build/types/object/fetchPageOrThrow.d.ts +10 -4
  39. package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +3 -2
  40. package/build/types/object/getLinkedObjectOrThrow.d.ts +5 -2
  41. package/build/types/object/pageLinkedObjectsOrThrow.d.ts +4 -6
  42. package/build/types/objectSet/LinkTypesFrom.d.ts +2 -2
  43. package/build/types/objectSet/ObjectSet.d.ts +13 -11
  44. package/build/types/objectSet/ObjectSet.test.d.ts +1 -0
  45. package/build/types/objectSet/ObjectSetListener.d.ts +7 -7
  46. package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +2 -2
  47. package/build/types/objectSet/createObjectSet.d.ts +2 -2
  48. package/build/types/query/WhereClause.d.ts +12 -5
  49. package/build/types/query/aggregations/AggregatableKeys.d.ts +3 -3
  50. package/build/types/query/aggregations/AggregateOpts.d.ts +4 -4
  51. package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +5 -6
  52. package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +5 -5
  53. package/build/types/query/aggregations/AggregationsClause.d.ts +5 -5
  54. package/build/types/query/aggregations/AggregationsClause.test.d.ts +4 -2
  55. package/build/types/query/aggregations/AggregationsResults.d.ts +2 -2
  56. package/build/types/query/aggregations/GroupByClause.d.ts +4 -4
  57. package/build/types/query/aggregations/GroupByClause.test.d.ts +2 -1
  58. package/build/types/util/test/mockOntology.d.ts +50 -48
  59. package/changelog/0.10.0/pr-74.v2.yml +5 -0
  60. package/changelog/0.10.0/pr-78.v2.yml +5 -0
  61. package/changelog/0.10.0/pr-79.v2.yml +5 -0
  62. package/changelog/0.6.0/pr-9.v2.yml +5 -0
  63. package/changelog/0.7.0/pr-20.v2.yml +5 -0
  64. package/changelog/0.7.0/pr-24.v2.yml +5 -0
  65. package/changelog/0.7.0/pr-28.v2.yml +5 -0
  66. package/changelog/0.8.0/pr-30.v2.yml +5 -0
  67. package/changelog/0.9.0/pr-43.v2.yml +5 -0
  68. package/changelog/0.9.0/pr-45.v2.yml +5 -0
  69. package/changelog/0.9.0/pr-48.v2.yml +5 -0
  70. package/changelog/0.9.0/pr-59.v2.yml +5 -0
  71. package/changelog/0.9.0/pr-65.v2.yml +5 -0
  72. package/changelog/0.9.0/pr-72.v2.yml +5 -0
  73. package/changelog/0.9.0/pr-75.v2.yml +5 -0
  74. package/changelog/@unreleased/.gitkeep +0 -0
  75. package/package.json +11 -6
  76. package/build/js/chunk-TJNTUGSE.mjs.map +0 -1
  77. package/build/js/chunk-V77HHGVZ.cjs.map +0 -1
  78. package/build/types/object/followLinkOrThrow.d.ts +0 -5
  79. /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
@@ -1,3 +1,49 @@
1
+ import type { ObjectTypeDefinition, ObjectTypeLinkDefinition } from "@osdk/api";
2
+ interface TaskDef extends ObjectTypeDefinition<"Task"> {
3
+ type: "object";
4
+ apiName: "Task";
5
+ primaryKeyType: "integer";
6
+ properties: {
7
+ id: {
8
+ type: "integer";
9
+ };
10
+ name: {
11
+ type: "string";
12
+ };
13
+ };
14
+ links: {
15
+ "Todos": ObjectTypeLinkDefinition<TodoDef, true>;
16
+ "RP": ObjectTypeLinkDefinition<PersonDef, false>;
17
+ };
18
+ }
19
+ interface TodoDef extends ObjectTypeDefinition<"Todo"> {
20
+ type: "object";
21
+ apiName: "Todo";
22
+ primaryKeyType: "integer";
23
+ properties: {
24
+ id: {
25
+ type: "integer";
26
+ };
27
+ text: {
28
+ type: "string";
29
+ };
30
+ };
31
+ links: {};
32
+ }
33
+ interface PersonDef extends ObjectTypeDefinition<"Person"> {
34
+ type: "object";
35
+ apiName: "Person";
36
+ primaryKeyType: "integer";
37
+ properties: {
38
+ id: {
39
+ type: "integer";
40
+ };
41
+ name: {
42
+ type: "string";
43
+ };
44
+ };
45
+ links: {};
46
+ }
1
47
  export declare const MockOntology: {
2
48
  metadata: {
3
49
  ontologyRid: string;
@@ -5,55 +51,11 @@ export declare const MockOntology: {
5
51
  userAgent: string;
6
52
  };
7
53
  objects: {
8
- Task: {
9
- apiName: "Task";
10
- primaryKeyType: "integer";
11
- properties: {
12
- id: {
13
- type: "integer";
14
- };
15
- name: {
16
- type: "string";
17
- };
18
- };
19
- links: {
20
- Todos: {
21
- targetType: "Todo";
22
- multiplicity: true;
23
- };
24
- RP: {
25
- targetType: "Person";
26
- multiplicity: false;
27
- };
28
- };
29
- };
30
- Todo: {
31
- apiName: "Todo";
32
- primaryKeyType: "integer";
33
- properties: {
34
- id: {
35
- type: "integer";
36
- };
37
- text: {
38
- type: "string";
39
- };
40
- };
41
- links: {};
42
- };
43
- Person: {
44
- apiName: "Person";
45
- primaryKeyType: "integer";
46
- properties: {
47
- id: {
48
- type: "integer";
49
- };
50
- name: {
51
- type: "string";
52
- };
53
- };
54
- links: {};
55
- };
54
+ Task: TaskDef;
55
+ Todo: TodoDef;
56
+ Person: PersonDef;
56
57
  };
57
58
  actions: {};
58
59
  queries: {};
59
60
  };
61
+ export {};
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Dont fetch rid by default
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/74
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Add orderBy syntax to fetchPageOrThrow
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/78
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Minor aggregation syntax changes
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/79
@@ -0,0 +1,5 @@
1
+ type: feature
2
+ feature:
3
+ description: Add actions support to v2 client
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/9
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Send consistent UserAgent strings
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/20
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Remove __name shim from v2 objects
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/24
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Don't throw errors when converting wire objects with unknown api names
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/28
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Adds geopoint $within where clauses
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/30
@@ -0,0 +1,5 @@
1
+ type: fix
2
+ fix:
3
+ description: Fix intellisense for aggregations and fill in more number types
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/43
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Force dollar sign in osdk verbs for where (break)
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/45
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Prep for new client syntax
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/48
@@ -0,0 +1,5 @@
1
+ type: feature
2
+ feature:
3
+ description: Add $intersects for where clause
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/59
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Prep for actions
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/65
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Add intersect, subtract, union ObjectSet operations
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/72
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Use object set in aggregations
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/75
File without changes
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/palantir/osdk-ts.git"
10
+ },
7
11
  "exports": {
8
12
  ".": {
9
13
  "types": "./build/types/index.d.ts",
@@ -22,16 +26,16 @@
22
26
  "isomorphic-ws": "^5.0.0",
23
27
  "tiny-invariant": "^1.3.1",
24
28
  "ws": "^8.14.2",
25
- "@osdk/gateway": "1.1.1",
26
- "@osdk/api": "1.1.1",
27
- "@osdk/shared.net": "1.2.0"
29
+ "@osdk/api": "1.2.0",
30
+ "@osdk/shared.net": "1.4.0",
31
+ "@osdk/gateway": "1.2.0"
28
32
  },
29
33
  "devDependencies": {
30
34
  "@types/geojson": "^7946.0.14",
31
35
  "@types/ws": "^8.5.10",
32
36
  "ts-expect": "^1.3.0",
33
37
  "typescript": "^5.2.2",
34
- "@osdk/generator": "1.3.0",
38
+ "@osdk/generator": "1.5.0",
35
39
  "@osdk/shared.test": "1.1.1"
36
40
  },
37
41
  "publishConfig": {
@@ -41,7 +45,8 @@
41
45
  "files": [
42
46
  "build/types",
43
47
  "build/js",
44
- "CHANGELOG.md",
48
+ "changelog",
49
+ "CHANGELOG_OLD.md",
45
50
  "package.json",
46
51
  "templates",
47
52
  "*.d.ts"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/object/aggregateOrThrow.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/query/WhereClause.ts","../../src/object/fetchPageOrThrow.ts","../../src/createCachedOntologyTransform.ts","../../src/object/Attachment.ts","../../src/object/getLinkedObjectByPkOrThrow.ts","../../src/object/getLinkedObjectOrThrow.ts","../../src/object/pageLinkedObjectsOrThrow.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/object/index.ts"],"names":["invariant","createOpenApiRequest"],"mappings":";;;;;;;AAgBA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,OAAOA,gBAAe;;;ACFtB,OAAO,eAAe;AACf,SAAS,sCAAsC,OAAO;AAC3D,SAAO,MAAM,QAAQ,OAAO,CAAC,aAAa,aAAa;AACrD,UAAM,QAAQ,SAAS,KAAK,MAAM,GAAG;AACrC,MAAE,MAAM,UAAU,KAAK,QAAQ,IAAI,aAAa,eAAe,UAAU,OAAO,4CAA4C,IAAI,UAAU,KAAK,IAAI;AACnJ,QAAI,EAAE,MAAM,CAAC,KAAK,cAAc;AAC9B,kBAAY,MAAM,CAAC,CAAC,IAAI,CAAC;AAAA,IAC3B;AACA,gBAAY,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,SAAS;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;;;ACXO,SAAS,gCAAgC,QAAQ;AACtD,SAAO,OAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM;AAChD,QAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,aAAO,EAAE,IAAI,QAAM;AACjB,eAAO;AAAA,UACL,MAAM;AAAA,UACN,MAAM,GAAG,CAAC,IAAI,EAAE;AAAA,UAChB,OAAO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,aAAO,CAAC;AAAA,QACN,MAAM;AAAA;AAAA,QAEN,MAAM,GAAG,CAAC,IAAI,CAAC;AAAA,QACf,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;;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,EACF,IAAI;AACN;AAKO,SAAS,yBAAyB,QAAQ,MAAM;AACrD,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,aAAa,OAAO,UAAU,IAAI,SAAS;AACzD,UAAM,YAAY,aAAa,OAAO,UAAU,IAAI,SAAS;AAC7D,WAAO,eAAe,KAAK,KAAK;AAChC,WAAO,eAAe,KAAK,cAAc;AAAA,MACvC,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,IACZ,CAAC;AACD,QAAI,WAAW;AACb,gBAAU,GAAG;AAAA,IACf;AAAA,EACF;AACF;;;AN1FA,eAAsB,iBAAiB,QAAQ,YAAY,MAAM,YAAY;AAAA,EAC3E,MAAM;AAAA,EACN;AACF,GAAG;AACD,QAAM,OAAO;AAAA,IACX;AAAA;AAAA,IAEA,QAAQ,MAAM,UAAU,CAAC;AAAA;AAAA,EAC3B;AACA,MAAI,MAAM,eAAe;AACvB,SAAK,YAAY,KAAK;AAAA,EACxB;AACA,MAAI,MAAM,YAAY,MAAM;AAC1B,SAAK,WAAW,KAAK;AAAA,EACvB;AACA,QAAM,IAAI,MAAM,gBAAgBA,sBAAqB,OAAO,OAAO,OAAO,KAAK,GAAG,OAAO,SAAS,SAAS,iBAAiB,IAAI;AAChI,2BAAyB,QAAQ,EAAE,IAAI;AAIvC,SAAO;AACT;;;AOxCA;AAAA;AAAA;AAAA;AAAA","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 { aggregateObjectsV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult, modernToLegacyAggregationClause, modernToLegacyGroupByClause, modernToLegacyWhereClause } from \"../internal/conversions/index.js\";\nexport async function aggregateOrThrow(clientCtx, objectType, req) {\n const body = {\n aggregation: modernToLegacyAggregationClause(req.select),\n groupBy: [],\n where: undefined\n };\n if (req.groupBy) {\n body.groupBy = modernToLegacyGroupByClause(req.groupBy);\n }\n if (req.where) {\n body.where = modernToLegacyWhereClause(req.where);\n // TODO: orderBy\n // TODO The token stuff here sucks\n }\n const result = await aggregateObjectsV2(createOpenApiRequest(clientCtx.stack, clientCtx.fetch), clientCtx.ontology.metadata.ontologyApiName, objectType, body);\n if (!req.groupBy) {\n !(result.data.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"no group by clause should mean only one data result\") : invariant(false) : void 0;\n return legacyToModernSingleAggregationResult(result.data[0]);\n }\n const ret = result.data.map(entry => {\n return {\n group: entry.group,\n values: legacyToModernSingleAggregationResult(entry)\n };\n }); // fixme\n\n return ret; // FIXME\n}","/*\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 invariant from \"tiny-invariant\";\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n !(parts.length == 2) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"assumed we were getting a `${key}.${type}`\") : invariant(false) : void 0;\n if (!(parts[0] in accumulator)) {\n accumulator[parts[0]] = {};\n }\n accumulator[parts[0]][parts[1]] = curValue.value;\n return accumulator;\n }, {});\n}","/*\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\nexport function modernToLegacyAggregationClause(select) {\n return Object.entries(select).flatMap(([k, v]) => {\n if (Array.isArray(v)) {\n return v.map(v2 => {\n return {\n type: v2,\n name: `${k}.${v2}`,\n field: k\n };\n });\n } else {\n return [{\n type: v,\n // FIXME v has additional possible values\n name: `${k}.${v}`,\n field: k\n }];\n }\n });\n}","/*\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\nexport function modernToLegacyGroupByClause(groupByClause) {\n if (!groupByClause) return [];\n return Object.entries(groupByClause).flatMap(([field, type]) => {\n if (type === \"exact\") {\n return [{\n type,\n field\n }];\n } else if (type.exactWithLimit) {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.exactWithLimit\n }];\n } else {\n return [];\n }\n });\n}","/*\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 invariant from \"tiny-invariant\";\nimport { DistanceUnitMapping } from \"../../query/WhereClause.js\";\nexport function modernToLegacyWhereClause(whereClause) {\n if (\"$and\" in whereClause) {\n return {\n type: \"and\",\n value: whereClause.$and.map(modernToLegacyWhereClause)\n };\n } else if (\"$or\" in whereClause) {\n return {\n type: \"or\",\n value: whereClause.$or.map(modernToLegacyWhereClause)\n };\n } else if (\"$not\" in whereClause) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(whereClause.$not)\n };\n }\n const parts = Object.entries(whereClause);\n if (parts.length === 1) {\n return handleWherePair(parts[0]);\n }\n return {\n type: \"and\",\n value: parts.map(handleWherePair)\n };\n}\nfunction makeWithinBbox(field, bbox) {\n return {\n type: \"withinBoundingBox\",\n field,\n value: {\n topLeft: {\n type: \"Point\",\n coordinates: [bbox[0], bbox[3]]\n },\n bottomRight: {\n type: \"Point\",\n coordinates: [bbox[2], bbox[1]]\n }\n }\n };\n}\nfunction handleWherePair([field, filter]) {\n !(filter != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Defined key values are only allowed when they are not undefined.\") : invariant(false) : void 0;\n if (typeof filter === \"string\" || typeof filter === \"number\") {\n return {\n type: \"eq\",\n field,\n value: filter\n };\n }\n !(Object.keys(filter).length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"WhereClause Filter with multiple properties isn't allowed\") : invariant(false) : void 0;\n const firstKey = Object.keys(filter)[0];\n !(filter[firstKey] != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n if (firstKey === \"ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n field,\n value: filter[firstKey]\n }\n };\n }\n if (firstKey === \"$within\") {\n const withinBody = filter[firstKey];\n if (Array.isArray(withinBody)) {\n return makeWithinBbox(field, withinBody);\n } else if (\"bbox\" in withinBody && !(\"type\" in withinBody)) {\n return makeWithinBbox(field, withinBody.bbox);\n } else if (\"distance\" in withinBody && \"of\" in withinBody) {\n return {\n type: \"withinDistanceOf\",\n field,\n value: {\n center: Array.isArray(withinBody.of) ? {\n type: \"Point\",\n coordinates: withinBody.of\n } : withinBody.of,\n distance: {\n value: withinBody.distance[0],\n unit: DistanceUnitMapping[withinBody.distance[1]]\n }\n }\n };\n } else {\n const coordinates = \"polygon\" in withinBody ? withinBody.polygon : withinBody.coordinates;\n return {\n type: \"withinPolygon\",\n field,\n value: {\n type: \"Polygon\",\n coordinates\n }\n };\n }\n }\n return {\n type: firstKey,\n field,\n value: filter[firstKey]\n };\n}","/*\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\n// We need to conditional here to force the union to be distributed\n\nexport const DistanceUnitMapping = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\"\n};\n\n// FIXME we need to represent all types","/*\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 { loadObjectSetV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function fetchPageOrThrow(client, objectType, args, objectSet = {\n type: \"base\",\n objectType\n}) {\n const body = {\n objectSet,\n // We have to do the following case because LoadObjectSetRequestV2 isnt readonly\n select: args?.select ?? [] // FIXME?\n };\n if (args?.nextPageToken) {\n body.pageToken = args.nextPageToken;\n }\n if (args?.pageSize != null) {\n body.pageSize = args.pageSize;\n }\n const r = await loadObjectSetV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, body);\n convertWireToOsdkObjects(client, r.data);\n\n // any is okay here because we have properly converted the wire objects via prototypes\n // which don't type out correctly.\n return r;\n}","/*\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\n/**\n * Creates a getter function that caches based on the ontology.objects[type] value\n *\n * Any extra arguments are passed through, but only the first args passed in will be used and are not considered as part of the caching\n */\nexport function createCachedOntologyTransform(creator) {\n // We can use the ObjectTypeDefinition as the key because it will be a globally unique singleton\n // Use Map instead of WeakMap here so usage for things like object prototypes do not churn over time\n const cache = new Map();\n return (ontology, type) => {\n const objectDefinition = ontology.objects[type];\n let result = cache.get(objectDefinition);\n if (result == null) {\n result = creator(ontology, type);\n cache.set(objectDefinition, result);\n }\n return result;\n };\n}","/*\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\nexport class Attachment {\n constructor(rid) {\n this.rid = rid;\n }\n}\nexport function isAttachment(o) {\n return o instanceof Attachment;\n}","/*\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 { getLinkedObjectV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function getLinkedObjectByPkOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, linkedObjectPrimaryKey, select) {\n const object = await getLinkedObjectV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, sourceApiName, primaryKey, linkTypeApiName, linkedObjectPrimaryKey, {\n select: select ?? []\n });\n const objects = [object];\n convertWireToOsdkObjects(client, objects);\n return objects[0];\n}","/*\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 { PalantirApiError } from \"@osdk/shared.net\";\nimport { pageLinkedObjectsOrThrow } from \"./pageLinkedObjectsOrThrow.js\";\nexport async function getLinkedObjectOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, select) {\n const result = await pageLinkedObjectsOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, {\n pageSize: 1,\n select\n });\n if (result.data.length !== 1 || result.nextPageToken != null) {\n throw new PalantirApiError(`Expected a single result but got ${result.data.length} instead${result.nextPageToken != null ? \" with nextPageToken set\" : \"\"}`);\n }\n return result.data[0];\n}","/*\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 { listLinkedObjectsV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function pageLinkedObjectsOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, options) {\n const page = await listLinkedObjectsV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, sourceApiName, primaryKey, linkTypeApiName, {\n pageSize: options?.pageSize,\n pageToken: options?.nextPageToken,\n select: options?.select ?? []\n });\n convertWireToOsdkObjects(client, page.data);\n return {\n nextPageToken: page.nextPageToken,\n data: page.data\n };\n}","/*\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 { createCachedOntologyTransform } from \"../createCachedOntologyTransform.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { getLinkedObjectByPkOrThrow } from \"./getLinkedObjectByPkOrThrow.js\";\nimport { getLinkedObjectOrThrow } from \"./getLinkedObjectOrThrow.js\";\nimport { pageLinkedObjectsOrThrow } from \"./pageLinkedObjectsOrThrow.js\";\nconst getPrototype = createCachedOntologyTransform(createPrototype);\nconst getConverter = createCachedOntologyTransform(createConverter);\nconst OriginClient = Symbol();\nfunction createPrototype(ontology, type) {\n const objDef = ontology.objects[type];\n const proto = {};\n if (!objDef) {\n return proto;\n }\n Object.defineProperty(proto, \"$link\", {\n get: function () {\n const client = this[OriginClient];\n const primaryKey = this[\"__primaryKey\"];\n return new Proxy({}, {\n get(_target, p, _receiver) {\n const linkDef = objDef.links[p];\n if (linkDef == null) {\n return;\n }\n if (!linkDef.multiplicity) {\n return {\n get: options => getLinkedObjectOrThrow(client, type, primaryKey, p, options?.select)\n };\n } else {\n return {\n get: (targetPrimaryKey, options) => getLinkedObjectByPkOrThrow(client, type, primaryKey, p, targetPrimaryKey, options?.select),\n fetchPageOrThrow: options => pageLinkedObjectsOrThrow(client, type, primaryKey, p, {\n nextPageToken: options?.nextPageToken,\n pageSize: options?.pageSize,\n select: options?.select\n })\n };\n }\n }\n });\n },\n enumerable: false,\n configurable: false\n });\n return proto;\n}\n\n// preprocess the ontology definition to more quickly apply object conversions when needed\nfunction createConverter(ontology, type) {\n const objDef = ontology.objects[type];\n if (!objDef) {\n return false;\n }\n const steps = [];\n for (const [key, value] of Object.entries(objDef.properties)) {\n // attachments need a wrapper to provide functionality and to identify them at serialization time\n if (value.type === \"attachment\") {\n steps.push(o => {\n if (o[key] != null) {\n if (Array.isArray(o[key])) {\n o[key] = o[key].map(a => new Attachment(a.rid));\n } else {\n o[key] = new Attachment(o[key].rid);\n }\n }\n });\n }\n }\n return steps.length > 0 ? o => {\n for (const step of steps) {\n step(o);\n }\n } : false;\n}\n\n/**\n * @param objs the objects to be converted, the contents of this array will be mutated\n */\nexport function convertWireToOsdkObjects(client, objs) {\n for (const obj of objs) {\n const proto = getPrototype(client.ontology, obj.__apiName);\n const converter = getConverter(client.ontology, obj.__apiName);\n Object.setPrototypeOf(obj, proto);\n Object.defineProperty(obj, OriginClient, {\n value: client,\n enumerable: false,\n configurable: false,\n writable: false\n });\n if (converter) {\n converter(obj);\n }\n }\n}","/*\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\nexport { aggregateOrThrow } from \"./aggregateOrThrow.js\";\nexport { fetchPageOrThrow } from \"./fetchPageOrThrow.js\";"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/object/aggregateOrThrow.ts","../../src/internal/conversions/legacyToModernSingleAggregationResult.ts","../../src/internal/conversions/modernToLegacyAggregationClause.ts","../../src/internal/conversions/modernToLegacyGroupByClause.ts","../../src/internal/conversions/modernToLegacyWhereClause.ts","../../src/query/WhereClause.ts","../../src/object/fetchPageOrThrow.ts","../../src/createCachedOntologyTransform.ts","../../src/object/Attachment.ts","../../src/object/getLinkedObjectByPkOrThrow.ts","../../src/object/getLinkedObjectOrThrow.ts","../../src/object/pageLinkedObjectsOrThrow.ts","../../src/object/convertWireToOsdkObjects.ts","../../src/object/index.ts"],"names":["invariant","createOpenApiRequest"],"mappings":";;;;;;;AAgBA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC,OAAOA,gBAAe;;;ACFtB,OAAO,eAAe;AACf,SAAS,sCAAsC,OAAO;AAC3D,SAAO,MAAM,QAAQ,OAAO,CAAC,aAAa,aAAa;AACrD,UAAM,QAAQ,SAAS,KAAK,MAAM,GAAG;AACrC,MAAE,MAAM,UAAU,KAAK,QAAQ,IAAI,aAAa,eAAe,UAAU,OAAO,4CAA4C,IAAI,UAAU,KAAK,IAAI;AACnJ,QAAI,EAAE,MAAM,CAAC,KAAK,cAAc;AAC9B,kBAAY,MAAM,CAAC,CAAC,IAAI,CAAC;AAAA,IAC3B;AACA,gBAAY,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,SAAS;AAC3C,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;;;ACXO,SAAS,gCAAgC,QAAQ;AACtD,SAAO,OAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM;AAChD,QAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,aAAO,EAAE,IAAI,QAAM;AACjB,eAAO;AAAA,UACL,MAAM;AAAA,UACN,MAAM,GAAG,CAAC,IAAI,EAAE;AAAA,UAChB,OAAO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH,OAAO;AACL,aAAO,CAAC;AAAA,QACN,MAAM;AAAA;AAAA,QAEN,MAAM,GAAG,CAAC,IAA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AS,IAAI,OAAK;AAC7B,eAAW,QAAQ,OAAO;AACxB,WAAK,CAAC;AAAA,IACR;AAAA,EACF,IAAI;AACN;AAKO,SAAS,yBAAyB,QAAQ,MAAM;AACrD,aAAW,OAAO,MAAM;AACtB,UAAM,QAAQ,aAAa,OAAO,UAAU,IAAI,SAAS;AACzD,UAAM,YAAY,aAAa,OAAO,UAAU,IAAI,SAAS;AAC7D,WAAO,eAAe,KAAK,KAAK;AAChC,WAAO,eAAe,KAAK,cAAc;AAAA,MACvC,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,cAAc;AAAA,MACd,UAAU;AAAA,IACZ,CAAC;AACD,QAAI,WAAW;AACb,gBAAU,GAAG;AAAA,IACf;AAAA,EACF;AACF;;;AN1FA,eAAsB,iBAAiB,QAAQ,YAAY,MAAM,YAAY;AAAA,EAC3E,MAAM;AAAA,EACN;AACF,GAAG;AACD,QAAM,OAAO;AAAA,IACX;AAAA;AAAA,IAEA,QAAQ,MAAM,UAAU,CAAC;AAAA;AAAA,EAC3B;AACA,MAAI,MAAM,eAAe;AACvB,SAAK,YAAY,KAAK;AAAA,EACxB;AACA,MAAI,MAAM,YAAY,MAAM;AAC1B,SAAK,WAAW,KAAK;AAAA,EACvB;AACA,QAAM,IAAI,MAAM,gBAAgBA,sBAAqB,OAAO,OAAO,OAAO,KAAK,GAAG,OAAO,SAAS,SAAS,iBAAiB,IAAI;AAChI,2BAAyB,QAAQ,EAAE,IAAI;AAIvC,SAAO;AACT;;;AOxCA;AAAA;AAAA;AAAA;AAAA","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 { aggregateObjectsV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport invariant from \"tiny-invariant\";\nimport { legacyToModernSingleAggregationResult, modernToLegacyAggregationClause, modernToLegacyGroupByClause, modernToLegacyWhereClause } from \"../internal/conversions/index.js\";\nexport async function aggregateOrThrow(clientCtx, objectType, req) {\n const body = {\n aggregation: modernToLegacyAggregationClause(req.select),\n groupBy: [],\n where: undefined\n };\n if (req.groupBy) {\n body.groupBy = modernToLegacyGroupByClause(req.groupBy);\n }\n if (req.where) {\n body.where = modernToLegacyWhereClause(req.where);\n // TODO: orderBy\n // TODO The token stuff here sucks\n }\n const result = await aggregateObjectsV2(createOpenApiRequest(clientCtx.stack, clientCtx.fetch), clientCtx.ontology.metadata.ontologyApiName, objectType, body);\n if (!req.groupBy) {\n !(result.data.length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"no group by clause should mean only one data result\") : invariant(false) : void 0;\n return legacyToModernSingleAggregationResult(result.data[0]);\n }\n const ret = result.data.map(entry => {\n return {\n group: entry.group,\n values: legacyToModernSingleAggregationResult(entry)\n };\n }); // fixme\n\n return ret; // FIXME\n}","/*\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 invariant from \"tiny-invariant\";\nexport function legacyToModernSingleAggregationResult(entry) {\n return entry.metrics.reduce((accumulator, curValue) => {\n const parts = curValue.name.split(\".\");\n !(parts.length == 2) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"assumed we were getting a `${key}.${type}`\") : invariant(false) : void 0;\n if (!(parts[0] in accumulator)) {\n accumulator[parts[0]] = {};\n }\n accumulator[parts[0]][parts[1]] = curValue.value;\n return accumulator;\n }, {});\n}","/*\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\nexport function modernToLegacyAggregationClause(select) {\n return Object.entries(select).flatMap(([k, v]) => {\n if (Array.isArray(v)) {\n return v.map(v2 => {\n return {\n type: v2,\n name: `${k}.${v2}`,\n field: k\n };\n });\n } else {\n return [{\n type: v,\n // FIXME v has additional possible values\n name: `${k}.${v}`,\n field: k\n }];\n }\n });\n}","/*\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\nexport function modernToLegacyGroupByClause(groupByClause) {\n if (!groupByClause) return [];\n return Object.entries(groupByClause).flatMap(([field, type]) => {\n if (type === \"exact\") {\n return [{\n type,\n field\n }];\n } else if (type.exactWithLimit) {\n return [{\n type: \"exact\",\n field,\n maxGroupCount: type.exactWithLimit\n }];\n } else {\n return [];\n }\n });\n}","/*\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 invariant from \"tiny-invariant\";\nimport { DistanceUnitMapping } from \"../../query/WhereClause.js\";\nexport function modernToLegacyWhereClause(whereClause) {\n if (\"$and\" in whereClause) {\n return {\n type: \"and\",\n value: whereClause.$and.map(modernToLegacyWhereClause)\n };\n } else if (\"$or\" in whereClause) {\n return {\n type: \"or\",\n value: whereClause.$or.map(modernToLegacyWhereClause)\n };\n } else if (\"$not\" in whereClause) {\n return {\n type: \"not\",\n value: modernToLegacyWhereClause(whereClause.$not)\n };\n }\n const parts = Object.entries(whereClause);\n if (parts.length === 1) {\n return handleWherePair(parts[0]);\n }\n return {\n type: \"and\",\n value: parts.map(handleWherePair)\n };\n}\nfunction makeWithinBbox(field, bbox) {\n return {\n type: \"withinBoundingBox\",\n field,\n value: {\n topLeft: {\n type: \"Point\",\n coordinates: [bbox[0], bbox[3]]\n },\n bottomRight: {\n type: \"Point\",\n coordinates: [bbox[2], bbox[1]]\n }\n }\n };\n}\nfunction handleWherePair([field, filter]) {\n !(filter != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Defined key values are only allowed when they are not undefined.\") : invariant(false) : void 0;\n if (typeof filter === \"string\" || typeof filter === \"number\") {\n return {\n type: \"eq\",\n field,\n value: filter\n };\n }\n !(Object.keys(filter).length === 1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"WhereClause Filter with multiple properties isn't allowed\") : invariant(false) : void 0;\n const firstKey = Object.keys(filter)[0];\n !(filter[firstKey] != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n if (firstKey === \"ne\") {\n return {\n type: \"not\",\n value: {\n type: \"eq\",\n field,\n value: filter[firstKey]\n }\n };\n }\n if (firstKey === \"$within\") {\n const withinBody = filter[firstKey];\n if (Array.isArray(withinBody)) {\n return makeWithinBbox(field, withinBody);\n } else if (\"bbox\" in withinBody && !(\"type\" in withinBody)) {\n return makeWithinBbox(field, withinBody.bbox);\n } else if (\"distance\" in withinBody && \"of\" in withinBody) {\n return {\n type: \"withinDistanceOf\",\n field,\n value: {\n center: Array.isArray(withinBody.of) ? {\n type: \"Point\",\n coordinates: withinBody.of\n } : withinBody.of,\n distance: {\n value: withinBody.distance[0],\n unit: DistanceUnitMapping[withinBody.distance[1]]\n }\n }\n };\n } else {\n const coordinates = \"polygon\" in withinBody ? withinBody.polygon : withinBody.coordinates;\n return {\n type: \"withinPolygon\",\n field,\n value: {\n type: \"Polygon\",\n coordinates\n }\n };\n }\n }\n return {\n type: firstKey,\n field,\n value: filter[firstKey]\n };\n}","/*\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\n// We need to conditional here to force the union to be distributed\n\nexport const DistanceUnitMapping = {\n \"centimeter\": \"CENTIMETERS\",\n \"centimeters\": \"CENTIMETERS\",\n \"cm\": \"CENTIMETERS\",\n \"meter\": \"METERS\",\n \"meters\": \"METERS\",\n \"m\": \"METERS\",\n \"kilometer\": \"KILOMETERS\",\n \"kilometers\": \"KILOMETERS\",\n \"km\": \"KILOMETERS\",\n \"inch\": \"INCHES\",\n \"inches\": \"INCHES\",\n \"foot\": \"FEET\",\n \"feet\": \"FEET\",\n \"yard\": \"YARDS\",\n \"yards\": \"YARDS\",\n \"mile\": \"MILES\",\n \"miles\": \"MILES\",\n \"nautical_mile\": \"NAUTICAL_MILES\",\n \"nauticalMile\": \"NAUTICAL_MILES\",\n \"nautical miles\": \"NAUTICAL_MILES\"\n};\n\n// FIXME we need to represent all types","/*\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 { loadObjectSetV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function fetchPageOrThrow(client, objectType, args, objectSet = {\n type: \"base\",\n objectType\n}) {\n const body = {\n objectSet,\n // We have to do the following case because LoadObjectSetRequestV2 isnt readonly\n select: args?.select ?? [] // FIXME?\n };\n if (args?.nextPageToken) {\n body.pageToken = args.nextPageToken;\n }\n if (args?.pageSize != null) {\n body.pageSize = args.pageSize;\n }\n const r = await loadObjectSetV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, body);\n convertWireToOsdkObjects(client, r.data);\n\n // any is okay here because we have properly converted the wire objects via prototypes\n // which don't type out correctly.\n return r;\n}","/*\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\n/**\n * Creates a getter function that caches based on the ontology.objects[type] value\n *\n * Any extra arguments are passed through, but only the first args passed in will be used and are not considered as part of the caching\n */\nexport function createCachedOntologyTransform(creator) {\n // We can use the ObjectTypeDefinition as the key because it will be a globally unique singleton\n // Use Map instead of WeakMap here so usage for things like object prototypes do not churn over time\n const cache = new Map();\n return (ontology, type) => {\n const objectDefinition = ontology.objects[type];\n let result = cache.get(objectDefinition);\n if (result == null) {\n result = creator(ontology, type);\n cache.set(objectDefinition, result);\n }\n return result;\n };\n}","/*\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\nexport class Attachment {\n constructor(rid) {\n this.rid = rid;\n }\n}\nexport function isAttachment(o) {\n return o instanceof Attachment;\n}","/*\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 { getLinkedObjectV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function getLinkedObjectByPkOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, linkedObjectPrimaryKey, select) {\n const object = await getLinkedObjectV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, sourceApiName, primaryKey, linkTypeApiName, linkedObjectPrimaryKey, {\n select: select ?? []\n });\n const objects = [object];\n convertWireToOsdkObjects(client, objects);\n return objects[0];\n}","/*\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 { PalantirApiError } from \"@osdk/shared.net\";\nimport { pageLinkedObjectsOrThrow } from \"./pageLinkedObjectsOrThrow.js\";\nexport async function getLinkedObjectOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, select) {\n const result = await pageLinkedObjectsOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, {\n pageSize: 1,\n select\n });\n if (result.data.length !== 1 || result.nextPageToken != null) {\n throw new PalantirApiError(`Expected a single result but got ${result.data.length} instead${result.nextPageToken != null ? \" with nextPageToken set\" : \"\"}`);\n }\n return result.data[0];\n}","/*\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 { listLinkedObjectsV2 } from \"@osdk/gateway/requests\";\nimport { createOpenApiRequest } from \"@osdk/shared.net\";\nimport { convertWireToOsdkObjects } from \"./convertWireToOsdkObjects.js\";\nexport async function pageLinkedObjectsOrThrow(client, sourceApiName, primaryKey, linkTypeApiName, options) {\n const page = await listLinkedObjectsV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, sourceApiName, primaryKey, linkTypeApiName, {\n pageSize: options?.pageSize,\n pageToken: options?.nextPageToken,\n select: options?.select ?? []\n });\n convertWireToOsdkObjects(client, page.data);\n return {\n nextPageToken: page.nextPageToken,\n data: page.data\n };\n}","/*\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 { createCachedOntologyTransform } from \"../createCachedOntologyTransform.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { getLinkedObjectByPkOrThrow } from \"./getLinkedObjectByPkOrThrow.js\";\nimport { getLinkedObjectOrThrow } from \"./getLinkedObjectOrThrow.js\";\nimport { pageLinkedObjectsOrThrow } from \"./pageLinkedObjectsOrThrow.js\";\nconst getPrototype = createCachedOntologyTransform(createPrototype);\nconst getConverter = createCachedOntologyTransform(createConverter);\nconst OriginClient = Symbol();\nfunction createPrototype(ontology, type) {\n const objDef = ontology.objects[type];\n const proto = {};\n if (!objDef) {\n return proto;\n }\n Object.defineProperty(proto, \"$link\", {\n get: function () {\n const client = this[OriginClient];\n const primaryKey = this[\"__primaryKey\"];\n return new Proxy({}, {\n get(_target, p, _receiver) {\n const linkDef = objDef.links[p];\n if (linkDef == null) {\n return;\n }\n if (!linkDef.multiplicity) {\n return {\n get: options => getLinkedObjectOrThrow(client, type, primaryKey, p, options?.select)\n };\n } else {\n return {\n get: (targetPrimaryKey, options) => getLinkedObjectByPkOrThrow(client, type, primaryKey, p, targetPrimaryKey, options?.select),\n fetchPageOrThrow: options => pageLinkedObjectsOrThrow(client, type, primaryKey, p, {\n nextPageToken: options?.nextPageToken,\n pageSize: options?.pageSize,\n select: options?.select\n })\n };\n }\n }\n });\n },\n enumerable: false,\n configurable: false\n });\n return proto;\n}\n\n// preprocess the ontology definition to more quickly apply object conversions when needed\nfunction createConverter(ontology, type) {\n const objDef = ontology.objects[type];\n if (!objDef) {\n return false;\n }\n const steps = [];\n for (const [key, value] of Object.entries(objDef.properties)) {\n // attachments need a wrapper to provide functionality and to identify them at serialization time\n if (value.type === \"attachment\") {\n steps.push(o => {\n if (o[key] != null) {\n if (Array.isArray(o[key])) {\n o[key] = o[key].map(a => new Attachment(a.rid));\n } else {\n o[key] = new Attachment(o[key].rid);\n }\n }\n });\n }\n }\n return steps.length > 0 ? o => {\n for (const step of steps) {\n step(o);\n }\n } : false;\n}\n\n/**\n * @param objs the objects to be converted, the contents of this array will be mutated\n */\nexport function convertWireToOsdkObjects(client, objs) {\n for (const obj of objs) {\n const proto = getPrototype(client.ontology, obj.__apiName);\n const converter = getConverter(client.ontology, obj.__apiName);\n Object.setPrototypeOf(obj, proto);\n Object.defineProperty(obj, OriginClient, {\n value: client,\n enumerable: false,\n configurable: false,\n writable: false\n });\n if (converter) {\n converter(obj);\n }\n }\n}","/*\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\nexport { aggregateOrThrow } from \"./aggregateOrThrow.js\";\nexport { fetchPageOrThrow } from \"./fetchPageOrThrow.js\";"]}
@@ -1,5 +0,0 @@
1
- import { type ObjectTypeKeysFrom, type ObjectTypeLinkKeysFrom, type ObjectTypeLinkTargetTypeFrom, type OntologyDefinition } from "@osdk/api";
2
- import { type ClientContext } from "@osdk/shared.net";
3
- import type { OsdkObjectFrom } from "../OsdkObjectFrom.js";
4
- import type { PageResult } from "../PageResult.js";
5
- export declare function followLinkOrThrow<O extends OntologyDefinition<any>, K extends ObjectTypeKeysFrom<O>, L extends ObjectTypeLinkKeysFrom<O, K>>(clientCtx: ClientContext<O>, sourceObject: OsdkObjectFrom<K, O>, link: L): Promise<PageResult<OsdkObjectFrom<ObjectTypeLinkTargetTypeFrom<O, K, L>, O>>>;
File without changes