@contember/react-client-tenant 2.0.0-alpha.24 → 2.0.0-alpha.26

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 (51) hide show
  1. package/dist/development/index.cjs +6 -0
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +6 -0
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.cjs +29 -0
  6. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -0
  7. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.js +12 -0
  8. package/dist/development/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -0
  9. package/dist/development/src/hooks/mutations/profile/useChangeProfile.cjs +29 -0
  10. package/dist/development/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -0
  11. package/dist/development/src/hooks/mutations/profile/useChangeProfile.js +12 -0
  12. package/dist/development/src/hooks/mutations/profile/useChangeProfile.js.map +1 -0
  13. package/dist/development/src/hooks/useFetchIdentity.cjs +1 -0
  14. package/dist/development/src/hooks/useFetchIdentity.cjs.map +1 -1
  15. package/dist/development/src/hooks/useFetchIdentity.js +1 -0
  16. package/dist/development/src/hooks/useFetchIdentity.js.map +1 -1
  17. package/dist/production/index.cjs +6 -0
  18. package/dist/production/index.cjs.map +1 -1
  19. package/dist/production/index.js +6 -0
  20. package/dist/production/index.js.map +1 -1
  21. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.cjs +29 -0
  22. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.cjs.map +1 -0
  23. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.js +12 -0
  24. package/dist/production/src/hooks/mutations/profile/useChangeMyProfile.js.map +1 -0
  25. package/dist/production/src/hooks/mutations/profile/useChangeProfile.cjs +29 -0
  26. package/dist/production/src/hooks/mutations/profile/useChangeProfile.cjs.map +1 -0
  27. package/dist/production/src/hooks/mutations/profile/useChangeProfile.js +12 -0
  28. package/dist/production/src/hooks/mutations/profile/useChangeProfile.js.map +1 -0
  29. package/dist/production/src/hooks/useFetchIdentity.cjs +1 -0
  30. package/dist/production/src/hooks/useFetchIdentity.cjs.map +1 -1
  31. package/dist/production/src/hooks/useFetchIdentity.js +1 -0
  32. package/dist/production/src/hooks/useFetchIdentity.js.map +1 -1
  33. package/dist/types/hooks/mutations/index.d.ts +1 -0
  34. package/dist/types/hooks/mutations/index.d.ts.map +1 -1
  35. package/dist/types/hooks/mutations/profile/index.d.ts +3 -0
  36. package/dist/types/hooks/mutations/profile/index.d.ts.map +1 -0
  37. package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts +21 -0
  38. package/dist/types/hooks/mutations/profile/useChangeMyProfile.d.ts.map +1 -0
  39. package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts +23 -0
  40. package/dist/types/hooks/mutations/profile/useChangeProfile.d.ts.map +1 -0
  41. package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -1
  42. package/dist/types/tsconfig.tsbuildinfo +1 -1
  43. package/dist/types/types/Identity.d.ts +1 -0
  44. package/dist/types/types/Identity.d.ts.map +1 -1
  45. package/package.json +4 -4
  46. package/src/hooks/mutations/index.ts +1 -0
  47. package/src/hooks/mutations/profile/index.ts +2 -0
  48. package/src/hooks/mutations/profile/useChangeMyProfile.ts +13 -0
  49. package/src/hooks/mutations/profile/useChangeProfile.ts +13 -0
  50. package/src/hooks/useFetchIdentity.ts +1 -0
  51. package/src/types/Identity.ts +1 -0
@@ -1,5 +1,6 @@
1
1
  export interface Identity {
2
2
  readonly id: string;
3
+ readonly roles: readonly string[];
3
4
  readonly person?: Person;
4
5
  readonly projects: IdentityProject[];
5
6
  readonly permissions: {
@@ -1 +1 @@
1
- {"version":3,"file":"Identity.d.ts","sourceRoot":"","sources":["../../../src/types/Identity.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CA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EAAE,SAAS,MAAM,EAAE,CAAA;CACjC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contember/react-client-tenant",
3
3
  "license": "Apache-2.0",
4
- "version": "2.0.0-alpha.24",
4
+ "version": "2.0.0-alpha.26",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/production/index.js",
@@ -33,9 +33,9 @@
33
33
  "directory": "packages/react-client-tenant"
34
34
  },
35
35
  "dependencies": {
36
- "@contember/graphql-client-tenant": "2.0.0-alpha.24",
37
- "@contember/react-client": "2.0.0-alpha.24",
38
- "@contember/react-utils": "2.0.0-alpha.24",
36
+ "@contember/graphql-client-tenant": "2.0.0-alpha.26",
37
+ "@contember/react-client": "2.0.0-alpha.26",
38
+ "@contember/react-utils": "2.0.0-alpha.26",
39
39
  "@radix-ui/primitive": "^1.1.0",
40
40
  "@radix-ui/react-slot": "^1.1.0",
41
41
  "graphql-ts-client-api": "^3.1.17"
@@ -6,3 +6,4 @@ export * from './memberships'
6
6
  export * from './passwordless'
7
7
  export * from './otp'
8
8
  export * from './passwordReset'
9
+ export * from './profile'
@@ -0,0 +1,2 @@
1
+ export * from './useChangeProfile'
2
+ export * from './useChangeMyProfile'
@@ -0,0 +1,13 @@
1
+ import * as TenantApi from '@contember/graphql-client-tenant'
2
+ import { createTenantMutation } from '../../useTenantMutation'
3
+
4
+ export const changeMyProfile = TenantApi.mutation$
5
+ .changeMyProfile(
6
+ TenantApi
7
+ .changeMyProfileResponse$$
8
+ .error(TenantApi.changeMyProfileError$$),
9
+ options => options.alias('mutation'),
10
+ )
11
+
12
+ export const useChangeMyProfileMutation = createTenantMutation(changeMyProfile)
13
+ export type ChangeMyProfileMutationVariables = Parameters<ReturnType<typeof useChangeMyProfileMutation>>[0]
@@ -0,0 +1,13 @@
1
+ import * as TenantApi from '@contember/graphql-client-tenant'
2
+ import { createTenantMutation } from '../../useTenantMutation'
3
+
4
+ export const changeProfile = TenantApi.mutation$
5
+ .changeProfile(
6
+ TenantApi
7
+ .changeProfileResponse$$
8
+ .error(TenantApi.changeProfileError$$),
9
+ options => options.alias('mutation'),
10
+ )
11
+
12
+ export const useChangeProfileMutation = createTenantMutation(changeProfile)
13
+ export type ChangeProfileMutationVariables = Parameters<ReturnType<typeof useChangeProfileMutation>>[0]
@@ -25,6 +25,7 @@ export const useFetchIdentity = (): [{ state: IdentityStateValue; identity: Iden
25
25
  state: 'success',
26
26
  identity: {
27
27
  id: response.id,
28
+ roles: response.roles ?? [],
28
29
  person: person ?? undefined,
29
30
  projects: projects.map(it => ({
30
31
  name: it.project.name,
@@ -1,5 +1,6 @@
1
1
  export interface Identity {
2
2
  readonly id: string
3
+ readonly roles: readonly string[]
3
4
  readonly person?: Person
4
5
  readonly projects: IdentityProject[]
5
6
  readonly permissions: {