@squidcloud/client 1.0.159 → 1.0.160
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 +90 -31
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +25 -0
- package/dist/internal-common/src/public-types/ai-chatbot.public-types.d.ts +29 -0
- package/dist/internal-common/src/public-types/api-call.context.d.ts +13 -0
- package/dist/internal-common/src/public-types/api.types.d.ts +4 -0
- package/dist/internal-common/src/public-types/application.types.d.ts +149 -0
- package/dist/internal-common/src/public-types/backend-run.types.d.ts +2 -0
- package/dist/internal-common/src/public-types/base-query-builder.d.ts +147 -0
- package/dist/internal-common/src/public-types/bundle-api.types.d.ts +49 -0
- package/dist/internal-common/src/public-types/bundle-data.types.d.ts +11 -0
- package/dist/internal-common/src/public-types/communication.types.d.ts +10 -0
- package/dist/internal-common/src/public-types/context.types.d.ts +40 -0
- package/dist/internal-common/src/public-types/distributed-lock.context.d.ts +4 -0
- package/dist/internal-common/src/public-types/document.types.d.ts +22 -0
- package/dist/internal-common/src/public-types/graphql.context.d.ts +7 -0
- package/dist/internal-common/src/public-types/graphql.types.d.ts +9 -0
- package/dist/internal-common/src/public-types/heartbeat.types.d.ts +1 -0
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +50 -0
- package/dist/internal-common/src/public-types/integration-types.d.ts +62 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +32 -0
- package/dist/internal-common/src/public-types/integrations/api.types.d.ts +81 -0
- package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +54 -0
- package/dist/internal-common/src/public-types/integrations/database.types.d.ts +275 -0
- package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +24 -0
- package/dist/internal-common/src/public-types/integrations/queue-types.d.ts +40 -0
- package/dist/internal-common/src/public-types/integrations/schemas.d.ts +79 -0
- package/dist/internal-common/src/public-types/logger.types.d.ts +21 -0
- package/dist/internal-common/src/public-types/metrics.types.d.ts +1 -0
- package/dist/internal-common/src/public-types/mutation.context.d.ts +14 -0
- package/dist/internal-common/src/public-types/mutation.types.d.ts +53 -0
- package/dist/internal-common/src/public-types/native-query.context.d.ts +7 -0
- package/dist/internal-common/src/public-types/native-query.types.d.ts +16 -0
- package/dist/internal-common/src/public-types/openapi.types.d.ts +1 -0
- package/dist/internal-common/src/public-types/pagination.d.ts +62 -0
- package/dist/internal-common/src/public-types/query-context.d.ts +137 -0
- package/dist/internal-common/src/public-types/query.types.d.ts +64 -0
- package/dist/internal-common/src/public-types/regions.d.ts +1 -0
- package/dist/internal-common/src/public-types/secret.types.d.ts +22 -0
- package/dist/internal-common/src/public-types/serialized-query.types.d.ts +24 -0
- package/dist/internal-common/src/public-types/socket.types.d.ts +12 -0
- package/dist/internal-common/src/public-types/topic.context.d.ts +1 -0
- package/dist/internal-common/src/public-types/types.d.ts +14 -0
- package/dist/internal-common/src/public-utils/id-utils.d.ts +6 -0
- package/dist/internal-common/src/schema/schema.types.d.ts +54 -0
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
- package/dist/internal-common/src/types/ai-chatbot.context.d.ts +12 -0
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +1 -0
- package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
- package/dist/internal-common/src/utils/array.d.ts +1 -0
- package/dist/internal-common/src/utils/assert.d.ts +1 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
- package/dist/internal-common/src/utils/http.d.ts +2 -0
- package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
- package/dist/internal-common/src/utils/object.d.ts +5 -0
- package/dist/internal-common/src/utils/serialization.d.ts +5 -0
- package/dist/internal-common/src/utils/validation.d.ts +27 -0
- package/dist/internal-common/src/websocket.impl.d.ts +21 -0
- package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -0
- package/dist/typescript-client/src/ai-assistant-client.d.ts +73 -0
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +174 -0
- package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +8 -0
- package/dist/typescript-client/src/ai.types.d.ts +63 -0
- package/dist/typescript-client/src/api.manager.d.ts +11 -0
- package/dist/typescript-client/src/auth.manager.d.ts +27 -0
- package/dist/typescript-client/src/backend-function.manager.d.ts +9 -0
- package/dist/typescript-client/src/backend-transforms.d.ts +0 -0
- package/dist/typescript-client/src/client-id.service.d.ts +27 -0
- package/dist/typescript-client/src/collection-reference.d.ts +80 -0
- package/dist/typescript-client/src/collection-reference.factory.d.ts +13 -0
- package/dist/typescript-client/src/connection-details.d.ts +23 -0
- package/dist/typescript-client/src/data.manager.d.ts +175 -0
- package/dist/typescript-client/src/destruct.manager.d.ts +13 -0
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +16 -0
- package/dist/typescript-client/src/document-identity.service.d.ts +12 -0
- package/dist/typescript-client/src/document-reference.d.ts +148 -0
- package/dist/typescript-client/src/document-reference.factory.d.ts +13 -0
- package/dist/typescript-client/src/document-store.d.ts +14 -0
- package/dist/typescript-client/src/graphql-client.d.ts +14 -0
- package/dist/typescript-client/src/graphql-client.factory.d.ts +11 -0
- package/dist/typescript-client/src/index.d.ts +11 -0
- package/dist/typescript-client/src/mutation/mutation-sender.d.ts +11 -0
- package/dist/typescript-client/src/native-query-manager.d.ts +7 -0
- package/dist/typescript-client/src/public-types.d.ts +41 -0
- package/dist/typescript-client/src/public-utils.d.ts +1 -0
- package/dist/typescript-client/src/query/deserializer.d.ts +3 -0
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +161 -0
- package/dist/typescript-client/src/query/local-query-manager.d.ts +9 -0
- package/dist/typescript-client/src/query/query-builder.factory.d.ts +77 -0
- package/dist/typescript-client/src/query/query-sender.d.ts +33 -0
- package/dist/typescript-client/src/query/query-subscription.manager.d.ts +131 -0
- package/dist/typescript-client/src/query/query.types.d.ts +49 -0
- package/dist/typescript-client/src/queue.manager.d.ts +7 -0
- package/dist/typescript-client/src/rate-limiter.d.ts +32 -0
- package/dist/typescript-client/src/rpc.manager.d.ts +30 -0
- package/dist/typescript-client/src/secret.client.d.ts +22 -0
- package/dist/typescript-client/src/socket.manager.d.ts +43 -0
- package/dist/typescript-client/src/squid.d.ts +245 -0
- package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -0
- package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -0
- package/dist/typescript-client/src/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -888,8 +888,9 @@ __exportStar(__webpack_require__(3355), exports);
|
|
|
888
888
|
"use strict";
|
|
889
889
|
|
|
890
890
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
891
|
-
exports.callValueAssertion = exports.assertArray = exports.assertObject = exports.getErrorMessage = exports.getAssertionErrorFromProvider = exports.fail = exports.truthy = exports.assertTruthy = void 0;
|
|
891
|
+
exports.callValueAssertion = exports.assertRecord = exports.assertArray = exports.assertObject = exports.getErrorMessage = exports.getAssertionErrorFromProvider = exports.fail = exports.truthy = exports.assertTruthy = void 0;
|
|
892
892
|
const ChecksLib_1 = __webpack_require__(9862);
|
|
893
|
+
const AssertionsLib_1 = __webpack_require__(4356);
|
|
893
894
|
/** Asserts that the *param* value is truthy using '!' operator or throws an Error. */
|
|
894
895
|
function assertTruthy(value, error) {
|
|
895
896
|
if (!value) {
|
|
@@ -937,7 +938,9 @@ exports.getErrorMessage = getErrorMessage;
|
|
|
937
938
|
* Works only with non-array objects: use 'assertArray' to check arrays.
|
|
938
939
|
*/
|
|
939
940
|
function assertObject(value, objectAssertion, errorContextProvider = undefined, constraints = {}) {
|
|
940
|
-
const ctx = () => {
|
|
941
|
+
const ctx = () => {
|
|
942
|
+
return getErrorMessage(errorContextProvider);
|
|
943
|
+
};
|
|
941
944
|
const errorWithContext = (message) => {
|
|
942
945
|
const context = ctx();
|
|
943
946
|
return context.length === 0 ? message : `${context} ${message}`;
|
|
@@ -956,8 +959,7 @@ function assertObject(value, objectAssertion, errorContextProvider = undefined,
|
|
|
956
959
|
}
|
|
957
960
|
let $o;
|
|
958
961
|
for (const [fieldKey, fieldAssertion] of assertionEntries) {
|
|
959
|
-
assertTruthy(typeof fieldAssertion === 'function' ||
|
|
960
|
-
(typeof fieldAssertion === 'object' && fieldAssertion !== null), () => `${ctx()}.${fieldKey} assertion is not an object or a function: ${typeof fieldAssertion}`);
|
|
962
|
+
assertTruthy(typeof fieldAssertion === 'function' || (typeof fieldAssertion === 'object' && fieldAssertion !== null), () => `${ctx()}.${fieldKey} assertion is not an object or a function: ${typeof fieldAssertion}`);
|
|
961
963
|
const fieldValue = value[fieldKey];
|
|
962
964
|
const fieldCtx = () => `${ctx()}.${fieldKey}`;
|
|
963
965
|
if (typeof fieldAssertion === 'object') {
|
|
@@ -971,7 +973,7 @@ function assertObject(value, objectAssertion, errorContextProvider = undefined,
|
|
|
971
973
|
}
|
|
972
974
|
else {
|
|
973
975
|
const checkResult = fieldAssertion(fieldValue, fieldCtx);
|
|
974
|
-
assertTruthy(checkResult === undefined, `Assertion function must assert (void) but it returns a value: ${checkResult}. Wrap with $
|
|
976
|
+
assertTruthy(checkResult === undefined, `Assertion function must assert (void) but it returns a value: ${checkResult}. Wrap with $u()?`);
|
|
975
977
|
}
|
|
976
978
|
}
|
|
977
979
|
}
|
|
@@ -981,15 +983,12 @@ function assertObject(value, objectAssertion, errorContextProvider = undefined,
|
|
|
981
983
|
}
|
|
982
984
|
exports.assertObject = assertObject;
|
|
983
985
|
/**
|
|
984
|
-
* Asserts that the
|
|
986
|
+
* Asserts that the `value` is an array and every element in the array satisfy to the *elementAssertion*.
|
|
985
987
|
* Throws error if check fails.
|
|
986
988
|
*/
|
|
987
989
|
function assertArray(value, elementAssertion, constraints = {}, errorContextProvider = undefined) {
|
|
988
990
|
var _a, _b;
|
|
989
|
-
const ctx = (
|
|
990
|
-
const text = getErrorMessage(errorContextProvider);
|
|
991
|
-
return text ? `${text}${mode === 'with-space-separator' ? ' ' : ''}` : '';
|
|
992
|
-
};
|
|
991
|
+
const ctx = createChildNodeContextProvider(errorContextProvider);
|
|
993
992
|
assertTruthy(Array.isArray(value), () => `${ctx()}value is not an array: ${value}`);
|
|
994
993
|
const minLength = (_a = constraints.minLength) !== null && _a !== void 0 ? _a : 0;
|
|
995
994
|
const maxLength = (_b = constraints.maxLength) !== null && _b !== void 0 ? _b : Infinity;
|
|
@@ -1002,16 +1001,39 @@ function assertArray(value, elementAssertion, constraints = {}, errorContextProv
|
|
|
1002
1001
|
const elementErrorProvider = () => `${ctx('no-space-separator')}[${i}]`;
|
|
1003
1002
|
for (; i < value.length; i++) {
|
|
1004
1003
|
const element = value[i];
|
|
1005
|
-
|
|
1006
|
-
assertTruthy(!Array.isArray(element), () => `${elementErrorProvider}: use arrayAssertion() to create a ValueAssertion for an array`);
|
|
1007
|
-
assertObject(element, elementAssertion, elementErrorProvider);
|
|
1008
|
-
}
|
|
1009
|
-
else {
|
|
1010
|
-
callValueAssertion(element, elementAssertion, elementErrorProvider);
|
|
1011
|
-
}
|
|
1004
|
+
assertChildValue(element, elementAssertion, elementErrorProvider);
|
|
1012
1005
|
}
|
|
1013
1006
|
}
|
|
1014
1007
|
exports.assertArray = assertArray;
|
|
1008
|
+
/**
|
|
1009
|
+
* Asserts that the `value` is record of values of the given types.
|
|
1010
|
+
* Throws error if check fails.
|
|
1011
|
+
*/
|
|
1012
|
+
function assertRecord(value, valueAssertion, constraints = {}, errorContextProvider = undefined) {
|
|
1013
|
+
const ctx = createChildNodeContextProvider(errorContextProvider);
|
|
1014
|
+
assertTruthy(typeof value === 'object', () => `${ctx()}value is not an object: ${(0, AssertionsLib_1.formatValue)(value)}`);
|
|
1015
|
+
assertTruthy(value !== null, () => `${ctx()}value is null`);
|
|
1016
|
+
assertTruthy(!Array.isArray(value), () => `${ctx()}the value is not a record, but is an array`);
|
|
1017
|
+
// Check every key and value.
|
|
1018
|
+
for (const [k, v] of Object.entries(value)) {
|
|
1019
|
+
const keyCtx = () => `${ctx('no-space-separator')}['${k}']`;
|
|
1020
|
+
if (constraints.keyAssertion) {
|
|
1021
|
+
assertChildValue(k, constraints.keyAssertion, () => `${keyCtx()}, key assertion failed:`);
|
|
1022
|
+
}
|
|
1023
|
+
assertChildValue(v, valueAssertion, keyCtx);
|
|
1024
|
+
const { keyField } = constraints;
|
|
1025
|
+
if (keyField) {
|
|
1026
|
+
assertTruthy(typeof v == 'object' && v !== null, () => `${keyCtx()} is not an object: ${(0, AssertionsLib_1.formatValue)(v)}`);
|
|
1027
|
+
const kv = v[keyField];
|
|
1028
|
+
assertTruthy(kv === k, () => `${keyCtx()} key value does not match object field '${keyField}' value: ${(0, AssertionsLib_1.formatValue)(kv)}`);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
// Check the whole record with a cross-field check.
|
|
1032
|
+
if (constraints.$o) {
|
|
1033
|
+
constraints.$o(value, errorContextProvider);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
exports.assertRecord = assertRecord;
|
|
1015
1037
|
/**
|
|
1016
1038
|
* Calls the assertion.
|
|
1017
1039
|
* Workaround for TS issue with assertion on genetic arrow function. See https://github.com/microsoft/TypeScript/issues/34523.
|
|
@@ -1020,6 +1042,21 @@ function callValueAssertion(value, valueAssertion, errorContextProvider) {
|
|
|
1020
1042
|
valueAssertion(value, errorContextProvider);
|
|
1021
1043
|
}
|
|
1022
1044
|
exports.callValueAssertion = callValueAssertion;
|
|
1045
|
+
function createChildNodeContextProvider(errorContextProvider) {
|
|
1046
|
+
return (mode = 'with-space-separator') => {
|
|
1047
|
+
const text = getErrorMessage(errorContextProvider);
|
|
1048
|
+
return text ? `${text}${mode === 'with-space-separator' ? ' ' : ''}` : '';
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
function assertChildValue(value, assertion, elementErrorProvider) {
|
|
1052
|
+
if (typeof assertion === 'object') {
|
|
1053
|
+
assertTruthy(!Array.isArray(value), () => `${elementErrorProvider}: use arrayAssertion() to create a ValueAssertion for an array`);
|
|
1054
|
+
assertObject(value, assertion, elementErrorProvider);
|
|
1055
|
+
}
|
|
1056
|
+
else {
|
|
1057
|
+
callValueAssertion(value, assertion, elementErrorProvider);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1023
1060
|
//# sourceMappingURL=Assertion.js.map
|
|
1024
1061
|
|
|
1025
1062
|
/***/ }),
|
|
@@ -1030,17 +1067,18 @@ exports.callValueAssertion = callValueAssertion;
|
|
|
1030
1067
|
"use strict";
|
|
1031
1068
|
|
|
1032
1069
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1033
|
-
exports.stringAssertion = exports.nullOr = exports.undefinedOr = exports.valueOr = exports.$u = exports.$a = exports.arrayAssertion = exports.objectAssertion = void 0;
|
|
1070
|
+
exports.stringAssertion = exports.nullOr = exports.undefinedOr = exports.valueOr = exports.$u = exports.$a = exports.recordAssertion = exports.arrayAssertion = exports.objectAssertion = void 0;
|
|
1034
1071
|
const Assertion_1 = __webpack_require__(6676);
|
|
1035
1072
|
const AssertionsLib_1 = __webpack_require__(4356);
|
|
1036
|
-
/**
|
|
1073
|
+
/** Wraps an object assertion as a value assertion. */
|
|
1037
1074
|
function objectAssertion(objectTypeAssertion, errorContextProvider = undefined) {
|
|
1038
1075
|
return o => (0, Assertion_1.assertObject)(o, objectTypeAssertion, errorContextProvider);
|
|
1039
1076
|
}
|
|
1040
1077
|
exports.objectAssertion = objectAssertion;
|
|
1041
1078
|
/**
|
|
1042
|
-
* Creates an
|
|
1043
|
-
*
|
|
1079
|
+
* Creates an ValueAssertion for an array.
|
|
1080
|
+
* The assertion check checks that array is defined,
|
|
1081
|
+
* satisfies the `constraints` and every element of the array passes the `elementAssertion` check.
|
|
1044
1082
|
*/
|
|
1045
1083
|
function arrayAssertion(elementAssertion, constraints = {}) {
|
|
1046
1084
|
const { minLength, maxLength } = constraints;
|
|
@@ -1052,6 +1090,13 @@ function arrayAssertion(elementAssertion, constraints = {}) {
|
|
|
1052
1090
|
};
|
|
1053
1091
|
}
|
|
1054
1092
|
exports.arrayAssertion = arrayAssertion;
|
|
1093
|
+
/** Creates a value assertion for the record of elements where each of the elements passes `valueAssertion` check. */
|
|
1094
|
+
function recordAssertion(valueAssertion, constraints = {}) {
|
|
1095
|
+
return (value, errorContextProvider = undefined) => {
|
|
1096
|
+
(0, Assertion_1.assertRecord)(value, valueAssertion, constraints, errorContextProvider);
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
exports.recordAssertion = recordAssertion;
|
|
1055
1100
|
/**
|
|
1056
1101
|
* Creates a new value assertion using *check* function.
|
|
1057
1102
|
* The assertion accepts the value as valid if 'check(value)' returns true or throws an error otherwise.
|
|
@@ -1064,7 +1109,7 @@ function $a(check, errorMessageProvider) {
|
|
|
1064
1109
|
errorContext += ':';
|
|
1065
1110
|
}
|
|
1066
1111
|
const errorMessage = (0, Assertion_1.getErrorMessage)(errorMessageProvider);
|
|
1067
|
-
return `${errorContext} ${
|
|
1112
|
+
return `${errorContext} ${errorMessage || (typeof value === 'object' ? '[object]' : `'${value}'`)}`;
|
|
1068
1113
|
});
|
|
1069
1114
|
}
|
|
1070
1115
|
exports.$a = $a;
|
|
@@ -1122,19 +1167,25 @@ exports.stringAssertion = stringAssertion;
|
|
|
1122
1167
|
"use strict";
|
|
1123
1168
|
|
|
1124
1169
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1125
|
-
exports.assertNonNullable = exports.assertDate = exports.assertEmail = exports.assertHexString = exports.assertUuid = exports.assertBoolean = exports.assertNumber = exports.assertString = exports.formatError = void 0;
|
|
1170
|
+
exports.assertNonNullable = exports.assertDate = exports.assertEmail = exports.assertHexString = exports.assertUuid = exports.assertBoolean = exports.assertNumber = exports.assertString = exports.formatError = exports.formatValue = void 0;
|
|
1126
1171
|
const Assertion_1 = __webpack_require__(6676);
|
|
1127
1172
|
const ChecksLib_1 = __webpack_require__(9862);
|
|
1173
|
+
function formatValue(value) {
|
|
1174
|
+
return value === undefined
|
|
1175
|
+
? '<undefined>'
|
|
1176
|
+
: typeof value === 'symbol'
|
|
1177
|
+
? value.toString()
|
|
1178
|
+
: value === null
|
|
1179
|
+
? '<null>'
|
|
1180
|
+
: `<${typeof value}:${value}>`;
|
|
1181
|
+
}
|
|
1182
|
+
exports.formatValue = formatValue;
|
|
1128
1183
|
function formatError(contextProvider, message, value) {
|
|
1129
1184
|
const context = (0, Assertion_1.getAssertionErrorFromProvider)(contextProvider);
|
|
1130
1185
|
if (typeof context === 'object') {
|
|
1131
1186
|
throw context;
|
|
1132
1187
|
}
|
|
1133
|
-
const renderedValue = value
|
|
1134
|
-
? '<undefined>'
|
|
1135
|
-
: value === null
|
|
1136
|
-
? '<null>'
|
|
1137
|
-
: `<${typeof value}:${value}>`;
|
|
1188
|
+
const renderedValue = formatValue(value);
|
|
1138
1189
|
return `${context ? `${context}: ` : ''}${message} ${renderedValue}`;
|
|
1139
1190
|
}
|
|
1140
1191
|
exports.formatError = formatError;
|
|
@@ -1255,8 +1306,9 @@ function checkArraysHasEqualElementsByComparator(array1, array2, comparator) {
|
|
|
1255
1306
|
}
|
|
1256
1307
|
exports.checkArraysHasEqualElementsByComparator = checkArraysHasEqualElementsByComparator;
|
|
1257
1308
|
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])+$/;
|
|
1309
|
+
const EMAIL_REGEX_INTERNATIONAL =
|
|
1258
1310
|
// eslint-disable-next-line no-misleading-character-class
|
|
1259
|
-
|
|
1311
|
+
/^(?!\.)((?!.*\.{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;
|
|
1260
1312
|
/** Returns true if *email* is a valid email address. */
|
|
1261
1313
|
function isEmail(email, constraints = { allowInternationalDomains: false }) {
|
|
1262
1314
|
if (!isString(email) || email.length === 0 || email.length > 254) {
|
|
@@ -28597,6 +28649,7 @@ var IntegrationType;
|
|
|
28597
28649
|
IntegrationType["okta"] = "okta";
|
|
28598
28650
|
IntegrationType["descope"] = "descope";
|
|
28599
28651
|
IntegrationType["kafka"] = "kafka";
|
|
28652
|
+
IntegrationType["confluent"] = "confluent";
|
|
28600
28653
|
IntegrationType["built_in_queue"] = "built_in_queue";
|
|
28601
28654
|
// Coming Soon
|
|
28602
28655
|
IntegrationType["algolia"] = "algolia";
|
|
@@ -28678,7 +28731,11 @@ const AuthIntegrationTypes = [
|
|
|
28678
28731
|
IntegrationType.okta,
|
|
28679
28732
|
IntegrationType.descope,
|
|
28680
28733
|
];
|
|
28681
|
-
const QueueIntegrationTypes = [
|
|
28734
|
+
const QueueIntegrationTypes = [
|
|
28735
|
+
IntegrationType.built_in_queue,
|
|
28736
|
+
IntegrationType.kafka,
|
|
28737
|
+
IntegrationType.confluent,
|
|
28738
|
+
];
|
|
28682
28739
|
function isDataIntegrationType(type) {
|
|
28683
28740
|
return DatabaseIntegrationTypes.includes(type);
|
|
28684
28741
|
}
|
|
@@ -45873,7 +45930,9 @@ class BackendFunctionManager {
|
|
|
45873
45930
|
functionName,
|
|
45874
45931
|
paramsArrayStr: serializeObj(params),
|
|
45875
45932
|
};
|
|
45876
|
-
|
|
45933
|
+
// Append '?functionName' suffix to every POST request for visibility in the browser's 'Network' tab.
|
|
45934
|
+
const postUrl = `backend-function/execute?${encodeURIComponent(functionName)}`;
|
|
45935
|
+
return (0,external_rxjs_.race)((0,external_rxjs_.from)(this.rpcManager.post(postUrl, request)).pipe(map(response => {
|
|
45877
45936
|
if (!response.success) {
|
|
45878
45937
|
throw new Error(response.payload);
|
|
45879
45938
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FunctionName } from './bundle-data.types';
|
|
2
|
+
export type AssistantToolType = 'code_interpreter' | 'retrieval';
|
|
3
|
+
export interface CreateAssistantRequest {
|
|
4
|
+
name: string;
|
|
5
|
+
instructions: string;
|
|
6
|
+
functions: Array<FunctionName>;
|
|
7
|
+
toolTypes?: Array<AssistantToolType>;
|
|
8
|
+
}
|
|
9
|
+
export interface DeleteAssistantRequest {
|
|
10
|
+
assistantId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateAssistantThreadRequest {
|
|
13
|
+
assistantId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface DeleteThreadRequest {
|
|
16
|
+
threadId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateAssistantThreadRequest {
|
|
19
|
+
}
|
|
20
|
+
export interface CreateAssistantResponse {
|
|
21
|
+
assistantId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CreateAssistantThreadResponse {
|
|
24
|
+
threadId: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The supported AI model names. */
|
|
2
|
+
export declare const AI_MODEL_NAMES: readonly ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "claude-2", "gpt-4-1106-preview"];
|
|
3
|
+
export type AiModelName = (typeof AI_MODEL_NAMES)[number];
|
|
4
|
+
/** The possible sources for the LLM provider API key. */
|
|
5
|
+
export type ApiKeySource = 'user' | 'system';
|
|
6
|
+
export type AiChatbotContextType = 'text' | 'url' | 'file';
|
|
7
|
+
interface AiChatbotContextBase {
|
|
8
|
+
type: AiChatbotContextType;
|
|
9
|
+
data: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AiChatbotTextContext extends AiChatbotContextBase {
|
|
12
|
+
type: 'text';
|
|
13
|
+
}
|
|
14
|
+
export interface AiChatbotUrlContext extends AiChatbotContextBase {
|
|
15
|
+
type: 'url';
|
|
16
|
+
}
|
|
17
|
+
export interface AiChatbotFileContext extends AiChatbotContextBase {
|
|
18
|
+
type: 'file';
|
|
19
|
+
}
|
|
20
|
+
export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
|
|
21
|
+
export type OpenAiResponseFormat = 'text' | 'json_object';
|
|
22
|
+
export interface AiChatbotChatOptions {
|
|
23
|
+
maxTokens?: number;
|
|
24
|
+
chatId?: string;
|
|
25
|
+
disableHistory?: boolean;
|
|
26
|
+
includeReference?: boolean;
|
|
27
|
+
responseFormat?: OpenAiResponseFormat;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiHeaders } from './api.types';
|
|
2
|
+
import { ApiEndpointId, HttpMethod } from './integrations/api.types';
|
|
3
|
+
/** The context of an API call. */
|
|
4
|
+
export declare class ApiCallContext {
|
|
5
|
+
readonly endpointId: ApiEndpointId;
|
|
6
|
+
readonly url: string;
|
|
7
|
+
readonly method: HttpMethod;
|
|
8
|
+
readonly headers: ApiHeaders;
|
|
9
|
+
readonly body: Record<string, any>;
|
|
10
|
+
readonly queryParams: Record<string, string | number | boolean>;
|
|
11
|
+
readonly pathParams: Record<string, string>;
|
|
12
|
+
readonly serverUrlOverride: string | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { AppId, EnvironmentId, IntegrationId } from './communication.types';
|
|
2
|
+
import { AuthIntegrationType, DatabaseIntegrationType, IntegrationConfig, IntegrationConfigTypes, IntegrationSchema, IntegrationSchemaKeys, IntegrationSchemaTypes, IntegrationTypeWithConfig } from './integrations/schemas';
|
|
3
|
+
import { IntegrationType } from './integration-types';
|
|
4
|
+
/** A type alias for a string that represents a webhook. */
|
|
5
|
+
export type WebhookId = string;
|
|
6
|
+
/** A type alias for a string that represents a trigger id. */
|
|
7
|
+
export type TriggerId = string;
|
|
8
|
+
/** A type alias for a string that represents a scheduler id. */
|
|
9
|
+
export type SchedulerId = string;
|
|
10
|
+
/** The supported cron expression string. */
|
|
11
|
+
export type CronExpressionString = `${string} ${string} ${string} ${string} ${string}` | `${string} ${string} ${string} ${string}`;
|
|
12
|
+
/** A set of predefined cron expressions. */
|
|
13
|
+
export declare enum CronExpression {
|
|
14
|
+
EVERY_SECOND = "* * * * * *",
|
|
15
|
+
EVERY_5_SECONDS = "*/5 * * * * *",
|
|
16
|
+
EVERY_10_SECONDS = "*/10 * * * * *",
|
|
17
|
+
EVERY_30_SECONDS = "*/30 * * * * *",
|
|
18
|
+
EVERY_MINUTE = "*/1 * * * *",
|
|
19
|
+
EVERY_5_MINUTES = "0 */5 * * * *",
|
|
20
|
+
EVERY_10_MINUTES = "0 */10 * * * *",
|
|
21
|
+
EVERY_30_MINUTES = "0 */30 * * * *",
|
|
22
|
+
EVERY_HOUR = "0 0-23/1 * * *",
|
|
23
|
+
EVERY_2_HOURS = "0 0-23/2 * * *",
|
|
24
|
+
EVERY_3_HOURS = "0 0-23/3 * * *",
|
|
25
|
+
EVERY_4_HOURS = "0 0-23/4 * * *",
|
|
26
|
+
EVERY_5_HOURS = "0 0-23/5 * * *",
|
|
27
|
+
EVERY_6_HOURS = "0 0-23/6 * * *",
|
|
28
|
+
EVERY_7_HOURS = "0 0-23/7 * * *",
|
|
29
|
+
EVERY_8_HOURS = "0 0-23/8 * * *",
|
|
30
|
+
EVERY_9_HOURS = "0 0-23/9 * * *",
|
|
31
|
+
EVERY_10_HOURS = "0 0-23/10 * * *",
|
|
32
|
+
EVERY_11_HOURS = "0 0-23/11 * * *",
|
|
33
|
+
EVERY_12_HOURS = "0 0-23/12 * * *",
|
|
34
|
+
EVERY_DAY_AT_1AM = "0 01 * * *",
|
|
35
|
+
EVERY_DAY_AT_2AM = "0 02 * * *",
|
|
36
|
+
EVERY_DAY_AT_3AM = "0 03 * * *",
|
|
37
|
+
EVERY_DAY_AT_4AM = "0 04 * * *",
|
|
38
|
+
EVERY_DAY_AT_5AM = "0 05 * * *",
|
|
39
|
+
EVERY_DAY_AT_6AM = "0 06 * * *",
|
|
40
|
+
EVERY_DAY_AT_7AM = "0 07 * * *",
|
|
41
|
+
EVERY_DAY_AT_8AM = "0 08 * * *",
|
|
42
|
+
EVERY_DAY_AT_9AM = "0 09 * * *",
|
|
43
|
+
EVERY_DAY_AT_10AM = "0 10 * * *",
|
|
44
|
+
EVERY_DAY_AT_11AM = "0 11 * * *",
|
|
45
|
+
EVERY_DAY_AT_NOON = "0 12 * * *",
|
|
46
|
+
EVERY_DAY_AT_1PM = "0 13 * * *",
|
|
47
|
+
EVERY_DAY_AT_2PM = "0 14 * * *",
|
|
48
|
+
EVERY_DAY_AT_3PM = "0 15 * * *",
|
|
49
|
+
EVERY_DAY_AT_4PM = "0 16 * * *",
|
|
50
|
+
EVERY_DAY_AT_5PM = "0 17 * * *",
|
|
51
|
+
EVERY_DAY_AT_6PM = "0 18 * * *",
|
|
52
|
+
EVERY_DAY_AT_7PM = "0 19 * * *",
|
|
53
|
+
EVERY_DAY_AT_8PM = "0 20 * * *",
|
|
54
|
+
EVERY_DAY_AT_9PM = "0 21 * * *",
|
|
55
|
+
EVERY_DAY_AT_10PM = "0 22 * * *",
|
|
56
|
+
EVERY_DAY_AT_11PM = "0 23 * * *",
|
|
57
|
+
EVERY_DAY_AT_MIDNIGHT = "0 0 * * *",
|
|
58
|
+
EVERY_WEEK = "0 0 * * 7",
|
|
59
|
+
EVERY_WEEKDAY = "0 0 * * 1-5",
|
|
60
|
+
EVERY_WEEKEND = "0 0 * * 6,7",
|
|
61
|
+
EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *",
|
|
62
|
+
EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *",
|
|
63
|
+
EVERY_2ND_HOUR = "0 */2 * * *",
|
|
64
|
+
EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *",
|
|
65
|
+
EVERY_2ND_MONTH = "0 0 1 */2 *",
|
|
66
|
+
EVERY_QUARTER = "0 0 1 */3 *",
|
|
67
|
+
EVERY_6_MONTHS = "0 0 1 */6 *",
|
|
68
|
+
EVERY_YEAR = "0 0 1 1 *",
|
|
69
|
+
EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *",
|
|
70
|
+
EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *",
|
|
71
|
+
EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *",
|
|
72
|
+
MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5",
|
|
73
|
+
MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5",
|
|
74
|
+
MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5",
|
|
75
|
+
MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5",
|
|
76
|
+
MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5",
|
|
77
|
+
MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5",
|
|
78
|
+
MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5",
|
|
79
|
+
MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5",
|
|
80
|
+
MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5",
|
|
81
|
+
MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5",
|
|
82
|
+
MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5",
|
|
83
|
+
MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5",
|
|
84
|
+
MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5",
|
|
85
|
+
MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5",
|
|
86
|
+
MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5",
|
|
87
|
+
MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5",
|
|
88
|
+
MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5",
|
|
89
|
+
MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5",
|
|
90
|
+
MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5",
|
|
91
|
+
MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5",
|
|
92
|
+
MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5",
|
|
93
|
+
MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5",
|
|
94
|
+
MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5",
|
|
95
|
+
MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5",
|
|
96
|
+
MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
|
|
97
|
+
}
|
|
98
|
+
export interface DeleteIntegrationRequest {
|
|
99
|
+
integrationId: IntegrationId;
|
|
100
|
+
}
|
|
101
|
+
export interface UpdateAllowedHostsRequest {
|
|
102
|
+
allowedHosts: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface CreateEnvironmentRequest {
|
|
105
|
+
sourceAppId: AppId;
|
|
106
|
+
environmentId: EnvironmentId;
|
|
107
|
+
}
|
|
108
|
+
export interface UpdateApplicationCodeRequest {
|
|
109
|
+
appId: AppId;
|
|
110
|
+
openApiSpecStr?: string;
|
|
111
|
+
openApiControllersStr?: string;
|
|
112
|
+
}
|
|
113
|
+
interface BaseUpsertIntegrationRequest<T extends IntegrationTypeWithConfig, C extends IntegrationConfig> {
|
|
114
|
+
id: IntegrationId;
|
|
115
|
+
type: T;
|
|
116
|
+
config: Partial<C>;
|
|
117
|
+
}
|
|
118
|
+
type ConfigurationTypes = {
|
|
119
|
+
[K in IntegrationTypeWithConfig]: IntegrationConfigTypes[K];
|
|
120
|
+
};
|
|
121
|
+
type UpsertIntegrationRequests = {
|
|
122
|
+
[K in IntegrationTypeWithConfig]: BaseUpsertIntegrationRequest<K, ConfigurationTypes[K]>;
|
|
123
|
+
};
|
|
124
|
+
export type UpsertDataIntegrationRequest = UpsertIntegrationRequests[DatabaseIntegrationType];
|
|
125
|
+
export type UpsertGraphQLIntegrationRequest = UpsertIntegrationRequests[IntegrationType.graphql];
|
|
126
|
+
export type UpsertApiIntegrationRequest = UpsertIntegrationRequests[IntegrationType.api];
|
|
127
|
+
export type UpsertAiChatbotIntegrationRequest = UpsertIntegrationRequests[IntegrationType.ai_chatbot];
|
|
128
|
+
export type UpsertKafkaIntegrationRequest = UpsertIntegrationRequests[IntegrationType.kafka];
|
|
129
|
+
export type UpsertConfluentIntegrationRequest = UpsertIntegrationRequests[IntegrationType.confluent];
|
|
130
|
+
export type UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
|
|
131
|
+
interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
|
|
132
|
+
id: IntegrationId;
|
|
133
|
+
type: T;
|
|
134
|
+
schema: S;
|
|
135
|
+
}
|
|
136
|
+
type SchemaTypes = {
|
|
137
|
+
[K in IntegrationSchemaKeys]: IntegrationSchemaTypes[K];
|
|
138
|
+
};
|
|
139
|
+
type UpsertIntegrationSchemaRequests = {
|
|
140
|
+
[K in IntegrationSchemaKeys]: BaseUpsertIntegrationSchemaRequest<K, SchemaTypes[K]>;
|
|
141
|
+
};
|
|
142
|
+
export type UpsertIntegrationSchemaRequest = UpsertDataIntegrationSchemaRequest | UpsertGraphQLIntegrationSchemaRequest | UpsertApiIntegrationSchemaRequest;
|
|
143
|
+
export type UpsertDataIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[DatabaseIntegrationType];
|
|
144
|
+
export type UpsertGraphQLIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.graphql];
|
|
145
|
+
export type UpsertApiIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.api];
|
|
146
|
+
export interface GetSchemaRequest {
|
|
147
|
+
integrationId: IntegrationId;
|
|
148
|
+
}
|
|
149
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { SerializedQuery } from './serialized-query.types';
|
|
3
|
+
import { Pagination, PaginationOptions } from './pagination';
|
|
4
|
+
import { DocumentData, FieldName, PrimitiveFieldType } from './document.types';
|
|
5
|
+
import { Operator } from './query.types';
|
|
6
|
+
export interface SnapshotEmitter<ReturnType> {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a promise that resolves to the query results.
|
|
9
|
+
*
|
|
10
|
+
* @returns A promise that resolves to the query results.
|
|
11
|
+
*/
|
|
12
|
+
snapshot(): Promise<Array<ReturnType>>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns an observable that emits the query results and updates whenever the query results change unless
|
|
15
|
+
* `subscribe=false` is provided.
|
|
16
|
+
*
|
|
17
|
+
* Important: Make sure to unsubscribe from the observable when you are done with it.
|
|
18
|
+
*
|
|
19
|
+
* @param subscribe Whether to subscribe to changes to the query results. Defaults to `true`.
|
|
20
|
+
* @returns An observable for the query results.
|
|
21
|
+
*/
|
|
22
|
+
snapshots(subscribe?: boolean): Observable<Array<ReturnType>>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the results of the query based on the data that is currently available on the client. This method is useful
|
|
25
|
+
* for synchronously accessing data that has already been fetched by another query. The method will return an empty
|
|
26
|
+
* array if data has not yet been populated.
|
|
27
|
+
*
|
|
28
|
+
* @returns An array of query results.
|
|
29
|
+
*/
|
|
30
|
+
peek(): Array<ReturnType>;
|
|
31
|
+
limit(limit: number): SnapshotEmitter<ReturnType>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a pagination wrapper for this query.
|
|
34
|
+
* @param options The pagination options. Defaults to `{ subscribe: true, pageSize: 100 }`.
|
|
35
|
+
*/
|
|
36
|
+
paginate(options?: Partial<PaginationOptions>): Pagination<ReturnType>;
|
|
37
|
+
serialize(): SerializedQuery;
|
|
38
|
+
}
|
|
39
|
+
/** Query builder base class. */
|
|
40
|
+
export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
|
|
41
|
+
/**
|
|
42
|
+
* Adds a condition to the query.
|
|
43
|
+
* @param fieldName The name of the field to query.
|
|
44
|
+
* @param operator The operator to use.
|
|
45
|
+
* @param value The value to compare against.
|
|
46
|
+
* @returns The query builder.
|
|
47
|
+
*/
|
|
48
|
+
abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
|
|
49
|
+
/**
|
|
50
|
+
* A shortcut for where(fieldName, '==', value)
|
|
51
|
+
*
|
|
52
|
+
* @param fieldName The name of the field to query.
|
|
53
|
+
* @param value The value to compare against.
|
|
54
|
+
* @returns The query builder.
|
|
55
|
+
*/
|
|
56
|
+
eq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
57
|
+
/**
|
|
58
|
+
* A shortcut for where(fieldName, '!=', value)
|
|
59
|
+
* @param fieldName The name of the field to query.
|
|
60
|
+
* @param value The value to compare against.
|
|
61
|
+
* @returns The query builder.
|
|
62
|
+
*/
|
|
63
|
+
neq(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
64
|
+
/**
|
|
65
|
+
* A shortcut for where(fieldName, 'in', value)
|
|
66
|
+
* @param fieldName The name of the field to query.
|
|
67
|
+
* @param value An array of values to compare against.
|
|
68
|
+
* @returns The query builder.
|
|
69
|
+
*/
|
|
70
|
+
in(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
|
|
71
|
+
/**
|
|
72
|
+
* A shortcut for where(fieldName, 'not in', value)
|
|
73
|
+
* @param fieldName The name of the field to query.
|
|
74
|
+
* @param value An array of values to compare against.
|
|
75
|
+
* @returns The query builder.
|
|
76
|
+
*/
|
|
77
|
+
nin(fieldName: (keyof MyDocType & FieldName) | string, value: Array<PrimitiveFieldType>): this;
|
|
78
|
+
/**
|
|
79
|
+
* A shortcut for where(fieldName, '>', value)
|
|
80
|
+
* @param fieldName The name of the field to query.
|
|
81
|
+
* @param value The value to compare against.
|
|
82
|
+
* @returns The query builder.
|
|
83
|
+
*/
|
|
84
|
+
gt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
85
|
+
/**
|
|
86
|
+
* A shortcut for where(fieldName, '>=', value)
|
|
87
|
+
* @param fieldName The name of the field to query.
|
|
88
|
+
* @param value The value to compare against.
|
|
89
|
+
* @returns The query builder.
|
|
90
|
+
*/
|
|
91
|
+
gte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
92
|
+
/**
|
|
93
|
+
* A shortcut for where(fieldName, '<', value)
|
|
94
|
+
* @param fieldName The name of the field to query.
|
|
95
|
+
* @param value The value to compare against.
|
|
96
|
+
* @returns The query builder.
|
|
97
|
+
*/
|
|
98
|
+
lt(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
99
|
+
/**
|
|
100
|
+
* A shortcut for where(fieldName, '<=', value)
|
|
101
|
+
* @param fieldName The name of the field to query.
|
|
102
|
+
* @param value The value to compare against.
|
|
103
|
+
* @returns The query builder.
|
|
104
|
+
*/
|
|
105
|
+
lte(fieldName: (keyof MyDocType & FieldName) | string, value: PrimitiveFieldType): this;
|
|
106
|
+
/**
|
|
107
|
+
* A shortcut for where(fieldName, 'like', pattern).
|
|
108
|
+
*
|
|
109
|
+
* @param fieldName The name of the field to query.
|
|
110
|
+
* @param pattern The pattern to compare against. '%' is the only allowed wildcard
|
|
111
|
+
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
112
|
+
* @returns The query builder.
|
|
113
|
+
*/
|
|
114
|
+
like(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
|
|
115
|
+
/**
|
|
116
|
+
* A shortcut for where(fieldName, 'not like', pattern).
|
|
117
|
+
*
|
|
118
|
+
* @param fieldName The name of the field to query.
|
|
119
|
+
* @param pattern The pattern to compare against. '%' is the only allowed wildcard
|
|
120
|
+
* @param caseSensitive Whether to use case-sensitive comparison. Defaults to true.
|
|
121
|
+
* @returns The query builder.
|
|
122
|
+
*/
|
|
123
|
+
notLike(fieldName: (keyof MyDocType & FieldName) | string, pattern: string, caseSensitive?: boolean): this;
|
|
124
|
+
/**
|
|
125
|
+
* Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
|
|
126
|
+
* if none is provided.
|
|
127
|
+
* @param limit The limit to set.
|
|
128
|
+
* @returns The query builder.
|
|
129
|
+
*/
|
|
130
|
+
abstract limit(limit: number): this;
|
|
131
|
+
/**
|
|
132
|
+
* Adds a sort order to the query. You can add multiple sort orders to the query. The order in which you add them
|
|
133
|
+
* determines the order in which they are applied.
|
|
134
|
+
* @param fieldName The name of the field to sort by.
|
|
135
|
+
* @param asc Whether to sort in ascending order. Defaults to true.
|
|
136
|
+
* @returns The query builder.
|
|
137
|
+
*/
|
|
138
|
+
abstract sortBy(fieldName: keyof MyDocType & FieldName, asc?: boolean): this;
|
|
139
|
+
}
|
|
140
|
+
export interface HasDereference {
|
|
141
|
+
/**
|
|
142
|
+
* Dereferences the document references in the result of this query. For example, collection.query().snapshot()
|
|
143
|
+
* returns an array of DocumentReference objects, but collection.query().dereference().snapshot() returns an array of
|
|
144
|
+
* the actual document data.
|
|
145
|
+
*/
|
|
146
|
+
dereference(): any;
|
|
147
|
+
}
|