@or-sdk/idw 7.9.0 → 7.10.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
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.10.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@7.9.0...@or-sdk/idw@7.10.0) (2025-04-10)
7
+
8
+
9
+ ### Features
10
+
11
+ * **@or-sdk/idw:** improve knowledge types ([c0a6b7b](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/c0a6b7bbe63536b722a9c0525422e665e7d913b4))
12
+
13
+
14
+
6
15
  ## [7.9.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@7.8.0...@or-sdk/idw@7.9.0) (2025-03-28)
7
16
 
8
17
 
@@ -5,10 +5,10 @@ export declare const enum KnowledgeStatusEnum {
5
5
  Expired = "expired",
6
6
  Published = "published"
7
7
  }
8
- export type Knowledge = {
8
+ type KnowledgeBase = {
9
+ type: 'text' | 'doc';
9
10
  knowledge_id: string;
10
11
  question_text: string;
11
- answer_text: string;
12
12
  created_by: string;
13
13
  date_created: string;
14
14
  modified_by: string | null;
@@ -17,6 +17,18 @@ export type Knowledge = {
17
17
  status: KnowledgeStatusEnum;
18
18
  domain: string;
19
19
  };
20
- export type KnowledgeCreateData = Pick<Knowledge, 'question_text' | 'answer_text' | 'expired_at' | 'status' | 'domain'>;
21
- export type KnowledgeUpdateData = Pick<Knowledge, 'knowledge_id' | 'question_text' | 'answer_text' | 'expired_at' | 'status' | 'domain'>;
20
+ type KnowledgeText = KnowledgeBase & {
21
+ type: 'text';
22
+ answer_text: string;
23
+ file_url?: null;
24
+ };
25
+ type KnowledgeDoc = KnowledgeBase & {
26
+ type: 'doc';
27
+ answer_text?: null;
28
+ file_url: string;
29
+ };
30
+ export type Knowledge = KnowledgeText | KnowledgeDoc;
31
+ export type KnowledgeCreateData = Pick<Knowledge, 'type' | 'file_url' | 'question_text' | 'answer_text' | 'expired_at' | 'status' | 'domain'>;
32
+ export type KnowledgeUpdateData = KnowledgeCreateData & Pick<Knowledge, 'knowledge_id'>;
33
+ export {};
22
34
  //# sourceMappingURL=knowledge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../../src/types/knowledge.ts"],"names":[],"mappings":"AACA,0BAAkB,mBAAmB;IACnC,GAAG,QAAQ;IACX,QAAQ,cAAc;IAEtB,QAAQ,aAAa;IACrB,OAAO,YAAY;IAEnB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IAErB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAChD,eAAe,GACf,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,QAAQ,CAAC,CAAC;AAEV,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAChD,cAAc,GACd,eAAe,GACf,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../../src/types/knowledge.ts"],"names":[],"mappings":"AACA,0BAAkB,mBAAmB;IACnC,GAAG,QAAQ;IACX,QAAQ,cAAc;IAEtB,QAAQ,aAAa;IACrB,OAAO,YAAY;IAEnB,SAAS,cAAc;CACxB;AAED,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IAErB,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,aAAa,GAAG,aAAa,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG,aAAa,GAAG;IAClC,IAAI,EAAE,KAAK,CAAC;IACZ,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAChD,MAAM,GACN,UAAU,GACV,eAAe,GACf,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,QAAQ,CAAC,CAAC;AAEV,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@or-sdk/idw",
3
- "version": "7.9.0",
3
+ "version": "7.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "12535306c22b51af8c94e4e6b2dc0e47c6772d97"
32
+ "gitHead": "b3aca9de816ca3fb970997433dea9a0a03a78d76"
33
33
  }
@@ -9,11 +9,11 @@ export const enum KnowledgeStatusEnum {
9
9
  Published = 'published',
10
10
  }
11
11
 
12
- export type Knowledge = {
12
+ type KnowledgeBase = {
13
+ type: 'text' | 'doc';
13
14
  knowledge_id: string;
14
15
 
15
16
  question_text: string; // title
16
- answer_text: string; // content
17
17
 
18
18
  created_by: string;
19
19
  date_created: string;
@@ -27,17 +27,27 @@ export type Knowledge = {
27
27
  domain: string;
28
28
  };
29
29
 
30
+ type KnowledgeText = KnowledgeBase & {
31
+ type: 'text';
32
+ answer_text: string;
33
+ file_url?: null;
34
+ };
35
+
36
+ type KnowledgeDoc = KnowledgeBase & {
37
+ type: 'doc';
38
+ answer_text?: null;
39
+ file_url: string;
40
+ };
41
+
42
+ export type Knowledge = KnowledgeText | KnowledgeDoc;
43
+
30
44
  export type KnowledgeCreateData = Pick<Knowledge,
45
+ 'type' |
46
+ 'file_url' |
31
47
  'question_text' |
32
48
  'answer_text' |
33
49
  'expired_at' |
34
50
  'status' |
35
51
  'domain'>;
36
52
 
37
- export type KnowledgeUpdateData = Pick<Knowledge,
38
- 'knowledge_id' |
39
- 'question_text' |
40
- 'answer_text' |
41
- 'expired_at' |
42
- 'status' |
43
- 'domain'>;
53
+ export type KnowledgeUpdateData = KnowledgeCreateData & Pick<Knowledge, 'knowledge_id'>;