@cognigy/rest-api-client 4.94.0 → 4.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
- # 4.94.0
2
- Released: February 07th, 2025
1
+ # 4.95.0
2
+ Released: February 19th, 2025
3
3
 
4
- Released state of package up to date with Cognigy.AI v4.94.0
4
+ Released state of package up to date with Cognigy.AI v4.95.0
5
5
 
6
6
  # 4.93.0
7
7
  Released: Jan 22nd, 2025
@@ -13,6 +13,7 @@ exports.profileDataSchema = {
13
13
  properties: {
14
14
  active: { type: "boolean" },
15
15
  contactIds: { type: "array", items: { type: "string" }, additionalItems: false, minItems: 1 },
16
+ contactIdsHash: { type: "string" },
16
17
  expiresAt: { type: "object" },
17
18
  profile: {},
18
19
  },
@@ -24,6 +24,11 @@ exports.profileSchemaSchema = {
24
24
  },
25
25
  } }),
26
26
  };
27
+ /**
28
+ * WARNING!!
29
+ * make sure to update the default values for the profile mongoose model in the models/profiles.ts file
30
+ * when changing the profile schema and the default profile object below
31
+ */
27
32
  exports.defaultProfile = {
28
33
  firstname: "",
29
34
  lastname: "",
@@ -11,7 +11,7 @@ exports.connectionFieldReturnFormat = [
11
11
  ];
12
12
  const generateConnectionsRedisKey = (data) => {
13
13
  return [
14
- `organisationId:${data.organisationReference}:projectId:${data.projectReference}:connection:${data.referenceId}`
14
+ `organisationId:${data.organisationReference}:${data.projectReference ? `projectId:${data.projectReference}:` : ''}connection:${data.referenceId}`
15
15
  ];
16
16
  };
17
17
  exports.generateConnectionsRedisKey = generateConnectionsRedisKey;
@@ -54,7 +54,8 @@ exports.connectionDataSchema = {
54
54
  },
55
55
  extension: { type: "string", format: "package-name" },
56
56
  type: { type: "string", format: "resource-name" },
57
- isDeprecated: { type: "boolean" }
57
+ isDeprecated: { type: "boolean" },
58
+ resourceLevel: { type: "string", enum: ["organisation", "project"] }
58
59
  }
59
60
  };
60
61
  exports.connectionSchema = {
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IGlobalResource.js.map
@@ -122,7 +122,16 @@ exports.largeLanguageModelDataSchema = {
122
122
  alephAlpha: exports.alephAlphaMetaSchema,
123
123
  anthropic: exports.anthropicMetaSchema,
124
124
  awsBedrock: exports.awsBedrockMetaSchema,
125
- fallbacks: exports.llmFallbackSchema
125
+ fallbacks: exports.llmFallbackSchema,
126
+ resourceLevel: { type: "string", enum: ["organisation", "project"] },
127
+ assignedToProjects: {
128
+ type: "array",
129
+ uniqueItems: true,
130
+ items: {
131
+ type: "string",
132
+ format: "mongo-id"
133
+ }
134
+ }
126
135
  }
127
136
  };
128
137
  exports.largeLanguageModelSchema = {
@@ -10,6 +10,7 @@ export const profileDataSchema = {
10
10
  properties: {
11
11
  active: { type: "boolean" },
12
12
  contactIds: { type: "array", items: { type: "string" }, additionalItems: false, minItems: 1 },
13
+ contactIdsHash: { type: "string" },
13
14
  expiresAt: { type: "object" },
14
15
  profile: {},
15
16
  },
@@ -21,6 +21,11 @@ export const profileSchemaSchema = {
21
21
  },
22
22
  } }),
23
23
  };
24
+ /**
25
+ * WARNING!!
26
+ * make sure to update the default values for the profile mongoose model in the models/profiles.ts file
27
+ * when changing the profile schema and the default profile object below
28
+ */
24
29
  export const defaultProfile = {
25
30
  firstname: "",
26
31
  lastname: "",
@@ -8,7 +8,7 @@ export const connectionFieldReturnFormat = [
8
8
  ];
9
9
  export const generateConnectionsRedisKey = (data) => {
10
10
  return [
11
- `organisationId:${data.organisationReference}:projectId:${data.projectReference}:connection:${data.referenceId}`
11
+ `organisationId:${data.organisationReference}:${data.projectReference ? `projectId:${data.projectReference}:` : ''}connection:${data.referenceId}`
12
12
  ];
13
13
  };
14
14
  export const connectionFieldDataSchema = {
@@ -50,7 +50,8 @@ export const connectionDataSchema = {
50
50
  },
51
51
  extension: { type: "string", format: "package-name" },
52
52
  type: { type: "string", format: "resource-name" },
53
- isDeprecated: { type: "boolean" }
53
+ isDeprecated: { type: "boolean" },
54
+ resourceLevel: { type: "string", enum: ["organisation", "project"] }
54
55
  }
55
56
  };
56
57
  export const connectionSchema = {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IGlobalResource.js.map
@@ -119,7 +119,16 @@ export const largeLanguageModelDataSchema = {
119
119
  alephAlpha: alephAlphaMetaSchema,
120
120
  anthropic: anthropicMetaSchema,
121
121
  awsBedrock: awsBedrockMetaSchema,
122
- fallbacks: llmFallbackSchema
122
+ fallbacks: llmFallbackSchema,
123
+ resourceLevel: { type: "string", enum: ["organisation", "project"] },
124
+ assignedToProjects: {
125
+ type: "array",
126
+ uniqueItems: true,
127
+ items: {
128
+ type: "string",
129
+ format: "mongo-id"
130
+ }
131
+ }
123
132
  }
124
133
  };
125
134
  export const largeLanguageModelSchema = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cognigy/rest-api-client",
3
- "version": "4.94.0",
3
+ "version": "4.95.0",
4
4
  "description": "Cognigy REST-Client",
5
5
  "main": "build/index.js",
6
6
  "module": "dist/esm/index.js",
package/types/index.d.ts CHANGED
@@ -8414,10 +8414,85 @@ export interface IGraphAgentAssistConfig {
8414
8414
  referenceId: string;
8415
8415
  properties: Pick<IAgentAssistConfig, "createdAt" | "createdBy" | "lastChanged" | "lastChangedBy">;
8416
8416
  }
8417
+ /**
8418
+ * @openapi
8419
+ * components:
8420
+ * parameters:
8421
+ * globalResourceQueryParam:
8422
+ * in: query
8423
+ * name: resourceLevel
8424
+ * description: Scope of the resource (global "organisation" or project).
8425
+ * required: false
8426
+ * schema:
8427
+ * $ref: '#/components/schemas/ResourceLevel'
8428
+ * schemas:
8429
+ * ResourceLevel:
8430
+ * type: string
8431
+ * enum:
8432
+ * - organisation
8433
+ * - project
8434
+ * description: General scope of the resource.
8435
+ * default: project
8436
+ *
8437
+ * ProjectScopedResource:
8438
+ * type: object
8439
+ * properties:
8440
+ * resourceLevel:
8441
+ * type: string
8442
+ * enum:
8443
+ * - project
8444
+ * description: Scope for project-level resources.
8445
+ *
8446
+ * GlobalScopedResource:
8447
+ * type: object
8448
+ * properties:
8449
+ * resourceLevel:
8450
+ * type: string
8451
+ * enum:
8452
+ * - organisation
8453
+ * description: Scope for globally scoped resources.
8454
+ * required:
8455
+ * - resourceLevel
8456
+ *
8457
+ * AssignedToProjects:
8458
+ * type: object
8459
+ * properties:
8460
+ * assignedToProjects:
8461
+ * type: array
8462
+ * items:
8463
+ * type: string
8464
+ * description: MongoDB ObjectId representing a project
8465
+ *
8466
+ * IGlobalResourceFields_2_0:
8467
+ * allOf:
8468
+ * - $ref: '#/components/schemas/GlobalScopedResource'
8469
+ * - $ref: '#/components/schemas/AssignedToProjects'
8470
+ *
8471
+ * IProjectResourceFields_2_0:
8472
+ * $ref: '#/components/schemas/ProjectScopedResource'
8473
+ *
8474
+ * IGlobalResourceData:
8475
+ * allOf:
8476
+ * - $ref: '#/components/schemas/IGlobalResourceFields_2_0'
8477
+ * - type: object
8478
+ * properties:
8479
+ * id:
8480
+ * type: string
8481
+ * description: The unique identifier for the resource.
8482
+ * example: 507f191e810c19729de860eb
8483
+ *
8484
+ * IGlobalResource:
8485
+ * allOf:
8486
+ * - $ref: '#/components/schemas/IGlobalResourceData'
8487
+ */
8488
+ export interface IGlobalResource {
8489
+ resourceLevel?: "organisation" | "project";
8490
+ assignedToProjects?: TMongoId[];
8491
+ }
8417
8492
  export interface IConnectionFields {
8418
8493
  [key: string]: string;
8419
8494
  }
8420
- export interface IConnection extends IEntityMeta {
8495
+ export interface IConnection extends IEntityMeta, Pick<IGlobalResource, "resourceLevel"> {
8421
8496
  _id: TMongoId;
8422
8497
  referenceId: string;
8423
8498
  name: string;
@@ -8483,7 +8558,7 @@ export declare type TLLMFallback = {
8483
8558
  emailNotificationList: string[];
8484
8559
  };
8485
8560
  };
8486
- export interface ILargeLanguageModel extends IEntityMeta {
8561
+ export interface ILargeLanguageModel extends IEntityMeta, IGlobalResource {
8487
8562
  _id: TMongoId;
8488
8563
  referenceId: string;
8489
8564
  name: string;
@@ -8495,7 +8570,7 @@ export interface ILargeLanguageModel extends IEntityMeta {
8495
8570
  provider: TGenerativeAIProviders;
8496
8571
  connectionId: string;
8497
8572
  isDefault: boolean;
8498
- projectReference: TMongoId;
8573
+ projectReference?: TMongoId;
8499
8574
  organisationReference: TMongoId;
8500
8575
  azureOpenAI?: IAzureOpenAIMeta;
8501
8576
  googleVertexAI?: IGoogleVertexAIMeta;
@@ -14496,7 +14571,7 @@ export interface IComposeSnapshotDownloadLinkRestReturnValue_2_0 {
14496
14571
  * description: The type of connection.
14497
14572
  * - $ref: '#/components/schemas/IEntityMeta'
14498
14573
  */
14499
- export interface IConnectionIndexItem_2_0 {
14574
+ export interface IConnectionIndexItem_2_0 extends Pick<IGlobalResource, "resourceLevel"> {
14500
14575
  _id: TMongoId;
14501
14576
  referenceId: string;
14502
14577
  name: string;
@@ -14579,7 +14654,7 @@ export interface IIndexConnectionsRestReturnValue_2_0 extends ICursorBasedPagina
14579
14654
  * - $ref: '#/components/schemas/IConnectionData_2_0'
14580
14655
  * - $ref: '#/components/schemas/IEntityMeta'
14581
14656
  */
14582
- export interface IConnection_2_0 {
14657
+ export interface IConnection_2_0 extends Pick<IGlobalResource, "resourceLevel"> {
14583
14658
  referenceId: string;
14584
14659
  _id: TMongoId;
14585
14660
  name: string;
@@ -16633,103 +16708,111 @@ export interface IGoogleGeminiMeta_2_0 {
16633
16708
  *
16634
16709
  * components:
16635
16710
  * schemas:
16636
- * ILargeLanguageModelFields_2_0:
16637
- * allOf:
16638
- * - type: object
16639
- * required: ['name', 'modelType', 'provider', 'connectionId']
16711
+ * ILargeLanguageModelFieldsBase_2_0:
16712
+ * type: object
16713
+ * required: ['name', 'modelType', 'provider', 'connectionId']
16714
+ * properties:
16715
+ * name:
16716
+ * type: string
16717
+ * example: "LLM Name"
16718
+ * description:
16719
+ * type: string
16720
+ * example: "LLM meaningful description"
16721
+ * modelType:
16722
+ * $ref: '#/components/schemas/TGenerativeAIModels'
16723
+ * modelGroup:
16724
+ * $ref: '#/components/schemas/TModelGroups'
16725
+ * isCustomModel:
16726
+ * type: boolean
16727
+ * example: true
16728
+ * provider:
16729
+ * $ref: '#/components/schemas/TGenerativeAIProviders'
16730
+ * connectionId:
16731
+ * type: string
16732
+ * description: The reference id of the GenerativeAI Provider Connection
16733
+ * format: uuid
16734
+ * openAI:
16735
+ * type: object
16736
+ * description: OpenAI specific meta data
16640
16737
  * properties:
16641
- * name:
16738
+ * customModel:
16642
16739
  * type: string
16643
- * example: "LLM Name"
16644
- * description:
16740
+ * example: gpt-4-32k-0613
16741
+ * description: The custom model name. This does not work with embedding models
16742
+ * anthropic:
16743
+ * type: object
16744
+ * description: Anthropic specific meta data
16745
+ * properties:
16746
+ * customModel:
16645
16747
  * type: string
16646
- * example: "LLM meaningful description"
16647
- * modelType:
16648
- * $ref: '#/components/schemas/TGenerativeAIModels'
16649
- * modelGroup:
16650
- * $ref: '#/components/schemas/TModelGroups'
16651
- * isCustomModel:
16652
- * type: boolean
16653
- * example: true
16654
- * provider:
16655
- * $ref: '#/components/schemas/TGenerativeAIProviders'
16656
- * connectionId:
16748
+ * example: claude-3-opus-20240229
16749
+ * description: The custom model name. This does not work with embedding models
16750
+ * azureOpenAI:
16751
+ * type: object
16752
+ * description: Azure OpenAI specific meta data
16753
+ * properties:
16754
+ * resourceName:
16657
16755
  * type: string
16658
- * description: The reference id of the GenerativeAI Provider Connection
16659
- * format: uuid
16756
+ * deploymentName:
16757
+ * type: string
16758
+ * apiVersion:
16759
+ * type: string
16760
+ * baseCustomUrl:
16761
+ * type: string
16762
+ * example:
16763
+ * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/chat/completions?api-version=<apiVersion>
16764
+ * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/completions?api-version=<apiVersion>
16765
+ * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/embeddings?api-version=<apiVersion>
16766
+ * googleVertexAI:
16767
+ * type: object
16768
+ * description: Google VertexAI specific meta data
16769
+ * properties:
16770
+ * location:
16771
+ * type: string
16772
+ * apiEndpoint:
16773
+ * type: string
16774
+ * publisher:
16775
+ * type: string
16776
+ * googleGemini:
16777
+ * type: object
16778
+ * description: Google Gemini specific meta data
16779
+ * properties:
16780
+ * location:
16781
+ * type: string
16782
+ * alephAlpha:
16783
+ * type: object
16784
+ * description: Aleph Alpha specific meta data
16785
+ * properties:
16786
+ * customModel:
16787
+ * type: string
16788
+ * example: luminous-003
16789
+ * description: The custom model name. This does not work with embedding models
16790
+ * baseCustomUrl:
16791
+ * type: string
16792
+ * example: https://api.aleph-alpha.com
16793
+ *
16794
+ * ILargeLanguageModelFields_2_0:
16795
+ * allOf:
16796
+ * - $ref: '#/components/schemas/ILargeLanguageModelFieldsBase_2_0'
16797
+ * - $ref: '#/components/schemas/IProjectResourceFields_2_0'
16798
+ * - type: object
16799
+ * properties:
16660
16800
  * isDefault:
16661
16801
  * type: boolean
16662
16802
  * description: Sets the LLM to default (fallback) if no other LLM is set
16663
16803
  * example: false
16664
- * openAI:
16665
- * type: object
16666
- * description: OpenAI specific meta data
16667
- * properties:
16668
- * customModel:
16669
- * type: string
16670
- * example: gpt-4-32k-0613
16671
- * description: The custom model name. This does not work with embedding models
16672
- * anthropic:
16673
- * type: object
16674
- * description: Anthropic specific meta data
16675
- * properties:
16676
- * customModel:
16677
- * type: string
16678
- * example: claude-3-opus-20240229
16679
- * description: The custom model name. This does not work with embedding models
16680
- * azureOpenAI:
16681
- * type: object
16682
- * description: Azure OpenAI specific meta data
16683
- * properties:
16684
- * resourceName:
16685
- * type: string
16686
- * deploymentName:
16687
- * type: string
16688
- * apiVersion:
16689
- * type: string
16690
- * baseCustomUrl:
16691
- * type: string
16692
- * example:
16693
- * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/chat/completions?api-version=<apiVersion>
16694
- * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/completions?api-version=<apiVersion>
16695
- * - https://<resourceName>.openai.azure.com/openai/deployments/<deploymentName>/embeddings?api-version=<apiVersion>
16696
- * googleVertexAI:
16697
- * type: object
16698
- * description: Google VertexAI specific meta data
16699
- * properties:
16700
- * location:
16701
- * type: string
16702
- * apiEndpoint:
16703
- * type: string
16704
- * publisher:
16705
- * type: string
16706
- * googleGemini:
16707
- * type: object
16708
- * description: Google Gemini specific meta data
16709
- * properties:
16710
- * location:
16711
- * type: string
16712
- * alephAlpha:
16713
- * type: object
16714
- * description: Aleph Alpha specific meta data
16715
- * properties:
16716
- * customModel:
16717
- * type: string
16718
- * example: luminous-003
16719
- * description: The custom model name. This does not work with embedding models
16720
- * baseCustomUrl:
16721
- * type: string
16722
- * example: https://api.aleph-alpha.com
16723
16804
  * fallbacks:
16724
16805
  * type: array
16725
16806
  * description: (alpha feature) specifies a fallback LLM that will be used when the current LLM stops working.
16726
16807
  * items:
16727
16808
  * $ref: '#/components/schemas/ILLMFallback_2_0'
16728
- *
16809
+ * IGlobalLargeLanguageModelFields_2_0:
16810
+ * allOf:
16811
+ * - $ref: '#/components/schemas/ILargeLanguageModelFieldsBase_2_0'
16812
+ * - $ref: '#/components/schemas/IGlobalResourceFields_2_0'
16729
16813
  * ILargeLanguageModelCreate_2_0:
16730
16814
  * allOf:
16731
16815
  * - $ref: '#/components/schemas/ILargeLanguageModelFields_2_0'
16732
- *
16733
16816
  * ILargeLanguageModelData_2_0:
16734
16817
  * allOf:
16735
16818
  * - $ref: '#/components/schemas/ILargeLanguageModelFields_2_0'
@@ -16739,13 +16822,25 @@ export interface IGoogleGeminiMeta_2_0 {
16739
16822
  * type: string
16740
16823
  * description: The reference id of the LargeLanguageModel
16741
16824
  * format: uuid
16742
- *
16825
+ * IGlobalLargeLanguageModelData_2_0:
16826
+ * allOf:
16827
+ * - $ref: '#/components/schemas/IGlobalLargeLanguageModelFields_2_0'
16828
+ * - type: object
16829
+ * properties:
16830
+ * referenceId:
16831
+ * type: string
16832
+ * description: The reference id of the LargeLanguageModel
16833
+ * format: uuid
16834
+ * IGlobalLargeLanguageModel_2_0:
16835
+ * allOf:
16836
+ * - $ref: '#/components/schemas/IGlobalLargeLanguageModelData_2_0'
16837
+ * - $ref: '#/components/schemas/IEntityMeta'
16743
16838
  * ILargeLanguageModel_2_0:
16744
16839
  * allOf:
16745
16840
  * - $ref: '#/components/schemas/ILargeLanguageModelData_2_0'
16746
16841
  * - $ref: '#/components/schemas/IEntityMeta'
16747
16842
  */
16748
- export interface ILargeLanguageModel_2_0 {
16843
+ export interface ILargeLanguageModel_2_0 extends IGlobalResource {
16749
16844
  referenceId: string;
16750
16845
  _id: TMongoId;
16751
16846
  name: string;
@@ -16811,7 +16906,7 @@ export interface ILargeLanguageModel_2_0 {
16811
16906
  * example: false
16812
16907
  * - $ref: '#/components/schemas/IEntityMeta'
16813
16908
  */
16814
- export interface ILargeLanguageModelIndexItem_2_0 {
16909
+ export interface ILargeLanguageModelIndexItem_2_0 extends IGlobalResource {
16815
16910
  referenceId: string;
16816
16911
  _id: TMongoId;
16817
16912
  name: string;