@squidcloud/client 1.0.158 → 1.0.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/cjs/index.js +126 -55
  2. package/package.json +1 -1
  3. package/dist/internal-common/src/public-types/ai-assistant.types.d.ts +0 -25
  4. package/dist/internal-common/src/public-types/ai-chatbot.context.d.ts +0 -12
  5. package/dist/internal-common/src/public-types/ai-chatbot.types.d.ts +0 -29
  6. package/dist/internal-common/src/public-types/api-call.context.d.ts +0 -13
  7. package/dist/internal-common/src/public-types/api.types.d.ts +0 -4
  8. package/dist/internal-common/src/public-types/application.types.d.ts +0 -147
  9. package/dist/internal-common/src/public-types/backend-run.types.d.ts +0 -2
  10. package/dist/internal-common/src/public-types/base-query-builder.d.ts +0 -147
  11. package/dist/internal-common/src/public-types/bundle-api.types.d.ts +0 -47
  12. package/dist/internal-common/src/public-types/bundle-data.types.d.ts +0 -9
  13. package/dist/internal-common/src/public-types/communication.types.d.ts +0 -10
  14. package/dist/internal-common/src/public-types/context.types.d.ts +0 -40
  15. package/dist/internal-common/src/public-types/distributed-lock.context.d.ts +0 -4
  16. package/dist/internal-common/src/public-types/document.types.d.ts +0 -22
  17. package/dist/internal-common/src/public-types/graphql.context.d.ts +0 -7
  18. package/dist/internal-common/src/public-types/graphql.types.d.ts +0 -9
  19. package/dist/internal-common/src/public-types/heartbeat.types.d.ts +0 -1
  20. package/dist/internal-common/src/public-types/http-status.enum.d.ts +0 -50
  21. package/dist/internal-common/src/public-types/integration-types.d.ts +0 -58
  22. package/dist/internal-common/src/public-types/integrations/ai_chatbot.types.d.ts +0 -32
  23. package/dist/internal-common/src/public-types/integrations/api.types.d.ts +0 -81
  24. package/dist/internal-common/src/public-types/integrations/auth.types.d.ts +0 -54
  25. package/dist/internal-common/src/public-types/integrations/database.types.d.ts +0 -275
  26. package/dist/internal-common/src/public-types/integrations/observability.types.d.ts +0 -24
  27. package/dist/internal-common/src/public-types/integrations/schemas.d.ts +0 -74
  28. package/dist/internal-common/src/public-types/logger.types.d.ts +0 -21
  29. package/dist/internal-common/src/public-types/metrics.types.d.ts +0 -1
  30. package/dist/internal-common/src/public-types/mutation.context.d.ts +0 -14
  31. package/dist/internal-common/src/public-types/mutation.types.d.ts +0 -53
  32. package/dist/internal-common/src/public-types/native-query.context.d.ts +0 -7
  33. package/dist/internal-common/src/public-types/native-query.types.d.ts +0 -16
  34. package/dist/internal-common/src/public-types/openapi.types.d.ts +0 -1
  35. package/dist/internal-common/src/public-types/pagination.d.ts +0 -62
  36. package/dist/internal-common/src/public-types/query-context.d.ts +0 -137
  37. package/dist/internal-common/src/public-types/query.types.d.ts +0 -64
  38. package/dist/internal-common/src/public-types/regions.d.ts +0 -1
  39. package/dist/internal-common/src/public-types/secret.types.d.ts +0 -22
  40. package/dist/internal-common/src/public-types/serialized-query.types.d.ts +0 -24
  41. package/dist/internal-common/src/public-types/socket.types.d.ts +0 -5
  42. package/dist/internal-common/src/public-types/types.d.ts +0 -14
  43. package/dist/internal-common/src/public-utils/id-utils.d.ts +0 -6
  44. package/dist/internal-common/src/schema/schema.types.d.ts +0 -54
  45. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  46. package/dist/internal-common/src/utils/array.d.ts +0 -1
  47. package/dist/internal-common/src/utils/assert.d.ts +0 -1
  48. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  49. package/dist/internal-common/src/utils/http.d.ts +0 -2
  50. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  51. package/dist/internal-common/src/utils/object.d.ts +0 -5
  52. package/dist/internal-common/src/utils/serialization.d.ts +0 -5
  53. package/dist/internal-common/src/utils/validation.d.ts +0 -27
  54. package/dist/internal-common/src/websocket.impl.d.ts +0 -21
  55. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
  56. package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -73
  57. package/dist/typescript-client/src/ai-chatbot-client.d.ts +0 -174
  58. package/dist/typescript-client/src/ai-chatbot-client.factory.d.ts +0 -8
  59. package/dist/typescript-client/src/ai.types.d.ts +0 -63
  60. package/dist/typescript-client/src/api.manager.d.ts +0 -11
  61. package/dist/typescript-client/src/auth.manager.d.ts +0 -27
  62. package/dist/typescript-client/src/backend-function.manager.d.ts +0 -9
  63. package/dist/typescript-client/src/backend-transforms.d.ts +0 -0
  64. package/dist/typescript-client/src/client-id.service.d.ts +0 -27
  65. package/dist/typescript-client/src/collection-reference.d.ts +0 -80
  66. package/dist/typescript-client/src/collection-reference.factory.d.ts +0 -13
  67. package/dist/typescript-client/src/connection-details.d.ts +0 -23
  68. package/dist/typescript-client/src/data.manager.d.ts +0 -175
  69. package/dist/typescript-client/src/destruct.manager.d.ts +0 -12
  70. package/dist/typescript-client/src/distributed-lock.manager.d.ts +0 -16
  71. package/dist/typescript-client/src/document-identity.service.d.ts +0 -12
  72. package/dist/typescript-client/src/document-reference.d.ts +0 -148
  73. package/dist/typescript-client/src/document-reference.factory.d.ts +0 -13
  74. package/dist/typescript-client/src/document-store.d.ts +0 -14
  75. package/dist/typescript-client/src/graphql-client.d.ts +0 -14
  76. package/dist/typescript-client/src/graphql-client.factory.d.ts +0 -11
  77. package/dist/typescript-client/src/index.d.ts +0 -11
  78. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +0 -11
  79. package/dist/typescript-client/src/native-query-manager.d.ts +0 -7
  80. package/dist/typescript-client/src/public-types.d.ts +0 -40
  81. package/dist/typescript-client/src/public-utils.d.ts +0 -1
  82. package/dist/typescript-client/src/query/deserializer.d.ts +0 -3
  83. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +0 -161
  84. package/dist/typescript-client/src/query/local-query-manager.d.ts +0 -9
  85. package/dist/typescript-client/src/query/query-builder.factory.d.ts +0 -77
  86. package/dist/typescript-client/src/query/query-sender.d.ts +0 -33
  87. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +0 -131
  88. package/dist/typescript-client/src/query/query.types.d.ts +0 -49
  89. package/dist/typescript-client/src/rate-limiter.d.ts +0 -32
  90. package/dist/typescript-client/src/rpc.manager.d.ts +0 -30
  91. package/dist/typescript-client/src/secret.client.d.ts +0 -22
  92. package/dist/typescript-client/src/socket.manager.d.ts +0 -43
  93. package/dist/typescript-client/src/squid.d.ts +0 -238
  94. package/dist/typescript-client/src/state/state.service.spec.d.ts +0 -1
  95. package/dist/typescript-client/src/testing/setup-tests.d.ts +0 -1
  96. package/dist/typescript-client/src/types.d.ts +0 -2
package/dist/cjs/index.js CHANGED
@@ -27924,10 +27924,7 @@ __webpack_require__.r(__webpack_exports__);
27924
27924
  __webpack_require__.d(__webpack_exports__, {
27925
27925
  AI_MODEL_NAMES: () => (/* reexport */ AI_MODEL_NAMES),
27926
27926
  APP_API_KEY: () => (/* reexport */ APP_API_KEY),
27927
- AiChatbotChatContext: () => (/* reexport */ AiChatbotChatContext),
27928
- AiChatbotMutationContext: () => (/* reexport */ AiChatbotMutationContext),
27929
27927
  AiChatbotProfileReference: () => (/* reexport */ AiChatbotProfileReference),
27930
- AiModelData: () => (/* reexport */ AiModelData),
27931
27928
  ApiCallContext: () => (/* reexport */ ApiCallContext),
27932
27929
  ApiIntegrationTypes: () => (/* reexport */ ApiIntegrationTypes),
27933
27930
  AuthIntegrationTypes: () => (/* reexport */ AuthIntegrationTypes),
@@ -27959,6 +27956,7 @@ __webpack_require__.d(__webpack_exports__, {
27959
27956
  QueryBuilder: () => (/* reexport */ QueryBuilder),
27960
27957
  QueryContext: () => (/* reexport */ QueryContext),
27961
27958
  QueryMappingManager: () => (/* reexport */ QueryMappingManager),
27959
+ QueueIntegrationTypes: () => (/* reexport */ QueueIntegrationTypes),
27962
27960
  SQUID_CLOUD_IDS: () => (/* reexport */ SQUID_CLOUD_IDS),
27963
27961
  Squid: () => (/* reexport */ Squid),
27964
27962
  SquidPlaceholderId: () => (/* reexport */ SquidPlaceholderId),
@@ -28002,30 +28000,7 @@ __webpack_require__.d(__webpack_exports__, {
28002
28000
  verifyWithSquidDevId: () => (/* reexport */ verifyWithSquidDevId)
28003
28001
  });
28004
28002
 
28005
- ;// CONCATENATED MODULE: ../internal-common/src/public-types/ai-chatbot.context.ts
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
28003
+ ;// CONCATENATED MODULE: ../internal-common/src/public-types/ai-chatbot.public-types.ts
28029
28004
  /** The supported AI model names. */
28030
28005
  const AI_MODEL_NAMES = [
28031
28006
  'gpt-3.5-turbo',
@@ -28034,24 +28009,6 @@ const AI_MODEL_NAMES = [
28034
28009
  'claude-2',
28035
28010
  'gpt-4-1106-preview',
28036
28011
  ];
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
28012
 
28056
28013
  ;// CONCATENATED MODULE: ../internal-common/src/public-types/api-call.context.ts
28057
28014
  /** The context of an API call. */
@@ -28178,6 +28135,8 @@ const ExecuteFunctionSecureAnnotations = [
28178
28135
  'secureApi',
28179
28136
  'secureAiChatbotChat',
28180
28137
  'secureAiChatbotMutation',
28138
+ 'secureQueueWrite',
28139
+ 'secureQueueRead',
28181
28140
  ];
28182
28141
  function convertToRunSecrets(appSecrets) {
28183
28142
  const result = {
@@ -28610,6 +28569,7 @@ var http_status_enum_HttpStatus;
28610
28569
  var IntegrationCategory;
28611
28570
  (function (IntegrationCategory) {
28612
28571
  IntegrationCategory["database"] = "database";
28572
+ IntegrationCategory["queue"] = "queue";
28613
28573
  IntegrationCategory["api"] = "api";
28614
28574
  IntegrationCategory["observability"] = "observability";
28615
28575
  IntegrationCategory["crm"] = "crm";
@@ -28636,6 +28596,8 @@ var IntegrationType;
28636
28596
  IntegrationType["cognito"] = "cognito";
28637
28597
  IntegrationType["okta"] = "okta";
28638
28598
  IntegrationType["descope"] = "descope";
28599
+ IntegrationType["kafka"] = "kafka";
28600
+ IntegrationType["built_in_queue"] = "built_in_queue";
28639
28601
  // Coming Soon
28640
28602
  IntegrationType["algolia"] = "algolia";
28641
28603
  IntegrationType["elastic_observability"] = "elastic_observability";
@@ -28716,6 +28678,7 @@ const AuthIntegrationTypes = [
28716
28678
  IntegrationType.okta,
28717
28679
  IntegrationType.descope,
28718
28680
  ];
28681
+ const QueueIntegrationTypes = [IntegrationType.built_in_queue, IntegrationType.kafka];
28719
28682
  function isDataIntegrationType(type) {
28720
28683
  return DatabaseIntegrationTypes.includes(type);
28721
28684
  }
@@ -29751,6 +29714,7 @@ var ClientConnectionState;
29751
29714
 
29752
29715
 
29753
29716
 
29717
+
29754
29718
 
29755
29719
 
29756
29720
  ;// CONCATENATED MODULE: ../internal-common/src/public-utils/id-utils.ts
@@ -30844,7 +30808,7 @@ class AiChatbotProfileReference {
30844
30808
  return new AiChatbotInstructionReference(this.client, this.integrationId, this.profileId, id);
30845
30809
  }
30846
30810
  /**
30847
- * Adds a new profile to the chat bot. This will result in an error if a profile already exists with the same id.
30811
+ * Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
30848
30812
  *
30849
30813
  * @param data An object containing options for creating the profile.
30850
30814
  * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4` or `claude-2`).
@@ -45720,6 +45684,7 @@ const kotlinControllers = [
45720
45684
  'application-kotlin',
45721
45685
  'openapi',
45722
45686
  'secret',
45687
+ 'queue',
45723
45688
  ];
45724
45689
  function getApplicationUrl(regionPrefix, appId, path) {
45725
45690
  const baseUrl = 'https://squid.cloud';
@@ -46766,7 +46731,7 @@ const UNSET_VALUE = Symbol('undefined');
46766
46731
 
46767
46732
  class DestructManager {
46768
46733
  constructor() {
46769
- this.predestructors = [];
46734
+ this.preDestructors = [];
46770
46735
  this.destructors = [];
46771
46736
  this.isDestructedSubject = new external_rxjs_.BehaviorSubject(false);
46772
46737
  }
@@ -46777,17 +46742,14 @@ class DestructManager {
46777
46742
  return this.isDestructedSubject.asObservable().pipe((0,external_rxjs_.filter)(Boolean), map(() => undefined));
46778
46743
  }
46779
46744
  onPreDestruct(fn) {
46780
- this.predestructors.push(fn);
46745
+ this.preDestructors.push(fn);
46781
46746
  }
46782
46747
  onDestruct(fn) {
46783
46748
  this.destructors.push(fn);
46784
46749
  }
46785
46750
  async destruct() {
46786
- if (this.isDestructing) {
46787
- return;
46788
- }
46789
- this.isDestructedSubject.next(true);
46790
- const fns = this.predestructors.concat(this.destructors);
46751
+ this.reportDestructed();
46752
+ const fns = this.preDestructors.concat(this.destructors);
46791
46753
  let fn = fns.shift();
46792
46754
  while (fn) {
46793
46755
  try {
@@ -46799,6 +46761,12 @@ class DestructManager {
46799
46761
  fn = fns.shift();
46800
46762
  }
46801
46763
  }
46764
+ reportDestructed() {
46765
+ if (this.isDestructing) {
46766
+ return;
46767
+ }
46768
+ this.isDestructedSubject.next(true);
46769
+ }
46802
46770
  }
46803
46771
 
46804
46772
  ;// CONCATENATED MODULE: ./src/distributed-lock.manager.ts
@@ -49002,6 +48970,101 @@ class LockManager {
49002
48970
  }
49003
48971
  }
49004
48972
 
48973
+ ;// CONCATENATED MODULE: ./src/queue.manager.ts
48974
+
48975
+ /** @internal */
48976
+ class QueueManagerFactory {
48977
+ constructor(rpcManager, socketManager, destructManager) {
48978
+ this.rpcManager = rpcManager;
48979
+ this.socketManager = socketManager;
48980
+ this.queueManagers = new Map();
48981
+ this.socketManager.observeNotifications().subscribe(message => {
48982
+ const queueManager = this.getOrUndefined(message.integrationId, message.topicName);
48983
+ if (!queueManager) {
48984
+ return;
48985
+ }
48986
+ queueManager.onMessages(message.payload);
48987
+ });
48988
+ destructManager.onPreDestruct(() => {
48989
+ for (const queueManagersForIntegration of this.queueManagers.values()) {
48990
+ for (const queueManager of queueManagersForIntegration.values()) {
48991
+ queueManager.destruct();
48992
+ }
48993
+ }
48994
+ });
48995
+ }
48996
+ get(integrationId, topicName) {
48997
+ let integrationQueueManagers = this.queueManagers.get(integrationId);
48998
+ if (!integrationQueueManagers) {
48999
+ integrationQueueManagers = new Map();
49000
+ this.queueManagers.set(integrationId, integrationQueueManagers);
49001
+ }
49002
+ let queueManager = integrationQueueManagers.get(topicName);
49003
+ if (!queueManager) {
49004
+ queueManager = new QueueManagerImpl(integrationId, topicName, this.rpcManager);
49005
+ integrationQueueManagers.set(topicName, queueManager);
49006
+ }
49007
+ return queueManager;
49008
+ }
49009
+ getOrUndefined(integrationId, topicName) {
49010
+ var _a;
49011
+ return (_a = this.queueManagers.get(integrationId)) === null || _a === void 0 ? void 0 : _a.get(topicName);
49012
+ }
49013
+ }
49014
+ /** @internal */
49015
+ class QueueManagerImpl {
49016
+ constructor(integrationId, topicName, rpcManager) {
49017
+ this.integrationId = integrationId;
49018
+ this.topicName = topicName;
49019
+ this.rpcManager = rpcManager;
49020
+ this.messagesSubject = new external_rxjs_.Subject();
49021
+ this.subscriberCount = 0;
49022
+ }
49023
+ async produce(messages) {
49024
+ await this.rpcManager.post('queue/produceMessages', {
49025
+ integrationId: this.integrationId,
49026
+ topicName: this.topicName,
49027
+ messages,
49028
+ });
49029
+ }
49030
+ consume() {
49031
+ return (0,external_rxjs_.defer)(() => {
49032
+ // Code to run when the observable is subscribed
49033
+ this.subscriberCount++;
49034
+ if (this.subscriberCount === 1) {
49035
+ this.rpcManager
49036
+ .post('queue/subscribe', {
49037
+ integrationId: this.integrationId,
49038
+ topicName: this.topicName,
49039
+ })
49040
+ .catch(e => {
49041
+ this.messagesSubject.error(e);
49042
+ this.messagesSubject.complete();
49043
+ this.subscriberCount = 0;
49044
+ this.messagesSubject = new external_rxjs_.Subject();
49045
+ });
49046
+ }
49047
+ return this.messagesSubject.asObservable().pipe((0,external_rxjs_.finalize)(() => {
49048
+ this.subscriberCount--;
49049
+ if (this.subscriberCount === 0) {
49050
+ this.rpcManager.post('queue/unsubscribe', {
49051
+ integrationId: this.integrationId,
49052
+ topicName: this.topicName,
49053
+ });
49054
+ }
49055
+ }));
49056
+ });
49057
+ }
49058
+ onMessages(payload) {
49059
+ for (const message of payload) {
49060
+ this.messagesSubject.next(message);
49061
+ }
49062
+ }
49063
+ destruct() {
49064
+ this.messagesSubject.complete();
49065
+ }
49066
+ }
49067
+
49005
49068
  ;// CONCATENATED MODULE: ./src/squid.ts
49006
49069
 
49007
49070
 
@@ -49031,6 +49094,7 @@ class LockManager {
49031
49094
 
49032
49095
 
49033
49096
 
49097
+
49034
49098
 
49035
49099
 
49036
49100
  /**
@@ -49089,6 +49153,7 @@ class Squid {
49089
49153
  this.graphqlClientFactory = new GraphQLClientFactory(this.rpcManager, options.region, appId);
49090
49154
  this.secretClient = new SecretClient(this.rpcManager);
49091
49155
  this._connectionDetails = new ConnectionDetails(this.clientIdService, this.socketManager);
49156
+ this.queueManagerFactory = new QueueManagerFactory(this.rpcManager, this.socketManager, this.destructManager);
49092
49157
  }
49093
49158
  /**
49094
49159
  * Returns the global Squid instance with the given options, creating a new instance if one with the same options
@@ -49244,6 +49309,14 @@ class Squid {
49244
49309
  this._validateNotDestructed();
49245
49310
  return this.distributedLockManager.lock(mutex);
49246
49311
  }
49312
+ /**
49313
+ * Returns a queue manager for the given topic name and integration id. Using the queue manager you can consume and
49314
+ * produce messages
49315
+ */
49316
+ queue(topicName, integrationId = IntegrationType.built_in_queue) {
49317
+ this._validateNotDestructed();
49318
+ return this.queueManagerFactory.get(integrationId, topicName);
49319
+ }
49247
49320
  /**
49248
49321
  * Destructs the Squid Client. Unsubscribes from all ongoing queries or requests, and clears the local data.
49249
49322
  * After invoking this method, the Squid client will not be usable.
@@ -49251,8 +49324,6 @@ class Squid {
49251
49324
  * @returns A promise that resolves when the destruct process is complete.
49252
49325
  */
49253
49326
  async destruct() {
49254
- if (this.destructManager.isDestructing)
49255
- return;
49256
49327
  return this.destructManager.destruct().finally(() => {
49257
49328
  const entry = Object.entries(Squid.squidInstancesMap).find(([, value]) => value === this);
49258
49329
  if (entry)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -1,25 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
1
- import { AiChatbotMutationType, AiChatbotResourceType } from './ai-chatbot.types';
2
- export declare class AiChatbotChatContext {
3
- readonly prompt: string;
4
- readonly profileId: string;
5
- }
6
- /** A context provided to the security rules of an AI Chatbot mutation. */
7
- export declare class AiChatbotMutationContext {
8
- readonly type: AiChatbotMutationType;
9
- readonly resource: AiChatbotResourceType;
10
- readonly profileId: string;
11
- readonly payload: any;
12
- }
@@ -1,29 +0,0 @@
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 {};
@@ -1,13 +0,0 @@
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
- }
@@ -1,4 +0,0 @@
1
- /** The headers of an API call. */
2
- export type ApiHeaders = Record<string, string | number | boolean>;
3
- /** The query parameters of an API call. */
4
- export type ApiQueryParams = Record<string, string | number | boolean>;
@@ -1,147 +0,0 @@
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 UpsertAuthIntegrationRequest = UpsertIntegrationRequests[AuthIntegrationType];
129
- interface BaseUpsertIntegrationSchemaRequest<T extends IntegrationType, S extends IntegrationSchema> {
130
- id: IntegrationId;
131
- type: T;
132
- schema: S;
133
- }
134
- type SchemaTypes = {
135
- [K in IntegrationSchemaKeys]: IntegrationSchemaTypes[K];
136
- };
137
- type UpsertIntegrationSchemaRequests = {
138
- [K in IntegrationSchemaKeys]: BaseUpsertIntegrationSchemaRequest<K, SchemaTypes[K]>;
139
- };
140
- export type UpsertIntegrationSchemaRequest = UpsertDataIntegrationSchemaRequest | UpsertGraphQLIntegrationSchemaRequest | UpsertApiIntegrationSchemaRequest;
141
- export type UpsertDataIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[DatabaseIntegrationType];
142
- export type UpsertGraphQLIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.graphql];
143
- export type UpsertApiIntegrationSchemaRequest = UpsertIntegrationSchemaRequests[IntegrationType.api];
144
- export interface GetSchemaRequest {
145
- integrationId: IntegrationId;
146
- }
147
- export {};
@@ -1,2 +0,0 @@
1
- import { ApplicationSecrets } from './secret.types';
2
- export declare function convertToRunSecrets(appSecrets: ApplicationSecrets): RunSecrets;