@squidcloud/client 1.0.158 → 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 +215 -85
- package/dist/internal-common/src/public-types/application.types.d.ts +2 -0
- package/dist/internal-common/src/public-types/bundle-api.types.d.ts +4 -2
- package/dist/internal-common/src/public-types/bundle-data.types.d.ts +2 -0
- package/dist/internal-common/src/public-types/integration-types.d.ts +4 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +1 -1
- 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 +6 -1
- package/dist/internal-common/src/public-types/socket.types.d.ts +7 -0
- package/dist/internal-common/src/public-types/topic.context.d.ts +1 -0
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +1 -0
- package/dist/typescript-client/src/ai-chatbot-client.d.ts +1 -1
- package/dist/typescript-client/src/destruct.manager.d.ts +2 -1
- package/dist/typescript-client/src/public-types.d.ts +4 -3
- package/dist/typescript-client/src/queue.manager.d.ts +7 -0
- package/dist/typescript-client/src/squid.d.ts +7 -0
- package/package.json +1 -1
- /package/dist/internal-common/src/public-types/{ai-assistant.types.d.ts → ai-assistant.public-types.d.ts} +0 -0
- /package/dist/internal-common/src/public-types/{ai-chatbot.types.d.ts → ai-chatbot.public-types.d.ts} +0 -0
- /package/dist/internal-common/src/{public-types → types}/ai-chatbot.context.d.ts +0 -0
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) {
|
|
@@ -27924,10 +27976,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
27924
27976
|
__webpack_require__.d(__webpack_exports__, {
|
|
27925
27977
|
AI_MODEL_NAMES: () => (/* reexport */ AI_MODEL_NAMES),
|
|
27926
27978
|
APP_API_KEY: () => (/* reexport */ APP_API_KEY),
|
|
27927
|
-
AiChatbotChatContext: () => (/* reexport */ AiChatbotChatContext),
|
|
27928
|
-
AiChatbotMutationContext: () => (/* reexport */ AiChatbotMutationContext),
|
|
27929
27979
|
AiChatbotProfileReference: () => (/* reexport */ AiChatbotProfileReference),
|
|
27930
|
-
AiModelData: () => (/* reexport */ AiModelData),
|
|
27931
27980
|
ApiCallContext: () => (/* reexport */ ApiCallContext),
|
|
27932
27981
|
ApiIntegrationTypes: () => (/* reexport */ ApiIntegrationTypes),
|
|
27933
27982
|
AuthIntegrationTypes: () => (/* reexport */ AuthIntegrationTypes),
|
|
@@ -27959,6 +28008,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27959
28008
|
QueryBuilder: () => (/* reexport */ QueryBuilder),
|
|
27960
28009
|
QueryContext: () => (/* reexport */ QueryContext),
|
|
27961
28010
|
QueryMappingManager: () => (/* reexport */ QueryMappingManager),
|
|
28011
|
+
QueueIntegrationTypes: () => (/* reexport */ QueueIntegrationTypes),
|
|
27962
28012
|
SQUID_CLOUD_IDS: () => (/* reexport */ SQUID_CLOUD_IDS),
|
|
27963
28013
|
Squid: () => (/* reexport */ Squid),
|
|
27964
28014
|
SquidPlaceholderId: () => (/* reexport */ SquidPlaceholderId),
|
|
@@ -28002,30 +28052,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28002
28052
|
verifyWithSquidDevId: () => (/* reexport */ verifyWithSquidDevId)
|
|
28003
28053
|
});
|
|
28004
28054
|
|
|
28005
|
-
;// CONCATENATED MODULE: ../internal-common/src/public-types/ai-chatbot.
|
|
28006
|
-
class AiChatbotChatContext {
|
|
28007
|
-
/**
|
|
28008
|
-
* @internal
|
|
28009
|
-
*/
|
|
28010
|
-
constructor(request) {
|
|
28011
|
-
this.profileId = request.profileId;
|
|
28012
|
-
this.prompt = request.prompt;
|
|
28013
|
-
}
|
|
28014
|
-
}
|
|
28015
|
-
/** A context provided to the security rules of an AI Chatbot mutation. */
|
|
28016
|
-
class AiChatbotMutationContext {
|
|
28017
|
-
/**
|
|
28018
|
-
* @internal
|
|
28019
|
-
*/
|
|
28020
|
-
constructor(request) {
|
|
28021
|
-
this.profileId = request.profileId;
|
|
28022
|
-
this.type = request.type;
|
|
28023
|
-
this.resource = request.resource;
|
|
28024
|
-
this.payload = request.payload;
|
|
28025
|
-
}
|
|
28026
|
-
}
|
|
28027
|
-
|
|
28028
|
-
;// CONCATENATED MODULE: ../internal-common/src/public-types/ai-chatbot.types.ts
|
|
28055
|
+
;// CONCATENATED MODULE: ../internal-common/src/public-types/ai-chatbot.public-types.ts
|
|
28029
28056
|
/** The supported AI model names. */
|
|
28030
28057
|
const AI_MODEL_NAMES = [
|
|
28031
28058
|
'gpt-3.5-turbo',
|
|
@@ -28034,24 +28061,6 @@ const AI_MODEL_NAMES = [
|
|
|
28034
28061
|
'claude-2',
|
|
28035
28062
|
'gpt-4-1106-preview',
|
|
28036
28063
|
];
|
|
28037
|
-
/** @internal */
|
|
28038
|
-
const AiModelData = {
|
|
28039
|
-
'gpt-4': {
|
|
28040
|
-
tokens: 8192,
|
|
28041
|
-
},
|
|
28042
|
-
'gpt-3.5-turbo': {
|
|
28043
|
-
tokens: 4096,
|
|
28044
|
-
},
|
|
28045
|
-
'gpt-3.5-turbo-1106': {
|
|
28046
|
-
tokens: 16385,
|
|
28047
|
-
},
|
|
28048
|
-
'claude-2': {
|
|
28049
|
-
tokens: 100000,
|
|
28050
|
-
},
|
|
28051
|
-
'gpt-4-1106-preview': {
|
|
28052
|
-
tokens: 8192,
|
|
28053
|
-
},
|
|
28054
|
-
};
|
|
28055
28064
|
|
|
28056
28065
|
;// CONCATENATED MODULE: ../internal-common/src/public-types/api-call.context.ts
|
|
28057
28066
|
/** The context of an API call. */
|
|
@@ -28178,6 +28187,8 @@ const ExecuteFunctionSecureAnnotations = [
|
|
|
28178
28187
|
'secureApi',
|
|
28179
28188
|
'secureAiChatbotChat',
|
|
28180
28189
|
'secureAiChatbotMutation',
|
|
28190
|
+
'secureQueueWrite',
|
|
28191
|
+
'secureQueueRead',
|
|
28181
28192
|
];
|
|
28182
28193
|
function convertToRunSecrets(appSecrets) {
|
|
28183
28194
|
const result = {
|
|
@@ -28610,6 +28621,7 @@ var http_status_enum_HttpStatus;
|
|
|
28610
28621
|
var IntegrationCategory;
|
|
28611
28622
|
(function (IntegrationCategory) {
|
|
28612
28623
|
IntegrationCategory["database"] = "database";
|
|
28624
|
+
IntegrationCategory["queue"] = "queue";
|
|
28613
28625
|
IntegrationCategory["api"] = "api";
|
|
28614
28626
|
IntegrationCategory["observability"] = "observability";
|
|
28615
28627
|
IntegrationCategory["crm"] = "crm";
|
|
@@ -28636,6 +28648,9 @@ var IntegrationType;
|
|
|
28636
28648
|
IntegrationType["cognito"] = "cognito";
|
|
28637
28649
|
IntegrationType["okta"] = "okta";
|
|
28638
28650
|
IntegrationType["descope"] = "descope";
|
|
28651
|
+
IntegrationType["kafka"] = "kafka";
|
|
28652
|
+
IntegrationType["confluent"] = "confluent";
|
|
28653
|
+
IntegrationType["built_in_queue"] = "built_in_queue";
|
|
28639
28654
|
// Coming Soon
|
|
28640
28655
|
IntegrationType["algolia"] = "algolia";
|
|
28641
28656
|
IntegrationType["elastic_observability"] = "elastic_observability";
|
|
@@ -28716,6 +28731,11 @@ const AuthIntegrationTypes = [
|
|
|
28716
28731
|
IntegrationType.okta,
|
|
28717
28732
|
IntegrationType.descope,
|
|
28718
28733
|
];
|
|
28734
|
+
const QueueIntegrationTypes = [
|
|
28735
|
+
IntegrationType.built_in_queue,
|
|
28736
|
+
IntegrationType.kafka,
|
|
28737
|
+
IntegrationType.confluent,
|
|
28738
|
+
];
|
|
28719
28739
|
function isDataIntegrationType(type) {
|
|
28720
28740
|
return DatabaseIntegrationTypes.includes(type);
|
|
28721
28741
|
}
|
|
@@ -29751,6 +29771,7 @@ var ClientConnectionState;
|
|
|
29751
29771
|
|
|
29752
29772
|
|
|
29753
29773
|
|
|
29774
|
+
|
|
29754
29775
|
|
|
29755
29776
|
|
|
29756
29777
|
;// CONCATENATED MODULE: ../internal-common/src/public-utils/id-utils.ts
|
|
@@ -30844,7 +30865,7 @@ class AiChatbotProfileReference {
|
|
|
30844
30865
|
return new AiChatbotInstructionReference(this.client, this.integrationId, this.profileId, id);
|
|
30845
30866
|
}
|
|
30846
30867
|
/**
|
|
30847
|
-
* Adds a new profile to the
|
|
30868
|
+
* Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
|
|
30848
30869
|
*
|
|
30849
30870
|
* @param data An object containing options for creating the profile.
|
|
30850
30871
|
* @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
|
|
@@ -45720,6 +45741,7 @@ const kotlinControllers = [
|
|
|
45720
45741
|
'application-kotlin',
|
|
45721
45742
|
'openapi',
|
|
45722
45743
|
'secret',
|
|
45744
|
+
'queue',
|
|
45723
45745
|
];
|
|
45724
45746
|
function getApplicationUrl(regionPrefix, appId, path) {
|
|
45725
45747
|
const baseUrl = 'https://squid.cloud';
|
|
@@ -45908,7 +45930,9 @@ class BackendFunctionManager {
|
|
|
45908
45930
|
functionName,
|
|
45909
45931
|
paramsArrayStr: serializeObj(params),
|
|
45910
45932
|
};
|
|
45911
|
-
|
|
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 => {
|
|
45912
45936
|
if (!response.success) {
|
|
45913
45937
|
throw new Error(response.payload);
|
|
45914
45938
|
}
|
|
@@ -46766,7 +46790,7 @@ const UNSET_VALUE = Symbol('undefined');
|
|
|
46766
46790
|
|
|
46767
46791
|
class DestructManager {
|
|
46768
46792
|
constructor() {
|
|
46769
|
-
this.
|
|
46793
|
+
this.preDestructors = [];
|
|
46770
46794
|
this.destructors = [];
|
|
46771
46795
|
this.isDestructedSubject = new external_rxjs_.BehaviorSubject(false);
|
|
46772
46796
|
}
|
|
@@ -46777,17 +46801,14 @@ class DestructManager {
|
|
|
46777
46801
|
return this.isDestructedSubject.asObservable().pipe((0,external_rxjs_.filter)(Boolean), map(() => undefined));
|
|
46778
46802
|
}
|
|
46779
46803
|
onPreDestruct(fn) {
|
|
46780
|
-
this.
|
|
46804
|
+
this.preDestructors.push(fn);
|
|
46781
46805
|
}
|
|
46782
46806
|
onDestruct(fn) {
|
|
46783
46807
|
this.destructors.push(fn);
|
|
46784
46808
|
}
|
|
46785
46809
|
async destruct() {
|
|
46786
|
-
|
|
46787
|
-
|
|
46788
|
-
}
|
|
46789
|
-
this.isDestructedSubject.next(true);
|
|
46790
|
-
const fns = this.predestructors.concat(this.destructors);
|
|
46810
|
+
this.reportDestructed();
|
|
46811
|
+
const fns = this.preDestructors.concat(this.destructors);
|
|
46791
46812
|
let fn = fns.shift();
|
|
46792
46813
|
while (fn) {
|
|
46793
46814
|
try {
|
|
@@ -46799,6 +46820,12 @@ class DestructManager {
|
|
|
46799
46820
|
fn = fns.shift();
|
|
46800
46821
|
}
|
|
46801
46822
|
}
|
|
46823
|
+
reportDestructed() {
|
|
46824
|
+
if (this.isDestructing) {
|
|
46825
|
+
return;
|
|
46826
|
+
}
|
|
46827
|
+
this.isDestructedSubject.next(true);
|
|
46828
|
+
}
|
|
46802
46829
|
}
|
|
46803
46830
|
|
|
46804
46831
|
;// CONCATENATED MODULE: ./src/distributed-lock.manager.ts
|
|
@@ -49002,6 +49029,101 @@ class LockManager {
|
|
|
49002
49029
|
}
|
|
49003
49030
|
}
|
|
49004
49031
|
|
|
49032
|
+
;// CONCATENATED MODULE: ./src/queue.manager.ts
|
|
49033
|
+
|
|
49034
|
+
/** @internal */
|
|
49035
|
+
class QueueManagerFactory {
|
|
49036
|
+
constructor(rpcManager, socketManager, destructManager) {
|
|
49037
|
+
this.rpcManager = rpcManager;
|
|
49038
|
+
this.socketManager = socketManager;
|
|
49039
|
+
this.queueManagers = new Map();
|
|
49040
|
+
this.socketManager.observeNotifications().subscribe(message => {
|
|
49041
|
+
const queueManager = this.getOrUndefined(message.integrationId, message.topicName);
|
|
49042
|
+
if (!queueManager) {
|
|
49043
|
+
return;
|
|
49044
|
+
}
|
|
49045
|
+
queueManager.onMessages(message.payload);
|
|
49046
|
+
});
|
|
49047
|
+
destructManager.onPreDestruct(() => {
|
|
49048
|
+
for (const queueManagersForIntegration of this.queueManagers.values()) {
|
|
49049
|
+
for (const queueManager of queueManagersForIntegration.values()) {
|
|
49050
|
+
queueManager.destruct();
|
|
49051
|
+
}
|
|
49052
|
+
}
|
|
49053
|
+
});
|
|
49054
|
+
}
|
|
49055
|
+
get(integrationId, topicName) {
|
|
49056
|
+
let integrationQueueManagers = this.queueManagers.get(integrationId);
|
|
49057
|
+
if (!integrationQueueManagers) {
|
|
49058
|
+
integrationQueueManagers = new Map();
|
|
49059
|
+
this.queueManagers.set(integrationId, integrationQueueManagers);
|
|
49060
|
+
}
|
|
49061
|
+
let queueManager = integrationQueueManagers.get(topicName);
|
|
49062
|
+
if (!queueManager) {
|
|
49063
|
+
queueManager = new QueueManagerImpl(integrationId, topicName, this.rpcManager);
|
|
49064
|
+
integrationQueueManagers.set(topicName, queueManager);
|
|
49065
|
+
}
|
|
49066
|
+
return queueManager;
|
|
49067
|
+
}
|
|
49068
|
+
getOrUndefined(integrationId, topicName) {
|
|
49069
|
+
var _a;
|
|
49070
|
+
return (_a = this.queueManagers.get(integrationId)) === null || _a === void 0 ? void 0 : _a.get(topicName);
|
|
49071
|
+
}
|
|
49072
|
+
}
|
|
49073
|
+
/** @internal */
|
|
49074
|
+
class QueueManagerImpl {
|
|
49075
|
+
constructor(integrationId, topicName, rpcManager) {
|
|
49076
|
+
this.integrationId = integrationId;
|
|
49077
|
+
this.topicName = topicName;
|
|
49078
|
+
this.rpcManager = rpcManager;
|
|
49079
|
+
this.messagesSubject = new external_rxjs_.Subject();
|
|
49080
|
+
this.subscriberCount = 0;
|
|
49081
|
+
}
|
|
49082
|
+
async produce(messages) {
|
|
49083
|
+
await this.rpcManager.post('queue/produceMessages', {
|
|
49084
|
+
integrationId: this.integrationId,
|
|
49085
|
+
topicName: this.topicName,
|
|
49086
|
+
messages,
|
|
49087
|
+
});
|
|
49088
|
+
}
|
|
49089
|
+
consume() {
|
|
49090
|
+
return (0,external_rxjs_.defer)(() => {
|
|
49091
|
+
// Code to run when the observable is subscribed
|
|
49092
|
+
this.subscriberCount++;
|
|
49093
|
+
if (this.subscriberCount === 1) {
|
|
49094
|
+
this.rpcManager
|
|
49095
|
+
.post('queue/subscribe', {
|
|
49096
|
+
integrationId: this.integrationId,
|
|
49097
|
+
topicName: this.topicName,
|
|
49098
|
+
})
|
|
49099
|
+
.catch(e => {
|
|
49100
|
+
this.messagesSubject.error(e);
|
|
49101
|
+
this.messagesSubject.complete();
|
|
49102
|
+
this.subscriberCount = 0;
|
|
49103
|
+
this.messagesSubject = new external_rxjs_.Subject();
|
|
49104
|
+
});
|
|
49105
|
+
}
|
|
49106
|
+
return this.messagesSubject.asObservable().pipe((0,external_rxjs_.finalize)(() => {
|
|
49107
|
+
this.subscriberCount--;
|
|
49108
|
+
if (this.subscriberCount === 0) {
|
|
49109
|
+
this.rpcManager.post('queue/unsubscribe', {
|
|
49110
|
+
integrationId: this.integrationId,
|
|
49111
|
+
topicName: this.topicName,
|
|
49112
|
+
});
|
|
49113
|
+
}
|
|
49114
|
+
}));
|
|
49115
|
+
});
|
|
49116
|
+
}
|
|
49117
|
+
onMessages(payload) {
|
|
49118
|
+
for (const message of payload) {
|
|
49119
|
+
this.messagesSubject.next(message);
|
|
49120
|
+
}
|
|
49121
|
+
}
|
|
49122
|
+
destruct() {
|
|
49123
|
+
this.messagesSubject.complete();
|
|
49124
|
+
}
|
|
49125
|
+
}
|
|
49126
|
+
|
|
49005
49127
|
;// CONCATENATED MODULE: ./src/squid.ts
|
|
49006
49128
|
|
|
49007
49129
|
|
|
@@ -49031,6 +49153,7 @@ class LockManager {
|
|
|
49031
49153
|
|
|
49032
49154
|
|
|
49033
49155
|
|
|
49156
|
+
|
|
49034
49157
|
|
|
49035
49158
|
|
|
49036
49159
|
/**
|
|
@@ -49089,6 +49212,7 @@ class Squid {
|
|
|
49089
49212
|
this.graphqlClientFactory = new GraphQLClientFactory(this.rpcManager, options.region, appId);
|
|
49090
49213
|
this.secretClient = new SecretClient(this.rpcManager);
|
|
49091
49214
|
this._connectionDetails = new ConnectionDetails(this.clientIdService, this.socketManager);
|
|
49215
|
+
this.queueManagerFactory = new QueueManagerFactory(this.rpcManager, this.socketManager, this.destructManager);
|
|
49092
49216
|
}
|
|
49093
49217
|
/**
|
|
49094
49218
|
* Returns the global Squid instance with the given options, creating a new instance if one with the same options
|
|
@@ -49244,6 +49368,14 @@ class Squid {
|
|
|
49244
49368
|
this._validateNotDestructed();
|
|
49245
49369
|
return this.distributedLockManager.lock(mutex);
|
|
49246
49370
|
}
|
|
49371
|
+
/**
|
|
49372
|
+
* Returns a queue manager for the given topic name and integration id. Using the queue manager you can consume and
|
|
49373
|
+
* produce messages
|
|
49374
|
+
*/
|
|
49375
|
+
queue(topicName, integrationId = IntegrationType.built_in_queue) {
|
|
49376
|
+
this._validateNotDestructed();
|
|
49377
|
+
return this.queueManagerFactory.get(integrationId, topicName);
|
|
49378
|
+
}
|
|
49247
49379
|
/**
|
|
49248
49380
|
* Destructs the Squid Client. Unsubscribes from all ongoing queries or requests, and clears the local data.
|
|
49249
49381
|
* After invoking this method, the Squid client will not be usable.
|
|
@@ -49251,8 +49383,6 @@ class Squid {
|
|
|
49251
49383
|
* @returns A promise that resolves when the destruct process is complete.
|
|
49252
49384
|
*/
|
|
49253
49385
|
async destruct() {
|
|
49254
|
-
if (this.destructManager.isDestructing)
|
|
49255
|
-
return;
|
|
49256
49386
|
return this.destructManager.destruct().finally(() => {
|
|
49257
49387
|
const entry = Object.entries(Squid.squidInstancesMap).find(([, value]) => value === this);
|
|
49258
49388
|
if (entry)
|
|
@@ -125,6 +125,8 @@ export type UpsertDataIntegrationRequest = UpsertIntegrationRequests[DatabaseInt
|
|
|
125
125
|
export type UpsertGraphQLIntegrationRequest = UpsertIntegrationRequests[IntegrationType.graphql];
|
|
126
126
|
export type UpsertApiIntegrationRequest = UpsertIntegrationRequests[IntegrationType.api];
|
|
127
127
|
export type UpsertAiChatbotIntegrationRequest = UpsertIntegrationRequests[IntegrationType.ai_chatbot];
|
|
128
|
+
export type UpsertKafkaIntegrationRequest = UpsertIntegrationRequests[IntegrationType.kafka];
|
|
129
|
+
export type UpsertConfluentIntegrationRequest = UpsertIntegrationRequests[IntegrationType.confluent];
|
|
128
130
|
export type UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
|
|
129
131
|
interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
|
|
130
132
|
id: IntegrationId;
|
|
@@ -3,14 +3,16 @@ import { ApiCallContext } from './api-call.context';
|
|
|
3
3
|
import { GraphqlContext } from './graphql.context';
|
|
4
4
|
import { DistributedLockContext } from './distributed-lock.context';
|
|
5
5
|
import { NativeQueryContext } from './native-query.context';
|
|
6
|
-
import { AiChatbotChatContext, AiChatbotMutationContext } from './ai-chatbot.context';
|
|
7
6
|
import { QueryContext } from './query-context';
|
|
8
|
-
import { AiChatbotActionType, DatabaseActionType } from './bundle-data.types';
|
|
7
|
+
import { AiChatbotActionType, DatabaseActionType, TopicActionType } from './bundle-data.types';
|
|
9
8
|
import { ClientId } from './communication.types';
|
|
10
9
|
import { DocumentData, SquidDocId } from './document.types';
|
|
11
10
|
import { MutationType } from './mutation.types';
|
|
12
11
|
import { ClientConnectionState } from './socket.types';
|
|
12
|
+
import { TopicReadContext, TopicWriteContext } from './topic.context';
|
|
13
|
+
import { AiChatbotChatContext, AiChatbotMutationContext } from '../types/ai-chatbot.context';
|
|
13
14
|
export type SecureDatabaseAction<T extends DatabaseActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: QueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: MutationContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
15
|
+
export type SecureTopicAction<T extends TopicActionType> = T extends 'all' ? () => boolean | Promise<boolean> : T extends 'read' ? ((context: TopicReadContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>) : ((context: TopicWriteContext<T>) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
14
16
|
export type SecureApiAction = ((context: ApiCallContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
15
17
|
export type SecureNativeQueryAction = ((context: NativeQueryContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
16
18
|
export type SecureDistributedLockAction = ((context: DistributedLockContext) => boolean | Promise<boolean>) | (() => boolean | Promise<boolean>);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** The different types of actions that can be performed on a database. */
|
|
2
2
|
export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
|
|
3
|
+
/** The different types of actions that can be performed on a topic. */
|
|
4
|
+
export type TopicActionType = 'read' | 'write' | 'all';
|
|
3
5
|
/** The different types of actions that can be performed on an AI chatbot. */
|
|
4
6
|
export type AiChatbotActionType = 'chat' | 'mutate' | 'all';
|
|
5
7
|
export interface LocalBackendData {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare enum IntegrationCategory {
|
|
2
2
|
'database' = "database",
|
|
3
|
+
'queue' = "queue",
|
|
3
4
|
'api' = "api",
|
|
4
5
|
'observability' = "observability",
|
|
5
6
|
'crm' = "crm",
|
|
@@ -25,6 +26,9 @@ export declare enum IntegrationType {
|
|
|
25
26
|
'cognito' = "cognito",
|
|
26
27
|
'okta' = "okta",
|
|
27
28
|
'descope' = "descope",
|
|
29
|
+
'kafka' = "kafka",
|
|
30
|
+
'confluent' = "confluent",
|
|
31
|
+
'built_in_queue' = "built_in_queue",
|
|
28
32
|
'algolia' = "algolia",
|
|
29
33
|
'elastic_observability' = "elastic_observability",
|
|
30
34
|
'elastic_search' = "elastic_search",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseIntegrationConfig } from './schemas';
|
|
2
|
-
import { AiModelName } from '../ai-chatbot.types';
|
|
2
|
+
import { AiModelName } from '../ai-chatbot.public-types';
|
|
3
3
|
import { IntegrationId } from '../communication.types';
|
|
4
4
|
import { IntegrationType } from '../integration-types';
|
|
5
5
|
export interface AiChatbotIntegrationConfig extends BaseIntegrationConfig {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IntegrationType } from '../integration-types';
|
|
2
|
+
import { BaseIntegrationConfig, QueueIntegrationTypes } from './schemas';
|
|
3
|
+
export type QueueIntegrationType = (typeof QueueIntegrationTypes)[number];
|
|
4
|
+
export interface BaseQueueIntegrationConfig extends BaseIntegrationConfig {
|
|
5
|
+
type: QueueIntegrationType;
|
|
6
|
+
}
|
|
7
|
+
export interface KafkaConnectionSecretOptions {
|
|
8
|
+
password?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface KafkaConnectionOptions {
|
|
11
|
+
secrets?: KafkaConnectionSecretOptions;
|
|
12
|
+
username?: string;
|
|
13
|
+
bootstrapServers: string;
|
|
14
|
+
}
|
|
15
|
+
export interface KafkaIntegrationConfiguration {
|
|
16
|
+
connectionOptions: KafkaConnectionOptions;
|
|
17
|
+
}
|
|
18
|
+
export interface KafkaIntegrationConfig extends BaseQueueIntegrationConfig {
|
|
19
|
+
type: IntegrationType.kafka;
|
|
20
|
+
configuration: KafkaIntegrationConfiguration;
|
|
21
|
+
}
|
|
22
|
+
export interface ConfluentIntegrationConfig extends BaseQueueIntegrationConfig {
|
|
23
|
+
type: IntegrationType.confluent;
|
|
24
|
+
configuration: KafkaIntegrationConfiguration;
|
|
25
|
+
}
|
|
26
|
+
export interface BuiltInQueueIntegrationConfig extends BaseQueueIntegrationConfig {
|
|
27
|
+
type: IntegrationType.built_in_queue;
|
|
28
|
+
}
|
|
29
|
+
export interface TestKafkaConnectionRequest {
|
|
30
|
+
type: IntegrationType.kafka;
|
|
31
|
+
configuration: {
|
|
32
|
+
connectionOptions: KafkaConnectionOptions;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface TestConfluentConnectionRequest {
|
|
36
|
+
type: IntegrationType.confluent;
|
|
37
|
+
configuration: {
|
|
38
|
+
connectionOptions: KafkaConnectionOptions;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -5,6 +5,7 @@ import { BaseDatabaseIntegrationConfig, BigQueryIntegrationConfig, CockroachInte
|
|
|
5
5
|
import { DatadogIntegrationConfig, NewRelicIntegrationConfig } from './observability.types';
|
|
6
6
|
import { IntegrationId } from '../communication.types';
|
|
7
7
|
import { IntegrationSchemaType, IntegrationType } from '../integration-types';
|
|
8
|
+
import { BuiltInQueueIntegrationConfig, ConfluentIntegrationConfig, KafkaIntegrationConfig, TestConfluentConnectionRequest, TestKafkaConnectionRequest } from './queue-types';
|
|
8
9
|
export interface IntegrationConfigTypes {
|
|
9
10
|
[IntegrationType.built_in_db]: InternalIntegrationConfig;
|
|
10
11
|
[IntegrationType.mongo]: MongoIntegrationConfig;
|
|
@@ -26,6 +27,9 @@ export interface IntegrationConfigTypes {
|
|
|
26
27
|
[IntegrationType.ai_chatbot]: AiChatbotIntegrationConfig;
|
|
27
28
|
[IntegrationType.cognito]: CognitoIntegrationConfig;
|
|
28
29
|
[IntegrationType.okta]: OktaIntegrationConfig;
|
|
30
|
+
[IntegrationType.kafka]: KafkaIntegrationConfig;
|
|
31
|
+
[IntegrationType.confluent]: ConfluentIntegrationConfig;
|
|
32
|
+
[IntegrationType.built_in_queue]: BuiltInQueueIntegrationConfig;
|
|
29
33
|
[IntegrationType.descope]: DescopeIntegrationConfig;
|
|
30
34
|
}
|
|
31
35
|
export interface IntegrationSchemaTypes {
|
|
@@ -52,6 +56,7 @@ export type DatabaseIntegrationConfig = IntegrationConfigTypes[DatabaseIntegrati
|
|
|
52
56
|
export declare const ApiIntegrationTypes: readonly [IntegrationType.api, IntegrationType.graphql];
|
|
53
57
|
export declare const ObservabilityIntegrationTypes: readonly [IntegrationType.datadog, IntegrationType.newrelic];
|
|
54
58
|
export declare const AuthIntegrationTypes: readonly [IntegrationType.auth0, IntegrationType.jwt_rsa, IntegrationType.jwt_hmac, IntegrationType.cognito, IntegrationType.okta, IntegrationType.descope];
|
|
59
|
+
export declare const QueueIntegrationTypes: readonly [IntegrationType.built_in_queue, IntegrationType.kafka, IntegrationType.confluent];
|
|
55
60
|
export type ApiIntegrationType = (typeof ApiIntegrationTypes)[number];
|
|
56
61
|
export type ApiIntegrationConfig = IntegrationConfigTypes[ApiIntegrationType];
|
|
57
62
|
export type ObservabilityIntegrationType = (typeof ObservabilityIntegrationTypes)[number];
|
|
@@ -71,4 +76,4 @@ export interface BaseIntegrationConfig {
|
|
|
71
76
|
export interface BaseIntegrationSchema {
|
|
72
77
|
type: IntegrationSchemaType;
|
|
73
78
|
}
|
|
74
|
-
export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest;
|
|
79
|
+
export type TestConnectionRequest = TestDataConnectionRequest | TestGraphQLDataConnectionRequest | TestKafkaConnectionRequest | TestConfluentConnectionRequest;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { IntegrationId } from './communication.types';
|
|
2
|
+
export interface QueueMessageToClient extends BaseMessageToClient {
|
|
3
|
+
type: 'queue';
|
|
4
|
+
integrationId: IntegrationId;
|
|
5
|
+
topicName: string;
|
|
6
|
+
payload: string[];
|
|
7
|
+
}
|
|
1
8
|
export declare enum ClientConnectionState {
|
|
2
9
|
CONNECTED = "CONNECTED",
|
|
3
10
|
DISCONNECTED = "DISCONNECTED",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -62,7 +62,7 @@ export declare class AiChatbotProfileReference {
|
|
|
62
62
|
*/
|
|
63
63
|
instruction(id?: string): AiChatbotInstructionReference;
|
|
64
64
|
/**
|
|
65
|
-
* Adds a new profile to the
|
|
65
|
+
* Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
|
|
66
66
|
*
|
|
67
67
|
* @param data An object containing options for creating the profile.
|
|
68
68
|
* @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
export type DestructorFn = () => Promise<void> | void;
|
|
3
3
|
export declare class DestructManager {
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly preDestructors;
|
|
5
5
|
private readonly destructors;
|
|
6
6
|
private readonly isDestructedSubject;
|
|
7
7
|
get isDestructing(): boolean;
|
|
@@ -9,4 +9,5 @@ export declare class DestructManager {
|
|
|
9
9
|
onPreDestruct(fn: DestructorFn): void;
|
|
10
10
|
onDestruct(fn: DestructorFn): void;
|
|
11
11
|
destruct(): Promise<void>;
|
|
12
|
+
reportDestructed(): void;
|
|
12
13
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export * from '../../internal-common/src/public-types/ai-assistant.types';
|
|
2
|
-
export * from '../../internal-common/src/public-types/ai-chatbot.
|
|
3
|
-
export * from '../../internal-common/src/public-types/ai-chatbot.types';
|
|
1
|
+
export * from '../../internal-common/src/public-types/ai-assistant.public-types';
|
|
2
|
+
export * from '../../internal-common/src/public-types/ai-chatbot.public-types';
|
|
4
3
|
export * from '../../internal-common/src/public-types/api-call.context';
|
|
5
4
|
export * from '../../internal-common/src/public-types/api.types';
|
|
6
5
|
export * from '../../internal-common/src/public-types/application.types';
|
|
@@ -23,6 +22,7 @@ export * from '../../internal-common/src/public-types/integrations/auth.types';
|
|
|
23
22
|
export * from '../../internal-common/src/public-types/integrations/database.types';
|
|
24
23
|
export * from '../../internal-common/src/public-types/integrations/observability.types';
|
|
25
24
|
export * from '../../internal-common/src/public-types/integrations/schemas';
|
|
25
|
+
export * from '../../internal-common/src/public-types/integrations/queue-types';
|
|
26
26
|
export * from '../../internal-common/src/public-types/logger.types';
|
|
27
27
|
export * from '../../internal-common/src/public-types/metrics.types';
|
|
28
28
|
export * from '../../internal-common/src/public-types/mutation.context';
|
|
@@ -37,4 +37,5 @@ export * from '../../internal-common/src/public-types/regions';
|
|
|
37
37
|
export * from '../../internal-common/src/public-types/secret.types';
|
|
38
38
|
export * from '../../internal-common/src/public-types/serialized-query.types';
|
|
39
39
|
export * from '../../internal-common/src/public-types/socket.types';
|
|
40
|
+
export * from '../../internal-common/src/public-types/topic.context';
|
|
40
41
|
export * from '../../internal-common/src/public-types/types';
|
|
@@ -6,6 +6,7 @@ import { SecretClient } from './secret.client';
|
|
|
6
6
|
import { TransactionId } from './types';
|
|
7
7
|
import { AiClient } from './ai.types';
|
|
8
8
|
import { ApiEndpointId, ApiKey, AppId, CollectionName, DocumentData, EnvironmentId, IntegrationId, SquidDeveloperId, SupportedSquidRegion } from './public-types';
|
|
9
|
+
import { QueueManager } from './queue.manager';
|
|
9
10
|
/** The different options that can be used to initialize a Squid instance. */
|
|
10
11
|
export interface SquidOptions {
|
|
11
12
|
/**
|
|
@@ -102,6 +103,7 @@ export declare class Squid {
|
|
|
102
103
|
private readonly querySender;
|
|
103
104
|
private static readonly squidInstancesMap;
|
|
104
105
|
private readonly aiClient;
|
|
106
|
+
private readonly queueManagerFactory;
|
|
105
107
|
/**
|
|
106
108
|
* Creates a new instance of Squid with the given options.
|
|
107
109
|
*
|
|
@@ -225,6 +227,11 @@ export declare class Squid {
|
|
|
225
227
|
* @returns A promise that resolves with the lock object. The promise will reject if failed to acquire the lock.
|
|
226
228
|
*/
|
|
227
229
|
acquireLock(mutex: string): Promise<DistributedLock>;
|
|
230
|
+
/**
|
|
231
|
+
* Returns a queue manager for the given topic name and integration id. Using the queue manager you can consume and
|
|
232
|
+
* produce messages
|
|
233
|
+
*/
|
|
234
|
+
queue(topicName: string, integrationId?: IntegrationId): QueueManager;
|
|
228
235
|
/**
|
|
229
236
|
* Destructs the Squid Client. Unsubscribes from all ongoing queries or requests, and clears the local data.
|
|
230
237
|
* After invoking this method, the Squid client will not be usable.
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|