@osdk/client 2.0.10 → 2.0.12

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 (42) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/build/browser/Client.d.ts +2 -2
  3. package/build/browser/Client.d.ts.map +1 -1
  4. package/build/browser/Client.js +1 -1
  5. package/build/browser/Client.js.map +1 -1
  6. package/build/browser/createClient.d.ts.map +1 -1
  7. package/build/browser/createClient.js +11 -1
  8. package/build/browser/createClient.js.map +1 -1
  9. package/build/browser/index.d.ts +1 -0
  10. package/build/browser/index.d.ts.map +1 -1
  11. package/build/browser/index.js +1 -0
  12. package/build/browser/index.js.map +1 -1
  13. package/build/browser/util/UserAgent.js +1 -1
  14. package/build/browser/util/datetimeConverters.d.ts +22 -0
  15. package/build/browser/util/datetimeConverters.d.ts.map +1 -0
  16. package/build/browser/util/datetimeConverters.js +55 -0
  17. package/build/browser/util/datetimeConverters.js.map +1 -0
  18. package/build/browser/util/datetimeConverters.test.d.ts +2 -0
  19. package/build/browser/util/datetimeConverters.test.d.ts.map +1 -0
  20. package/build/browser/util/datetimeConverters.test.js +75 -0
  21. package/build/browser/util/datetimeConverters.test.js.map +1 -0
  22. package/build/esm/Client.d.ts +2 -2
  23. package/build/esm/Client.d.ts.map +1 -1
  24. package/build/esm/Client.js +1 -1
  25. package/build/esm/Client.js.map +1 -1
  26. package/build/esm/createClient.d.ts.map +1 -1
  27. package/build/esm/createClient.js +11 -1
  28. package/build/esm/createClient.js.map +1 -1
  29. package/build/esm/index.d.ts +1 -0
  30. package/build/esm/index.d.ts.map +1 -1
  31. package/build/esm/index.js +1 -0
  32. package/build/esm/index.js.map +1 -1
  33. package/build/esm/util/UserAgent.js +1 -1
  34. package/build/esm/util/datetimeConverters.d.ts +22 -0
  35. package/build/esm/util/datetimeConverters.d.ts.map +1 -0
  36. package/build/esm/util/datetimeConverters.js +55 -0
  37. package/build/esm/util/datetimeConverters.js.map +1 -0
  38. package/build/esm/util/datetimeConverters.test.d.ts +2 -0
  39. package/build/esm/util/datetimeConverters.test.d.ts.map +1 -0
  40. package/build/esm/util/datetimeConverters.test.js +75 -0
  41. package/build/esm/util/datetimeConverters.test.js.map +1 -0
  42. package/package.json +9 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 99e976e: Adds experimental method to convert an object set into RID
8
+ - Updated dependencies [99e976e]
9
+ - Updated dependencies [29f2eae]
10
+ - @osdk/api@2.0.12
11
+ - @osdk/generator-converters@2.0.12
12
+ - @osdk/client.unstable@2.0.12
13
+
14
+ ## 2.0.11
15
+
16
+ ### Patch Changes
17
+
18
+ - c0b8206: Adds methods to extract date strings from Dates and ISO-8601 strings
19
+ - @osdk/api@2.0.11
20
+ - @osdk/client.unstable@2.0.11
21
+ - @osdk/generator-converters@2.0.11
22
+
3
23
  ## 2.0.10
4
24
 
5
25
  ### Patch Changes
@@ -14,12 +14,12 @@ export interface Client extends SharedClient, OldSharedClient {
14
14
  <Q extends (InterfaceDefinition)>(o: Q): unknown extends CompileTimeMetadata<Q>["objectSet"] ? MinimalObjectSet<Q> : CompileTimeMetadata<Q>["objectSet"];
15
15
  <Q extends ActionDefinition<any>>(o: Q): ActionSignatureFromDef<Q>;
16
16
  <Q extends QueryDefinition<any>>(o: Q): QuerySignatureFromDef<Q>;
17
- <Q extends Experiment<"2.0.8">>(experiment: Q): ExperimentFns<Q>;
17
+ <Q extends Experiment<"2.0.8"> | Experiment<"2.0.12">>(experiment: Q): ExperimentFns<Q>;
18
18
  fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
19
19
  [additionalContext]: MinimalClient;
20
20
  }
21
21
  export declare const additionalContext: unique symbol;
22
- declare const MaxOsdkVersion = "2.0.10";
22
+ declare const MaxOsdkVersion = "2.0.12";
23
23
  export type MaxOsdkVersion = typeof MaxOsdkVersion;
24
24
  declare const ErrorMessage: unique symbol;
25
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CACjE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,SAAS,IAAI,GAAG,CAAC,GAC/C,CAAC,GAAG;IACJ,CAAC,YAAY,CAAC,EACZ,sDAAsD,CAAC,cAAc,cAAc,4BAA4B,CAAC;CACnH,CACJ,GACC,CAAC,CAAC;AAEN,MAAM,WAAW,MAAO,SAAQ,YAAY,EAAE,eAAe;IAC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AO,cAAc,CAAC;AACnD,QAAA,MAAM,YAAY,eAAyB,CAAC"}
@@ -16,6 +16,6 @@
16
16
  // DO NOT EXPORT FROM PACKAGE
17
17
  export const additionalContext = Symbol("additionalContext");
18
18
  // BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.
19
- const MaxOsdkVersion = "2.0.10";
19
+ const MaxOsdkVersion = "2.0.12";
20
20
  const ErrorMessage = Symbol("ErrorMessage");
21
21
  //# sourceMappingURL=Client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.js"],"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// DO NOT EXPORT FROM PACKAGE\nexport const additionalContext = Symbol(\"additionalContext\");\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.0.10\";\nconst ErrorMessage = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAGC,MAAM,CAAC,mBAAmB,CAAC;AAC5D;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B,MAAMC,YAAY,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.js"],"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// DO NOT EXPORT FROM PACKAGE\nexport const additionalContext = Symbol(\"additionalContext\");\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.0.12\";\nconst ErrorMessage = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAGC,MAAM,CAAC,mBAAmB,CAAC;AAC5D;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B,MAAMC,YAAY,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/createClient.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAqL1C,eAAO,MAAM,YAAY,gFArIF,OAAO,CAAC,MAAM,CAAC;aAChB,MAAM;4DAuI3B,CAAC"}
1
+ {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/createClient.ts"],"names":[],"mappings":"AA8CA,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA0M1C,eAAO,MAAM,YAAY,gFA1JF,OAAO,CAAC,MAAM,CAAC;aAChB,MAAM;4DA4J3B,CAAC"}
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "@osdk/api/unstable";
16
+ import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "@osdk/api/unstable";
17
+ import { OntologyObjectSets } from "@osdk/internal.foundry.ontologiesv2";
17
18
  import { symbolClientContext as oldSymbolClientContext } from "@osdk/shared.client";
18
19
  import { symbolClientContext } from "@osdk/shared.client2";
19
20
  import { createBulkLinksAsyncIterFactory } from "./__unstable/createBulkLinksAsyncIterFactory.js";
@@ -85,6 +86,15 @@ baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
85
86
  return async () => (await pendingSubscribe)();
86
87
  }
87
88
  };
89
+ case __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet.name:
90
+ return {
91
+ createTemporaryObjectSet: async objectSet => {
92
+ const response = await OntologyObjectSets.createTemporary(clientCtx, await clientCtx.ontologyRid, {
93
+ objectSet: getWireObjectSet(objectSet)
94
+ });
95
+ return response.objectSetRid;
96
+ }
97
+ };
88
98
  }
89
99
  throw new Error("not implemented");
90
100
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","createObjectSet","getWireObjectSet","ObjectSetListenerWebsocket","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","preexistingObjectSet","definition","rid","objectSets","objectType","apiName","reference","subscribe","objectSet","listener","pendingSubscribe","getInstance","Error","value","createClient"],"sources":["createClient.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe, } from \"@osdk/api/unstable\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { createObjectSet, getWireObjectSet, } from \"./objectSet/createObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./objectSet/ObjectSetListenerWebsocket.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n applyAction;\n batchApplyAction;\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n executeFunction;\n}\n/** @internal */\nexport function createClientInternal(objectSetFactory, // first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({ ontologyRid }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return objectSetFactory(o, clientCtx);\n }\n else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n }\n else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n }\n else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(clientCtx),\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet.name:\n return {\n preexistingObjectSet: (definition, rid) => {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe.name:\n return {\n subscribe: (objectSet, listener) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(getWireObjectSet(objectSet), listener);\n return async () => (await pendingSubscribe)();\n },\n };\n }\n throw new Error(\"not implemented\");\n }\n else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,+CAA+C,EAAEC,uDAAuD,EAAEC,2CAA2C,QAAS,oBAAoB;AAC3L,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASD,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASE,+BAA+B,QAAQ,iDAAiD;AACjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,eAAe,EAAEC,gBAAgB,QAAS,gCAAgC;AACnF,SAASC,0BAA0B,QAAQ,2CAA2C;AACtF,SAASC,UAAU,QAAQ,yBAAyB;AACpD,MAAMC,aAAa,CAAC;EAChBC,WAAWA,CAACC,SAAS,EAAEC,SAAS,EAAE;IAC9B;IACA;IACA;IACA;IACA,IAAI,CAACX,WAAW,GAAGA,WAAW,CAACY,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEC,SAAS,CAAC;IACpE,IAAI,CAACG,gBAAgB,GAAGd,WAAW,CAACY,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEC,SAAS,CAAC;EAC7E;EACAX,WAAW;EACXc,gBAAgB;AACpB;AACA,MAAMC,YAAY,CAAC;EACfN,WAAWA,CAACC,SAAS,EAAEM,QAAQ,EAAE;IAC7B,IAAI,CAACC,eAAe,GAAGV,UAAU,CAACK,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEM,QAAQ,CAAC;EAC1E;EACAC,eAAe;AACnB;AACA;AACA,OAAO,SAASC,oB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AE,CACR;kBACIN,IAAI,EAAE,MAAM;kBACZO,UAAU,EAAEH,UAAU,CAACI;gBAC3B,CAAC,EACD;kBACIR,IAAI,EAAE,WAAW;kBACjBS,SAAS,EAAEJ;gBACf,CAAC;cAET,CAAC,CAAC;YACN;UACJ,CAAC;QACL,KAAKxC,2CAA2C,CAACoC,IAAI;UACjD,OAAO;YACHS,SAAS,EAAEA,CAACC,SAAS,EAAEC,QAAQ,KAAK;cAChC,MAAMC,gBAAgB,GAAGtC,0BAA0B,CAACuC,WAAW,CAACnC,SAAS,CAAC,CAAC+B,SAAS,CAACpC,gBAAgB,CAACqC,SAAS,CAAC,EAAEC,QAAQ,CAAC;cAC3H,OAAO,YAAY,CAAC,MAAMC,gBAAgB,EAAE,CAAC;YACjD;UACJ,CAAC;MACT;MACA,MAAM,IAAIE,KAAK,CAAC,iBAAiB,CAAC;IACtC,CAAC,MACI;MACD,MAAM,IAAIA,KAAK,CAAC,iBAAiB,CAAC;IACtC;EACJ,CAAC,EAEgD;IAC7C,CAAChD,sBAAsB,GAAG;MACtBiD,KAAK,EAAErC;IACX,CAAC;IACD,CAACb,mBAAmB,GAAG;MACnBkD,KAAK,EAAErC;IACX,CAAC;IACD,CAACT,iBAAiB,GAAG;MACjB8C,KAAK,EAAErC;IACX,CAAC;IACDgB,aAAa,EAAE;MACXqB,KAAK,EAAErB;IACX;EACJ,CAAC,CAAC;EACF,OAAOC,MAAM;AACjB;AACA,OAAO,MAAMqB,YAAY,GAAG9B,oBAAoB,CAACN,IAAI,CAACC,SAAS,EAAET,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","OntologyObjectSets","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","createObjectSet","getWireObjectSet","ObjectSetListenerWebsocket","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","preexistingObjectSet","definition","rid","objectSets","objectType","apiName","reference","subscribe","objectSet","listener","pendingSubscribe","getInstance","createTemporaryObjectSet","response","createTemporary","objectSetRid","Error","value","createClient"],"sources":["createClient.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe, } from \"@osdk/api/unstable\";\nimport { OntologyObjectSets, } from \"@osdk/internal.foundry.ontologiesv2\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { createObjectSet, getWireObjectSet, } from \"./objectSet/createObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./objectSet/ObjectSetListenerWebsocket.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n applyAction;\n batchApplyAction;\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n executeFunction;\n}\n/** @internal */\nexport function createClientInternal(objectSetFactory, // first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({ ontologyRid }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return objectSetFactory(o, clientCtx);\n }\n else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n }\n else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n }\n else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(clientCtx),\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet.name:\n return {\n preexistingObjectSet: (definition, rid) => {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe.name:\n return {\n subscribe: (objectSet, listener) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(getWireObjectSet(objectSet), listener);\n return async () => (await pendingSubscribe)();\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet.name:\n return {\n createTemporaryObjectSet: async (objectSet) => {\n const response = await OntologyObjectSets.createTemporary(clientCtx, await clientCtx.ontologyRid, {\n objectSet: getWireObjectSet(objectSet),\n });\n return response.objectSetRid;\n },\n };\n }\n throw new Error(\"not implemented\");\n }\n else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,2DAA2D,EAAEC,+CAA+C,EAAEC,uDAAuD,EAAEC,2CAA2C,QAAS,oBAAoB;AACxP,SAASC,kBAAkB,QAAS,qCAAqC;AACzE,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASD,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASE,+BAA+B,QAAQ,iDAAiD;AACjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,eAAe,EAAEC,gBAAgB,QAAS,gCAAgC;AACnF,SAASC,0BAA0B,QAAQ,2CAA2C;AACtF,SAASC,UAAU,QAAQ,yBAAyB;AACpD,MAAMC,aAAa,CAAC;EAChBC,WAAWA,CAACC,SAAS,EAAEC,SAAS,EAAE;IAC9B;IACA;IACA;IACA;IACA,IAAI,CAACX,W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ACA,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;IACtC,CAAC,MACI;MACD,MAAM,IAAIA,KAAK,CAAC,iBAAiB,CAAC;IACtC;EACJ,CAAC,EAEgD;IAC7C,CAACpD,sBAAsB,GAAG;MACtBqD,KAAK,EAAEzC;IACX,CAAC;IACD,CAACb,mBAAmB,GAAG;MACnBsD,KAAK,EAAEzC;IACX,CAAC;IACD,CAACT,iBAAiB,GAAG;MACjBkD,KAAK,EAAEzC;IACX,CAAC;IACDgB,aAAa,EAAE;MACXyB,KAAK,EAAEzB;IACX;EACJ,CAAC,CAAC;EACF,OAAOC,MAAM;AACjB;AACA,OAAO,MAAMyB,YAAY,GAAGlC,oBAAoB,CAACN,IAAI,CAACC,SAAS,EAAET,eAAe,CAAC","ignoreList":[]}
@@ -9,4 +9,5 @@ export type { PlatformClient } from "./createPlatformClient.js";
9
9
  export type { Logger } from "./Logger.js";
10
10
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
11
11
  export type { ResultOrError } from "./ResultOrError.js";
12
+ export { extractDate, extractDateInLocalTime, extractDateInUTC, } from "./util/datetimeConverters.js";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC"}
@@ -19,4 +19,5 @@ export { ActionValidationError } from "./actions/ActionValidationError.js";
19
19
  export { createClient } from "./createClient.js";
20
20
  export { createPlatformClient } from "./createPlatformClient.js";
21
21
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
22
+ export { extractDate, extractDateInLocalTime, extractDateInUTC } from "./util/datetimeConverters.js";
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload"],"sources":["index.js"],"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 */\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,sBAAsB,QAAQ,8BAA8B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.js"],"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 */\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport { extractDate, extractDateInLocalTime, extractDateInUTC, } from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,gBAAgB,QAAS,8BAA8B","ignoreList":[]}
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export const USER_AGENT = `osdk-client/${"2.0.10"}`;
16
+ export const USER_AGENT = `osdk-client/${"2.0.12"}`;
17
17
  //# sourceMappingURL=UserAgent.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
3
+ *
4
+ * @param dateTime An ISO 8601 formatted date time string
5
+ * @returns The date part of the input string
6
+ */
7
+ export declare const extractDate: (dateTime: string) => string;
8
+ /**
9
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
10
+ *
11
+ * @param date
12
+ * @returns The date part of a ISO 8601 formatted date time string
13
+ */
14
+ export declare const extractDateInUTC: (date: Date) => string;
15
+ /**
16
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
17
+ *
18
+ * @param date
19
+ * @returns The date part of a ISO 8601 formatted date time string
20
+ */
21
+ export declare const extractDateInLocalTime: (date: Date) => string;
22
+ //# sourceMappingURL=datetimeConverters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,WAU3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAE1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,WAEhD,CAAC"}
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import invariant from "tiny-invariant";
17
+ const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
18
+ /**
19
+ * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
20
+ *
21
+ * @param dateTime An ISO 8601 formatted date time string
22
+ * @returns The date part of the input string
23
+ */
24
+ export const extractDate = dateTime => {
25
+ !(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid date format. Provided input is too long.") : invariant(false) : void 0;
26
+ !isoRegex.test(dateTime) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`) : invariant(false) : void 0;
27
+ return extractDateFromIsoString(dateTime);
28
+ };
29
+ /**
30
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
31
+ *
32
+ * @param date
33
+ * @returns The date part of a ISO 8601 formatted date time string
34
+ */
35
+ export const extractDateInUTC = date => {
36
+ return extractDateFromIsoString(date.toISOString());
37
+ };
38
+ /**
39
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
40
+ *
41
+ * @param date
42
+ * @returns The date part of a ISO 8601 formatted date time string
43
+ */
44
+ export const extractDateInLocalTime = date => {
45
+ return extractDateFromIsoString(generateOffsetUtcString(date));
46
+ };
47
+ /** @internal */
48
+ export const generateOffsetUtcString = date => {
49
+ const offsetMs = date.getTimezoneOffset() * 60 * 1000;
50
+ return new Date(date.getTime() - offsetMs).toISOString();
51
+ };
52
+ const extractDateFromIsoString = dateTime => {
53
+ return dateTime.split("T")[0];
54
+ };
55
+ //# sourceMappingURL=datetimeConverters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.js","names":["invariant","isoRegex","extractDate","dateTime","length","process","env","NODE_ENV","test","extractDateFromIsoString","extractDateInUTC","date","toISOString","extractDateInLocalTime","generateOffsetUtcString","offsetMs","getTimezoneOffset","Date","getTime","split"],"sources":["datetimeConverters.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nconst isoRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\n/**\n * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.\n *\n * @param dateTime An ISO 8601 formatted date time string\n * @returns The date part of the input string\n */\nexport const extractDate = (dateTime) => {\n invariant(dateTime.length < 33, \"Invalid date format. Provided input is too long.\");\n invariant(isoRegex.test(dateTime), `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`);\n return extractDateFromIsoString(dateTime);\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInUTC = (date) => {\n return extractDateFromIsoString(date.toISOString());\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInLocalTime = (date) => {\n return extractDateFromIsoString(generateOffsetUtcString(date));\n};\n/** @internal */\nexport const generateOffsetUtcString = (date) => {\n const offsetMs = date.getTimezoneOffset() * 60 * 1000;\n return new Date(date.getTime() - offsetMs).toISOString();\n};\nconst extractDateFromIsoString = (dateTime) => {\n return dateTime.split(\"T\")[0];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,MAAMC,QAAQ,GAAG,uEAAuE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAIC,QAAQ,IAAK;EACrC,EAAUA,QAAQ,CAACC,MAAM,GAAG,EAAE,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA9BP,SAAS,QAAuB,kDAAkD,IAAlFA,SAAS;EACT,CAAUC,QAAQ,CAACO,IAAI,CAACL,QAAQ,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAjCP,SAAS,QAA0B,+DAA+DG,QAAQ,EAAE,IAA5GH,SAAS;EACT,OAAOS,wBAAwB,CAACN,QAAQ,CAAC;AAC7C,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,gBAAgB,GAAIC,IAAI,IAAK;EACtC,OAAOF,wBAAwB,CAACE,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;AACvD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAIF,IAAI,IAAK;EAC5C,OAAOF,wBAAwB,CAACK,uBAAuB,CAACH,IAAI,CAAC,CAAC;AAClE,CAAC;AACD;AACA,OAAO,MAAMG,uBAAuB,GAAIH,IAAI,IAAK;EAC7C,MAAMI,QAAQ,GAAGJ,IAAI,CAACK,iBAAiB,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI;EACrD,OAAO,IAAIC,IAAI,CAACN,IAAI,CAACO,OAAO,CAAC,CAAC,GAAGH,QAAQ,CAAC,CAACH,WAAW,CAAC,CAAC;AAC5D,CAAC;AACD,MAAMH,wBAAwB,GAAIN,QAAQ,IAAK;EAC3C,OAAOA,QAAQ,CAACgB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=datetimeConverters.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.test.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { register, unregister } from "timezone-mock";
17
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
18
+ import { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString } from "./datetimeConverters.js";
19
+ describe("test datetime converters", () => {
20
+ beforeAll(() => {
21
+ register("Etc/GMT+5");
22
+ });
23
+ afterAll(() => {
24
+ unregister();
25
+ });
26
+ describe("test extractDate", () => {
27
+ it("should error if the date is not in UTC format", () => {
28
+ expect(() => extractDate("2021-01-01")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
29
+ expect(() => extractDate("2021-01-01T00:0000.000Z")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
30
+ });
31
+ it("should return the date part of the input string", () => {
32
+ const result = extractDate("2021-01-01T00:00:00.000Z");
33
+ expect(result).toBe("2021-01-01");
34
+ });
35
+ });
36
+ describe("test extractDateInUTC", () => {
37
+ it("should return the date in UTC given Date constructed with UTC time", () => {
38
+ const date = new Date("2021-01-01T00:00:00.000Z");
39
+ expect(date.getDate()).toBe(31);
40
+ expect(date.getUTCDate()).toBe(1);
41
+ const result = extractDateInUTC(date);
42
+ expect(result).toBe("2021-01-01");
43
+ });
44
+ it("should return the date in UTC given Date constructed with a local time", () => {
45
+ const date = new Date("2020-12-31T23:00:00.000");
46
+ expect(date.getDate()).toBe(31);
47
+ expect(date.getUTCDate()).toBe(1);
48
+ const result = extractDateInUTC(date);
49
+ expect(result).toBe("2021-01-01");
50
+ });
51
+ });
52
+ describe("test extractDateInLocalTime", () => {
53
+ it("should return the date in local time given Date constructed with local time", () => {
54
+ const date = new Date("2020-12-31T23:00:00.000");
55
+ expect(date.getDate()).toBe(31);
56
+ const result = extractDateInLocalTime(date);
57
+ expect(result).toBe("2020-12-31");
58
+ });
59
+ describe("test generating ISO String", () => {
60
+ it("should return a correct ISO 8601 string that is offset correctly", () => {
61
+ const date = new Date("2021-01-01T00:00:00.000Z");
62
+ expect(date.getDate()).toBe(31);
63
+ const result = generateOffsetUtcString(date);
64
+ expect(result).toBe("2020-12-31T19:00:00.000Z");
65
+ });
66
+ });
67
+ it("should return the date in local time given Date constructed with UTC time", () => {
68
+ const date = new Date("2021-01-01T00:00:00.000Z");
69
+ expect(date.getDate()).toBe(31);
70
+ const result = extractDateInLocalTime(date);
71
+ expect(result).toBe("2020-12-31");
72
+ });
73
+ });
74
+ });
75
+ //# sourceMappingURL=datetimeConverters.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.test.js","names":["register","unregister","afterAll","beforeAll","describe","expect","it","extractDate","extractDateInLocalTime","extractDateInUTC","generateOffsetUtcString","toThrowError","result","toBe","date","Date","getDate","getUTCDate"],"sources":["datetimeConverters.test.js"],"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 */\nimport { register, unregister } from \"timezone-mock\";\nimport { afterAll, beforeAll, describe, expect, it, } from \"vitest\";\nimport { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString, } from \"./datetimeConverters.js\";\ndescribe(\"test datetime converters\", () => {\n beforeAll(() => {\n register(\"Etc/GMT+5\");\n });\n afterAll(() => {\n unregister();\n });\n describe(\"test extractDate\", () => {\n it(\"should error if the date is not in UTC format\", () => {\n expect(() => extractDate(\"2021-01-01\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n expect(() => extractDate(\"2021-01-01T00:0000.000Z\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n });\n it(\"should return the date part of the input string\", () => {\n const result = extractDate(\"2021-01-01T00:00:00.000Z\");\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInUTC\", () => {\n it(\"should return the date in UTC given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n it(\"should return the date in UTC given Date constructed with a local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInLocalTime\", () => {\n it(\"should return the date in local time given Date constructed with local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31\");\n });\n describe(\"test generating ISO String\", () => {\n it(\"should return a correct ISO 8601 string that is offset correctly\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = generateOffsetUtcString(date);\n expect(result).toBe(\"2020-12-31T19:00:00.000Z\");\n });\n });\n it(\"should return the date in local time given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31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C;QAC5CT,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,0BAA0B,CAAC;MACnD,CAAC,CAAC;IACN,CAAC,CAAC;IACFP,EAAE,CAAC,2EAA2E,EAAE,MAAM;MAClF,MAAMQ,IAAI,GAAG,IAAIC,IAAI,CAAC,0BAA0B,CAAC;MACjDV,MAAM,CAACS,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;MAC/B,MAAMD,MAAM,GAAGJ,sBAAsB,CAACM,IAAI,CAAC;MAC3CT,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -14,12 +14,12 @@ export interface Client extends SharedClient, OldSharedClient {
14
14
  <Q extends (InterfaceDefinition)>(o: Q): unknown extends CompileTimeMetadata<Q>["objectSet"] ? MinimalObjectSet<Q> : CompileTimeMetadata<Q>["objectSet"];
15
15
  <Q extends ActionDefinition<any>>(o: Q): ActionSignatureFromDef<Q>;
16
16
  <Q extends QueryDefinition<any>>(o: Q): QuerySignatureFromDef<Q>;
17
- <Q extends Experiment<"2.0.8">>(experiment: Q): ExperimentFns<Q>;
17
+ <Q extends Experiment<"2.0.8"> | Experiment<"2.0.12">>(experiment: Q): ExperimentFns<Q>;
18
18
  fetchMetadata<Q extends (ObjectTypeDefinition | InterfaceDefinition | ActionDefinition<any> | QueryDefinition<any>)>(o: Q): Promise<Q extends ObjectTypeDefinition ? ObjectMetadata : Q extends InterfaceDefinition ? InterfaceMetadata : Q extends ActionDefinition<any> ? ActionMetadata : Q extends QueryDefinition<any> ? QueryMetadata : never>;
19
19
  [additionalContext]: MinimalClient;
20
20
  }
21
21
  export declare const additionalContext: unique symbol;
22
- declare const MaxOsdkVersion = "2.0.10";
22
+ declare const MaxOsdkVersion = "2.0.12";
23
23
  export type MaxOsdkVersion = typeof MaxOsdkVersion;
24
24
  declare const ErrorMessage: unique symbol;
25
25
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/Client.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CACjE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,SAAS,IAAI,GAAG,CAAC,GAC/C,CAAC,GAAG;IACJ,CAAC,YAAY,CAAC,EACZ,sDAAsD,CAAC,cAAc,cAAc,4BAA4B,CAAC;CACnH,CACJ,GACC,CAAC,CAAC;AAEN,MAAM,WAAW,MAAO,SAAQ,YAAY,EAAE,eAAe;IAC3D,CAAC,CAAC,SAAS,oBAAoB,EAC7B,CAAC,EAAE,CAAC,GACH,OAAO,SAAS,mBAAmB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GACjE,mBAAmB,CAAC,CAA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OT EDIT.
19
- const MaxOsdkVersion = "2.0.10";
19
+ const MaxOsdkVersion = "2.0.12";
20
20
  const ErrorMessage = Symbol("ErrorMessage");
21
21
  //# sourceMappingURL=Client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.js"],"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// DO NOT EXPORT FROM PACKAGE\nexport const additionalContext = Symbol(\"additionalContext\");\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.0.10\";\nconst ErrorMessage = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAGC,MAAM,CAAC,mBAAmB,CAAC;AAC5D;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B,MAAMC,YAAY,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Client.js","names":["additionalContext","Symbol","MaxOsdkVersion","ErrorMessage"],"sources":["Client.js"],"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// DO NOT EXPORT FROM PACKAGE\nexport const additionalContext = Symbol(\"additionalContext\");\n// BEGIN: THIS IS GENERATED CODE. DO NOT EDIT.\nconst MaxOsdkVersion = \"2.0.12\";\nconst ErrorMessage = Symbol(\"ErrorMessage\");\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,GAAGC,MAAM,CAAC,mBAAmB,CAAC;AAC5D;AACA,MAAMC,cAAc,GAAG,QAAQ;AAC/B,MAAMC,YAAY,GAAGF,MAAM,CAAC,cAAc,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/createClient.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAqL1C,eAAO,MAAM,YAAY,gFArIF,OAAO,CAAC,MAAM,CAAC;aAChB,MAAM;4DAuI3B,CAAC"}
1
+ {"version":3,"file":"createClient.d.ts","sourceRoot":"","sources":["../../src/createClient.ts"],"names":[],"mappings":"AA8CA,OAAO,EAAqB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA0M1C,eAAO,MAAM,YAAY,gFA1JF,OAAO,CAAC,MAAM,CAAC;aAChB,MAAM;4DA4J3B,CAAC"}
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "@osdk/api/unstable";
16
+ import { __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe } from "@osdk/api/unstable";
17
+ import { OntologyObjectSets } from "@osdk/internal.foundry.ontologiesv2";
17
18
  import { symbolClientContext as oldSymbolClientContext } from "@osdk/shared.client";
18
19
  import { symbolClientContext } from "@osdk/shared.client2";
19
20
  import { createBulkLinksAsyncIterFactory } from "./__unstable/createBulkLinksAsyncIterFactory.js";
@@ -85,6 +86,15 @@ baseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {
85
86
  return async () => (await pendingSubscribe)();
86
87
  }
87
88
  };
89
+ case __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet.name:
90
+ return {
91
+ createTemporaryObjectSet: async objectSet => {
92
+ const response = await OntologyObjectSets.createTemporary(clientCtx, await clientCtx.ontologyRid, {
93
+ objectSet: getWireObjectSet(objectSet)
94
+ });
95
+ return response.objectSetRid;
96
+ }
97
+ };
88
98
  }
89
99
  throw new Error("not implemented");
90
100
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","createObjectSet","getWireObjectSet","ObjectSetListenerWebsocket","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","preexistingObjectSet","definition","rid","objectSets","objectType","apiName","reference","subscribe","objectSet","listener","pendingSubscribe","getInstance","Error","value","createClient"],"sources":["createClient.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe, } from \"@osdk/api/unstable\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { createObjectSet, getWireObjectSet, } from \"./objectSet/createObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./objectSet/ObjectSetListenerWebsocket.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n applyAction;\n batchApplyAction;\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n executeFunction;\n}\n/** @internal */\nexport function createClientInternal(objectSetFactory, // first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({ ontologyRid }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return objectSetFactory(o, clientCtx);\n }\n else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n }\n else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n }\n else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(clientCtx),\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet.name:\n return {\n preexistingObjectSet: (definition, rid) => {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe.name:\n return {\n subscribe: (objectSet, listener) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(getWireObjectSet(objectSet), listener);\n return async () => (await pendingSubscribe)();\n },\n };\n }\n throw new Error(\"not implemented\");\n }\n else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);\n"],"mappings":"A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,CAAC;QACL,KAAKxC,2CAA2C,CAACoC,IAAI;UACjD,OAAO;YACHS,SAAS,EAAEA,CAACC,SAAS,EAAEC,QAAQ,KAAK;cAChC,MAAMC,gBAAgB,GAAGtC,0BAA0B,CAACuC,WAAW,CAACnC,SAAS,CAAC,CAAC+B,SAAS,CAACpC,gBAAgB,CAACqC,SAAS,CAAC,EAAEC,QAAQ,CAAC;cAC3H,OAAO,YAAY,CAAC,MAAMC,gBAAgB,EAAE,CAAC;YACjD;UACJ,CAAC;MACT;MACA,MAAM,IAAIE,KAAK,CAAC,iBAAiB,CAAC;IACtC,CAAC,MACI;MACD,MAAM,IAAIA,KAAK,CAAC,iBAAiB,CAAC;IACtC;EACJ,CAAC,EAEgD;IAC7C,CAAChD,sBAAsB,GAAG;MACtBiD,KAAK,EAAErC;IACX,CAAC;IACD,CAACb,mBAAmB,GAAG;MACnBkD,KAAK,EAAErC;IACX,CAAC;IACD,CAACT,iBAAiB,GAAG;MACjB8C,KAAK,EAAErC;IACX,CAAC;IACDgB,aAAa,EAAE;MACXqB,KAAK,EAAErB;IACX;EACJ,CAAC,CAAC;EACF,OAAOC,MAAM;AACjB;AACA,OAAO,MAAMqB,YAAY,GAAG9B,oBAAoB,CAACN,IAAI,CAACC,SAAS,EAAET,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"createClient.js","names":["__EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks","__EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet","__EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe","OntologyObjectSets","symbolClientContext","oldSymbolClientContext","createBulkLinksAsyncIterFactory","applyAction","additionalContext","createMinimalClient","fetchMetadataInternal","createObjectSet","getWireObjectSet","ObjectSetListenerWebsocket","applyQuery","ActionInvoker","constructor","clientCtx","actionDef","bind","undefined","batchApplyAction","QueryInvoker","queryDef","executeFunction","createClientInternal","objectSetFactory","baseUrl","ontologyRid","tokenProvider","options","fetchFn","fetch","fetchMetadata","client","Object","defineProperties","o","type","name","getBulkLinks","preexistingObjectSet","definition","rid","objectSets","objectType","apiName","reference","subscribe","objectSet","listener","pendingSubscribe","getInstance","createTemporaryObjectSet","response","createTemporary","objectSetRid","Error","value","createClient"],"sources":["createClient.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks, __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet, __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe, } from \"@osdk/api/unstable\";\nimport { OntologyObjectSets, } from \"@osdk/internal.foundry.ontologiesv2\";\nimport { symbolClientContext as oldSymbolClientContext } from \"@osdk/shared.client\";\nimport { symbolClientContext } from \"@osdk/shared.client2\";\nimport { createBulkLinksAsyncIterFactory } from \"./__unstable/createBulkLinksAsyncIterFactory.js\";\nimport { applyAction } from \"./actions/applyAction.js\";\nimport { additionalContext } from \"./Client.js\";\nimport { createMinimalClient } from \"./createMinimalClient.js\";\nimport { fetchMetadataInternal } from \"./fetchMetadata.js\";\nimport { createObjectSet, getWireObjectSet, } from \"./objectSet/createObjectSet.js\";\nimport { ObjectSetListenerWebsocket } from \"./objectSet/ObjectSetListenerWebsocket.js\";\nimport { applyQuery } from \"./queries/applyQuery.js\";\nclass ActionInvoker {\n constructor(clientCtx, actionDef) {\n // We type the property as a generic function as binding `applyAction`\n // doesn't return a type thats all that useful anyway\n // The implements covers us for the most part here as this exact type doesn't\n // escape this file\n this.applyAction = applyAction.bind(undefined, clientCtx, actionDef);\n this.batchApplyAction = applyAction.bind(undefined, clientCtx, actionDef);\n }\n applyAction;\n batchApplyAction;\n}\nclass QueryInvoker {\n constructor(clientCtx, queryDef) {\n this.executeFunction = applyQuery.bind(undefined, clientCtx, queryDef);\n }\n executeFunction;\n}\n/** @internal */\nexport function createClientInternal(objectSetFactory, // first so i can bind\nbaseUrl, ontologyRid, tokenProvider, options = undefined, fetchFn = fetch) {\n const clientCtx = createMinimalClient({ ontologyRid }, baseUrl, tokenProvider, options, fetchFn, objectSetFactory);\n function clientFn(o) {\n if (o.type === \"object\" || o.type === \"interface\") {\n return objectSetFactory(o, clientCtx);\n }\n else if (o.type === \"action\") {\n return new ActionInvoker(clientCtx, o); // then as any for dealing with the conditional return value\n }\n else if (o.type === \"query\") {\n return new QueryInvoker(clientCtx, o);\n }\n else if (o.type === \"experiment\") {\n switch (o.name) {\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__getBulkLinks.name:\n return {\n getBulkLinks: createBulkLinksAsyncIterFactory(clientCtx),\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__preexistingObjectSet.name:\n return {\n preexistingObjectSet: (definition, rid) => {\n return createObjectSet(definition, client[additionalContext], {\n type: \"intersect\",\n objectSets: [\n {\n type: \"base\",\n objectType: definition.apiName,\n },\n {\n type: \"reference\",\n reference: rid,\n },\n ],\n });\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET_subscribe.name:\n return {\n subscribe: (objectSet, listener) => {\n const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(getWireObjectSet(objectSet), listener);\n return async () => (await pendingSubscribe)();\n },\n };\n case __EXPERIMENTAL__NOT_SUPPORTED_YET__createTemporaryObjectSet.name:\n return {\n createTemporaryObjectSet: async (objectSet) => {\n const response = await OntologyObjectSets.createTemporary(clientCtx, await clientCtx.ontologyRid, {\n objectSet: getWireObjectSet(objectSet),\n });\n return response.objectSetRid;\n },\n };\n }\n throw new Error(\"not implemented\");\n }\n else {\n throw new Error(\"not implemented\");\n }\n }\n const fetchMetadata = fetchMetadataInternal.bind(undefined, clientCtx);\n const client = Object.defineProperties(clientFn, {\n [oldSymbolClientContext]: {\n value: clientCtx,\n },\n [symbolClientContext]: {\n value: clientCtx,\n },\n [additionalContext]: {\n value: clientCtx,\n },\n fetchMetadata: {\n value: fetchMetadata,\n },\n });\n return client;\n}\nexport const createClient = createClientInternal.bind(undefined, createObjectSet);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,2DAA2D,EAAEC,+CAA+C,EAAEC,uDAAuD,EAAEC,2CAA2C,QAAS,oBAAoB;AACxP,SAASC,kBAAkB,QAAS,qCAAqC;AACzE,SAASC,mBAAmB,IAAIC,sBAAsB,QAAQ,qBAAqB;AACnF,SAASD,mBAAmB,QAAQ,sBAAsB;AAC1D,SAASE,+BAA+B,QAAQ,iDAAiD;AACjG,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,eAAe,EAAEC,gBAAgB,QAAS,gCAAgC;AACnF,SAASC,0BAA0B,QAAQ,2CAA2C;AACtF,SAASC,UAAU,QAAQ,yBAAyB;AACpD,MAAMC,aAAa,CAAC;EAChBC,WAAWA,CAACC,SAAS,EAAEC,SAAS,EAAE;IAC9B;IACA;IACA;IACA;IACA,IAAI,CAACX,WAAW,GAAGA,WAAW,CAACY,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEC,SAAS,CAAC;IACpE,IAAI,CAACG,gBAAgB,GAAGd,WAAW,CAACY,IAAI,CAACC,SAAS,EAAEH,SAAS,EAAEC,SAAS,CAAC;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K,EAAEzC;IACX,CAAC;IACD,CAACb,mBAAmB,GAAG;MACnBsD,KAAK,EAAEzC;IACX,CAAC;IACD,CAACT,iBAAiB,GAAG;MACjBkD,KAAK,EAAEzC;IACX,CAAC;IACDgB,aAAa,EAAE;MACXyB,KAAK,EAAEzB;IACX;EACJ,CAAC,CAAC;EACF,OAAOC,MAAM;AACjB;AACA,OAAO,MAAMyB,YAAY,GAAGlC,oBAAoB,CAACN,IAAI,CAACC,SAAS,EAAET,eAAe,CAAC","ignoreList":[]}
@@ -9,4 +9,5 @@ export type { PlatformClient } from "./createPlatformClient.js";
9
9
  export type { Logger } from "./Logger.js";
10
10
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
11
11
  export type { ResultOrError } from "./ResultOrError.js";
12
+ export { extractDate, extractDateInLocalTime, extractDateInUTC, } from "./util/datetimeConverters.js";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,YAAY,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,8BAA8B,CAAC"}
@@ -19,4 +19,5 @@ export { ActionValidationError } from "./actions/ActionValidationError.js";
19
19
  export { createClient } from "./createClient.js";
20
20
  export { createPlatformClient } from "./createPlatformClient.js";
21
21
  export { createAttachmentUpload } from "./object/AttachmentUpload.js";
22
+ export { extractDate, extractDateInLocalTime, extractDateInUTC } from "./util/datetimeConverters.js";
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload"],"sources":["index.js"],"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 */\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,sBAAsB,QAAQ,8BAA8B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["isOk","PalantirApiError","ActionValidationError","createClient","createPlatformClient","createAttachmentUpload","extractDate","extractDateInLocalTime","extractDateInUTC"],"sources":["index.js"],"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 */\nexport { isOk } from \"@osdk/api\";\nexport { PalantirApiError } from \"@osdk/shared.net.errors\";\nexport { ActionValidationError } from \"./actions/ActionValidationError.js\";\nexport { createClient } from \"./createClient.js\";\nexport { createPlatformClient } from \"./createPlatformClient.js\";\nexport { createAttachmentUpload } from \"./object/AttachmentUpload.js\";\nexport { extractDate, extractDateInLocalTime, extractDateInUTC, } from \"./util/datetimeConverters.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,WAAW;AAChC,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SAASC,qBAAqB,QAAQ,oCAAoC;AAC1E,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,WAAW,EAAEC,sBAAsB,EAAEC,gBAAgB,QAAS,8BAA8B","ignoreList":[]}
@@ -13,5 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export const USER_AGENT = `osdk-client/${"2.0.10"}`;
16
+ export const USER_AGENT = `osdk-client/${"2.0.12"}`;
17
17
  //# sourceMappingURL=UserAgent.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
3
+ *
4
+ * @param dateTime An ISO 8601 formatted date time string
5
+ * @returns The date part of the input string
6
+ */
7
+ export declare const extractDate: (dateTime: string) => string;
8
+ /**
9
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
10
+ *
11
+ * @param date
12
+ * @returns The date part of a ISO 8601 formatted date time string
13
+ */
14
+ export declare const extractDateInUTC: (date: Date) => string;
15
+ /**
16
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
17
+ *
18
+ * @param date
19
+ * @returns The date part of a ISO 8601 formatted date time string
20
+ */
21
+ export declare const extractDateInLocalTime: (date: Date) => string;
22
+ //# sourceMappingURL=datetimeConverters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aAAc,MAAM,WAU3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,WAE1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,IAAI,WAEhD,CAAC"}
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright 2024 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import invariant from "tiny-invariant";
17
+ const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
18
+ /**
19
+ * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.
20
+ *
21
+ * @param dateTime An ISO 8601 formatted date time string
22
+ * @returns The date part of the input string
23
+ */
24
+ export const extractDate = dateTime => {
25
+ !(dateTime.length < 33) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid date format. Provided input is too long.") : invariant(false) : void 0;
26
+ !isoRegex.test(dateTime) ? process.env.NODE_ENV !== "production" ? invariant(false, `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`) : invariant(false) : void 0;
27
+ return extractDateFromIsoString(dateTime);
28
+ };
29
+ /**
30
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.
31
+ *
32
+ * @param date
33
+ * @returns The date part of a ISO 8601 formatted date time string
34
+ */
35
+ export const extractDateInUTC = date => {
36
+ return extractDateFromIsoString(date.toISOString());
37
+ };
38
+ /**
39
+ * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.
40
+ *
41
+ * @param date
42
+ * @returns The date part of a ISO 8601 formatted date time string
43
+ */
44
+ export const extractDateInLocalTime = date => {
45
+ return extractDateFromIsoString(generateOffsetUtcString(date));
46
+ };
47
+ /** @internal */
48
+ export const generateOffsetUtcString = date => {
49
+ const offsetMs = date.getTimezoneOffset() * 60 * 1000;
50
+ return new Date(date.getTime() - offsetMs).toISOString();
51
+ };
52
+ const extractDateFromIsoString = dateTime => {
53
+ return dateTime.split("T")[0];
54
+ };
55
+ //# sourceMappingURL=datetimeConverters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.js","names":["invariant","isoRegex","extractDate","dateTime","length","process","env","NODE_ENV","test","extractDateFromIsoString","extractDateInUTC","date","toISOString","extractDateInLocalTime","generateOffsetUtcString","offsetMs","getTimezoneOffset","Date","getTime","split"],"sources":["datetimeConverters.js"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport invariant from \"tiny-invariant\";\nconst isoRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\n/**\n * Extracts the date from a ISO 8601 formatted date time string. Throws if the input is not in the correct format.\n *\n * @param dateTime An ISO 8601 formatted date time string\n * @returns The date part of the input string\n */\nexport const extractDate = (dateTime) => {\n invariant(dateTime.length < 33, \"Invalid date format. Provided input is too long.\");\n invariant(isoRegex.test(dateTime), `Invalid date format. Expected ISO 8601 format, but received ${dateTime}`);\n return extractDateFromIsoString(dateTime);\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in UTC time.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInUTC = (date) => {\n return extractDateFromIsoString(date.toISOString());\n};\n/**\n * Generates a string representation of the input date (YYYY-MM-DD). The resulting date string reflects the given date in the local time zone.\n *\n * @param date\n * @returns The date part of a ISO 8601 formatted date time string\n */\nexport const extractDateInLocalTime = (date) => {\n return extractDateFromIsoString(generateOffsetUtcString(date));\n};\n/** @internal */\nexport const generateOffsetUtcString = (date) => {\n const offsetMs = date.getTimezoneOffset() * 60 * 1000;\n return new Date(date.getTime() - offsetMs).toISOString();\n};\nconst extractDateFromIsoString = (dateTime) => {\n return dateTime.split(\"T\")[0];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AACtC,MAAMC,QAAQ,GAAG,uEAAuE;AACxF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAIC,QAAQ,IAAK;EACrC,EAAUA,QAAQ,CAACC,MAAM,GAAG,EAAE,IAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAA9BP,SAAS,QAAuB,kDAAkD,IAAlFA,SAAS;EACT,CAAUC,QAAQ,CAACO,IAAI,CAACL,QAAQ,CAAC,GAAAE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAjCP,SAAS,QAA0B,+DAA+DG,QAAQ,EAAE,IAA5GH,SAAS;EACT,OAAOS,wBAAwB,CAACN,QAAQ,CAAC;AAC7C,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,gBAAgB,GAAIC,IAAI,IAAK;EACtC,OAAOF,wBAAwB,CAACE,IAAI,CAACC,WAAW,CAAC,CAAC,CAAC;AACvD,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAIF,IAAI,IAAK;EAC5C,OAAOF,wBAAwB,CAACK,uBAAuB,CAACH,IAAI,CAAC,CAAC;AAClE,CAAC;AACD;AACA,OAAO,MAAMG,uBAAuB,GAAIH,IAAI,IAAK;EAC7C,MAAMI,QAAQ,GAAGJ,IAAI,CAACK,iBAAiB,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI;EACrD,OAAO,IAAIC,IAAI,CAACN,IAAI,CAACO,OAAO,CAAC,CAAC,GAAGH,QAAQ,CAAC,CAACH,WAAW,CAAC,CAAC;AAC5D,CAAC;AACD,MAAMH,wBAAwB,GAAIN,QAAQ,IAAK;EAC3C,OAAOA,QAAQ,CAACgB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=datetimeConverters.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.test.d.ts","sourceRoot":"","sources":["../../../src/util/datetimeConverters.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { register, unregister } from "timezone-mock";
17
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
18
+ import { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString } from "./datetimeConverters.js";
19
+ describe("test datetime converters", () => {
20
+ beforeAll(() => {
21
+ register("Etc/GMT+5");
22
+ });
23
+ afterAll(() => {
24
+ unregister();
25
+ });
26
+ describe("test extractDate", () => {
27
+ it("should error if the date is not in UTC format", () => {
28
+ expect(() => extractDate("2021-01-01")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
29
+ expect(() => extractDate("2021-01-01T00:0000.000Z")).toThrowError("Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01");
30
+ });
31
+ it("should return the date part of the input string", () => {
32
+ const result = extractDate("2021-01-01T00:00:00.000Z");
33
+ expect(result).toBe("2021-01-01");
34
+ });
35
+ });
36
+ describe("test extractDateInUTC", () => {
37
+ it("should return the date in UTC given Date constructed with UTC time", () => {
38
+ const date = new Date("2021-01-01T00:00:00.000Z");
39
+ expect(date.getDate()).toBe(31);
40
+ expect(date.getUTCDate()).toBe(1);
41
+ const result = extractDateInUTC(date);
42
+ expect(result).toBe("2021-01-01");
43
+ });
44
+ it("should return the date in UTC given Date constructed with a local time", () => {
45
+ const date = new Date("2020-12-31T23:00:00.000");
46
+ expect(date.getDate()).toBe(31);
47
+ expect(date.getUTCDate()).toBe(1);
48
+ const result = extractDateInUTC(date);
49
+ expect(result).toBe("2021-01-01");
50
+ });
51
+ });
52
+ describe("test extractDateInLocalTime", () => {
53
+ it("should return the date in local time given Date constructed with local time", () => {
54
+ const date = new Date("2020-12-31T23:00:00.000");
55
+ expect(date.getDate()).toBe(31);
56
+ const result = extractDateInLocalTime(date);
57
+ expect(result).toBe("2020-12-31");
58
+ });
59
+ describe("test generating ISO String", () => {
60
+ it("should return a correct ISO 8601 string that is offset correctly", () => {
61
+ const date = new Date("2021-01-01T00:00:00.000Z");
62
+ expect(date.getDate()).toBe(31);
63
+ const result = generateOffsetUtcString(date);
64
+ expect(result).toBe("2020-12-31T19:00:00.000Z");
65
+ });
66
+ });
67
+ it("should return the date in local time given Date constructed with UTC time", () => {
68
+ const date = new Date("2021-01-01T00:00:00.000Z");
69
+ expect(date.getDate()).toBe(31);
70
+ const result = extractDateInLocalTime(date);
71
+ expect(result).toBe("2020-12-31");
72
+ });
73
+ });
74
+ });
75
+ //# sourceMappingURL=datetimeConverters.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetimeConverters.test.js","names":["register","unregister","afterAll","beforeAll","describe","expect","it","extractDate","extractDateInLocalTime","extractDateInUTC","generateOffsetUtcString","toThrowError","result","toBe","date","Date","getDate","getUTCDate"],"sources":["datetimeConverters.test.js"],"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 */\nimport { register, unregister } from \"timezone-mock\";\nimport { afterAll, beforeAll, describe, expect, it, } from \"vitest\";\nimport { extractDate, extractDateInLocalTime, extractDateInUTC, generateOffsetUtcString, } from \"./datetimeConverters.js\";\ndescribe(\"test datetime converters\", () => {\n beforeAll(() => {\n register(\"Etc/GMT+5\");\n });\n afterAll(() => {\n unregister();\n });\n describe(\"test extractDate\", () => {\n it(\"should error if the date is not in UTC format\", () => {\n expect(() => extractDate(\"2021-01-01\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n expect(() => extractDate(\"2021-01-01T00:0000.000Z\")).toThrowError(\"Invariant failed: Invalid date format. Expected ISO 8601 format, but received 2021-01-01\");\n });\n it(\"should return the date part of the input string\", () => {\n const result = extractDate(\"2021-01-01T00:00:00.000Z\");\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInUTC\", () => {\n it(\"should return the date in UTC given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n it(\"should return the date in UTC given Date constructed with a local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n expect(date.getUTCDate()).toBe(1);\n const result = extractDateInUTC(date);\n expect(result).toBe(\"2021-01-01\");\n });\n });\n describe(\"test extractDateInLocalTime\", () => {\n it(\"should return the date in local time given Date constructed with local time\", () => {\n const date = new Date(\"2020-12-31T23:00:00.000\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31\");\n });\n describe(\"test generating ISO String\", () => {\n it(\"should return a correct ISO 8601 string that is offset correctly\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = generateOffsetUtcString(date);\n expect(result).toBe(\"2020-12-31T19:00:00.000Z\");\n });\n });\n it(\"should return the date in local time given Date constructed with UTC time\", () => {\n const date = new Date(\"2021-01-01T00:00:00.000Z\");\n expect(date.getDate()).toBe(31);\n const result = extractDateInLocalTime(date);\n expect(result).toBe(\"2020-12-31\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,UAAU,QAAQ,eAAe;AACpD,SAASC,QAAQ,EAAEC,S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IC,IAAI,CAAC,0BAA0B,CAAC;MACjDV,MAAM,CAACS,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACH,IAAI,CAAC,EAAE,CAAC;MAC/B,MAAMD,MAAM,GAAGJ,sBAAsB,CAACM,IAAI,CAAC;MAC3CT,MAAM,CAACO,MAAM,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;IACrC,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/client",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -32,11 +32,11 @@
32
32
  "tiny-invariant": "^1.3.1",
33
33
  "type-fest": "^4.18.2",
34
34
  "ws": "^8.18.0",
35
+ "@osdk/api": "~2.0.12",
35
36
  "@osdk/client.unstable.osw": "0.2.0",
36
- "@osdk/generator-converters": "2.0.10",
37
+ "@osdk/client.unstable": "2.0.12",
38
+ "@osdk/generator-converters": "2.0.12",
37
39
  "@osdk/shared.client.impl": "~1.0.4",
38
- "@osdk/client.unstable": "2.0.10",
39
- "@osdk/api": "~2.0.10",
40
40
  "@osdk/shared.net.errors": "~2.0.1",
41
41
  "@osdk/shared.net.fetch": "~1.0.1"
42
42
  },
@@ -54,14 +54,15 @@
54
54
  "p-state": "^2.0.1",
55
55
  "pino": "^9.1.0",
56
56
  "pino-pretty": "^11.2.1",
57
+ "timezone-mock": "^1.3.6",
57
58
  "ts-expect": "^1.3.0",
58
59
  "typescript": "~5.5.4",
59
60
  "zod": "^3.23.8",
60
- "@osdk/monorepo.api-extractor": "~0.0.0",
61
- "@osdk/client.test.ontology": "~2.0.10",
62
- "@osdk/monorepo.tsup": "~0.0.0",
61
+ "@osdk/client.test.ontology": "~2.0.12",
63
62
  "@osdk/monorepo.tsconfig": "~0.0.0",
64
- "@osdk/shared.test": "~2.0.10"
63
+ "@osdk/monorepo.tsup": "~0.0.0",
64
+ "@osdk/monorepo.api-extractor": "~0.0.0",
65
+ "@osdk/shared.test": "~2.0.12"
65
66
  },
66
67
  "publishConfig": {
67
68
  "access": "public"