@osdk/client 2.2.0-beta.19 → 2.2.0-beta.20

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,18 @@
1
1
  # @osdk/client
2
2
 
3
+ ## 2.2.0-beta.20
4
+
5
+ ### Minor Changes
6
+
7
+ - 889e84b: Release
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [889e84b]
12
+ - @osdk/generator-converters@2.2.0-beta.20
13
+ - @osdk/client.unstable@2.2.0-beta.20
14
+ - @osdk/api@2.2.0-beta.20
15
+
3
16
  ## 2.2.0-beta.19
4
17
 
5
18
  ### Minor Changes
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- export const USER_AGENT = `osdk-client/${"2.2.0-beta.19"}`;
17
+ export const USER_AGENT = `osdk-client/${"2.2.0-beta.20"}`;
18
18
  //# sourceMappingURL=UserAgent.js.map
@@ -1,5 +1,5 @@
1
1
  import * as _osdk_shared_client from '@osdk/shared.client';
2
- import { ActionDefinition, CompileTimeMetadata, ActionMetadata, ApplyActionOptions, ActionReturnTypeForOptions, ApplyBatchActionOptions, ActionParam, DataValueClientToWire, QueryDefinition, QueryDataTypeDefinition, ObjectQueryDataType, QueryResult, ObjectSetQueryDataType, DataValueWireToClient, QueryParam, ObjectTypeDefinition, ObjectSet, InterfaceDefinition, ObjectMetadata, InterfaceMetadata, QueryMetadata } from '@osdk/api';
2
+ import { ActionDefinition, CompileTimeMetadata, ActionMetadata, ActionParam, DataValueClientToWire, ApplyActionOptions, ActionReturnTypeForOptions, ApplyBatchActionOptions, QueryDefinition, QueryDataTypeDefinition, ObjectQueryDataType, QueryResult, ObjectSetQueryDataType, DataValueWireToClient, QueryParam, ObjectTypeDefinition, ObjectSet, InterfaceDefinition, ObjectMetadata, InterfaceMetadata, QueryMetadata } from '@osdk/api';
3
3
  import { MinimalObjectSet, Experiment, ExperimentFns } from '@osdk/api/unstable';
4
4
  import { SharedClient } from '@osdk/shared.client2';
5
5
 
@@ -126,7 +126,7 @@ async function fetchSingleWithErrors(client, objectType, args, objectSet) {
126
126
  }
127
127
  function extractNamespace(fqApiName) {
128
128
  const last = fqApiName.lastIndexOf(".");
129
- if (last === -1) return [undefined, fqApiName];
129
+ if (last === -1) return [void 0, fqApiName];
130
130
  return [fqApiName.slice(0, last), fqApiName.slice(last + 1)];
131
131
  }
132
132
  function modernToLegacyWhereClause(whereClause, objectOrInterface) {
@@ -193,13 +193,13 @@ function makeGeoFilterPolygon(coordinates, filterType, propertyIdentifier, field
193
193
  };
194
194
  }
195
195
  function handleWherePair([fieldName, filter], objectOrInterface, structFieldSelector) {
196
- !(filter != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant3__default.default(false) : undefined;
196
+ !(filter != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Defined key values are only allowed when they are not undefined.") : invariant3__default.default(false) : void 0;
197
197
  const propertyIdentifier = structFieldSelector != null ? {
198
198
  type: "structField",
199
199
  ...structFieldSelector,
200
200
  propertyApiName: fullyQualifyPropName(structFieldSelector.propertyApiName, objectOrInterface)
201
- } : undefined;
202
- const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : undefined;
201
+ } : void 0;
202
+ const field = structFieldSelector == null ? fullyQualifyPropName(fieldName, objectOrInterface) : void 0;
203
203
  if (typeof filter === "string" || typeof filter === "number" || typeof filter === "boolean") {
204
204
  return {
205
205
  type: "eq",
@@ -212,10 +212,10 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
212
212
  }
213
213
  const keysOfFilter = Object.keys(filter);
214
214
  const hasDollarSign = keysOfFilter.some((key) => key.startsWith("$"));
215
- !(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant3__default.default(false) : undefined;
215
+ !(!hasDollarSign || keysOfFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "A WhereClause Filter with multiple clauses/fields is not allowed. Instead, use an 'or'/'and' clause to combine multiple filters.") : invariant3__default.default(false) : void 0;
216
216
  if (!hasDollarSign) {
217
217
  const structFilter = Object.entries(filter);
218
- !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant3__default.default(false) : undefined;
218
+ !(structFilter.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Cannot filter on more than one struct field in the same clause, need to use an and clause") : invariant3__default.default(false) : void 0;
219
219
  const structFieldApiName = keysOfFilter[0];
220
220
  return handleWherePair(Object.entries(filter)[0], objectOrInterface, {
221
221
  propertyApiName: fieldName,
@@ -223,7 +223,7 @@ function handleWherePair([fieldName, filter], objectOrInterface, structFieldSele
223
223
  });
224
224
  }
225
225
  const firstKey = keysOfFilter[0];
226
- !(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : undefined;
226
+ !(filter[firstKey] != null) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false) : invariant3__default.default(false) : void 0;
227
227
  if (firstKey === "$ne") {
228
228
  return {
229
229
  type: "not",
@@ -372,7 +372,7 @@ function derivedPropertyDefinitionFactory(wireDefinition, definitionMap) {
372
372
  var getDefinitionFromMap = (arg, definitionMap) => {
373
373
  if (typeof arg === "object") {
374
374
  const definition = definitionMap.get(arg);
375
- !definition ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Derived Property is not defined") : invariant3__default.default(false) : undefined;
375
+ !definition ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Derived Property is not defined") : invariant3__default.default(false) : void 0;
376
376
  return definition;
377
377
  } else if (typeof arg === "number") {
378
378
  process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Literals for derived properties are not yet supported") : invariant3__default.default(false) ;
@@ -399,7 +399,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
399
399
  },
400
400
  aggregate: (aggregation, opt) => {
401
401
  const splitAggregation = aggregation.split(":");
402
- !(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Invalid aggregation format") : invariant3__default.default(false) : undefined;
402
+ !(splitAggregation.length === 2 || splitAggregation[0] === "$count") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Invalid aggregation format") : invariant3__default.default(false) : void 0;
403
403
  const [aggregationPropertyName, aggregationOperation] = splitAggregation;
404
404
  let aggregationOperationDefinition;
405
405
  switch (aggregationOperation) {
@@ -429,7 +429,7 @@ function createWithPropertiesObjectSet(objectType, objectSet, definitionMap, fro
429
429
  limit: opt?.limit ?? 100
430
430
  };
431
431
  break;
432
- case undefined:
432
+ case void 0:
433
433
  if (aggregationPropertyName === "$count") {
434
434
  aggregationOperationDefinition = {
435
435
  type: "count"
@@ -495,7 +495,7 @@ function legacyToModernSingleAggregationResult(entry) {
495
495
  if (parts[0] === "count") {
496
496
  return accumulator;
497
497
  }
498
- !(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "assumed we were getting a `${key}.${type}`") : invariant3__default.default(false) : undefined;
498
+ !(parts.length === 2) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "assumed we were getting a `${key}.${type}`") : invariant3__default.default(false) : void 0;
499
499
  const property = parts[0];
500
500
  const metricType = parts[1];
501
501
  if (!(property in accumulator)) {
@@ -507,7 +507,7 @@ function legacyToModernSingleAggregationResult(entry) {
507
507
  }
508
508
 
509
509
  // src/internal/conversions/modernToLegacyAggregationClause.ts
510
- var directionFieldMap = (dir) => dir === "asc" ? "ASC" : dir === "desc" ? "DESC" : undefined;
510
+ var directionFieldMap = (dir) => dir === "asc" ? "ASC" : dir === "desc" ? "DESC" : void 0;
511
511
  function modernToLegacyAggregationClause(select) {
512
512
  return Object.entries(select).flatMap(([propAndMetric, aggregationType]) => {
513
513
  if (propAndMetric === "$count") {
@@ -548,8 +548,8 @@ function modernToLegacyGroupByClause(groupByClause) {
548
548
  return [{
549
549
  type: "exact",
550
550
  field,
551
- maxGroupCount: type.$exact?.$limit ?? undefined,
552
- defaultValue: type.$exact.$defaultValue ?? undefined
551
+ maxGroupCount: type.$exact?.$limit ?? void 0,
552
+ defaultValue: type.$exact.$defaultValue ?? void 0
553
553
  }];
554
554
  } else if ("$fixedWidth" in type) {
555
555
  return [{
@@ -585,9 +585,7 @@ async function aggregate(clientCtx, objectType, objectSet = chunk37QC7LR3_cjs.re
585
585
  chunk37QC7LR3_cjs.resolveBaseObjectSetType(objectType);
586
586
  const body = {
587
587
  aggregation: modernToLegacyAggregationClause(req.$select),
588
- groupBy: [],
589
- where: undefined
590
- };
588
+ groupBy: []};
591
589
  if (req.$groupBy) {
592
590
  body.groupBy = modernToLegacyGroupByClause(req.$groupBy);
593
591
  }
@@ -597,7 +595,7 @@ async function aggregate(clientCtx, objectType, objectSet = chunk37QC7LR3_cjs.re
597
595
  aggregation: body.aggregation
598
596
  });
599
597
  if (!req.$groupBy) {
600
- !(result.data.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "no group by clause should mean only one data result") : invariant3__default.default(false) : undefined;
598
+ !(result.data.length === 1) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "no group by clause should mean only one data result") : invariant3__default.default(false) : void 0;
601
599
  return {
602
600
  ...aggregationToCountResult(result.data[0]),
603
601
  ...legacyToModernSingleAggregationResult(result.data[0])
@@ -693,7 +691,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
693
691
  this.#logger = client.logger?.child({}, {
694
692
  msgPrefix: "<OSW> "
695
693
  });
696
- !(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Stack must be a URL") : invariant3__default.default(false) : undefined;
694
+ !(client.baseUrl.startsWith("https://") || client.baseUrl.startsWith("http://")) ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "Stack must be a URL") : invariant3__default.default(false) : void 0;
697
695
  }
698
696
  async subscribe(objectType, objectSet, listener, properties = []) {
699
697
  const objOrInterfaceDef = objectType.type === "object" ? await this.#client.ontologyProvider.getObjectDefinition(objectType.apiName) : await this.#client.ontologyProvider.getInterfaceDefinition(objectType.apiName);
@@ -707,14 +705,14 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
707
705
  const sub = {
708
706
  listener: fillOutListener(listener),
709
707
  objectSet,
710
- primaryKeyPropertyName: objOrInterfaceDef.type === "interface" ? undefined : objOrInterfaceDef.primaryKeyApiName,
708
+ primaryKeyPropertyName: objOrInterfaceDef.type === "interface" ? void 0 : objOrInterfaceDef.primaryKeyApiName,
711
709
  requestedProperties: objectProperties,
712
710
  requestedReferenceProperties: referenceProperties,
713
711
  status: "preparing",
714
712
  // Since we don't have a real subscription id yet but we need to keep
715
713
  // track of this reference, we can just use a random uuid.
716
714
  subscriptionId: `TMP-${nextUuid()}}`,
717
- interfaceApiName: objOrInterfaceDef.type === "object" ? undefined : objOrInterfaceDef.apiName
715
+ interfaceApiName: objOrInterfaceDef.type === "object" ? void 0 : objOrInterfaceDef.apiName
718
716
  };
719
717
  this.#subscriptions.set(sub.subscriptionId, sub);
720
718
  void this.#initiateSubscribe(sub);
@@ -792,7 +790,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
792
790
  }
793
791
  this.#maybeDisconnectTimeout = setTimeout(
794
792
  () => {
795
- this.#maybeDisconnectTimeout = undefined;
793
+ this.#maybeDisconnectTimeout = void 0;
796
794
  if (this.#subscriptions.size === 0) {
797
795
  this.#cycleWebsocket();
798
796
  }
@@ -886,15 +884,15 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
886
884
  const osdkObjectsWithReferenceUpdates = await Promise.all(referenceUpdates.map(async (o) => {
887
885
  const osdkObjectArray = await this.#client.objectFactory2(this.#client, [{
888
886
  __apiName: o.objectType,
889
- __primaryKey: sub.primaryKeyPropertyName != null ? o.primaryKey[sub.primaryKeyPropertyName] : undefined,
887
+ __primaryKey: sub.primaryKeyPropertyName != null ? o.primaryKey[sub.primaryKeyPropertyName] : void 0,
890
888
  ...o.primaryKey,
891
889
  [o.property]: o.value
892
- }], sub.interfaceApiName, {}, false, undefined, false, await this.#fetchInterfaceMapping(o.objectType, sub.interfaceApiName));
893
- const singleOsdkObject = osdkObjectArray[0] ?? undefined;
890
+ }], sub.interfaceApiName, {}, false, void 0, false, await this.#fetchInterfaceMapping(o.objectType, sub.interfaceApiName));
891
+ const singleOsdkObject = osdkObjectArray[0] ?? void 0;
894
892
  return singleOsdkObject != null ? {
895
893
  object: singleOsdkObject,
896
894
  state: "ADDED_OR_UPDATED"
897
- } : undefined;
895
+ } : void 0;
898
896
  }));
899
897
  for (const update of osdkObjectsWithReferenceUpdates) {
900
898
  if (update != null) {
@@ -911,12 +909,12 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
911
909
  for (const key of keysToDelete) {
912
910
  delete o.object[key];
913
911
  }
914
- const osdkObjectArray = await this.#client.objectFactory2(this.#client, [o.object], sub.interfaceApiName, {}, false, undefined, false, await this.#fetchInterfaceMapping(o.object.__apiName, sub.interfaceApiName));
915
- const singleOsdkObject = osdkObjectArray[0] ?? undefined;
912
+ const osdkObjectArray = await this.#client.objectFactory2(this.#client, [o.object], sub.interfaceApiName, {}, false, void 0, false, await this.#fetchInterfaceMapping(o.object.__apiName, sub.interfaceApiName));
913
+ const singleOsdkObject = osdkObjectArray[0] ?? void 0;
916
914
  return singleOsdkObject != null ? {
917
915
  object: singleOsdkObject,
918
916
  state: o.state
919
- } : undefined;
917
+ } : void 0;
920
918
  }));
921
919
  for (const osdkObject of osdkObjects) {
922
920
  if (osdkObject != null) {
@@ -940,7 +938,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
940
938
  }
941
939
  #handleMessage_refreshObjectSet = (payload) => {
942
940
  const sub = this.#subscriptions.get(payload.id);
943
- !sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : undefined;
941
+ !sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : void 0;
944
942
  try {
945
943
  sub.listener.onOutOfDate();
946
944
  } catch (error) {
@@ -954,7 +952,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
954
952
  responses
955
953
  } = payload;
956
954
  const subs = this.#pendingSubscriptions.get(id);
957
- !subs ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `should have a pending subscription for ${id}`) : invariant3__default.default(false) : undefined;
955
+ !subs ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `should have a pending subscription for ${id}`) : invariant3__default.default(false) : void 0;
958
956
  this.#pendingSubscriptions.delete(id);
959
957
  for (let i = 0; i < responses.length; i++) {
960
958
  const sub = subs[i];
@@ -996,7 +994,7 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
996
994
  #handleMessage_subscriptionClosed(payload) {
997
995
  const sub = this.#subscriptions.get(payload.id);
998
996
  if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
999
- !sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : undefined;
997
+ !sub ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, `Expected subscription id ${payload.id}`) : invariant3__default.default(false) : void 0;
1000
998
  this.#tryCatchOnError(sub, true, payload.cause);
1001
999
  this.#unsubscribe(sub, "error");
1002
1000
  }
@@ -1016,12 +1014,12 @@ var ObjectSetListenerWebsocket = class _ObjectSetListenerWebsocket {
1016
1014
  if (this.#ws.readyState !== WebSocket__default.default.CLOSING && this.#ws.readyState !== WebSocket__default.default.CLOSED) {
1017
1015
  this.#ws.close();
1018
1016
  }
1019
- this.#ws = undefined;
1017
+ this.#ws = void 0;
1020
1018
  }
1021
1019
  if (this.#subscriptions.size > 0) {
1022
1020
  if (process.env.NODE_ENV !== "production") {
1023
1021
  for (const s of this.#subscriptions.values()) {
1024
- !(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "should not have done/error subscriptions still") : invariant3__default.default(false) : undefined;
1022
+ !(s.status !== "done" && s.status !== "error") ? process.env.NODE_ENV !== "production" ? invariant3__default.default(false, "should not have done/error subscriptions still") : invariant3__default.default(false) : void 0;
1025
1023
  }
1026
1024
  }
1027
1025
  for (const s of this.#subscriptions.values()) {
@@ -1110,7 +1108,7 @@ function createObjectSet(objectType, clientCtx, objectSet = chunk37QC7LR3_cjs.re
1110
1108
  });
1111
1109
  },
1112
1110
  asyncIter: async function* (args) {
1113
- let $nextPageToken = undefined;
1111
+ let $nextPageToken = void 0;
1114
1112
  do {
1115
1113
  const result = await chunk37QC7LR3_cjs.fetchPageInternal(augmentRequestContext(clientCtx, (_) => ({
1116
1114
  finalMethodCall: "asyncIter"
@@ -1129,12 +1127,12 @@ function createObjectSet(objectType, clientCtx, objectSet = chunk37QC7LR3_cjs.re
1129
1127
  return await fetchSingle(augmentRequestContext(clientCtx, (_) => ({
1130
1128
  finalMethodCall: "fetchOne"
1131
1129
  })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));
1132
- } : undefined,
1130
+ } : void 0,
1133
1131
  fetchOneWithErrors: isObjectTypeDefinition(objectType) ? async (primaryKey, options) => {
1134
1132
  return await fetchSingleWithErrors(augmentRequestContext(clientCtx, (_) => ({
1135
1133
  finalMethodCall: "fetchOneWithErrors"
1136
1134
  })), objectType, options, await createWithPk(clientCtx, objectType, objectSet, primaryKey));
1137
- } : undefined,
1135
+ } : void 0,
1138
1136
  subscribe: (listener, opts) => {
1139
1137
  const pendingSubscribe = ObjectSetListenerWebsocket.getInstance(clientCtx).subscribe(objectType, objectSet, listener, opts?.properties);
1140
1138
  return {