@zeniai/client-epic-state 5.1.32 → 5.1.33
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/README.md +1 -3
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +3 -29
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +0 -11
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
- package/lib/esm/view/aiCfoView/epics/submitQuestionEpic.js +1 -7
- package/lib/esm/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +16 -4
- package/lib/esm/view/onboardingView/cockpitView/onboardingCockpitViewPayload.js +2 -2
- package/lib/index.d.ts +4 -4
- package/lib/index.js +5 -9
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +0 -14
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +4 -8
- package/lib/view/aiCfoView/aiCfoViewReducer.js +4 -30
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +1 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.js +0 -12
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +0 -15
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +2 -2
- package/lib/view/aiCfoView/epics/submitQuestionEpic.js +1 -7
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +15 -3
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewPayload.js +2 -2
- package/package.json +36 -71
- package/lib/esm/view/aiCfoView/epics/fetchSkillsEpic.js +0 -34
- package/lib/view/aiCfoView/epics/fetchSkillsEpic.d.ts +0 -8
- package/lib/view/aiCfoView/epics/fetchSkillsEpic.js +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.33",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -33,44 +33,6 @@
|
|
|
33
33
|
"require": "./lib/view/*.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"clean": "rimraf lib",
|
|
38
|
-
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
39
|
-
"test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=2 ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
|
|
40
|
-
"test:typecheck-mocks": "echo 'Typechecking mock files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.mocks.json",
|
|
41
|
-
"test:typecheck-mocks-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=2 ./scripts/tsc-modified-files.sh master tsconfig.mocks.json",
|
|
42
|
-
"test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
|
|
43
|
-
"test:full": "pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
|
|
44
|
-
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
|
|
45
|
-
"lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
|
|
46
|
-
"lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
|
|
47
|
-
"tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
|
|
48
|
-
"typecheck": "tsc --noEmit",
|
|
49
|
-
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
50
|
-
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
51
|
-
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
52
|
-
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck (incl. lint-modified-files)...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
53
|
-
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
54
|
-
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
55
|
-
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
56
|
-
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
57
|
-
"check-version": "node ./scripts/check_version.js",
|
|
58
|
-
"prepublishOnly": "chmod +x ./scripts/branch_validation.sh && ./scripts/branch_validation.sh && (npm run update-slack-group-topic || true) && npm run check-version && npm run clean && npm run only-build",
|
|
59
|
-
"version": "git add -A src",
|
|
60
|
-
"postversion": "git push && git push --tags",
|
|
61
|
-
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
62
|
-
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
63
|
-
"create-or-update-release-branch": "chmod +x ./scripts/create_or_update_release_branch.sh && ./scripts/create_or_update_release_branch.sh",
|
|
64
|
-
"bump-versions-master": "chmod +x ./scripts/bump_versions_master.sh && ./scripts/bump_versions_master.sh",
|
|
65
|
-
"bump-versions-beta": "chmod +x ./scripts/bump_versions_beta.sh && ./scripts/bump_versions_beta.sh",
|
|
66
|
-
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
67
|
-
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
68
|
-
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
69
|
-
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
70
|
-
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
71
|
-
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
72
|
-
"test:file": "scripts/test-file.sh"
|
|
73
|
-
},
|
|
74
36
|
"files": [
|
|
75
37
|
"lib/**/*"
|
|
76
38
|
],
|
|
@@ -117,7 +79,6 @@
|
|
|
117
79
|
"ts-prune": "^0.10.3",
|
|
118
80
|
"ts-unused-exports": "^11.0.1",
|
|
119
81
|
"typescript": "^5.7.3",
|
|
120
|
-
"vite": "^7.3.5",
|
|
121
82
|
"vitest": "^4.1.8"
|
|
122
83
|
},
|
|
123
84
|
"dependencies": {
|
|
@@ -142,35 +103,39 @@
|
|
|
142
103
|
"dayjs": "^1.10.7",
|
|
143
104
|
"url-parse": "^1.5.10"
|
|
144
105
|
},
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
106
|
+
"scripts": {
|
|
107
|
+
"clean": "rimraf lib",
|
|
108
|
+
"test:typecheck": "echo 'Typechecking test files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.typecheck.json",
|
|
109
|
+
"test:typecheck-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=2 ./scripts/tsc-modified-files.sh master tsconfig.typecheck.json",
|
|
110
|
+
"test:typecheck-mocks": "echo 'Typechecking mock files...' && NODE_OPTIONS=--max-old-space-size=4096 time tsc -p tsconfig.mocks.json",
|
|
111
|
+
"test:typecheck-mocks-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && SINCE_DAYS=2 ./scripts/tsc-modified-files.sh master tsconfig.mocks.json",
|
|
112
|
+
"test": "pnpm lint-modified-files && pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
|
|
113
|
+
"test:full": "pnpm test:typecheck-modified-files && pnpm test:typecheck-mocks-modified-files && vitest run --typecheck",
|
|
114
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0 --fix",
|
|
115
|
+
"lint-modified-files": "chmod +x ./scripts/lint-modified-files.sh && ./scripts/lint-modified-files.sh",
|
|
116
|
+
"lint:fix-modified-files": "chmod +x ./scripts/lint-modified-files.sh && LINT_FIX=true ./scripts/lint-modified-files.sh",
|
|
117
|
+
"tsc-modified-files": "chmod +x ./scripts/tsc-modified-files.sh && ./scripts/tsc-modified-files.sh",
|
|
118
|
+
"typecheck": "tsc --noEmit",
|
|
119
|
+
"find-dead-code": "ts-prune | grep -v '(used in module)'",
|
|
120
|
+
"find-unused-exports": "ts-unused-exports ./tsconfig.json",
|
|
121
|
+
"circular-dependency": "npx madge --circular --extensions ts ./src",
|
|
122
|
+
"build": "concurrently --kill-others-on-fail --handle-input \"echo 'TypeScript build in progress...' && time tsc && echo 'ESM build...' && tsc -p tsconfig.esm.json\" \"echo 'Running tests and typecheck (incl. lint-modified-files)...' && pnpm test\" && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
123
|
+
"only-build": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc && tsc -p tsconfig.esm.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
124
|
+
"only-build-dev": "eslint . --ext .js,.jsx,.ts,.tsx && time tsc -p tsconfig.dev.json && tsc -p tsconfig.esm.dev.json && rimraf \"lib/**/__mocks__\" \"lib/**/__testHelpers__\"",
|
|
125
|
+
"format": "prettier --write --ignore-unknown \"src/**/*\" && pnpm lint",
|
|
126
|
+
"format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
|
|
127
|
+
"check-version": "node ./scripts/check_version.js",
|
|
128
|
+
"version": "git add -A src",
|
|
129
|
+
"postversion": "git push && git push --tags",
|
|
130
|
+
"check-dependencies": "node ./scripts/check_dependencies.js",
|
|
131
|
+
"clean-overrides": "node ./scripts/clean_overrides.js",
|
|
132
|
+
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
133
|
+
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
134
|
+
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
135
|
+
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
136
|
+
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh",
|
|
137
|
+
"pr-approvals-update": "chmod +x ./scripts/pr_approvals.sh && ./scripts/pr_approvals.sh",
|
|
138
|
+
"raise-pr-automation": "chmod +x ./scripts/raise_pr_automation.sh && ./scripts/raise_pr_automation.sh",
|
|
139
|
+
"test:file": "scripts/test-file.sh"
|
|
175
140
|
}
|
|
176
|
-
}
|
|
141
|
+
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap, switchMap } from 'rxjs/operators';
|
|
3
|
-
import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload';
|
|
4
|
-
import { fetchSkills, fetchSkillsFailure, fetchSkillsSuccess, } from '../aiCfoViewReducer';
|
|
5
|
-
const toSkill = (s) => ({
|
|
6
|
-
macroId: s.macro_id,
|
|
7
|
-
name: s.name,
|
|
8
|
-
displayName: s.display_name,
|
|
9
|
-
description: s.description,
|
|
10
|
-
semver: s.semver,
|
|
11
|
-
parameterHints: s.parameter_hints,
|
|
12
|
-
hasScripts: s.has_scripts,
|
|
13
|
-
});
|
|
14
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/skills — chat-visible skills for the `/` menu. */
|
|
15
|
-
export const fetchSkillsEpic = (actions$,
|
|
16
|
-
// state$ intentionally unused: the `/` menu dispatches this once per slash-entry
|
|
17
|
-
// (the composer dedupes), so we always re-fetch the (small, singleton) list.
|
|
18
|
-
_state$, zeniAPI) => actions$.pipe(filter(fetchSkills.match),
|
|
19
|
-
// switchMap: a singleton list endpoint with no key — cancel any in-flight
|
|
20
|
-
// fetch so the latest dispatch wins (no racing writes to `skills`).
|
|
21
|
-
switchMap(() => {
|
|
22
|
-
// aiCfoMicroServiceBaseUrl already targets the chat service (it serves the
|
|
23
|
-
// /1.0/agents/{id} submit route too); /1.0/skills lives on the same service.
|
|
24
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/skills`;
|
|
25
|
-
return zeniAPI.getJSON(url).pipe(mergeMap((response) => {
|
|
26
|
-
if (isSuccessResponse(response) && response.data != null) {
|
|
27
|
-
// Guard the array: a malformed 2xx body without `skills` must not crash .map.
|
|
28
|
-
return of(fetchSkillsSuccess({
|
|
29
|
-
skills: (response.data.skills ?? []).map(toSkill),
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
return of(fetchSkillsFailure(response.status));
|
|
33
|
-
}), catchError((error) => of(fetchSkillsFailure(createZeniAPIStatus('Unexpected Error', 'Fetch skills REST API call failed', error instanceof Error ? { message: error.message } : undefined)))));
|
|
34
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { fetchSkills, fetchSkillsFailure, fetchSkillsSuccess } from '../aiCfoViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchSkills> | ReturnType<typeof fetchSkillsSuccess> | ReturnType<typeof fetchSkillsFailure>;
|
|
7
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/skills — chat-visible skills for the `/` menu. */
|
|
8
|
-
export declare const fetchSkillsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchSkillsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
-
const toSkill = (s) => ({
|
|
9
|
-
macroId: s.macro_id,
|
|
10
|
-
name: s.name,
|
|
11
|
-
displayName: s.display_name,
|
|
12
|
-
description: s.description,
|
|
13
|
-
semver: s.semver,
|
|
14
|
-
parameterHints: s.parameter_hints,
|
|
15
|
-
hasScripts: s.has_scripts,
|
|
16
|
-
});
|
|
17
|
-
/** GET {aiCfoMicroServiceBaseUrl}/1.0/skills — chat-visible skills for the `/` menu. */
|
|
18
|
-
const fetchSkillsEpic = (actions$,
|
|
19
|
-
// state$ intentionally unused: the `/` menu dispatches this once per slash-entry
|
|
20
|
-
// (the composer dedupes), so we always re-fetch the (small, singleton) list.
|
|
21
|
-
_state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSkills.match),
|
|
22
|
-
// switchMap: a singleton list endpoint with no key — cancel any in-flight
|
|
23
|
-
// fetch so the latest dispatch wins (no racing writes to `skills`).
|
|
24
|
-
(0, operators_1.switchMap)(() => {
|
|
25
|
-
// aiCfoMicroServiceBaseUrl already targets the chat service (it serves the
|
|
26
|
-
// /1.0/agents/{id} submit route too); /1.0/skills lives on the same service.
|
|
27
|
-
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/skills`;
|
|
28
|
-
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
29
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
30
|
-
// Guard the array: a malformed 2xx body without `skills` must not crash .map.
|
|
31
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSkillsSuccess)({
|
|
32
|
-
skills: (response.data.skills ?? []).map(toSkill),
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSkillsFailure)(response.status));
|
|
36
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSkillsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch skills REST API call failed', error instanceof Error ? { message: error.message } : undefined)))));
|
|
37
|
-
}));
|
|
38
|
-
exports.fetchSkillsEpic = fetchSkillsEpic;
|