@camunda/camunda-composite-components 0.21.1 → 0.21.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/lib/esm/package.json +31 -41
- package/lib/esm/src/api/api.d.ts +5 -5
- package/lib/esm/src/api/api.js +14 -14
- package/lib/esm/src/api/clusters.d.ts +2 -2
- package/lib/esm/src/api/clusters.js +4 -4
- package/lib/esm/src/api/endpoints.const.d.ts +1 -1
- package/lib/esm/src/api/endpoints.const.js +22 -22
- package/lib/esm/src/api/help-center.d.ts +4 -4
- package/lib/esm/src/api/help-center.js +14 -14
- package/lib/esm/src/api/jwt.utils.js +5 -7
- package/lib/esm/src/api/notifications.d.ts +6 -6
- package/lib/esm/src/api/notifications.js +24 -24
- package/lib/esm/src/api/organizations.d.ts +1 -1
- package/lib/esm/src/api/organizations.js +3 -3
- package/lib/esm/src/api/profile.d.ts +6 -7
- package/lib/esm/src/api/profile.js +8 -8
- package/lib/esm/src/api/status.js +15 -15
- package/lib/esm/src/assets/c3-icons.d.ts +1 -1
- package/lib/esm/src/assets/c3-icons.js +4 -4
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +2 -2
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +45 -55
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +20 -20
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +1 -1
- package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +8 -8
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +3 -3
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +9 -9
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +15 -15
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +2 -2
- package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +17 -17
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +3 -3
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +16 -16
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +5 -5
- package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +4 -4
- package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +1 -1
- package/lib/esm/src/components/c3-data-table/c3-data-table.js +87 -83
- package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +20 -10
- package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +1 -1
- package/lib/esm/src/components/c3-data-table/link-button/link-button.js +2 -2
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +2 -2
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +8 -8
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +13 -9
- package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +4 -4
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +1 -1
- package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +5 -5
- package/lib/esm/src/components/c3-help-center/c3-help-center.js +30 -30
- package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +4 -4
- package/lib/esm/src/components/c3-help-center/help-center-hint.js +5 -8
- package/lib/esm/src/components/c3-help-center/help-center.d.ts +4 -4
- package/lib/esm/src/components/c3-help-center/help-center.js +67 -70
- package/lib/esm/src/components/c3-help-center/recommendations.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/recommendations.js +3 -3
- package/lib/esm/src/components/c3-help-center/styles.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/styles.js +30 -30
- package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +2 -2
- package/lib/esm/src/components/c3-help-center/tabs/feedback.js +43 -46
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +3 -3
- package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +10 -10
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +1 -1
- package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +14 -14
- package/lib/esm/src/components/c3-help-center/tile.d.ts +4 -4
- package/lib/esm/src/components/c3-help-center/tile.js +27 -27
- package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-info-button.js +3 -3
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +3 -3
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +65 -70
- package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +11 -11
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +22 -22
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +29 -29
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +30 -37
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +9 -9
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +39 -42
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +27 -27
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +4 -4
- package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-navigation.js +113 -115
- package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +34 -34
- package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +9 -9
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +4 -4
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +43 -51
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +10 -10
- package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/c3-org-name.js +23 -23
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +31 -31
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +4 -4
- package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +58 -58
- package/lib/esm/src/components/c3-navigation/helpers.d.ts +2 -2
- package/lib/esm/src/components/c3-navigation/helpers.js +7 -7
- package/lib/esm/src/components/c3-navigation/index.d.ts +1 -1
- package/lib/esm/src/components/c3-navigation/index.js +2 -2
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +8 -8
- package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +75 -75
- package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +3 -3
- package/lib/esm/src/components/c3-navigation/stories/story-templates.js +10 -10
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +5 -5
- package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +10 -10
- package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +1 -1
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +2 -2
- package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +15 -15
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +2 -2
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +13 -16
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +2 -2
- package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +15 -18
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +2 -2
- package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +3 -3
- package/lib/esm/src/components/c3-onboarding-survey/helpers.js +3 -3
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +2 -1
- package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +18 -18
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +1 -1
- package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +11 -11
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +4 -4
- package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +28 -30
- package/lib/esm/src/components/c3-onboarding-survey/step.js +7 -7
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +2 -2
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +8 -8
- package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +1 -1
- package/lib/esm/src/components/c3-page/c3-page.d.ts +2 -2
- package/lib/esm/src/components/c3-page/c3-page.js +5 -5
- package/lib/esm/src/components/c3-page/c3-page.test.js +11 -11
- package/lib/esm/src/components/c3-page/c3-page.types.d.ts +8 -8
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +2 -2
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +4 -4
- package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +1 -1
- package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +8 -8
- package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +2 -2
- package/lib/esm/src/components/c3-user-configuration/authToken.js +4 -4
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +5 -5
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +23 -20
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +3 -3
- package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +8 -8
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +5 -5
- package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +10 -10
- package/lib/esm/src/components/styles.js +55 -55
- package/lib/esm/src/components/test-utils.d.ts +1 -1
- package/lib/esm/src/components/test-utils.js +14 -9
- package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +2 -2
- package/lib/esm/src/contexts/c3-cluster-update-manager.js +4 -5
- package/lib/esm/src/hooks/useApi.d.ts +2 -2
- package/lib/esm/src/hooks/useApi.js +1 -1
- package/lib/esm/src/index.d.ts +23 -32
- package/lib/esm/src/index.js +14 -23
- package/lib/esm/src/utils/camunda.d.ts +1 -1
- package/lib/esm/src/utils/camunda.js +8 -8
- package/lib/esm/src/utils/camunda.types.d.ts +2 -2
- package/package.json +30 -39
- package/lib/esm/src/assets/app-teaser-images/operate-1-monitor.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/operate-1-monitor.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/operate-2-inspect.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/operate-2-inspect.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/operate-3-troubleshoot.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/operate-3-troubleshoot.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-1-Kpis.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-1-Kpis.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-2-opportunities.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-2-opportunities.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-3-reports.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/optimize-3-reports.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-1-task-manager.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-1-task-manager.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-2-form.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-2-form.js +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-3-api.d.ts +0 -1
- package/lib/esm/src/assets/app-teaser-images/tasklist-3-api.js +0 -1
package/lib/esm/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/camunda-composite-components",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.3",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"publishConfig": {
|
|
5
6
|
"access": "public",
|
|
6
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,20 +13,19 @@
|
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
14
15
|
"clean": "rimraf lib/",
|
|
15
|
-
"build": "pnpm clean && tsc",
|
|
16
|
+
"build": "pnpm clean && tsc && node fix-esm-imports.mjs",
|
|
16
17
|
"storybook": "storybook dev -p 6006",
|
|
17
18
|
"start": "pnpm storybook",
|
|
18
19
|
"build-storybook": "storybook build",
|
|
19
20
|
"build:all": "pnpm build && pnpm build-storybook",
|
|
20
21
|
"serve:storybook": "npx --yes serve ./storybook-static -p 6006 -n -L",
|
|
21
|
-
"prepare": "husky",
|
|
22
22
|
"docker:setup": "pnpm install && npx playwright install",
|
|
23
23
|
"format": "prettier --write .",
|
|
24
|
-
"lint": "
|
|
24
|
+
"lint": "biome lint ./src",
|
|
25
25
|
"lint:fix": "eslint --fix src/",
|
|
26
26
|
"test:ts": "tsc --noEmit --project ./tsconfig.json",
|
|
27
|
-
"test:storybook": "
|
|
28
|
-
"test:storybook:
|
|
27
|
+
"test:storybook": "vitest run",
|
|
28
|
+
"test:storybook:watch": "vitest",
|
|
29
29
|
"start:docker-storybook": "pnpm build-storybook && docker-compose up -d && docker-compose exec c3-visual-regression pnpm docker:setup && docker-compose exec c3-visual-regression pnpm serve:storybook",
|
|
30
30
|
"test:visual-regression": "wait-on http://localhost:6006 && pnpm playwright test",
|
|
31
31
|
"test:visual-regression:ui": "pnpm playwright test --ui",
|
|
@@ -33,62 +33,52 @@
|
|
|
33
33
|
"update:visual-regression": "pnpm playwright test --update-snapshots",
|
|
34
34
|
"test:visual-regression:docker": "docker exec -it -t c3-visual-regression pnpm test:visual-regression",
|
|
35
35
|
"update:visual-regression:docker": "docker exec -it -t c3-visual-regression pnpm update:visual-regression",
|
|
36
|
-
"test:all": "pnpm test:ts && pnpm
|
|
36
|
+
"test:all": "pnpm test:ts && pnpm test:storybook",
|
|
37
37
|
"test": "pnpm test:ts"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@babel/preset-react": "7.25.7",
|
|
43
|
-
"@babel/preset-typescript": "7.25.7",
|
|
40
|
+
"@auth0/auth0-spa-js": "^2.8.0",
|
|
41
|
+
"@camunda-cloud/shared-types": "workspace:*",
|
|
44
42
|
"@carbon/react": "1.90.0",
|
|
45
|
-
"@
|
|
43
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
44
|
+
"@mdx-js/react": "^3.1.1",
|
|
46
45
|
"@playwright/test": "1.56.1",
|
|
47
|
-
"@storybook/addon-a11y": "
|
|
48
|
-
"@storybook/addon-docs": "^
|
|
49
|
-
"@storybook/addon-links": "
|
|
50
|
-
"@storybook/addon-
|
|
51
|
-
"@storybook/
|
|
52
|
-
"@storybook/react-
|
|
53
|
-
"@storybook/test-runner": "0.23.0",
|
|
46
|
+
"@storybook/addon-a11y": "^10.0.7",
|
|
47
|
+
"@storybook/addon-docs": "^10.0.7",
|
|
48
|
+
"@storybook/addon-links": "^10.0.7",
|
|
49
|
+
"@storybook/addon-vitest": "^10.0.8",
|
|
50
|
+
"@storybook/react": "^10.0.7",
|
|
51
|
+
"@storybook/react-vite": "^10.0.7",
|
|
54
52
|
"@types/event-source-polyfill": "1.0.5",
|
|
55
|
-
"@types/react": "18.3.12",
|
|
56
|
-
"@types/react-dom": "18.3.2",
|
|
57
53
|
"@types/mixpanel-browser": "2.49.0",
|
|
58
54
|
"@types/node": "22.13.14",
|
|
55
|
+
"@types/react": "18.3.12",
|
|
56
|
+
"@types/react-dom": "18.3.2",
|
|
59
57
|
"@types/semver": "^7.5.8",
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"babel-loader": "9.2.1",
|
|
58
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
59
|
+
"@vitest/browser": "^4.0.13",
|
|
60
|
+
"@vitest/browser-playwright": "^4.0.13",
|
|
64
61
|
"conventional-changelog-conventionalcommits": "7.0.2",
|
|
65
|
-
"copyfiles": "2.4.1",
|
|
66
|
-
"css-loader": "7.1.0",
|
|
67
|
-
"eslint": "8.57.0",
|
|
68
|
-
"eslint-config-prettier": "9.1.0",
|
|
69
62
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
70
|
-
"eslint-plugin-
|
|
71
|
-
"eslint-plugin-
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-react-hooks": "4.6.2",
|
|
74
|
-
"eslint-plugin-storybook": "9.1.4",
|
|
63
|
+
"eslint-plugin-react": "7.37.2",
|
|
64
|
+
"eslint-plugin-react-hooks": "5.0.0",
|
|
65
|
+
"eslint-plugin-storybook": "^10.0.7",
|
|
75
66
|
"event-source-polyfill": "1.0.31",
|
|
76
|
-
"husky": "9.1.2",
|
|
77
67
|
"mixpanel-browser": "2.49.0",
|
|
78
|
-
"
|
|
68
|
+
"playwright": "^1.56.1",
|
|
79
69
|
"react": "19.1.0",
|
|
80
70
|
"react-dom": "19.1.0",
|
|
81
71
|
"react-is": "^19.1.0",
|
|
82
72
|
"rimraf": "6.0.1",
|
|
83
73
|
"sass": "1.74.1",
|
|
84
|
-
"sass-loader": "14.1.1",
|
|
85
74
|
"serve": "14.2.4",
|
|
86
|
-
"storybook": "^
|
|
87
|
-
"style-loader": "4.0.0",
|
|
75
|
+
"storybook": "^10.0.7",
|
|
88
76
|
"styled-components": "6.1.8",
|
|
89
77
|
"typescript": "5.8.3",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
78
|
+
"typescript-eslint": "^8.46.4",
|
|
79
|
+
"vite": "^7.2.2",
|
|
80
|
+
"vitest": "^4.0.13",
|
|
81
|
+
"wait-on": "8.0.2"
|
|
92
82
|
},
|
|
93
83
|
"dependencies": {
|
|
94
84
|
"jwt-decode": "4.0.0",
|
package/lib/esm/src/api/api.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Endpoints, Stage } from
|
|
1
|
+
import { type Endpoints, type Stage } from './endpoints.const';
|
|
2
2
|
export interface RequestPayload {
|
|
3
3
|
url: string;
|
|
4
|
-
base?:
|
|
4
|
+
base?: 'notifications' | 'accounts';
|
|
5
5
|
stage?: Stage;
|
|
6
6
|
endpoints?: Endpoints;
|
|
7
|
-
method?:
|
|
7
|
+
method?: 'get' | 'post' | 'put' | 'delete' | 'patch';
|
|
8
8
|
headers?: {
|
|
9
9
|
[key: string]: string;
|
|
10
10
|
};
|
|
11
|
-
type?:
|
|
12
|
-
responseType?:
|
|
11
|
+
type?: 'json' | 'text' | 'form' | 'none';
|
|
12
|
+
responseType?: 'json' | 'text' | 'none';
|
|
13
13
|
camundaAuth?: {
|
|
14
14
|
token: string;
|
|
15
15
|
refreshTokenMethod?: () => Promise<string>;
|
package/lib/esm/src/api/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getEndpoint, NOTIFICATIONS,
|
|
2
|
-
import { JWTUtils } from
|
|
1
|
+
import { ACCOUNTS, getEndpoint, NOTIFICATIONS, } from './endpoints.const.js';
|
|
2
|
+
import { JWTUtils } from './jwt.utils.js';
|
|
3
3
|
export const request = async (payload) => {
|
|
4
4
|
const headers = {};
|
|
5
5
|
if (payload.camundaAuth) {
|
|
@@ -12,18 +12,18 @@ export const request = async (payload) => {
|
|
|
12
12
|
headers.Authorization = `Bearer ${payload.camundaAuth.token}`;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
const type = payload.type ??
|
|
15
|
+
const type = payload.type ?? 'json';
|
|
16
16
|
if (type) {
|
|
17
17
|
switch (type) {
|
|
18
|
-
case
|
|
19
|
-
headers[
|
|
18
|
+
case 'json':
|
|
19
|
+
headers['Content-Type'] = 'application/json';
|
|
20
20
|
break;
|
|
21
|
-
case
|
|
22
|
-
headers[
|
|
21
|
+
case 'text':
|
|
22
|
+
headers['Content-Type'] = 'text/plain';
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
const body = payload.body && type ===
|
|
26
|
+
const body = payload.body && type === 'json'
|
|
27
27
|
? JSON.stringify(payload.body)
|
|
28
28
|
: payload.body instanceof FormData
|
|
29
29
|
? payload.body
|
|
@@ -31,7 +31,7 @@ export const request = async (payload) => {
|
|
|
31
31
|
let base;
|
|
32
32
|
if (payload.base) {
|
|
33
33
|
switch (payload.base) {
|
|
34
|
-
case
|
|
34
|
+
case 'notifications':
|
|
35
35
|
if (payload.endpoints?.notifications) {
|
|
36
36
|
base = payload.endpoints.notifications;
|
|
37
37
|
}
|
|
@@ -39,7 +39,7 @@ export const request = async (payload) => {
|
|
|
39
39
|
base = getEndpoint(payload.stage, NOTIFICATIONS);
|
|
40
40
|
}
|
|
41
41
|
break;
|
|
42
|
-
case
|
|
42
|
+
case 'accounts':
|
|
43
43
|
if (payload.endpoints?.accounts) {
|
|
44
44
|
base = payload.endpoints.accounts;
|
|
45
45
|
}
|
|
@@ -51,7 +51,7 @@ export const request = async (payload) => {
|
|
|
51
51
|
const url = base ? `${base}/${payload.url}` : payload.url;
|
|
52
52
|
try {
|
|
53
53
|
const response = await fetch(url, {
|
|
54
|
-
method: payload.method ? payload.method.toUpperCase() :
|
|
54
|
+
method: payload.method ? payload.method.toUpperCase() : 'GET',
|
|
55
55
|
headers,
|
|
56
56
|
body,
|
|
57
57
|
signal: payload?.signal,
|
|
@@ -68,10 +68,10 @@ export const request = async (payload) => {
|
|
|
68
68
|
const responseType = payload.responseType ?? type;
|
|
69
69
|
let res;
|
|
70
70
|
switch (responseType) {
|
|
71
|
-
case
|
|
71
|
+
case 'json':
|
|
72
72
|
res = await response.json();
|
|
73
73
|
break;
|
|
74
|
-
case
|
|
74
|
+
case 'text':
|
|
75
75
|
res = await response.text();
|
|
76
76
|
break;
|
|
77
77
|
default:
|
|
@@ -81,7 +81,7 @@ export const request = async (payload) => {
|
|
|
81
81
|
}
|
|
82
82
|
catch (error) {
|
|
83
83
|
if (payload.enableLogs)
|
|
84
|
-
console.error(
|
|
84
|
+
console.error('API request failed:', error);
|
|
85
85
|
return { success: false, error: error?.toString() };
|
|
86
86
|
}
|
|
87
87
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventSourcePolyfill } from
|
|
2
|
-
import { Endpoints, Stage } from
|
|
1
|
+
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
2
|
+
import { type Endpoints, type Stage } from './endpoints.const';
|
|
3
3
|
export interface C3ClustersProps {
|
|
4
4
|
stage?: Stage;
|
|
5
5
|
endpoints?: Endpoints;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventSourcePolyfill } from
|
|
2
|
-
import { CONSOLE, getEndpointByOptions, } from
|
|
1
|
+
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
2
|
+
import { CONSOLE, getEndpointByOptions, } from './endpoints.const.js';
|
|
3
3
|
export class ClustersService {
|
|
4
4
|
static clustersStream(options) {
|
|
5
5
|
const baseUrl = getEndpointByOptions({
|
|
@@ -12,9 +12,9 @@ export class ClustersService {
|
|
|
12
12
|
},
|
|
13
13
|
heartbeatTimeout: 2 * 60 * 1000,
|
|
14
14
|
});
|
|
15
|
-
source.onmessage =
|
|
15
|
+
source.onmessage = (event) => {
|
|
16
16
|
const data = JSON.parse(event.data);
|
|
17
|
-
const clusterChangeEvent = new CustomEvent(
|
|
17
|
+
const clusterChangeEvent = new CustomEvent('clusterchange', {
|
|
18
18
|
detail: data,
|
|
19
19
|
});
|
|
20
20
|
window.dispatchEvent(clusterChangeEvent);
|
|
@@ -13,7 +13,7 @@ export declare const NOTIFICATIONS: Endpoint;
|
|
|
13
13
|
export declare const ACCOUNTS: Endpoint;
|
|
14
14
|
export declare const CONSOLE: Endpoint;
|
|
15
15
|
export declare const STATUS: Endpoint;
|
|
16
|
-
export type Stage =
|
|
16
|
+
export type Stage = 'dev' | 'int' | 'prod';
|
|
17
17
|
export declare function getEndpoint(stage: Stage, endpoint: Endpoint): string;
|
|
18
18
|
export declare function getEndpointByOptions(options: {
|
|
19
19
|
stage?: Stage;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
export const NOTIFICATIONS = {
|
|
2
|
-
id:
|
|
3
|
-
dev:
|
|
4
|
-
int:
|
|
5
|
-
prod:
|
|
2
|
+
id: 'notifications',
|
|
3
|
+
dev: 'https://notifications.cloud.dev.ultrawombat.com',
|
|
4
|
+
int: 'https://notifications.cloud.ultrawombat.com',
|
|
5
|
+
prod: 'https://notifications.cloud.camunda.io',
|
|
6
6
|
};
|
|
7
7
|
export const ACCOUNTS = {
|
|
8
|
-
id:
|
|
9
|
-
dev:
|
|
10
|
-
int:
|
|
11
|
-
prod:
|
|
8
|
+
id: 'accounts',
|
|
9
|
+
dev: 'https://accounts.cloud.dev.ultrawombat.com',
|
|
10
|
+
int: 'https://accounts.cloud.ultrawombat.com',
|
|
11
|
+
prod: 'https://accounts.cloud.camunda.io',
|
|
12
12
|
};
|
|
13
13
|
export const CONSOLE = {
|
|
14
|
-
id:
|
|
15
|
-
dev:
|
|
16
|
-
int:
|
|
17
|
-
prod:
|
|
14
|
+
id: 'console',
|
|
15
|
+
dev: 'https://console.cloud.dev.ultrawombat.com',
|
|
16
|
+
int: 'https://console.cloud.ultrawombat.com',
|
|
17
|
+
prod: 'https://console.cloud.camunda.io',
|
|
18
18
|
};
|
|
19
19
|
export const STATUS = {
|
|
20
|
-
id:
|
|
21
|
-
dev:
|
|
22
|
-
int:
|
|
23
|
-
prod:
|
|
20
|
+
id: 'status',
|
|
21
|
+
dev: 'https://camundaultrawombat.statuspage.io/',
|
|
22
|
+
int: 'https://camundaultrawombat.statuspage.io/',
|
|
23
|
+
prod: 'https://status.camunda.io',
|
|
24
24
|
};
|
|
25
25
|
export function getEndpoint(stage, endpoint) {
|
|
26
26
|
switch (stage) {
|
|
27
|
-
case
|
|
27
|
+
case 'dev':
|
|
28
28
|
return endpoint.dev;
|
|
29
|
-
case
|
|
29
|
+
case 'int':
|
|
30
30
|
return endpoint.int;
|
|
31
|
-
case
|
|
31
|
+
case 'prod':
|
|
32
32
|
return endpoint.prod;
|
|
33
33
|
default:
|
|
34
34
|
throw new Error(`Unknown stage: ${stage}`);
|
|
@@ -36,7 +36,7 @@ export function getEndpoint(stage, endpoint) {
|
|
|
36
36
|
}
|
|
37
37
|
export function getEndpointByOptions(options) {
|
|
38
38
|
switch (options.endpoint.id) {
|
|
39
|
-
case
|
|
39
|
+
case 'notifications':
|
|
40
40
|
if (options.endpoints?.notifications) {
|
|
41
41
|
return options.endpoints.notifications;
|
|
42
42
|
}
|
|
@@ -44,7 +44,7 @@ export function getEndpointByOptions(options) {
|
|
|
44
44
|
return getEndpoint(options.stage, options.endpoint);
|
|
45
45
|
}
|
|
46
46
|
break;
|
|
47
|
-
case
|
|
47
|
+
case 'accounts':
|
|
48
48
|
if (options.endpoints?.accounts) {
|
|
49
49
|
return options.endpoints.accounts;
|
|
50
50
|
}
|
|
@@ -52,7 +52,7 @@ export function getEndpointByOptions(options) {
|
|
|
52
52
|
return getEndpoint(options.stage, options.endpoint);
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
|
-
case
|
|
55
|
+
case 'console':
|
|
56
56
|
if (options.endpoints?.console) {
|
|
57
57
|
return options.endpoints.console;
|
|
58
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { OnboardingConfig } from
|
|
4
|
-
import { RequestPayload, RequestResponse } from
|
|
1
|
+
import type { Persona, TileConfig, WpCardType } from '../components/c3-help-center/c3-help-center.types';
|
|
2
|
+
import type { HelpCenterConfig } from '../components/c3-help-center/defaultHelpCenterConfig';
|
|
3
|
+
import type { OnboardingConfig } from '../components/c3-onboarding-survey/defaultOnboardingConfig';
|
|
4
|
+
import { type RequestPayload, type RequestResponse } from './api';
|
|
5
5
|
export declare const getConfig: (accessToken: string, audience: string, orgId: string) => Promise<RequestResponse<HelpCenterConfig | null>>;
|
|
6
6
|
export declare const getTiles: ({ accessToken, tileConfig, salesPlanType, clusterIds, persona, flags, cloudAudience, signal, }: {
|
|
7
7
|
accessToken: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { recommendations } from
|
|
2
|
-
import { request } from
|
|
1
|
+
import { recommendations } from '../components/c3-help-center/recommendations.js';
|
|
2
|
+
import { request } from './api.js';
|
|
3
3
|
export const getConfig = async (accessToken, audience, orgId) => {
|
|
4
4
|
return await request({
|
|
5
5
|
url: `https://helpcenter.${audience}/helpcenter/config/${orgId}`,
|
|
@@ -12,8 +12,8 @@ export const getTiles = async ({ accessToken, tileConfig, salesPlanType, cluster
|
|
|
12
12
|
const availableTileTypes = recommendations(persona, flags, tileConfig, salesPlanType, clusterIds?.length > 0);
|
|
13
13
|
if (availableTileTypes.length) {
|
|
14
14
|
return await request({
|
|
15
|
-
url: `https://helpcenter.${cloudAudience}/cards?card_id=${availableTileTypes.join(
|
|
16
|
-
responseType:
|
|
15
|
+
url: `https://helpcenter.${cloudAudience}/cards?card_id=${availableTileTypes.join(',')}`,
|
|
16
|
+
responseType: 'json',
|
|
17
17
|
camundaAuth: { token: accessToken },
|
|
18
18
|
signal,
|
|
19
19
|
});
|
|
@@ -23,29 +23,29 @@ export const getTiles = async ({ accessToken, tileConfig, salesPlanType, cluster
|
|
|
23
23
|
export const getOnboardingConfig = ({ camundaAuth, audience, orgId, }) => request({
|
|
24
24
|
url: `https://helpcenter.${audience}/survey/config/${orgId}`,
|
|
25
25
|
camundaAuth,
|
|
26
|
-
type:
|
|
26
|
+
type: 'json',
|
|
27
27
|
});
|
|
28
28
|
export const updatePersona = async ({ newPersona, audience, accessToken, orgId, userId, }) => request({
|
|
29
29
|
url: `https://helpcenter.${audience}/persona`,
|
|
30
|
-
method:
|
|
30
|
+
method: 'patch',
|
|
31
31
|
camundaAuth: { token: accessToken },
|
|
32
|
-
type:
|
|
32
|
+
type: 'json',
|
|
33
33
|
body: { persona: newPersona, userId, orgId },
|
|
34
|
-
responseType:
|
|
34
|
+
responseType: 'text',
|
|
35
35
|
});
|
|
36
36
|
export const submitSurvey = async ({ audience, token, data, }) => request({
|
|
37
|
-
method:
|
|
37
|
+
method: 'post',
|
|
38
38
|
url: `https://helpcenter.${audience}/survey/submit`,
|
|
39
39
|
camundaAuth: { token },
|
|
40
|
-
type:
|
|
40
|
+
type: 'json',
|
|
41
41
|
body: { data },
|
|
42
|
-
responseType:
|
|
42
|
+
responseType: 'text',
|
|
43
43
|
});
|
|
44
44
|
export const submitFeedback = async ({ token, audience, formData, }) => request({
|
|
45
|
-
method:
|
|
45
|
+
method: 'post',
|
|
46
46
|
url: `https://helpcenter.${audience}/feedback/submit`,
|
|
47
47
|
camundaAuth: { token },
|
|
48
48
|
body: formData,
|
|
49
|
-
type:
|
|
50
|
-
responseType:
|
|
49
|
+
type: 'form',
|
|
50
|
+
responseType: 'text',
|
|
51
51
|
});
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
export class JWTUtils {
|
|
2
2
|
static decode(token) {
|
|
3
|
-
const base64Url = token.split(
|
|
4
|
-
const base64 = base64Url.replace(/-/g,
|
|
3
|
+
const base64Url = token.split('.')[1];
|
|
4
|
+
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
5
5
|
const jsonPayload = decodeURIComponent(window
|
|
6
6
|
.atob(base64)
|
|
7
|
-
.split(
|
|
8
|
-
.map(
|
|
9
|
-
|
|
10
|
-
})
|
|
11
|
-
.join(""));
|
|
7
|
+
.split('')
|
|
8
|
+
.map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
|
|
9
|
+
.join(''));
|
|
12
10
|
return JSON.parse(jsonPayload);
|
|
13
11
|
}
|
|
14
12
|
static getExpiration(token) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C3NotificationsProps } from
|
|
2
|
-
import { RequestResponse } from
|
|
1
|
+
import type { C3NotificationsProps } from '../components/c3-navigation/c3-navigation.types';
|
|
2
|
+
import { type RequestResponse } from './api';
|
|
3
3
|
export interface Notification {
|
|
4
4
|
uuid: string;
|
|
5
5
|
userId?: string;
|
|
@@ -24,18 +24,18 @@ export interface Notification {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export type AnalyticsEvent =
|
|
27
|
+
export type AnalyticsEvent = 'notification-panel-opened' | 'notification-clicked-cta';
|
|
28
28
|
export declare class NotificationService {
|
|
29
29
|
static getNotifications(options: C3NotificationsProps): Promise<RequestResponse<Notification[]>>;
|
|
30
30
|
static sendAnalyticsEvent(options: C3NotificationsProps, eventOptions: {
|
|
31
31
|
event: AnalyticsEvent;
|
|
32
32
|
id?: string;
|
|
33
33
|
}): void;
|
|
34
|
-
static changeState(options: C3NotificationsProps, notificationId: string, operation:
|
|
34
|
+
static changeState(options: C3NotificationsProps, notificationId: string, operation: 'read' | 'dismiss'): void;
|
|
35
35
|
static markManyAsRead(options: C3NotificationsProps, notificationIds: string[]): void;
|
|
36
36
|
static dismissAll(options: C3NotificationsProps, orgId: string): void;
|
|
37
37
|
static notificationsStream(options: C3NotificationsProps, handler: (notification: Notification) => void): void;
|
|
38
38
|
static updateNotifications(allNotifications: Notification[], newNotification: Notification): Notification[];
|
|
39
|
-
static updateNotificationState(allNotifications: Notification[], notificationId: string, newState:
|
|
40
|
-
static updateNotificationStates(allNotifications: Notification[], notificationIds: string[], newState:
|
|
39
|
+
static updateNotificationState(allNotifications: Notification[], notificationId: string, newState: 'read' | 'dismiss'): Notification[];
|
|
40
|
+
static updateNotificationStates(allNotifications: Notification[], notificationIds: string[], newState: 'read' | 'dismiss'): Notification[];
|
|
41
41
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventSourcePolyfill } from
|
|
2
|
-
import { request } from
|
|
3
|
-
import { getEndpointByOptions, NOTIFICATIONS } from
|
|
1
|
+
import { EventSourcePolyfill } from 'event-source-polyfill';
|
|
2
|
+
import { request } from './api.js';
|
|
3
|
+
import { getEndpointByOptions, NOTIFICATIONS } from './endpoints.const.js';
|
|
4
4
|
export class NotificationService {
|
|
5
5
|
static async getNotifications(options) {
|
|
6
6
|
return await request({
|
|
7
|
-
method:
|
|
8
|
-
base:
|
|
7
|
+
method: 'get',
|
|
8
|
+
base: 'notifications',
|
|
9
9
|
stage: options.stage,
|
|
10
10
|
endpoints: options.endpoints,
|
|
11
11
|
camundaAuth: {
|
|
@@ -17,8 +17,8 @@ export class NotificationService {
|
|
|
17
17
|
}
|
|
18
18
|
static sendAnalyticsEvent(options, eventOptions) {
|
|
19
19
|
request({
|
|
20
|
-
method:
|
|
21
|
-
base:
|
|
20
|
+
method: 'post',
|
|
21
|
+
base: 'notifications',
|
|
22
22
|
stage: options.stage,
|
|
23
23
|
endpoints: options.endpoints,
|
|
24
24
|
camundaAuth: {
|
|
@@ -29,14 +29,14 @@ export class NotificationService {
|
|
|
29
29
|
body: {
|
|
30
30
|
id: eventOptions.id,
|
|
31
31
|
},
|
|
32
|
-
type:
|
|
33
|
-
responseType:
|
|
32
|
+
type: 'json',
|
|
33
|
+
responseType: 'text',
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
static changeState(options, notificationId, operation) {
|
|
37
37
|
request({
|
|
38
|
-
method:
|
|
39
|
-
base:
|
|
38
|
+
method: 'patch',
|
|
39
|
+
base: 'notifications',
|
|
40
40
|
stage: options.stage,
|
|
41
41
|
endpoints: options.endpoints,
|
|
42
42
|
camundaAuth: {
|
|
@@ -51,8 +51,8 @@ export class NotificationService {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
request({
|
|
54
|
-
method:
|
|
55
|
-
base:
|
|
54
|
+
method: 'patch',
|
|
55
|
+
base: 'notifications',
|
|
56
56
|
stage: options.stage,
|
|
57
57
|
endpoints: options.endpoints,
|
|
58
58
|
camundaAuth: {
|
|
@@ -63,7 +63,7 @@ export class NotificationService {
|
|
|
63
63
|
body: {
|
|
64
64
|
uuids: notificationIds,
|
|
65
65
|
},
|
|
66
|
-
type:
|
|
66
|
+
type: 'json',
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
static dismissAll(options, orgId) {
|
|
@@ -71,8 +71,8 @@ export class NotificationService {
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
request({
|
|
74
|
-
method:
|
|
75
|
-
base:
|
|
74
|
+
method: 'patch',
|
|
75
|
+
base: 'notifications',
|
|
76
76
|
stage: options.stage,
|
|
77
77
|
endpoints: options.endpoints,
|
|
78
78
|
camundaAuth: {
|
|
@@ -80,7 +80,7 @@ export class NotificationService {
|
|
|
80
80
|
refreshTokenMethod: options.getNewUserToken,
|
|
81
81
|
},
|
|
82
82
|
url: `notifications/dismissAll?orgId=${orgId}`,
|
|
83
|
-
type:
|
|
83
|
+
type: 'json',
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
static notificationsStream(options, handler) {
|
|
@@ -95,7 +95,7 @@ export class NotificationService {
|
|
|
95
95
|
},
|
|
96
96
|
heartbeatTimeout: 1000 * 60 * 60,
|
|
97
97
|
});
|
|
98
|
-
source.onmessage =
|
|
98
|
+
source.onmessage = (event) => {
|
|
99
99
|
try {
|
|
100
100
|
const notification = JSON.parse(event.data);
|
|
101
101
|
if (!notification.keepAlive) {
|
|
@@ -108,7 +108,7 @@ export class NotificationService {
|
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
111
|
-
source.onerror =
|
|
111
|
+
source.onerror = (_event) => {
|
|
112
112
|
// ignore
|
|
113
113
|
};
|
|
114
114
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -124,7 +124,7 @@ export class NotificationService {
|
|
|
124
124
|
const updatedNotifications = allNotifications
|
|
125
125
|
.slice()
|
|
126
126
|
.filter((currentNotification) => currentNotification.uuid !== newNotification.uuid);
|
|
127
|
-
if (newNotification.state ===
|
|
127
|
+
if (newNotification.state === 'read' || newNotification.state === 'new') {
|
|
128
128
|
updatedNotifications.push(newNotification);
|
|
129
129
|
}
|
|
130
130
|
updatedNotifications.sort((a, b) => b.timestamp - a.timestamp);
|
|
@@ -134,10 +134,10 @@ export class NotificationService {
|
|
|
134
134
|
let updatedNotifications = allNotifications.slice();
|
|
135
135
|
let foundNotification;
|
|
136
136
|
switch (newState) {
|
|
137
|
-
case
|
|
137
|
+
case 'dismiss':
|
|
138
138
|
updatedNotifications = updatedNotifications.filter((notification) => notification.uuid !== notificationId);
|
|
139
139
|
break;
|
|
140
|
-
case
|
|
140
|
+
case 'read':
|
|
141
141
|
foundNotification = updatedNotifications.find((currentNotification) => currentNotification.uuid === notificationId);
|
|
142
142
|
if (foundNotification) {
|
|
143
143
|
foundNotification.state = newState;
|
|
@@ -150,10 +150,10 @@ export class NotificationService {
|
|
|
150
150
|
let updatedNotifications = allNotifications.slice();
|
|
151
151
|
let foundNotifications = [];
|
|
152
152
|
switch (newState) {
|
|
153
|
-
case
|
|
153
|
+
case 'dismiss':
|
|
154
154
|
updatedNotifications = updatedNotifications.filter((notification) => !notificationIds.includes(notification.uuid));
|
|
155
155
|
break;
|
|
156
|
-
case
|
|
156
|
+
case 'read':
|
|
157
157
|
foundNotifications = updatedNotifications.filter((notification) => notificationIds.includes(notification.uuid));
|
|
158
158
|
foundNotifications.forEach((foundNotification) => {
|
|
159
159
|
foundNotification.state = newState;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { request } from
|
|
1
|
+
import { request } from './api.js';
|
|
2
2
|
export const getStartingPrice = async ({ token, audience, }) => request({
|
|
3
3
|
url: `https://accounts.${audience}/external/organizations/startingPrice`,
|
|
4
4
|
camundaAuth: { token },
|
|
5
|
-
responseType:
|
|
5
|
+
responseType: 'json',
|
|
6
6
|
});
|
|
7
7
|
export const leaveOrganization = async ({ token, audience, orgId, }) => request({
|
|
8
8
|
url: `https://accounts.${audience}/external/organizations/${orgId}/membership`,
|
|
9
9
|
camundaAuth: { token },
|
|
10
|
-
method:
|
|
10
|
+
method: 'delete',
|
|
11
11
|
});
|