@osdk/client 0.0.9 → 0.0.10

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
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - ed78694: Fixes imports from older module resolution
8
+ - Updated dependencies [ed78694]
9
+ - @osdk/gateway@0.0.10
10
+ - @osdk/api@0.0.17
11
+
3
12
  ## 0.0.9
4
13
 
5
14
  ### Patch Changes
package/build/js/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var chunkAEQM3CTL_js = require('./chunk-AEQM3CTL.js');
4
4
  var api = require('@osdk/api');
5
5
 
6
- var m="searchAround_";function s(r,o,n,c={type:"base",objectType:r}){let i={aggregate:e=>{throw "TODO"},aggregateOrThrow:async e=>chunkAEQM3CTL_js.b(o,r,e),fetchPage:async e=>{throw "TODO"},fetchPageOrThrow:async e=>chunkAEQM3CTL_js.c(o,r,e??{},c),asyncIter:()=>{throw ""},where:e=>s(r,o,n,{type:"filter",objectSet:c,where:chunkAEQM3CTL_js.a(e)}),[Symbol.asyncIterator]:()=>{throw ""},pivotTo:function(e,t){return a(e)().where(t?.$where??{})}};function a(e){return ()=>s(r,o,{},{type:"searchAround",objectSet:c,link:e})}return new Proxy(i,{get(e,t,u){return typeof t=="string"&&t.startsWith(m)?a(t.substring(m.length)):e[t]}})}function w(r){return new Proxy({},{get:(o,n,c)=>{if(typeof n=="string")return r.objectSet(n)}})}function b(r,o,n,c=fetch){let i=api.createThinClient(r,o,n,c),a=(t,u)=>s(t,i,u),e=Object.defineProperties({},{objectSet:{get:()=>a},objects:{get:()=>w(e)}});return e}
6
+ var m="searchAround_";function i(r,o,n,c={type:"base",objectType:r}){let u={aggregateOrThrow:async e=>chunkAEQM3CTL_js.b(o,r,e),fetchPageOrThrow:async e=>chunkAEQM3CTL_js.c(o,r,e??{},c),where:e=>i(r,o,n,{type:"filter",objectSet:c,where:chunkAEQM3CTL_js.a(e)}),pivotTo:function(e,t){return a(e)().where(t?.$where??{})}};function a(e){return ()=>i(r,o,{},{type:"searchAround",objectSet:c,link:e})}return new Proxy(u,{get(e,t,f){return typeof t=="string"&&t.startsWith(m)?a(t.substring(m.length)):e[t]}})}function w(r){return new Proxy({},{get:(o,n,c)=>{if(typeof n=="string")return r.objectSet(n)}})}function b(r,o,n,c=fetch){let u=api.createThinClient(r,o,n,c),a=(t,f)=>i(t,u,f),e=Object.defineProperties({},{objectSet:{get:()=>a},objects:{get:()=>w(e)}});return e}
7
7
 
8
8
  Object.defineProperty(exports, 'Objects', {
9
9
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/createClient.ts","../../src/objectSet/createObjectSet.ts","../../src/ObjectSetCreator.ts"],"names":["createThinClient","searchAroundPrefix","createObjectSet","objectType","thinClient","opts","objectSet","base","req","aggregateOrThrow","args","fetchPageOrThrow","clause","modernToLegacyWhereClause","type","createSearchAround","link","target","p","receiver","createObjectSetCreator","client","createClient","ontology","stack","tokenProvider","fetchFn","objectSetFactory"],"mappings":"6DAgBA,OAAS,oBAAAA,MAAwB,YCEjC,IAAMC,EAAqB,gBACpB,SAASC,EAAgBC,EAAYC,EAAYC,EAAMC,EAAY,CACxE,KAAM,OACN,WAAAH,CACF,EAAG,CACD,IAAMI,EAAO,CACX,UAAWC,GAAO,CAChB,KAAM,MACR,EACA,iBAAkB,MAAMA,GACfC,EAAiBL,EAAYD,EAAYK,CAAG,EAErD,UAAW,MAAME,GAAQ,CACvB,KAAM,MACR,EACA,iBAAkB,MAAMA,GACfC,EAAiBP,EAAYD,EAAYO,GAAQ,CAAC,EAAGJ,CAAS,EAEvE,UAAW,IAAM,CACf,KAAM,EACR,EACA,MAAOM,GACEV,EAAgBC,EAAYC,EAAYC,EAAM,CACnD,KAAM,SACN,UAAWC,EACX,MAAOO,EAA0BD,CAAM,CACzC,CAAC,EAEH,CAAC,OAAO,aAAa,EAAG,IAAM,CAC5B,KAAM,EACR,EACA,QAAS,SAAUE,EAAMT,EAAM,CAC7B,OAAOU,EAAmBD,CAAI,EAAE,EAAE,MAAMT,GAAM,QAAU,CAAC,CAAC,CAC5D,CACF,EACA,SAASU,EAAmBC,EAAM,CAChC,MAAO,IACEd,EAAgBC,EAAYC,EAAY,CAAC,EAAG,CACjD,KAAM,eACN,UAAAE,EACA,KAAAU,CACF,CAAC,CAEL,CACA,OAAO,IAAI,MAAMT,EAAM,CACrB,IAAIU,EAAQC,EAAGC,EAAU,CACvB,OAAI,OAAOD,GAAM,UAAYA,EAAE,WAAWjB,CAAkB,EACnDc,EAAmBG,EAAE,UAAUjB,EAAmB,MAAM,CAAC,EAE3DgB,EAAOC,CAAC,CACjB,CACF,CAAC,CACH,CC7CO,SAASE,EAAuBC,EAAQ,CAC7C,OAAO,IAAI,MAAM,CAAC,EAAG,CACnB,IAAK,CAACJ,EAAQC,EAAGC,IAAa,CAC5B,GAAI,OAAOD,GAAM,SAAU,OAAOG,EAAO,UAAUH,CAAC,CAEtD,CACF,CAAC,CACH,CFbO,SAASI,EAAaC,EAAUC,EAAOC,EAAeC,EAAU,MAAO,CAC5E,IAAMtB,EAAaJ,EAAiBuB,EAAUC,EAAOC,EAAeC,CAAO,EACrEC,EAAmB,CAACb,EAAMT,IAASH,EAAgBY,EAAMV,EAAYC,CAAI,EACzEgB,EAAS,OAAO,iBAAiB,CAAC,EAAG,CACzC,UAAW,CACT,IAAK,IAAMM,CACb,EACA,QAAS,CACP,IAAK,IAAMP,EAAuBC,CAAM,CAC1C,CACF,CAAC,EACD,OAAOA,CACT","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 { createThinClient } from \"@osdk/api\";\nimport { createObjectSet } from \"./objectSet/createObjectSet\";\nimport { createObjectSetCreator } from \"./ObjectSetCreator\";\nexport function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {\n const thinClient = createThinClient(ontology, stack, tokenProvider, fetchFn);\n const objectSetFactory = (type, opts) => createObjectSet(type, thinClient, opts);\n const client = Object.defineProperties({}, {\n objectSet: {\n get: () => objectSetFactory\n },\n objects: {\n get: () => createObjectSetCreator(client)\n }\n });\n return client;\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 { modernToLegacyWhereClause } from \"../internal/conversions\";\nimport { aggregateOrThrow, fetchPageOrThrow } from \"../object\";\nconst searchAroundPrefix = \"searchAround_\";\nexport function createObjectSet(objectType, thinClient, opts, objectSet = {\n type: \"base\",\n objectType\n}) {\n const base = {\n aggregate: req => {\n throw \"TODO\";\n },\n aggregateOrThrow: async req => {\n return aggregateOrThrow(thinClient, objectType, req);\n },\n fetchPage: async args => {\n throw \"TODO\";\n },\n fetchPageOrThrow: async args => {\n return fetchPageOrThrow(thinClient, objectType, args ?? {}, objectSet);\n },\n asyncIter: () => {\n throw \"\";\n },\n where: clause => {\n return createObjectSet(objectType, thinClient, opts, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause)\n });\n },\n [Symbol.asyncIterator]: () => {\n throw \"\";\n },\n pivotTo: function (type, opts) {\n return createSearchAround(type)().where(opts?.$where ?? {});\n }\n };\n function createSearchAround(link) {\n return () => {\n return createObjectSet(objectType, thinClient, {}, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n return new Proxy(base, {\n get(target, p, receiver) {\n if (typeof p === \"string\" && p.startsWith(searchAroundPrefix)) {\n return createSearchAround(p.substring(searchAroundPrefix.length));\n }\n return target[p];\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\n/**\n * A type that creates an object set for each object in the ontology.\n */\n\n/**\n * Create a proxy for the object set creator.\n * @param client The client to use to create the object sets.\n * @returns A proxy for the object set creator.\n */\nexport function createObjectSetCreator(client) {\n return new Proxy({}, {\n get: (target, p, receiver) => {\n if (typeof p === \"string\") return client.objectSet(p);\n return undefined;\n }\n });\n}"]}
1
+ {"version":3,"sources":["../../src/createClient.ts","../../src/objectSet/createObjectSet.ts","../../src/ObjectSetCreator.ts"],"names":["createThinClient","searchAroundPrefix","createObjectSet","objectType","thinClient","opts","objectSet","base","req","aggregateOrThrow","args","fetchPageOrThrow","clause","modernToLegacyWhereClause","type","createSearchAround","link","target","p","receiver","createObjectSetCreator","client","createClient","ontology","stack","tokenProvider","fetchFn","objectSetFactory"],"mappings":"6DAgBA,OAAS,oBAAAA,MAAwB,YCEjC,IAAMC,EAAqB,gBACpB,SAASC,EAAgBC,EAAYC,EAAYC,EAAMC,EAAY,CACxE,KAAM,OACN,WAAAH,CACF,EAAG,CACD,IAAMI,EAAO,CAWX,iBAAkB,MAAMC,GACfC,EAAiBL,EAAYD,EAAYK,CAAG,EAKrD,iBAAkB,MAAME,GACfC,EAAiBP,EAAYD,EAAYO,GAAQ,CAAC,EAAGJ,CAAS,EAKvE,MAAOM,GACEV,EAAgBC,EAAYC,EAAYC,EAAM,CACnD,KAAM,SACN,UAAWC,EACX,MAAOO,EAA0BD,CAAM,CACzC,CAAC,EAMH,QAAS,SAAUE,EAAMT,EAAM,CAC7B,OAAOU,EAAmBD,CAAI,EAAE,EAAE,MAAMT,GAAM,QAAU,CAAC,CAAC,CAC5D,CACF,EACA,SAASU,EAAmBC,EAAM,CAChC,MAAO,IACEd,EAAgBC,EAAYC,EAAY,CAAC,EAAG,CACjD,KAAM,eACN,UAAAE,EACA,KAAAU,CACF,CAAC,CAEL,CACA,OAAO,IAAI,MAAMT,EAAM,CACrB,IAAIU,EAAQC,EAAGC,EAAU,CACvB,OAAI,OAAOD,GAAM,UAAYA,EAAE,WAAWjB,CAAkB,EACnDc,EAAmBG,EAAE,UAAUjB,EAAmB,MAAM,CAAC,EAE3DgB,EAAOC,CAAC,CACjB,CACF,CAAC,CACH,CCrDO,SAASE,EAAuBC,EAAQ,CAC7C,OAAO,IAAI,MAAM,CAAC,EAAG,CACnB,IAAK,CAACJ,EAAQC,EAAGC,IAAa,CAC5B,GAAI,OAAOD,GAAM,SAAU,OAAOG,EAAO,UAAUH,CAAC,CAEtD,CACF,CAAC,CACH,CFbO,SAASI,EAAaC,EAAUC,EAAOC,EAAeC,EAAU,MAAO,CAC5E,IAAMtB,EAAaJ,EAAiBuB,EAAUC,EAAOC,EAAeC,CAAO,EACrEC,EAAmB,CAACb,EAAMT,IAASH,EAAgBY,EAAMV,EAAYC,CAAI,EACzEgB,EAAS,OAAO,iBAAiB,CAAC,EAAG,CACzC,UAAW,CACT,IAAK,IAAMM,CACb,EACA,QAAS,CACP,IAAK,IAAMP,EAAuBC,CAAM,CAC1C,CACF,CAAC,EACD,OAAOA,CACT","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 { createThinClient } from \"@osdk/api\";\nimport { createObjectSet } from \"./objectSet/createObjectSet\";\nimport { createObjectSetCreator } from \"./ObjectSetCreator\";\nexport function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {\n const thinClient = createThinClient(ontology, stack, tokenProvider, fetchFn);\n const objectSetFactory = (type, opts) => createObjectSet(type, thinClient, opts);\n const client = Object.defineProperties({}, {\n objectSet: {\n get: () => objectSetFactory\n },\n objects: {\n get: () => createObjectSetCreator(client)\n }\n });\n return client;\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 { modernToLegacyWhereClause } from \"../internal/conversions\";\nimport { aggregateOrThrow, fetchPageOrThrow } from \"../object\";\nconst searchAroundPrefix = \"searchAround_\";\nexport function createObjectSet(objectType, thinClient, opts, objectSet = {\n type: \"base\",\n objectType\n}) {\n const base = {\n // aggregate: <\n // AC extends AggregationClause<O, K>,\n // GBC extends GroupByClause<O, K> | undefined = undefined,\n // >(req: {\n // select: AC;\n // where?: WhereClause<ObjectInfoFrom<O, K>>;\n // groupBy?: GBC;\n // }) => {\n // throw \"TODO\";\n // },\n aggregateOrThrow: async req => {\n return aggregateOrThrow(thinClient, objectType, req);\n },\n // fetchPage: async (args?: { nextPageToken?: string }) => {\n // throw \"TODO\";\n // },\n fetchPageOrThrow: async args => {\n return fetchPageOrThrow(thinClient, objectType, args ?? {}, objectSet);\n },\n // asyncIter: () => {\n // throw \"\";\n // },\n where: clause => {\n return createObjectSet(objectType, thinClient, opts, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause)\n });\n },\n // [Symbol.asyncIterator]: () => {\n // throw \"\";\n // },\n\n pivotTo: function (type, opts) {\n return createSearchAround(type)().where(opts?.$where ?? {});\n }\n };\n function createSearchAround(link) {\n return () => {\n return createObjectSet(objectType, thinClient, {}, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n return new Proxy(base, {\n get(target, p, receiver) {\n if (typeof p === \"string\" && p.startsWith(searchAroundPrefix)) {\n return createSearchAround(p.substring(searchAroundPrefix.length));\n }\n return target[p];\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\n/**\n * A type that creates an object set for each object in the ontology.\n */\n\n/**\n * Create a proxy for the object set creator.\n * @param client The client to use to create the object sets.\n * @returns A proxy for the object set creator.\n */\nexport function createObjectSetCreator(client) {\n return new Proxy({}, {\n get: (target, p, receiver) => {\n if (typeof p === \"string\") return client.objectSet(p);\n return undefined;\n }\n });\n}"]}
@@ -2,7 +2,7 @@ import { b as b$1, c, a } from './chunk-6NFYRRQY.mjs';
2
2
  export { d as Objects } from './chunk-6NFYRRQY.mjs';
3
3
  import { createThinClient } from '@osdk/api';
4
4
 
5
- var m="searchAround_";function s(r,o,n,c$1={type:"base",objectType:r}){let i={aggregate:e=>{throw "TODO"},aggregateOrThrow:async e=>b$1(o,r,e),fetchPage:async e=>{throw "TODO"},fetchPageOrThrow:async e=>c(o,r,e??{},c$1),asyncIter:()=>{throw ""},where:e=>s(r,o,n,{type:"filter",objectSet:c$1,where:a(e)}),[Symbol.asyncIterator]:()=>{throw ""},pivotTo:function(e,t){return a$1(e)().where(t?.$where??{})}};function a$1(e){return ()=>s(r,o,{},{type:"searchAround",objectSet:c$1,link:e})}return new Proxy(i,{get(e,t,u){return typeof t=="string"&&t.startsWith(m)?a$1(t.substring(m.length)):e[t]}})}function w(r){return new Proxy({},{get:(o,n,c)=>{if(typeof n=="string")return r.objectSet(n)}})}function b(r,o,n,c=fetch){let i=createThinClient(r,o,n,c),a=(t,u)=>s(t,i,u),e=Object.defineProperties({},{objectSet:{get:()=>a},objects:{get:()=>w(e)}});return e}
5
+ var m="searchAround_";function i(r,o,n,c$1={type:"base",objectType:r}){let u={aggregateOrThrow:async e=>b$1(o,r,e),fetchPageOrThrow:async e=>c(o,r,e??{},c$1),where:e=>i(r,o,n,{type:"filter",objectSet:c$1,where:a(e)}),pivotTo:function(e,t){return a$1(e)().where(t?.$where??{})}};function a$1(e){return ()=>i(r,o,{},{type:"searchAround",objectSet:c$1,link:e})}return new Proxy(u,{get(e,t,f){return typeof t=="string"&&t.startsWith(m)?a$1(t.substring(m.length)):e[t]}})}function w(r){return new Proxy({},{get:(o,n,c)=>{if(typeof n=="string")return r.objectSet(n)}})}function b(r,o,n,c=fetch){let u=createThinClient(r,o,n,c),a=(t,f)=>i(t,u,f),e=Object.defineProperties({},{objectSet:{get:()=>a},objects:{get:()=>w(e)}});return e}
6
6
 
7
7
  export { b as createClient };
8
8
  //# sourceMappingURL=out.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/createClient.ts","../../src/objectSet/createObjectSet.ts","../../src/ObjectSetCreator.ts"],"names":["createThinClient","searchAroundPrefix","createObjectSet","objectType","thinClient","opts","objectSet","base","req","aggregateOrThrow","args","fetchPageOrThrow","clause","modernToLegacyWhereClause","type","createSearchAround","link","target","p","receiver","createObjectSetCreator","client","createClient","ontology","stack","tokenProvider","fetchFn","objectSetFactory"],"mappings":"8DAgBA,OAAS,oBAAAA,MAAwB,YCEjC,IAAMC,EAAqB,gBACpB,SAASC,EAAgBC,EAAYC,EAAYC,EAAMC,EAAY,CACxE,KAAM,OACN,WAAAH,CACF,EAAG,CACD,IAAMI,EAAO,CACX,UAAWC,GAAO,CAChB,KAAM,MACR,EACA,iBAAkB,MAAMA,GACfC,EAAiBL,EAAYD,EAAYK,CAAG,EAErD,UAAW,MAAME,GAAQ,CACvB,KAAM,MACR,EACA,iBAAkB,MAAMA,GACfC,EAAiBP,EAAYD,EAAYO,GAAQ,CAAC,EAAGJ,CAAS,EAEvE,UAAW,IAAM,CACf,KAAM,EACR,EACA,MAAOM,GACEV,EAAgBC,EAAYC,EAAYC,EAAM,CACnD,KAAM,SACN,UAAWC,EACX,MAAOO,EAA0BD,CAAM,CACzC,CAAC,EAEH,CAAC,OAAO,aAAa,EAAG,IAAM,CAC5B,KAAM,EACR,EACA,QAAS,SAAUE,EAAMT,EAAM,CAC7B,OAAOU,EAAmBD,CAAI,EAAE,EAAE,MAAMT,GAAM,QAAU,CAAC,CAAC,CAC5D,CACF,EACA,SAASU,EAAmBC,EAAM,CAChC,MAAO,IACEd,EAAgBC,EAAYC,EAAY,CAAC,EAAG,CACjD,KAAM,eACN,UAAAE,EACA,KAAAU,CACF,CAAC,CAEL,CACA,OAAO,IAAI,MAAMT,EAAM,CACrB,IAAIU,EAAQC,EAAGC,EAAU,CACvB,OAAI,OAAOD,GAAM,UAAYA,EAAE,WAAWjB,CAAkB,EACnDc,EAAmBG,EAAE,UAAUjB,EAAmB,MAAM,CAAC,EAE3DgB,EAAOC,CAAC,CACjB,CACF,CAAC,CACH,CC7CO,SAASE,EAAuBC,EAAQ,CAC7C,OAAO,IAAI,MAAM,CAAC,EAAG,CACnB,IAAK,CAACJ,EAAQC,EAAGC,IAAa,CAC5B,GAAI,OAAOD,GAAM,SAAU,OAAOG,EAAO,UAAUH,CAAC,CAEtD,CACF,CAAC,CACH,CFbO,SAASI,EAAaC,EAAUC,EAAOC,EAAeC,EAAU,MAAO,CAC5E,IAAMtB,EAAaJ,EAAiBuB,EAAUC,EAAOC,EAAeC,CAAO,EACrEC,EAAmB,CAACb,EAAMT,IAASH,EAAgBY,EAAMV,EAAYC,CAAI,EACzEgB,EAAS,OAAO,iBAAiB,CAAC,EAAG,CACzC,UAAW,CACT,IAAK,IAAMM,CACb,EACA,QAAS,CACP,IAAK,IAAMP,EAAuBC,CAAM,CAC1C,CACF,CAAC,EACD,OAAOA,CACT","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 { createThinClient } from \"@osdk/api\";\nimport { createObjectSet } from \"./objectSet/createObjectSet\";\nimport { createObjectSetCreator } from \"./ObjectSetCreator\";\nexport function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {\n const thinClient = createThinClient(ontology, stack, tokenProvider, fetchFn);\n const objectSetFactory = (type, opts) => createObjectSet(type, thinClient, opts);\n const client = Object.defineProperties({}, {\n objectSet: {\n get: () => objectSetFactory\n },\n objects: {\n get: () => createObjectSetCreator(client)\n }\n });\n return client;\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 { modernToLegacyWhereClause } from \"../internal/conversions\";\nimport { aggregateOrThrow, fetchPageOrThrow } from \"../object\";\nconst searchAroundPrefix = \"searchAround_\";\nexport function createObjectSet(objectType, thinClient, opts, objectSet = {\n type: \"base\",\n objectType\n}) {\n const base = {\n aggregate: req => {\n throw \"TODO\";\n },\n aggregateOrThrow: async req => {\n return aggregateOrThrow(thinClient, objectType, req);\n },\n fetchPage: async args => {\n throw \"TODO\";\n },\n fetchPageOrThrow: async args => {\n return fetchPageOrThrow(thinClient, objectType, args ?? {}, objectSet);\n },\n asyncIter: () => {\n throw \"\";\n },\n where: clause => {\n return createObjectSet(objectType, thinClient, opts, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause)\n });\n },\n [Symbol.asyncIterator]: () => {\n throw \"\";\n },\n pivotTo: function (type, opts) {\n return createSearchAround(type)().where(opts?.$where ?? {});\n }\n };\n function createSearchAround(link) {\n return () => {\n return createObjectSet(objectType, thinClient, {}, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n return new Proxy(base, {\n get(target, p, receiver) {\n if (typeof p === \"string\" && p.startsWith(searchAroundPrefix)) {\n return createSearchAround(p.substring(searchAroundPrefix.length));\n }\n return target[p];\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\n/**\n * A type that creates an object set for each object in the ontology.\n */\n\n/**\n * Create a proxy for the object set creator.\n * @param client The client to use to create the object sets.\n * @returns A proxy for the object set creator.\n */\nexport function createObjectSetCreator(client) {\n return new Proxy({}, {\n get: (target, p, receiver) => {\n if (typeof p === \"string\") return client.objectSet(p);\n return undefined;\n }\n });\n}"]}
1
+ {"version":3,"sources":["../../src/createClient.ts","../../src/objectSet/createObjectSet.ts","../../src/ObjectSetCreator.ts"],"names":["createThinClient","searchAroundPrefix","createObjectSet","objectType","thinClient","opts","objectSet","base","req","aggregateOrThrow","args","fetchPageOrThrow","clause","modernToLegacyWhereClause","type","createSearchAround","link","target","p","receiver","createObjectSetCreator","client","createClient","ontology","stack","tokenProvider","fetchFn","objectSetFactory"],"mappings":"8DAgBA,OAAS,oBAAAA,MAAwB,YCEjC,IAAMC,EAAqB,gBACpB,SAASC,EAAgBC,EAAYC,EAAYC,EAAMC,EAAY,CACxE,KAAM,OACN,WAAAH,CACF,EAAG,CACD,IAAMI,EAAO,CAWX,iBAAkB,MAAMC,GACfC,EAAiBL,EAAYD,EAAYK,CAAG,EAKrD,iBAAkB,MAAME,GACfC,EAAiBP,EAAYD,EAAYO,GAAQ,CAAC,EAAGJ,CAAS,EAKvE,MAAOM,GACEV,EAAgBC,EAAYC,EAAYC,EAAM,CACnD,KAAM,SACN,UAAWC,EACX,MAAOO,EAA0BD,CAAM,CACzC,CAAC,EAMH,QAAS,SAAUE,EAAMT,EAAM,CAC7B,OAAOU,EAAmBD,CAAI,EAAE,EAAE,MAAMT,GAAM,QAAU,CAAC,CAAC,CAC5D,CACF,EACA,SAASU,EAAmBC,EAAM,CAChC,MAAO,IACEd,EAAgBC,EAAYC,EAAY,CAAC,EAAG,CACjD,KAAM,eACN,UAAAE,EACA,KAAAU,CACF,CAAC,CAEL,CACA,OAAO,IAAI,MAAMT,EAAM,CACrB,IAAIU,EAAQC,EAAGC,EAAU,CACvB,OAAI,OAAOD,GAAM,UAAYA,EAAE,WAAWjB,CAAkB,EACnDc,EAAmBG,EAAE,UAAUjB,EAAmB,MAAM,CAAC,EAE3DgB,EAAOC,CAAC,CACjB,CACF,CAAC,CACH,CCrDO,SAASE,EAAuBC,EAAQ,CAC7C,OAAO,IAAI,MAAM,CAAC,EAAG,CACnB,IAAK,CAACJ,EAAQC,EAAGC,IAAa,CAC5B,GAAI,OAAOD,GAAM,SAAU,OAAOG,EAAO,UAAUH,CAAC,CAEtD,CACF,CAAC,CACH,CFbO,SAASI,EAAaC,EAAUC,EAAOC,EAAeC,EAAU,MAAO,CAC5E,IAAMtB,EAAaJ,EAAiBuB,EAAUC,EAAOC,EAAeC,CAAO,EACrEC,EAAmB,CAACb,EAAMT,IAASH,EAAgBY,EAAMV,EAAYC,CAAI,EACzEgB,EAAS,OAAO,iBAAiB,CAAC,EAAG,CACzC,UAAW,CACT,IAAK,IAAMM,CACb,EACA,QAAS,CACP,IAAK,IAAMP,EAAuBC,CAAM,CAC1C,CACF,CAAC,EACD,OAAOA,CACT","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 { createThinClient } from \"@osdk/api\";\nimport { createObjectSet } from \"./objectSet/createObjectSet\";\nimport { createObjectSetCreator } from \"./ObjectSetCreator\";\nexport function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {\n const thinClient = createThinClient(ontology, stack, tokenProvider, fetchFn);\n const objectSetFactory = (type, opts) => createObjectSet(type, thinClient, opts);\n const client = Object.defineProperties({}, {\n objectSet: {\n get: () => objectSetFactory\n },\n objects: {\n get: () => createObjectSetCreator(client)\n }\n });\n return client;\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 { modernToLegacyWhereClause } from \"../internal/conversions\";\nimport { aggregateOrThrow, fetchPageOrThrow } from \"../object\";\nconst searchAroundPrefix = \"searchAround_\";\nexport function createObjectSet(objectType, thinClient, opts, objectSet = {\n type: \"base\",\n objectType\n}) {\n const base = {\n // aggregate: <\n // AC extends AggregationClause<O, K>,\n // GBC extends GroupByClause<O, K> | undefined = undefined,\n // >(req: {\n // select: AC;\n // where?: WhereClause<ObjectInfoFrom<O, K>>;\n // groupBy?: GBC;\n // }) => {\n // throw \"TODO\";\n // },\n aggregateOrThrow: async req => {\n return aggregateOrThrow(thinClient, objectType, req);\n },\n // fetchPage: async (args?: { nextPageToken?: string }) => {\n // throw \"TODO\";\n // },\n fetchPageOrThrow: async args => {\n return fetchPageOrThrow(thinClient, objectType, args ?? {}, objectSet);\n },\n // asyncIter: () => {\n // throw \"\";\n // },\n where: clause => {\n return createObjectSet(objectType, thinClient, opts, {\n type: \"filter\",\n objectSet: objectSet,\n where: modernToLegacyWhereClause(clause)\n });\n },\n // [Symbol.asyncIterator]: () => {\n // throw \"\";\n // },\n\n pivotTo: function (type, opts) {\n return createSearchAround(type)().where(opts?.$where ?? {});\n }\n };\n function createSearchAround(link) {\n return () => {\n return createObjectSet(objectType, thinClient, {}, {\n type: \"searchAround\",\n objectSet,\n link\n });\n };\n }\n return new Proxy(base, {\n get(target, p, receiver) {\n if (typeof p === \"string\" && p.startsWith(searchAroundPrefix)) {\n return createSearchAround(p.substring(searchAroundPrefix.length));\n }\n return target[p];\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\n/**\n * A type that creates an object set for each object in the ontology.\n */\n\n/**\n * Create a proxy for the object set creator.\n * @param client The client to use to create the object sets.\n * @returns A proxy for the object set creator.\n */\nexport function createObjectSetCreator(client) {\n return new Proxy({}, {\n get: (target, p, receiver) => {\n if (typeof p === \"string\") return client.objectSet(p);\n return undefined;\n }\n });\n}"]}
@@ -0,0 +1,3 @@
1
+ export type OsdkObject<N extends string> = {
2
+ __apiName: N;
3
+ };
@@ -0,0 +1,14 @@
1
+ import type { ObjectInfoFrom, ObjectTypesFrom, OntologyDefinition, OsdkObjectPropertyType, PropertyKeysFrom } from "@osdk/api";
2
+ export type OsdkObjectFrom<T_ObjectTypeKey extends ObjectTypesFrom<T_Ontology>, T_Ontology extends OntologyDefinition<any>, T_PropertyKeys extends PropertyKeysFrom<T_Ontology, T_ObjectTypeKey> = PropertyKeysFrom<T_Ontology, T_ObjectTypeKey>> = {
3
+ [P in T_PropertyKeys]: OsdkObjectPropertyType<ObjectInfoFrom<T_Ontology, T_ObjectTypeKey>["properties"][P]>;
4
+ } & {
5
+ /**@deprecated Use __apiName */
6
+ __name: T_ObjectTypeKey;
7
+ __apiName: T_ObjectTypeKey;
8
+ __primaryKey: ObjectInfoFrom<T_Ontology, T_ObjectTypeKey>["primaryKeyType"];
9
+ /**
10
+ * Future versions will require explicitly asking for this field. For now we are marking
11
+ * as always optional to avoid breaking changes.
12
+ */
13
+ __rid?: string;
14
+ };
@@ -1,4 +1,4 @@
1
- import type { OsdkObject } from "@osdk/api";
1
+ import type { OsdkObject } from "./OsdkObject";
2
2
  export interface PageResult<T extends OsdkObject<any>> {
3
3
  data: T[];
4
4
  nextPageToken: string | undefined;
@@ -3,3 +3,5 @@ export { createClient } from "./createClient";
3
3
  export type { ObjectSet } from "./objectSet/ObjectSet";
4
4
  export type { PageResult } from "./PageResult";
5
5
  export * as Objects from "./object/index";
6
+ export type { OsdkObject } from "./OsdkObject";
7
+ export type { OsdkObjectFrom } from "./OsdkObjectFrom";
@@ -1,3 +1,4 @@
1
- import type { ObjectTypesFrom, OntologyDefinition, OsdkObjectFrom, PropertyKeysFrom, ThinClient } from "@osdk/api";
1
+ import type { ObjectTypesFrom, OntologyDefinition, PropertyKeysFrom, ThinClient } from "@osdk/api";
2
2
  import type { OntologyObjectV2 } from "@osdk/gateway/types";
3
+ import type { OsdkObjectFrom } from "../OsdkObjectFrom";
3
4
  export declare function convertWireToOsdkObjects<T_ClientApiName extends ObjectTypesFrom<T_OntologyDefinition> & string, T_OntologyDefinition extends OntologyDefinition<any>>(client: ThinClient<T_OntologyDefinition>, apiName: T_ClientApiName, objs: OntologyObjectV2[]): OsdkObjectFrom<T_ClientApiName, T_OntologyDefinition, PropertyKeysFrom<T_OntologyDefinition, T_ClientApiName>>[];
@@ -1,5 +1,6 @@
1
- import type { ObjectTypesFrom, OntologyDefinition, OsdkObjectFrom, PropertyKeysFrom, ThinClient } from "@osdk/api";
1
+ import type { ObjectTypesFrom, OntologyDefinition, PropertyKeysFrom, ThinClient } from "@osdk/api";
2
2
  import type { Wire } from "../internal/net";
3
+ import type { OsdkObjectFrom } from "../OsdkObjectFrom";
3
4
  import type { PageResult } from "../PageResult";
4
5
  import type { NOOP } from "../util/NOOP";
5
6
  export interface FetchPageOrThrowArgs<O extends OntologyDefinition<any>, K extends ObjectTypesFrom<O>, L extends PropertyKeysFrom<O, K>> {
@@ -1,5 +1,6 @@
1
- import type { ObjectInfoFrom, ObjectTypesFrom, OntologyDefinition, OsdkObjectFrom, PropertyKeysFrom, ResultOrError } from "@osdk/api";
1
+ import type { ObjectInfoFrom, ObjectTypesFrom, OntologyDefinition, PropertyKeysFrom } from "@osdk/api";
2
2
  import type { FetchPageOrThrowArgs } from "../object/fetchPageOrThrow";
3
+ import type { OsdkObjectFrom } from "../OsdkObjectFrom";
3
4
  import type { PageResult } from "../PageResult";
4
5
  import type { AggregationsResults, WhereClause } from "../query";
5
6
  import type { AggregateOpts } from "../query/aggregations/AggregateOpts";
@@ -10,11 +11,7 @@ export type SearchAround<O extends OntologyDefinition<string>, K extends ObjectT
10
11
  };
11
12
  export interface BaseObjectSet<O extends OntologyDefinition<any>, K extends ObjectTypesFrom<O>> {
12
13
  fetchPageOrThrow: <L extends PropertyKeysFrom<O, K>>(args?: FetchPageOrThrowArgs<O, K, L>) => Promise<PageResult<OsdkObjectFrom<K, O, L>>>;
13
- fetchPage: <L extends PropertyKeysFrom<O, K>>(args?: FetchPageOrThrowArgs<O, K, L>) => Promise<ResultOrError<PageResult<OsdkObjectFrom<K, O, L>>>>;
14
- asyncIter: () => AsyncIterableIterator<OsdkObjectFrom<K, O, PropertyKeysFrom<O, K>>>;
15
- [Symbol.asyncIterator](): AsyncIterableIterator<OsdkObjectFrom<K, O, PropertyKeysFrom<O, K>>>;
16
14
  aggregateOrThrow: <const AO extends AggregateOpts<O, K, any>>(req: AO) => Promise<AggregationsResults<O, K, AO>>;
17
- aggregate: <const AO extends AggregateOpts<O, K, any>>(req: AO) => Promise<ResultOrError<AggregationsResults<O, K, typeof req>>>;
18
15
  where: (clause: WhereClause<ObjectInfoFrom<O, K>>) => ObjectSet<O, K>;
19
16
  pivotTo: <T extends LinkTypesFrom<O, K>>(type: T & string, opts?: ObjectSetOptions<O, O["objects"][K]["links"][T]["targetType"]>) => ObjectSet<O, O["objects"][K]["links"][T]["targetType"]>;
20
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -19,8 +19,8 @@
19
19
  "dependencies": {
20
20
  "fetch-retry": "^5.0.6",
21
21
  "tiny-invariant": "^1.3.1",
22
- "@osdk/api": "0.0.16",
23
- "@osdk/gateway": "0.0.9"
22
+ "@osdk/api": "0.0.17",
23
+ "@osdk/gateway": "0.0.10"
24
24
  },
25
25
  "devDependencies": {
26
26
  "ts-expect": "^1.3.0",
@@ -34,8 +34,12 @@
34
34
  "build/types",
35
35
  "build/js",
36
36
  "CHANGELOG.md",
37
- "package.json"
37
+ "package.json",
38
+ "*.d.ts"
38
39
  ],
40
+ "main": "./build/js/index.js",
41
+ "module": "./build/js/index.mjs",
42
+ "types": "./build/types/index.d.ts",
39
43
  "scripts": {
40
44
  "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
41
45
  "dev:transpile": "tsup --watch",