@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.
Files changed (179) hide show
  1. package/lib/esm/package.json +31 -41
  2. package/lib/esm/src/api/api.d.ts +5 -5
  3. package/lib/esm/src/api/api.js +14 -14
  4. package/lib/esm/src/api/clusters.d.ts +2 -2
  5. package/lib/esm/src/api/clusters.js +4 -4
  6. package/lib/esm/src/api/endpoints.const.d.ts +1 -1
  7. package/lib/esm/src/api/endpoints.const.js +22 -22
  8. package/lib/esm/src/api/help-center.d.ts +4 -4
  9. package/lib/esm/src/api/help-center.js +14 -14
  10. package/lib/esm/src/api/jwt.utils.js +5 -7
  11. package/lib/esm/src/api/notifications.d.ts +6 -6
  12. package/lib/esm/src/api/notifications.js +24 -24
  13. package/lib/esm/src/api/organizations.d.ts +1 -1
  14. package/lib/esm/src/api/organizations.js +3 -3
  15. package/lib/esm/src/api/profile.d.ts +6 -7
  16. package/lib/esm/src/api/profile.js +8 -8
  17. package/lib/esm/src/api/status.js +15 -15
  18. package/lib/esm/src/assets/c3-icons.d.ts +1 -1
  19. package/lib/esm/src/assets/c3-icons.js +4 -4
  20. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +2 -2
  21. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +45 -55
  22. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +1 -1
  23. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +20 -20
  24. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +1 -1
  25. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +8 -8
  26. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +3 -3
  27. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +9 -9
  28. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +15 -15
  29. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +2 -2
  30. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +17 -17
  31. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +3 -3
  32. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +16 -16
  33. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +5 -5
  34. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +4 -4
  35. package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +1 -1
  36. package/lib/esm/src/components/c3-data-table/c3-data-table.js +87 -83
  37. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +20 -10
  38. package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +1 -1
  39. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +2 -2
  40. package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +2 -2
  41. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +8 -8
  42. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +13 -9
  43. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +4 -4
  44. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +1 -1
  45. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +1 -1
  46. package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +5 -5
  47. package/lib/esm/src/components/c3-help-center/c3-help-center.js +30 -30
  48. package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +1 -1
  49. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +1 -1
  50. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +4 -4
  51. package/lib/esm/src/components/c3-help-center/help-center-hint.js +5 -8
  52. package/lib/esm/src/components/c3-help-center/help-center.d.ts +4 -4
  53. package/lib/esm/src/components/c3-help-center/help-center.js +67 -70
  54. package/lib/esm/src/components/c3-help-center/recommendations.d.ts +1 -1
  55. package/lib/esm/src/components/c3-help-center/recommendations.js +3 -3
  56. package/lib/esm/src/components/c3-help-center/styles.d.ts +1 -1
  57. package/lib/esm/src/components/c3-help-center/styles.js +30 -30
  58. package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +2 -2
  59. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +43 -46
  60. package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +3 -3
  61. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +10 -10
  62. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +1 -1
  63. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +14 -14
  64. package/lib/esm/src/components/c3-help-center/tile.d.ts +4 -4
  65. package/lib/esm/src/components/c3-help-center/tile.js +27 -27
  66. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +1 -1
  67. package/lib/esm/src/components/c3-navigation/c3-info-button.js +3 -3
  68. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +2 -2
  69. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +2 -2
  70. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +1 -1
  71. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +3 -3
  72. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +65 -70
  73. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +11 -11
  74. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +2 -2
  75. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +22 -22
  76. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +2 -2
  77. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +29 -29
  78. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +2 -2
  79. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +30 -37
  80. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +9 -9
  81. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +2 -2
  82. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +39 -42
  83. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +1 -1
  84. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +2 -2
  85. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +2 -2
  86. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +27 -27
  87. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +1 -1
  88. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +4 -4
  89. package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +1 -1
  90. package/lib/esm/src/components/c3-navigation/c3-navigation.js +113 -115
  91. package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +34 -34
  92. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +9 -9
  93. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +4 -4
  94. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +43 -51
  95. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +2 -2
  96. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +10 -10
  97. package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +1 -1
  98. package/lib/esm/src/components/c3-navigation/c3-org-name.js +23 -23
  99. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +2 -2
  100. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +31 -31
  101. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +4 -4
  102. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +58 -58
  103. package/lib/esm/src/components/c3-navigation/helpers.d.ts +2 -2
  104. package/lib/esm/src/components/c3-navigation/helpers.js +7 -7
  105. package/lib/esm/src/components/c3-navigation/index.d.ts +1 -1
  106. package/lib/esm/src/components/c3-navigation/index.js +2 -2
  107. package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +8 -8
  108. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +75 -75
  109. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +3 -3
  110. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +10 -10
  111. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +5 -5
  112. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +10 -10
  113. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +1 -1
  114. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +2 -2
  115. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +15 -15
  116. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +2 -2
  117. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +13 -16
  118. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +2 -2
  119. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +15 -18
  120. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +2 -2
  121. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +3 -3
  122. package/lib/esm/src/components/c3-onboarding-survey/helpers.js +3 -3
  123. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +2 -1
  124. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +18 -18
  125. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +1 -1
  126. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +11 -11
  127. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +4 -4
  128. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +28 -30
  129. package/lib/esm/src/components/c3-onboarding-survey/step.js +7 -7
  130. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +2 -2
  131. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +8 -8
  132. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +1 -1
  133. package/lib/esm/src/components/c3-page/c3-page.d.ts +2 -2
  134. package/lib/esm/src/components/c3-page/c3-page.js +5 -5
  135. package/lib/esm/src/components/c3-page/c3-page.test.js +11 -11
  136. package/lib/esm/src/components/c3-page/c3-page.types.d.ts +8 -8
  137. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +2 -2
  138. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +4 -4
  139. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +1 -1
  140. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +8 -8
  141. package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +2 -2
  142. package/lib/esm/src/components/c3-user-configuration/authToken.js +4 -4
  143. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +5 -5
  144. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +23 -20
  145. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +3 -3
  146. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +8 -8
  147. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +5 -5
  148. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +10 -10
  149. package/lib/esm/src/components/styles.js +55 -55
  150. package/lib/esm/src/components/test-utils.d.ts +1 -1
  151. package/lib/esm/src/components/test-utils.js +14 -9
  152. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +2 -2
  153. package/lib/esm/src/contexts/c3-cluster-update-manager.js +4 -5
  154. package/lib/esm/src/hooks/useApi.d.ts +2 -2
  155. package/lib/esm/src/hooks/useApi.js +1 -1
  156. package/lib/esm/src/index.d.ts +23 -32
  157. package/lib/esm/src/index.js +14 -23
  158. package/lib/esm/src/utils/camunda.d.ts +1 -1
  159. package/lib/esm/src/utils/camunda.js +8 -8
  160. package/lib/esm/src/utils/camunda.types.d.ts +2 -2
  161. package/package.json +30 -39
  162. package/lib/esm/src/assets/app-teaser-images/operate-1-monitor.d.ts +0 -1
  163. package/lib/esm/src/assets/app-teaser-images/operate-1-monitor.js +0 -1
  164. package/lib/esm/src/assets/app-teaser-images/operate-2-inspect.d.ts +0 -1
  165. package/lib/esm/src/assets/app-teaser-images/operate-2-inspect.js +0 -1
  166. package/lib/esm/src/assets/app-teaser-images/operate-3-troubleshoot.d.ts +0 -1
  167. package/lib/esm/src/assets/app-teaser-images/operate-3-troubleshoot.js +0 -1
  168. package/lib/esm/src/assets/app-teaser-images/optimize-1-Kpis.d.ts +0 -1
  169. package/lib/esm/src/assets/app-teaser-images/optimize-1-Kpis.js +0 -1
  170. package/lib/esm/src/assets/app-teaser-images/optimize-2-opportunities.d.ts +0 -1
  171. package/lib/esm/src/assets/app-teaser-images/optimize-2-opportunities.js +0 -1
  172. package/lib/esm/src/assets/app-teaser-images/optimize-3-reports.d.ts +0 -1
  173. package/lib/esm/src/assets/app-teaser-images/optimize-3-reports.js +0 -1
  174. package/lib/esm/src/assets/app-teaser-images/tasklist-1-task-manager.d.ts +0 -1
  175. package/lib/esm/src/assets/app-teaser-images/tasklist-1-task-manager.js +0 -1
  176. package/lib/esm/src/assets/app-teaser-images/tasklist-2-form.d.ts +0 -1
  177. package/lib/esm/src/assets/app-teaser-images/tasklist-2-form.js +0 -1
  178. package/lib/esm/src/assets/app-teaser-images/tasklist-3-api.d.ts +0 -1
  179. package/lib/esm/src/assets/app-teaser-images/tasklist-3-api.js +0 -1
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@camunda/camunda-composite-components",
3
- "version": "0.21.1",
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": "eslint src/",
24
+ "lint": "biome lint ./src",
25
25
  "lint:fix": "eslint --fix src/",
26
26
  "test:ts": "tsc --noEmit --project ./tsconfig.json",
27
- "test:storybook": "TEST_A11Y=true test-storybook",
28
- "test:storybook:smoke": "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 serve:storybook & pnpm wait-on http://localhost:6006 && pnpm test:storybook && pnpm test:visual-regression:docker",
36
+ "test:all": "pnpm test:ts && pnpm test:storybook",
37
37
  "test": "pnpm test:ts"
38
38
  },
39
39
  "devDependencies": {
40
- "@babel/core": "7.25.7",
41
- "@babel/preset-env": "7.25.7",
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
- "@mdx-js/react": "3.0.1",
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": "9.1.4",
48
- "@storybook/addon-docs": "^9.1.4",
49
- "@storybook/addon-links": "9.1.4",
50
- "@storybook/addon-webpack5-compiler-babel": "3.0.6",
51
- "@storybook/preset-scss": "1.0.3",
52
- "@storybook/react-webpack5": "9.1.4",
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
- "@typescript-eslint/eslint-plugin": "7.17.0",
61
- "@typescript-eslint/parser": "7.17.0",
62
- "axe-playwright": "2.2.2",
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-import": "2.29.1",
71
- "eslint-plugin-prettier": "5.2.1",
72
- "eslint-plugin-react": "7.35.0",
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
- "prettier": "3.3.3",
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": "^9.1.4",
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
- "wait-on": "8.0.2",
91
- "webpack": "5.94.0"
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",
@@ -1,15 +1,15 @@
1
- import { Endpoints, Stage } from "./endpoints.const";
1
+ import { type Endpoints, type Stage } from './endpoints.const';
2
2
  export interface RequestPayload {
3
3
  url: string;
4
- base?: "notifications" | "accounts";
4
+ base?: 'notifications' | 'accounts';
5
5
  stage?: Stage;
6
6
  endpoints?: Endpoints;
7
- method?: "get" | "post" | "put" | "delete" | "patch";
7
+ method?: 'get' | 'post' | 'put' | 'delete' | 'patch';
8
8
  headers?: {
9
9
  [key: string]: string;
10
10
  };
11
- type?: "json" | "text" | "form" | "none";
12
- responseType?: "json" | "text" | "none";
11
+ type?: 'json' | 'text' | 'form' | 'none';
12
+ responseType?: 'json' | 'text' | 'none';
13
13
  camundaAuth?: {
14
14
  token: string;
15
15
  refreshTokenMethod?: () => Promise<string>;
@@ -1,5 +1,5 @@
1
- import { getEndpoint, NOTIFICATIONS, ACCOUNTS, } from "./endpoints.const";
2
- import { JWTUtils } from "./jwt.utils";
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 ?? "json";
15
+ const type = payload.type ?? 'json';
16
16
  if (type) {
17
17
  switch (type) {
18
- case "json":
19
- headers["Content-Type"] = "application/json";
18
+ case 'json':
19
+ headers['Content-Type'] = 'application/json';
20
20
  break;
21
- case "text":
22
- headers["Content-Type"] = "text/plain";
21
+ case 'text':
22
+ headers['Content-Type'] = 'text/plain';
23
23
  break;
24
24
  }
25
25
  }
26
- const body = payload.body && type === "json"
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 "notifications":
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 "accounts":
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() : "GET",
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 "json":
71
+ case 'json':
72
72
  res = await response.json();
73
73
  break;
74
- case "text":
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("API request failed:", 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 "event-source-polyfill";
2
- import { Endpoints, Stage } from "./endpoints.const";
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 "event-source-polyfill";
2
- import { CONSOLE, getEndpointByOptions, } from "./endpoints.const";
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 = function (event) {
15
+ source.onmessage = (event) => {
16
16
  const data = JSON.parse(event.data);
17
- const clusterChangeEvent = new CustomEvent("clusterchange", {
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 = "dev" | "int" | "prod";
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: "notifications",
3
- dev: "https://notifications.cloud.dev.ultrawombat.com",
4
- int: "https://notifications.cloud.ultrawombat.com",
5
- prod: "https://notifications.cloud.camunda.io",
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: "accounts",
9
- dev: "https://accounts.cloud.dev.ultrawombat.com",
10
- int: "https://accounts.cloud.ultrawombat.com",
11
- prod: "https://accounts.cloud.camunda.io",
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: "console",
15
- dev: "https://console.cloud.dev.ultrawombat.com",
16
- int: "https://console.cloud.ultrawombat.com",
17
- prod: "https://console.cloud.camunda.io",
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: "status",
21
- dev: "https://camundaultrawombat.statuspage.io/",
22
- int: "https://camundaultrawombat.statuspage.io/",
23
- prod: "https://status.camunda.io",
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 "dev":
27
+ case 'dev':
28
28
  return endpoint.dev;
29
- case "int":
29
+ case 'int':
30
30
  return endpoint.int;
31
- case "prod":
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 "notifications":
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 "accounts":
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 "console":
55
+ case 'console':
56
56
  if (options.endpoints?.console) {
57
57
  return options.endpoints.console;
58
58
  }
@@ -1,7 +1,7 @@
1
- import { HelpCenterConfig } from "../components/c3-help-center/defaultHelpCenterConfig";
2
- import { Persona, TileConfig, WpCardType } from "../components/c3-help-center/c3-help-center.types";
3
- import { OnboardingConfig } from "../components/c3-onboarding-survey/defaultOnboardingConfig";
4
- import { RequestPayload, RequestResponse } from "./api";
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 "../components/c3-help-center/recommendations";
2
- import { request } from "./api";
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: "json",
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: "json",
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: "patch",
30
+ method: 'patch',
31
31
  camundaAuth: { token: accessToken },
32
- type: "json",
32
+ type: 'json',
33
33
  body: { persona: newPersona, userId, orgId },
34
- responseType: "text",
34
+ responseType: 'text',
35
35
  });
36
36
  export const submitSurvey = async ({ audience, token, data, }) => request({
37
- method: "post",
37
+ method: 'post',
38
38
  url: `https://helpcenter.${audience}/survey/submit`,
39
39
  camundaAuth: { token },
40
- type: "json",
40
+ type: 'json',
41
41
  body: { data },
42
- responseType: "text",
42
+ responseType: 'text',
43
43
  });
44
44
  export const submitFeedback = async ({ token, audience, formData, }) => request({
45
- method: "post",
45
+ method: 'post',
46
46
  url: `https://helpcenter.${audience}/feedback/submit`,
47
47
  camundaAuth: { token },
48
48
  body: formData,
49
- type: "form",
50
- responseType: "text",
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(".")[1];
4
- const base64 = base64Url.replace(/-/g, "+").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(function (c) {
9
- return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2);
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 "../components/c3-navigation/c3-navigation.types";
2
- import { RequestResponse } from "./api";
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 = "notification-panel-opened" | "notification-clicked-cta";
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: "read" | "dismiss"): void;
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: "read" | "dismiss"): Notification[];
40
- static updateNotificationStates(allNotifications: Notification[], notificationIds: string[], newState: "read" | "dismiss"): Notification[];
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 "event-source-polyfill";
2
- import { request } from "./api";
3
- import { getEndpointByOptions, NOTIFICATIONS } from "./endpoints.const";
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: "get",
8
- base: "notifications",
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: "post",
21
- base: "notifications",
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: "json",
33
- responseType: "text",
32
+ type: 'json',
33
+ responseType: 'text',
34
34
  });
35
35
  }
36
36
  static changeState(options, notificationId, operation) {
37
37
  request({
38
- method: "patch",
39
- base: "notifications",
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: "patch",
55
- base: "notifications",
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: "json",
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: "patch",
75
- base: "notifications",
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: "json",
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 = function (event) {
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 = function (_event) {
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 === "read" || newNotification.state === "new") {
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 "dismiss":
137
+ case 'dismiss':
138
138
  updatedNotifications = updatedNotifications.filter((notification) => notification.uuid !== notificationId);
139
139
  break;
140
- case "read":
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 "dismiss":
153
+ case 'dismiss':
154
154
  updatedNotifications = updatedNotifications.filter((notification) => !notificationIds.includes(notification.uuid));
155
155
  break;
156
- case "read":
156
+ case 'read':
157
157
  foundNotifications = updatedNotifications.filter((notification) => notificationIds.includes(notification.uuid));
158
158
  foundNotifications.forEach((foundNotification) => {
159
159
  foundNotification.state = newState;
@@ -1,4 +1,4 @@
1
- import { RequestResponse } from "./api";
1
+ import { type RequestResponse } from './api';
2
2
  export type StartingPrice = {
3
3
  amount: number;
4
4
  currency: string;
@@ -1,11 +1,11 @@
1
- import { request } from "./api";
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: "json",
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: "delete",
10
+ method: 'delete',
11
11
  });