@stack-spot/portal-network 1.0.0-betaadp.2 → 1.0.0-betaadp.3
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/api/discover.d.ts +294 -0
- package/dist/api/discover.d.ts.map +1 -0
- package/dist/api/discover.js +180 -0
- package/dist/api/discover.js.map +1 -0
- package/dist/apis.json +1 -1
- package/dist/client/discover.d.ts +63 -0
- package/dist/client/discover.d.ts.map +1 -0
- package/dist/client/discover.js +123 -0
- package/dist/client/discover.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/discover.ts +435 -0
- package/src/apis.json +1 -1
- package/src/client/discover.ts +86 -0
- package/src/index.ts +2 -2
- package/dist/api/discovery.d.ts +0 -494
- package/dist/api/discovery.d.ts.map +0 -1
- package/dist/api/discovery.js +0 -205
- package/dist/api/discovery.js.map +0 -1
- package/dist/client/adp-mock.d.ts +0 -89
- package/dist/client/adp-mock.d.ts.map +0 -1
- package/dist/client/adp-mock.js +0 -246
- package/dist/client/adp-mock.js.map +0 -1
- package/dist/client/discovery.d.ts +0 -110
- package/dist/client/discovery.d.ts.map +0 -1
- package/dist/client/discovery.js +0 -133
- package/dist/client/discovery.js.map +0 -1
- package/src/api/discovery.ts +0 -729
- package/src/client/adp-mock.ts +0 -244
- package/src/client/discovery.ts +0 -73
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { getApiAddresses } from '../api-addresses.js';
|
|
2
|
+
import { create, create1, create2, defaults, deleteById, deleteById1, deleteById2, getAll, getAll1, getAll2, getAllByHypothesis, getById, getById1, getById2 } from '../api/discover.js';
|
|
3
|
+
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
|
+
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
+
import { aiClient } from './ai.js';
|
|
6
|
+
class DiscoverClient extends ReactQueryNetworkClient {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(getApiAddresses().discover.url, defaults);
|
|
9
|
+
Object.defineProperty(this, "opportunities", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
writable: true,
|
|
13
|
+
value: this.query(getAll)
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(this, "opportunity", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: this.query(getById)
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(this, "hypotheses", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true,
|
|
24
|
+
writable: true,
|
|
25
|
+
value: this.query(getAll1)
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(this, "hypothesisById", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: this.query(getById1)
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(this, "documents", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
value: this.query(getAllByHypothesis)
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(this, "document", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true,
|
|
42
|
+
writable: true,
|
|
43
|
+
value: this.query(getById2)
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(this, "artifacts", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: this.query(getAll2)
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(this, "createOpportunity", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: this.mutation(create)
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(this, "createHypothesis", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: this.mutation(create1)
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(this, "createDocument", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: this.mutation(create2)
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(this, "deleteOpportunity", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
configurable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
value: this.mutation(deleteById)
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(this, "deleteHypothesis", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
configurable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: this.mutation(deleteById1)
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(this, "deleteDocument", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
configurable: true,
|
|
84
|
+
writable: true,
|
|
85
|
+
value: this.mutation(deleteById2)
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(this, "chats", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
configurable: true,
|
|
90
|
+
writable: true,
|
|
91
|
+
value: this.query({
|
|
92
|
+
name: 'chats',
|
|
93
|
+
request: async (_signal, variables) => {
|
|
94
|
+
const opportunities = await this.opportunities.query({});
|
|
95
|
+
const opportunitiesByChatId = opportunities.content.reduce((acc, opp) => {
|
|
96
|
+
if (opp.chatId) {
|
|
97
|
+
acc[opp.chatId] = opp;
|
|
98
|
+
}
|
|
99
|
+
return acc;
|
|
100
|
+
}, {});
|
|
101
|
+
const chatsHistory = await aiClient.chats.query({ ...variables, page: variables.page, size: variables.size ?? 40 });
|
|
102
|
+
const filteredItems = variables.filter
|
|
103
|
+
? chatsHistory.filter((chat) => chat.title.toLowerCase().includes(variables.filter.toLowerCase()))
|
|
104
|
+
: chatsHistory;
|
|
105
|
+
const enrichedChats = filteredItems?.map(chat => {
|
|
106
|
+
const relatedOpportunity = opportunitiesByChatId[chat.id];
|
|
107
|
+
return {
|
|
108
|
+
...chat,
|
|
109
|
+
opportunityName: relatedOpportunity?.title ?? null,
|
|
110
|
+
hypothesisCount: relatedOpportunity?.hypotheses?.length ?? 0,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
return enrichedChats;
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
buildStackSpotError(error) {
|
|
119
|
+
return new StackspotAPIError({ status: 0, message: error?.message });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export const discoverClient = new DiscoverClient();
|
|
123
|
+
//# sourceMappingURL=discover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/client/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAA0B,MAAM,iBAAiB,CAAA;AAC7M,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAO/B,MAAM,cAAe,SAAQ,uBAAuB;IAClD;QACE,KAAK,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAOjD;;;;mBAAgB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;WAAA;QAElC;;;;mBAAc,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;WAAA;QAEjC;;;;mBAAa,IAAI,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AG,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,EAAE,EAAE,CACnE,CAAA;oBAED,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM;wBACpC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAO,CAAC,WAAW,EAAE,CAAC,CAAC;wBACnG,CAAC,CAAC,YAAY,CAAA;oBAEhB,MAAM,aAAa,GAAG,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE;wBAC9C,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;wBAEzD,OAAO;4BACL,GAAG,IAAI;4BACP,eAAe,EAAE,kBAAkB,EAAE,KAAK,IAAI,IAAI;4BAClD,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;yBAC7D,CAAA;oBACH,CAAC,CAAC,CAAA;oBAEF,OAAO,aAAwC,CAAA;gBACjD,CAAC;aACF,CAAC;WAAA;IAnEF,CAAC;IAES,mBAAmB,CAAC,KAAU;QACtC,OAAO,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;IACtE,CAAC;CAgEF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query';
|
|
2
2
|
export { apiAddresses, getApiAddresses, getBaseUrlWithOverride, setApisOverride } from './api-addresses.js';
|
|
3
3
|
export { accountClient } from './client/account.js';
|
|
4
|
-
export * from './client/
|
|
4
|
+
export * from './client/discover.js';
|
|
5
5
|
export { agentClient } from './client/agent.js';
|
|
6
6
|
export { agentToolsClient } from './client/agent-tools.js';
|
|
7
7
|
export { aiClient } from './client/ai.js';
|
|
@@ -14,7 +14,7 @@ export { cloudServicesClient } from './client/cloud-services.js';
|
|
|
14
14
|
export { codeShiftClient } from './client/code-shift.js';
|
|
15
15
|
export { contentClient } from './client/content.js';
|
|
16
16
|
export { dataIntegrationClient } from './client/data-integration.js';
|
|
17
|
-
export {
|
|
17
|
+
export { discoverClient } from './client/discover.js';
|
|
18
18
|
export { eventBusClient } from './client/event-bus.js';
|
|
19
19
|
export { genAiInferenceClient } from './client/gen-ai-inference.js';
|
|
20
20
|
export { insightsClient } from './client/insights.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D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E,MAAM,4BAA4B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CancelledError } from '@tanstack/react-query';
|
|
2
2
|
export { apiAddresses, getApiAddresses, getBaseUrlWithOverride, setApisOverride } from './api-addresses.js';
|
|
3
3
|
export { accountClient } from './client/account.js';
|
|
4
|
-
export * from './client/
|
|
4
|
+
export * from './client/discover.js';
|
|
5
5
|
export { agentClient } from './client/agent.js';
|
|
6
6
|
export { agentToolsClient } from './client/agent-tools.js';
|
|
7
7
|
export { aiClient } from './client/ai.js';
|
|
@@ -14,7 +14,7 @@ export { cloudServicesClient } from './client/cloud-services.js';
|
|
|
14
14
|
export { codeShiftClient } from './client/code-shift.js';
|
|
15
15
|
export { contentClient } from './client/content.js';
|
|
16
16
|
export { dataIntegrationClient } from './client/data-integration.js';
|
|
17
|
-
export {
|
|
17
|
+
export { discoverClient } from './client/discover.js';
|
|
18
18
|
export { eventBusClient } from './client/event-bus.js';
|
|
19
19
|
export { genAiInferenceClient } from './client/gen-ai-inference.js';
|
|
20
20
|
export { insightsClient } from './client/insights.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D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CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI definition
|
|
3
|
+
* v0
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
+
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "https://discover-discover-core.stg.stackspot.com",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
15
|
+
generatedServerUrl: "https://discover-discover-core.stg.stackspot.com"
|
|
16
|
+
};
|
|
17
|
+
export type GetOpportunityResponseHypothesisResponse = {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
export type GetOpportunityResponse = {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
createdBy: string;
|
|
27
|
+
createdAt?: string;
|
|
28
|
+
hypotheses: GetOpportunityResponseHypothesisResponse[];
|
|
29
|
+
updatedBy?: string;
|
|
30
|
+
updatedAt?: string;
|
|
31
|
+
chatId?: string;
|
|
32
|
+
};
|
|
33
|
+
export type UpdateOpportunityRequest = {
|
|
34
|
+
title?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
};
|
|
37
|
+
export type UpdateOpportunityResponse = {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
createdBy: string;
|
|
42
|
+
createdAt?: string;
|
|
43
|
+
updatedBy?: string;
|
|
44
|
+
updatedAt?: string;
|
|
45
|
+
chatId?: string;
|
|
46
|
+
};
|
|
47
|
+
export type GetHypothesisResponseDocumentResponse = {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
export type GetHypothesisResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
opportunityId: string;
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
documents: GetHypothesisResponseDocumentResponse[];
|
|
58
|
+
createdBy: string;
|
|
59
|
+
createdAt?: string;
|
|
60
|
+
updatedBy?: string;
|
|
61
|
+
updatedAt?: string;
|
|
62
|
+
chatId?: string;
|
|
63
|
+
};
|
|
64
|
+
export type UpdateHypothesisRequest = {
|
|
65
|
+
title?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
};
|
|
68
|
+
export type UpdateHypothesisResponse = {
|
|
69
|
+
id: string;
|
|
70
|
+
opportunityId: string;
|
|
71
|
+
title: string;
|
|
72
|
+
description: string;
|
|
73
|
+
createdBy: string;
|
|
74
|
+
createdAt?: string;
|
|
75
|
+
updatedBy?: string;
|
|
76
|
+
updatedAt?: string;
|
|
77
|
+
chatId?: string;
|
|
78
|
+
};
|
|
79
|
+
export type GetDocumentResponse = {
|
|
80
|
+
id: string;
|
|
81
|
+
hypothesisId: string;
|
|
82
|
+
title: string;
|
|
83
|
+
description: string;
|
|
84
|
+
createdBy: string;
|
|
85
|
+
createdAt?: string;
|
|
86
|
+
updatedBy?: string;
|
|
87
|
+
updatedAt?: string;
|
|
88
|
+
chatId?: string;
|
|
89
|
+
};
|
|
90
|
+
export type UpdateDocumentRequest = {
|
|
91
|
+
title?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
content?: string;
|
|
94
|
+
};
|
|
95
|
+
export type UpdateDocumentResponse = {
|
|
96
|
+
id: string;
|
|
97
|
+
hypothesisId: string;
|
|
98
|
+
title: string;
|
|
99
|
+
description: string;
|
|
100
|
+
createdBy: string;
|
|
101
|
+
createdAt?: string;
|
|
102
|
+
updatedBy?: string;
|
|
103
|
+
updatedAt?: string;
|
|
104
|
+
chatId?: string;
|
|
105
|
+
};
|
|
106
|
+
export type SortResponse = {
|
|
107
|
+
direction: string;
|
|
108
|
+
nullHandling: string;
|
|
109
|
+
ascending: boolean;
|
|
110
|
+
property: string;
|
|
111
|
+
ignoreCase: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type PageableResponse = {
|
|
114
|
+
offset: number;
|
|
115
|
+
sort: SortResponse[];
|
|
116
|
+
paged: boolean;
|
|
117
|
+
pageSize: number;
|
|
118
|
+
pageNumber: number;
|
|
119
|
+
unpaged: boolean;
|
|
120
|
+
};
|
|
121
|
+
export type PageResponseGetOpportunityResponse = {
|
|
122
|
+
totalElements: number;
|
|
123
|
+
totalPages: number;
|
|
124
|
+
first: boolean;
|
|
125
|
+
last: boolean;
|
|
126
|
+
size: number;
|
|
127
|
+
content: GetOpportunityResponse[];
|
|
128
|
+
"number": number;
|
|
129
|
+
sort: SortResponse[];
|
|
130
|
+
numberOfElements: number;
|
|
131
|
+
pageable: PageableResponse;
|
|
132
|
+
empty: boolean;
|
|
133
|
+
};
|
|
134
|
+
export type CreateOpportunityRequest = {
|
|
135
|
+
title?: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
chatId?: string;
|
|
138
|
+
};
|
|
139
|
+
export type CreateOpportunityResponse = {
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
description: string;
|
|
143
|
+
createdBy: string;
|
|
144
|
+
createdAt?: string;
|
|
145
|
+
updatedBy?: string;
|
|
146
|
+
updatedAt?: string;
|
|
147
|
+
chatId?: string;
|
|
148
|
+
};
|
|
149
|
+
export type CreateHypothesisRequest = {
|
|
150
|
+
opportunityId?: string;
|
|
151
|
+
title?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
chatId?: string;
|
|
154
|
+
};
|
|
155
|
+
export type CreateHypothesisResponse = {
|
|
156
|
+
id: string;
|
|
157
|
+
opportunityId: string;
|
|
158
|
+
title: string;
|
|
159
|
+
description: string;
|
|
160
|
+
createdBy: string;
|
|
161
|
+
createdAt?: string;
|
|
162
|
+
updatedBy?: string;
|
|
163
|
+
updatedAt?: string;
|
|
164
|
+
chatId?: string;
|
|
165
|
+
};
|
|
166
|
+
export type CreateDocumentRequest = {
|
|
167
|
+
hypothesisId?: string;
|
|
168
|
+
title?: string;
|
|
169
|
+
description?: string;
|
|
170
|
+
content?: string;
|
|
171
|
+
chatId?: string;
|
|
172
|
+
};
|
|
173
|
+
export type CreateDocumentResponse = {
|
|
174
|
+
id: string;
|
|
175
|
+
hypothesisId: string;
|
|
176
|
+
title: string;
|
|
177
|
+
description: string;
|
|
178
|
+
createdBy: string;
|
|
179
|
+
createdAt?: string;
|
|
180
|
+
updatedBy?: string;
|
|
181
|
+
updatedAt?: string;
|
|
182
|
+
chatId?: string;
|
|
183
|
+
};
|
|
184
|
+
export type GetArtifactResponse = {
|
|
185
|
+
"type": "OPPORTUNITY" | "HYPOTHESIS" | "DOCUMENT";
|
|
186
|
+
id: string;
|
|
187
|
+
title: string;
|
|
188
|
+
description: string;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Get specific Opportunity
|
|
192
|
+
*/
|
|
193
|
+
export function getById({ opportunityId }: {
|
|
194
|
+
opportunityId: string;
|
|
195
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
196
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
197
|
+
status: 200;
|
|
198
|
+
data: GetOpportunityResponse;
|
|
199
|
+
}>(`/v2/opportunities/${encodeURIComponent(opportunityId)}`, {
|
|
200
|
+
...opts
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Update specific Opportunity
|
|
205
|
+
*/
|
|
206
|
+
export function updateById({ opportunityId, updateOpportunityRequest }: {
|
|
207
|
+
opportunityId: string;
|
|
208
|
+
updateOpportunityRequest: UpdateOpportunityRequest;
|
|
209
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
210
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
211
|
+
status: 200;
|
|
212
|
+
data: UpdateOpportunityResponse;
|
|
213
|
+
}>(`/v2/opportunities/${encodeURIComponent(opportunityId)}`, oazapfts.json({
|
|
214
|
+
...opts,
|
|
215
|
+
method: "PUT",
|
|
216
|
+
body: updateOpportunityRequest
|
|
217
|
+
})));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Delete specific Opportunity
|
|
221
|
+
*/
|
|
222
|
+
export function deleteById({ opportunityId }: {
|
|
223
|
+
opportunityId: string;
|
|
224
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
225
|
+
return oazapfts.ok(oazapfts.fetchText(`/v2/opportunities/${encodeURIComponent(opportunityId)}`, {
|
|
226
|
+
...opts,
|
|
227
|
+
method: "DELETE"
|
|
228
|
+
}));
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get specific Hypothesis
|
|
232
|
+
*/
|
|
233
|
+
export function getById1({ hypothesisId }: {
|
|
234
|
+
hypothesisId: string;
|
|
235
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
236
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
237
|
+
status: 200;
|
|
238
|
+
data: GetHypothesisResponse;
|
|
239
|
+
}>(`/v2/hypotheses/${encodeURIComponent(hypothesisId)}`, {
|
|
240
|
+
...opts
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Update specific Hypothesis
|
|
245
|
+
*/
|
|
246
|
+
export function updateById1({ hypothesisId, updateHypothesisRequest }: {
|
|
247
|
+
hypothesisId: string;
|
|
248
|
+
updateHypothesisRequest: UpdateHypothesisRequest;
|
|
249
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
250
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
251
|
+
status: 200;
|
|
252
|
+
data: UpdateHypothesisResponse;
|
|
253
|
+
}>(`/v2/hypotheses/${encodeURIComponent(hypothesisId)}`, oazapfts.json({
|
|
254
|
+
...opts,
|
|
255
|
+
method: "PUT",
|
|
256
|
+
body: updateHypothesisRequest
|
|
257
|
+
})));
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Delete specific Hypothesis
|
|
261
|
+
*/
|
|
262
|
+
export function deleteById1({ hypothesisId }: {
|
|
263
|
+
hypothesisId: string;
|
|
264
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
265
|
+
return oazapfts.ok(oazapfts.fetchText(`/v2/hypotheses/${encodeURIComponent(hypothesisId)}`, {
|
|
266
|
+
...opts,
|
|
267
|
+
method: "DELETE"
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get specific Document
|
|
272
|
+
*/
|
|
273
|
+
export function getById2({ documentId }: {
|
|
274
|
+
documentId: string;
|
|
275
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
276
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
277
|
+
status: 200;
|
|
278
|
+
data: GetDocumentResponse;
|
|
279
|
+
}>(`/v2/documents/${encodeURIComponent(documentId)}`, {
|
|
280
|
+
...opts
|
|
281
|
+
}));
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Update specific Document
|
|
285
|
+
*/
|
|
286
|
+
export function updateById2({ documentId, updateDocumentRequest }: {
|
|
287
|
+
documentId: string;
|
|
288
|
+
updateDocumentRequest: UpdateDocumentRequest;
|
|
289
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
290
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
291
|
+
status: 200;
|
|
292
|
+
data: UpdateDocumentResponse;
|
|
293
|
+
}>(`/v2/documents/${encodeURIComponent(documentId)}`, oazapfts.json({
|
|
294
|
+
...opts,
|
|
295
|
+
method: "PUT",
|
|
296
|
+
body: updateDocumentRequest
|
|
297
|
+
})));
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Delete specific Document
|
|
301
|
+
*/
|
|
302
|
+
export function deleteById2({ documentId }: {
|
|
303
|
+
documentId: string;
|
|
304
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
305
|
+
return oazapfts.ok(oazapfts.fetchText(`/v2/documents/${encodeURIComponent(documentId)}`, {
|
|
306
|
+
...opts,
|
|
307
|
+
method: "DELETE"
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Get all Opportunities
|
|
312
|
+
*/
|
|
313
|
+
export function getAll({ filter, page, size, sort, direction }: {
|
|
314
|
+
filter?: string;
|
|
315
|
+
page?: number;
|
|
316
|
+
size?: number;
|
|
317
|
+
sort?: string;
|
|
318
|
+
direction?: string;
|
|
319
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
320
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
321
|
+
status: 200;
|
|
322
|
+
data: PageResponseGetOpportunityResponse;
|
|
323
|
+
}>(`/v2/opportunities${QS.query(QS.explode({
|
|
324
|
+
filter,
|
|
325
|
+
page,
|
|
326
|
+
size,
|
|
327
|
+
sort,
|
|
328
|
+
direction
|
|
329
|
+
}))}`, {
|
|
330
|
+
...opts
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Create new Opportunity
|
|
335
|
+
*/
|
|
336
|
+
export function create({ createOpportunityRequest }: {
|
|
337
|
+
createOpportunityRequest: CreateOpportunityRequest;
|
|
338
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
339
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
340
|
+
status: 200;
|
|
341
|
+
data: CreateOpportunityResponse;
|
|
342
|
+
}>("/v2/opportunities", oazapfts.json({
|
|
343
|
+
...opts,
|
|
344
|
+
method: "POST",
|
|
345
|
+
body: createOpportunityRequest
|
|
346
|
+
})));
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Get all Hypotheses
|
|
350
|
+
*/
|
|
351
|
+
export function getAll1({ opportunityId }: {
|
|
352
|
+
opportunityId: string;
|
|
353
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
354
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
355
|
+
status: 200;
|
|
356
|
+
data: GetHypothesisResponse[];
|
|
357
|
+
}>(`/v2/hypotheses${QS.query(QS.explode({
|
|
358
|
+
opportunityId
|
|
359
|
+
}))}`, {
|
|
360
|
+
...opts
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Create new Hypothesis
|
|
365
|
+
*/
|
|
366
|
+
export function create1({ createHypothesisRequest }: {
|
|
367
|
+
createHypothesisRequest: CreateHypothesisRequest;
|
|
368
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
369
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
370
|
+
status: 200;
|
|
371
|
+
data: CreateHypothesisResponse;
|
|
372
|
+
}>("/v2/hypotheses", oazapfts.json({
|
|
373
|
+
...opts,
|
|
374
|
+
method: "POST",
|
|
375
|
+
body: createHypothesisRequest
|
|
376
|
+
})));
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Get all Documents by Hypothesis
|
|
380
|
+
*/
|
|
381
|
+
export function getAllByHypothesis({ hypothesisId }: {
|
|
382
|
+
hypothesisId: string;
|
|
383
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
384
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
385
|
+
status: 200;
|
|
386
|
+
data: GetDocumentResponse[];
|
|
387
|
+
}>(`/v2/documents${QS.query(QS.explode({
|
|
388
|
+
hypothesisId
|
|
389
|
+
}))}`, {
|
|
390
|
+
...opts
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Create Document
|
|
395
|
+
*/
|
|
396
|
+
export function create2({ createDocumentRequest }: {
|
|
397
|
+
createDocumentRequest: CreateDocumentRequest;
|
|
398
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
399
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
400
|
+
status: 200;
|
|
401
|
+
data: CreateDocumentResponse;
|
|
402
|
+
}>("/v2/documents", oazapfts.json({
|
|
403
|
+
...opts,
|
|
404
|
+
method: "POST",
|
|
405
|
+
body: createDocumentRequest
|
|
406
|
+
})));
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get specific Document content
|
|
410
|
+
*/
|
|
411
|
+
export function getContentById({ documentId }: {
|
|
412
|
+
documentId: string;
|
|
413
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
414
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
415
|
+
status: 200;
|
|
416
|
+
data: string;
|
|
417
|
+
}>(`/v2/documents/${encodeURIComponent(documentId)}/content`, {
|
|
418
|
+
...opts
|
|
419
|
+
}));
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Get chat artifacts
|
|
423
|
+
*/
|
|
424
|
+
export function getAll2({ chatId }: {
|
|
425
|
+
chatId: string;
|
|
426
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
427
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
428
|
+
status: 200;
|
|
429
|
+
data: GetArtifactResponse[];
|
|
430
|
+
}>(`/v2/artifacts${QS.query(QS.explode({
|
|
431
|
+
chatId
|
|
432
|
+
}))}`, {
|
|
433
|
+
...opts
|
|
434
|
+
}));
|
|
435
|
+
}
|