@squidcloud/client 1.0.152 → 1.0.154

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/dist/cjs/index.js CHANGED
@@ -7041,8 +7041,10 @@ function assertObject(value, objectAssertion, errorContextProvider = undefined,
7041
7041
  assertTruthy(!Array.isArray(value), () => errorWithContext(`is an array.`));
7042
7042
  const assertionEntries = Object.entries(objectAssertion);
7043
7043
  if (constraints.failOnUnknownFields) {
7044
+ const allowedUnknownFieldNames = constraints.allowedUnknownFieldNames || [];
7044
7045
  for (const objectFieldName in value) {
7045
- assertTruthy(assertionEntries.some(([assertionFieldName]) => objectFieldName === assertionFieldName), errorWithContext(`property can't be checked: ${objectFieldName}`));
7046
+ const skipUnknownFieldCheck = allowedUnknownFieldNames.includes(objectFieldName);
7047
+ assertTruthy(skipUnknownFieldCheck || assertionEntries.some(([assertionFieldName]) => objectFieldName === assertionFieldName), errorWithContext(`property can't be checked: ${objectFieldName}`));
7046
7048
  }
7047
7049
  }
7048
7050
  let $o;
@@ -7121,7 +7123,7 @@ exports.callValueAssertion = callValueAssertion;
7121
7123
  "use strict";
7122
7124
 
7123
7125
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7124
- exports.stringAssertion = exports.nullOr = exports.undefinedOr = exports.valueOr = exports.$a = exports.arrayAssertion = exports.objectAssertion = void 0;
7126
+ exports.stringAssertion = exports.nullOr = exports.undefinedOr = exports.valueOr = exports.$u = exports.$a = exports.arrayAssertion = exports.objectAssertion = void 0;
7125
7127
  const Assertion_1 = __webpack_require__(6676);
7126
7128
  const AssertionsLib_1 = __webpack_require__(4356);
7127
7129
  /** A shortcut to build new object type assertion. */
@@ -7159,6 +7161,16 @@ function $a(check, errorMessageProvider) {
7159
7161
  });
7160
7162
  }
7161
7163
  exports.$a = $a;
7164
+ /**
7165
+ * Creates a new value assertion using *check* function.
7166
+ * The assertion accepts the value as valid if 'check(value)' returns true or throws an error otherwise.
7167
+ *
7168
+ * Note: same as `$a` but forces processing of the check function argument as `unknown`.
7169
+ */
7170
+ function $u(check, errorMessageProvider) {
7171
+ return $a(check, errorMessageProvider);
7172
+ }
7173
+ exports.$u = $u;
7162
7174
  /**
7163
7175
  * Creates an assertion that makes comparison by reference with the *expectedValue* before calling *orAssertion*.
7164
7176
  * If comparison with the *expectedValue* succeeds, does not call the *orAssertion*.
@@ -7203,7 +7215,7 @@ exports.stringAssertion = stringAssertion;
7203
7215
  "use strict";
7204
7216
 
7205
7217
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7206
- exports.assertNonNullable = exports.assertEmail = exports.assertHexString = exports.assertUuid = exports.assertBoolean = exports.assertNumber = exports.assertString = exports.formatError = void 0;
7218
+ exports.assertNonNullable = exports.assertDate = exports.assertEmail = exports.assertHexString = exports.assertUuid = exports.assertBoolean = exports.assertNumber = exports.assertString = exports.formatError = void 0;
7207
7219
  const Assertion_1 = __webpack_require__(6676);
7208
7220
  const ChecksLib_1 = __webpack_require__(9862);
7209
7221
  function formatError(contextProvider, message, value) {
@@ -7244,6 +7256,11 @@ const assertEmail = (value, context = undefined) => {
7244
7256
  (0, Assertion_1.assertTruthy)((0, ChecksLib_1.isEmail)(value), () => formatError(context, 'Invalid email', value));
7245
7257
  };
7246
7258
  exports.assertEmail = assertEmail;
7259
+ /** Asserts that the `value` type is a `Date` object. */
7260
+ const assertDate = (value, context = undefined) => {
7261
+ (0, Assertion_1.assertTruthy)(value instanceof Date, () => formatError(context, 'Invalid Date', value));
7262
+ };
7263
+ exports.assertDate = assertDate;
7247
7264
  function assertNonNullable(value, context) {
7248
7265
  (0, Assertion_1.assertTruthy)((0, ChecksLib_1.isNonNullable)(value), () => formatError(context, `Value is ${value === undefined ? 'undefined' : 'null'}`, value));
7249
7266
  }
@@ -7258,25 +7275,30 @@ exports.assertNonNullable = assertNonNullable;
7258
7275
  "use strict";
7259
7276
 
7260
7277
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7261
- exports.isNonNullable = exports.isHexString = exports.isUuid = exports.isEmail = exports.checkArrayHasUniqueElements = exports.isNumber = exports.isString = exports.isBoolean = void 0;
7262
- /** Returns *true* if the value is *boolean*. */
7278
+ exports.isNonNullable = exports.isHexString = exports.isUuid = exports.isEmail = exports.checkArraysHasEqualElementsByComparator = exports.checkArraysHaveEqualElements = exports.checkArrayHasUniqueElements = exports.isDate = exports.isNumber = exports.isString = exports.isBoolean = void 0;
7279
+ /** Returns `true` if the value is `boolean`. */
7263
7280
  function isBoolean(value) {
7264
7281
  return typeof value === 'boolean';
7265
7282
  }
7266
7283
  exports.isBoolean = isBoolean;
7267
- /** Returns *true* if the value is *string*. */
7284
+ /** Returns `true` if the value is `string`. */
7268
7285
  function isString(value) {
7269
7286
  return typeof value === 'string';
7270
7287
  }
7271
7288
  exports.isString = isString;
7272
- /** Returns *true* if the value is *number*. */
7289
+ /** Returns `true` if the value is `number`. */
7273
7290
  function isNumber(value) {
7274
7291
  return typeof value === 'number';
7275
7292
  }
7276
7293
  exports.isNumber = isNumber;
7294
+ /** Returns `true` if the value is `Date` object. */
7295
+ function isDate(value) {
7296
+ return value instanceof Date;
7297
+ }
7298
+ exports.isDate = isDate;
7277
7299
  /**
7278
7300
  * Checks that array has only unique elements.
7279
- * Uses 'identity' function to perform checks.
7301
+ * Uses `identity` function to perform checks.
7280
7302
  */
7281
7303
  function checkArrayHasUniqueElements(array, identity) {
7282
7304
  if (array.length <= 1) {
@@ -7293,6 +7315,38 @@ function checkArrayHasUniqueElements(array, identity) {
7293
7315
  return true;
7294
7316
  }
7295
7317
  exports.checkArrayHasUniqueElements = checkArrayHasUniqueElements;
7318
+ /**
7319
+ * Checks if two arrays have equal elements.
7320
+ * Compares elements with by reference.
7321
+ * See `checkArraysHasEqualElementsByComparator` if you need to use a custom comparator.
7322
+ */
7323
+ function checkArraysHaveEqualElements(array1, array2) {
7324
+ return checkArraysHasEqualElementsByComparator(array1, array2, (e1, e2) => e1 === e2);
7325
+ }
7326
+ exports.checkArraysHaveEqualElements = checkArraysHaveEqualElements;
7327
+ /**
7328
+ * Checks that two arrays have equal elements.
7329
+ * Returns `true` if all elements and their indexes are equal or false otherwise.
7330
+ * Uses `comparator` to compare the elements.
7331
+ */
7332
+ function checkArraysHasEqualElementsByComparator(array1, array2, comparator) {
7333
+ if (array1 === array2) {
7334
+ return true;
7335
+ }
7336
+ if (!array1 || !array2) {
7337
+ return false;
7338
+ }
7339
+ if (array1.length !== array2.length) {
7340
+ return false;
7341
+ }
7342
+ for (let i = 0; i < array1.length; i++) {
7343
+ if (!comparator(array1[i], array2[i])) {
7344
+ return false;
7345
+ }
7346
+ }
7347
+ return true;
7348
+ }
7349
+ exports.checkArraysHasEqualElementsByComparator = checkArraysHasEqualElementsByComparator;
7296
7350
  const EMAIL_REGEX_REGULAR = /^[-!#$%&'*+/\d=?A-Z^_a-z{|}~](\.?[-!#$%&'*+/\d=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z\d])*\.[a-zA-Z](-?[a-zA-Z\d])+$/;
7297
7351
  // eslint-disable-next-line no-misleading-character-class
7298
7352
  const EMAIL_REGEX_INTERNATIONAL = /^(?!\.)((?!.*\.{2})[a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF.!#$%&'*+-/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF\-.\d]+)((\.([a-zA-Z\u0080-\u00FF\u0100-\u017F\u0180-\u024F\u0250-\u02AF\u0300-\u036F\u0370-\u03FF\u0400-\u04FF\u0500-\u052F\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u0700-\u074F\u0750-\u077F\u0780-\u07BF\u07C0-\u07FF\u0900-\u097F\u0980-\u09FF\u0A00-\u0A7F\u0A80-\u0AFF\u0B00-\u0B7F\u0B80-\u0BFF\u0C00-\u0C7F\u0C80-\u0CFF\u0D00-\u0D7F\u0D80-\u0DFF\u0E00-\u0E7F\u0E80-\u0EFF\u0F00-\u0FFF\u1000-\u109F\u10A0-\u10FF\u1100-\u11FF\u1200-\u137F\u1380-\u139F\u13A0-\u13FF\u1400-\u167F\u1680-\u169F\u16A0-\u16FF\u1700-\u171F\u1720-\u173F\u1740-\u175F\u1760-\u177F\u1780-\u17FF\u1800-\u18AF\u1900-\u194F\u1950-\u197F\u1980-\u19DF\u19E0-\u19FF\u1A00-\u1A1F\u1B00-\u1B7F\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u1E00-\u1EFF\u1F00-\u1FFF\u20D0-\u20FF\u2100-\u214F\u2C00-\u2C5F\u2C60-\u2C7F\u2C80-\u2CFF\u2D00-\u2D2F\u2D30-\u2D7F\u2D80-\u2DDF\u2F00-\u2FDF\u2FF0-\u2FFF\u3040-\u309F\u30A0-\u30FF\u3100-\u312F\u3130-\u318F\u3190-\u319F\u31C0-\u31EF\u31F0-\u31FF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4DC0-\u4DFF\u4E00-\u9FFF\uA000-\uA48F\uA490-\uA4CF\uA700-\uA71F\uA800-\uA82F\uA840-\uA87F\uAC00-\uD7AF\uF900-\uFAFF]){2,63})+)$/i;
@@ -36769,9 +36823,9 @@ function sortKeys(json) {
36769
36823
  return result;
36770
36824
  }
36771
36825
  function serialization_normalizeJsonAsString(json) {
36772
- return serialization_serializeObj(sortKeys(json));
36826
+ return serializeObj(sortKeys(json));
36773
36827
  }
36774
- function serialization_serializeObj(obj) {
36828
+ function serializeObj(obj) {
36775
36829
  if (obj === undefined)
36776
36830
  return null; // TODO: change method signature.
36777
36831
  const objWithReplacedDates = lodash.cloneDeepWith(obj, value => {
@@ -36790,7 +36844,7 @@ function deserializeObj(str) {
36790
36844
  function encodeValueForMapping(value) {
36791
36845
  if (value === undefined)
36792
36846
  throw new Error('INVALID_ENCODE_VALUE');
36793
- const serializedValue = serialization_serializeObj(value);
36847
+ const serializedValue = serializeObj(value);
36794
36848
  if (typeof Buffer !== 'undefined') {
36795
36849
  // Node.js
36796
36850
  return Buffer.from(serializedValue, 'utf8').toString('base64');
@@ -37389,6 +37443,7 @@ function replaceKeyInRecord(record, a, b) {
37389
37443
 
37390
37444
 
37391
37445
 
37446
+
37392
37447
  class Pagination {
37393
37448
  /** @internal */
37394
37449
  constructor(snapshotEmitter, options = {}) {
@@ -37419,6 +37474,7 @@ class Pagination {
37419
37474
  */
37420
37475
  this.navigatingToLastPage = false;
37421
37476
  this.lastElement = null;
37477
+ (0,dist.assertTruthy)(snapshotEmitter.getSortOrders().length > 0, 'Unable to paginate results. Please specify a sort order.');
37422
37478
  this.snapshotSubject.pipe((0,external_rxjs_.switchAll)()).subscribe(data => this.dataReceived(data));
37423
37479
  this.templateSnapshotEmitter = snapshotEmitter.clone();
37424
37480
  this.options = Object.assign({ pageSize: 100, subscribe: true }, options);
@@ -37654,7 +37710,6 @@ class Pagination {
37654
37710
 
37655
37711
 
37656
37712
 
37657
-
37658
37713
  /** @internal */
37659
37714
  const ExecuteFunctionSecureAnnotations = (/* unused pure expression or super */ null && ([
37660
37715
  'secureDistributedLock',
@@ -37711,7 +37766,7 @@ function transformResponse(functionResponse, executeFunctionAnnotationType) {
37711
37766
  'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
37712
37767
  'cache-control': 'no-cache',
37713
37768
  };
37714
- const body = isStringOrNullBody ? functionResponse || '' : serializeObj(functionResponse);
37769
+ const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
37715
37770
  // noinspection UnnecessaryLocalVariableJS
37716
37771
  const webhookResponse = {
37717
37772
  headers,
@@ -37720,6 +37775,26 @@ function transformResponse(functionResponse, executeFunctionAnnotationType) {
37720
37775
  };
37721
37776
  return webhookResponse;
37722
37777
  }
37778
+ if (executeFunctionAnnotationType === 'openapi') {
37779
+ if (isOpenApiResponse(functionResponse)) {
37780
+ delete functionResponse['__isOpenApiResponse__'];
37781
+ return functionResponse;
37782
+ }
37783
+ functionResponse = functionResponse !== null && functionResponse !== void 0 ? functionResponse : null;
37784
+ const isStringOrNullBody = functionResponse === null || typeof functionResponse === 'string';
37785
+ const headers = {
37786
+ 'content-type': isStringOrNullBody ? 'text/plain' : 'application/json',
37787
+ 'cache-control': 'no-cache',
37788
+ };
37789
+ const body = isStringOrNullBody ? functionResponse || '' : JSON.stringify(functionResponse);
37790
+ // noinspection UnnecessaryLocalVariableJS
37791
+ const openApiResponse = {
37792
+ headers,
37793
+ body,
37794
+ statusCode: functionResponse === null ? 204 : 200,
37795
+ };
37796
+ return openApiResponse;
37797
+ }
37723
37798
  return functionResponse;
37724
37799
  }
37725
37800
  function convertToRunSecrets(appSecrets) {
@@ -37735,6 +37810,9 @@ function convertToRunSecrets(appSecrets) {
37735
37810
  function isWebhookResponse(response) {
37736
37811
  return response && response.__isWebhookResponse__;
37737
37812
  }
37813
+ function isOpenApiResponse(response) {
37814
+ return response && response.__isOpenApiResponse__;
37815
+ }
37738
37816
 
37739
37817
  ;// CONCATENATED MODULE: ../common/src/communication.types.ts
37740
37818
  /**
@@ -38839,6 +38917,8 @@ const kotlinControllers = [
38839
38917
  'quota',
38840
38918
  'named-query',
38841
38919
  'native-query',
38920
+ 'application-kotlin',
38921
+ 'openapi',
38842
38922
  ];
38843
38923
  function getApplicationUrl(regionPrefix, appId, path) {
38844
38924
  const baseUrl = 'https://squid.cloud';
@@ -39129,6 +39209,8 @@ function createWebSocketWrapper(url, opts = {}) {
39129
39209
 
39130
39210
 
39131
39211
 
39212
+
39213
+
39132
39214
 
39133
39215
 
39134
39216
 
@@ -40197,7 +40279,7 @@ class JoinQueryBuilder extends BaseQueryBuilder {
40197
40279
  return this;
40198
40280
  }
40199
40281
  extractData(data) {
40200
- return data[this.rootAlias].data;
40282
+ return data[this.rootAlias].dataRef;
40201
40283
  }
40202
40284
  serialize() {
40203
40285
  return {
@@ -40424,10 +40506,10 @@ class GroupedJoin {
40424
40506
  * value is the document/document reference
40425
40507
  */
40426
40508
  if (Object.keys(this.joinQueryBuilder.leftToRight).length > 1) {
40427
- return data[this.joinQueryBuilder.rootAlias].data;
40509
+ return data[this.joinQueryBuilder.rootAlias].dataRef;
40428
40510
  }
40429
40511
  else {
40430
- return data.data;
40512
+ return data.dataRef;
40431
40513
  }
40432
40514
  }
40433
40515
  serialize() {
@@ -40699,6 +40781,16 @@ class DocumentReference {
40699
40781
  * @throws Error if the document does not exist.
40700
40782
  */
40701
40783
  get data() {
40784
+ return lodash.cloneDeep(this.dataRef);
40785
+ }
40786
+ /**
40787
+ * Returns a read-only internal copy of the document data. This works similar to `this.data`, except it does not
40788
+ * perform a defensive copy. The caller may not modify this object, on penalty of unexpected behavior.
40789
+ *
40790
+ * @returns The document data.
40791
+ * @throws Error if the document does not exist.
40792
+ */
40793
+ get dataRef() {
40702
40794
  const getError = () => {
40703
40795
  const { collectionName, integrationId, docId } = parseSquidDocId(this.squidDocId);
40704
40796
  return `No data found for document reference: ${JSON.stringify({
@@ -40707,7 +40799,7 @@ class DocumentReference {
40707
40799
  integrationId,
40708
40800
  }, null, 2)}`;
40709
40801
  };
40710
- return (0,dist.truthy)(this.dataManager.getProperties(this.squidDocId), getError());
40802
+ return (0,dist.truthy)(this.dataManager.getProperties(this.squidDocId), getError);
40711
40803
  }
40712
40804
  /**
40713
40805
  * Returns whether data has been populated for this document reference. Data
@@ -41173,7 +41265,7 @@ class QueryBuilder extends BaseQueryBuilder {
41173
41265
  else {
41174
41266
  for (const docAfter of data) {
41175
41267
  const squidDocId = docAfter.squidDocId;
41176
- const docAfterData = docAfter.data;
41268
+ const docAfterData = docAfter.dataRef;
41177
41269
  if (beforeDocSet.has(docAfterData)) {
41178
41270
  delete beforeDocMap[squidDocId];
41179
41271
  beforeDocSet.delete(docAfterData);
@@ -41196,7 +41288,7 @@ class QueryBuilder extends BaseQueryBuilder {
41196
41288
  beforeDocMap = {};
41197
41289
  beforeDocSet = new Set();
41198
41290
  for (const afterDoc of data) {
41199
- const afterDocData = afterDoc.data;
41291
+ const afterDocData = afterDoc.dataRef;
41200
41292
  beforeDocMap[afterDoc.squidDocId] = afterDocData;
41201
41293
  beforeDocSet.add(afterDocData);
41202
41294
  }
@@ -41226,6 +41318,9 @@ class QueryBuilder extends BaseQueryBuilder {
41226
41318
  return res;
41227
41319
  }
41228
41320
  addCompositeCondition(conditions) {
41321
+ if (!conditions.length) {
41322
+ return this;
41323
+ }
41229
41324
  this.query.conditions.push({ fields: conditions });
41230
41325
  return this;
41231
41326
  }
@@ -41246,7 +41341,7 @@ class QueryBuilder extends BaseQueryBuilder {
41246
41341
  };
41247
41342
  }
41248
41343
  extractData(data) {
41249
- return data.data;
41344
+ return data.dataRef;
41250
41345
  }
41251
41346
  paginate(options) {
41252
41347
  return new Pagination(this, options);
@@ -41799,7 +41894,7 @@ class BackendFunctionManager {
41799
41894
  executeFunctionAndSubscribe(functionName, ...params) {
41800
41895
  const request = {
41801
41896
  functionName,
41802
- paramsArrayStr: serialization_serializeObj(params),
41897
+ paramsArrayStr: serializeObj(params),
41803
41898
  };
41804
41899
  return (0,external_rxjs_.race)((0,external_rxjs_.from)(this.rpcManager.post('backend-function/execute', request)).pipe(map_map(response => {
41805
41900
  if (!response.success) {
@@ -57283,7 +57378,7 @@ class RpcManager {
57283
57378
  const filename = file instanceof Blob ? undefined : file.name;
57284
57379
  formData.append(filesFieldName, blob, filename);
57285
57380
  });
57286
- formData.append('body', serialization_serializeObj(message));
57381
+ formData.append('body', serializeObj(message));
57287
57382
  // Make the axios call
57288
57383
  axiosResponse = await external_axios_default().post(url, formData, {
57289
57384
  headers: Object.assign({}, headers),
@@ -57291,7 +57386,7 @@ class RpcManager {
57291
57386
  });
57292
57387
  }
57293
57388
  else {
57294
- axiosResponse = await external_axios_default().post(url, serialization_serializeObj(message), {
57389
+ axiosResponse = await external_axios_default().post(url, serializeObj(message), {
57295
57390
  headers: Object.assign(Object.assign({}, headers), { 'Content-Type': 'application/json' }),
57296
57391
  responseType: 'text',
57297
57392
  });
@@ -57504,7 +57599,7 @@ class SocketManager {
57504
57599
  }
57505
57600
  try {
57506
57601
  (0,dist.assertTruthy)(this.socket, 'Socket is undefined in sendMessageAsync');
57507
- this.socket.send(serialization_serializeObj({ message, authToken }));
57602
+ this.socket.send(serializeObj({ message, authToken }));
57508
57603
  }
57509
57604
  catch (e) {
57510
57605
  if (!((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected)) {
@@ -57523,7 +57618,7 @@ class SocketManager {
57523
57618
  if (!((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected))
57524
57619
  return;
57525
57620
  const message = { type: 'kill' };
57526
- this.socket.send(serialization_serializeObj({ message }));
57621
+ this.socket.send(serializeObj({ message }));
57527
57622
  }
57528
57623
  connect() {
57529
57624
  var _a;
@@ -104,6 +104,11 @@ export interface CreateEnvironmentRequest {
104
104
  sourceAppId: AppId;
105
105
  environmentId: EnvironmentId;
106
106
  }
107
+ export interface UpdateApplicationCodeRequest {
108
+ appId: AppId;
109
+ openApiSpecStr?: string;
110
+ openApiControllersStr?: string;
111
+ }
107
112
  interface BaseUpsertIntegrationRequest<T extends IntegrationTypeWithConfig, C extends IntegrationConfig> {
108
113
  id: IntegrationId;
109
114
  type: T;
@@ -30,8 +30,8 @@ export interface TriggerRequest<T extends DocumentData = any> {
30
30
  export type SchedulerAction = () => void | Promise<void>;
31
31
  export type WebhookAction = ((request: WebhookRequest) => any) | (() => any);
32
32
  /** The context provided to a webhook function. */
33
- export interface WebhookRequest {
34
- body: any;
33
+ export interface WebhookRequest<T = any> {
34
+ body: T;
35
35
  rawBody?: string;
36
36
  queryParams: Record<string, string>;
37
37
  headers: Record<string, string>;
@@ -2,4 +2,8 @@
2
2
  export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
3
3
  /** The different types of actions that can be performed on an AI chatbot. */
4
4
  export type AiChatbotActionType = 'chat' | 'mutate' | 'all';
5
+ export interface LocalBackendData {
6
+ applicationBundleData: ApplicationBundleData;
7
+ openApiSpecStr?: string;
8
+ }
5
9
  export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date';
@@ -14,6 +14,7 @@ export * from './communication.types';
14
14
  export * from './context.types';
15
15
  export * from './distributed-lock.context';
16
16
  export * from './document.types';
17
+ export * from './openapi.types';
17
18
  export * from './graphql.context';
18
19
  export * from './graphql.types';
19
20
  export * from './http-status.enum';
@@ -49,6 +50,7 @@ export * from './utils/transforms';
49
50
  export * from './utils/url';
50
51
  export * from './utils/validation';
51
52
  export * from './webhook-response';
53
+ export * from './openapi-response';
52
54
  export * from './heartbeat.types';
53
55
  export * from './utils/global.utils';
54
56
  export * from './websocket.impl';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -24,6 +24,14 @@ export declare class DocumentReference<T extends DocumentData = any> {
24
24
  * @throws Error if the document does not exist.
25
25
  */
26
26
  get data(): T;
27
+ /**
28
+ * Returns a read-only internal copy of the document data. This works similar to `this.data`, except it does not
29
+ * perform a defensive copy. The caller may not modify this object, on penalty of unexpected behavior.
30
+ *
31
+ * @returns The document data.
32
+ * @throws Error if the document does not exist.
33
+ */
34
+ get dataRef(): T;
27
35
  /**
28
36
  * Returns whether data has been populated for this document reference. Data
29
37
  * will not present if a document has not been queried, does not exist, or
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.152",
3
+ "version": "1.0.154",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "license": "ISC",
34
34
  "dependencies": {
35
35
  "@apollo/client": "^3.7.4",
36
- "@squidcloud/common": "1.0.152",
36
+ "@squidcloud/common": "^1.0.154",
37
37
  "@supercharge/promise-pool": "^2.3.2",
38
38
  "axios": "^1.6.2",
39
39
  "cross-fetch": "^3.1.5",