@geexcode/geex-angular 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2,24 +2,41 @@ import { WritableSignal, InjectionToken, Injector, Provider } from '@angular/cor
2
2
  import { Observable } from 'rxjs';
3
3
 
4
4
  interface Tenant {
5
- code: string;
6
- name: string;
5
+ /** Unique identifier */
6
+ id?: string;
7
+ /** Tenant code */
8
+ code?: string;
9
+ /** Tenant display name */
10
+ name?: string;
11
+ /** Whether the tenant is enabled */
12
+ isEnabled?: boolean;
13
+ /** Creation timestamp */
14
+ createdOn?: Date;
15
+ [key: string]: any;
7
16
  }
8
17
  interface Org {
9
- code: string;
10
- name: string;
18
+ /** Unique identifier */
19
+ id?: string;
20
+ /** Organization type */
21
+ orgType?: string;
22
+ /** Hierarchical code */
23
+ code?: string;
24
+ /** Organization name */
25
+ name?: string;
26
+ /** Parent organization code */
27
+ parentOrgCode?: string;
11
28
  [key: string]: any;
12
29
  }
13
30
  interface UserOrgMembership {
14
- code: string;
31
+ code?: string;
15
32
  }
16
33
  interface User {
17
- id: string;
18
- orgs: UserOrgMembership[];
34
+ id?: string;
35
+ orgs?: UserOrgMembership[];
19
36
  [key: string]: any;
20
37
  }
21
38
  interface SettingItem {
22
- name: string;
39
+ name?: string;
23
40
  value?: any;
24
41
  }
25
42
  interface TenantModule extends GeexModule {
package/dist/index.d.ts CHANGED
@@ -2,24 +2,41 @@ import { WritableSignal, InjectionToken, Injector, Provider } from '@angular/cor
2
2
  import { Observable } from 'rxjs';
3
3
 
4
4
  interface Tenant {
5
- code: string;
6
- name: string;
5
+ /** Unique identifier */
6
+ id?: string;
7
+ /** Tenant code */
8
+ code?: string;
9
+ /** Tenant display name */
10
+ name?: string;
11
+ /** Whether the tenant is enabled */
12
+ isEnabled?: boolean;
13
+ /** Creation timestamp */
14
+ createdOn?: Date;
15
+ [key: string]: any;
7
16
  }
8
17
  interface Org {
9
- code: string;
10
- name: string;
18
+ /** Unique identifier */
19
+ id?: string;
20
+ /** Organization type */
21
+ orgType?: string;
22
+ /** Hierarchical code */
23
+ code?: string;
24
+ /** Organization name */
25
+ name?: string;
26
+ /** Parent organization code */
27
+ parentOrgCode?: string;
11
28
  [key: string]: any;
12
29
  }
13
30
  interface UserOrgMembership {
14
- code: string;
31
+ code?: string;
15
32
  }
16
33
  interface User {
17
- id: string;
18
- orgs: UserOrgMembership[];
34
+ id?: string;
35
+ orgs?: UserOrgMembership[];
19
36
  [key: string]: any;
20
37
  }
21
38
  interface SettingItem {
22
- name: string;
39
+ name?: string;
23
40
  value?: any;
24
41
  }
25
42
  interface TenantModule extends GeexModule {
package/dist/index.js CHANGED
@@ -48,11 +48,11 @@ var import_util = require("@delon/util");
48
48
  var import_graphql_tag = __toESM(require("graphql-tag"));
49
49
  var import_rxjs = require("rxjs");
50
50
  var import_operators = require("rxjs/operators");
51
- var GQL_CHECK_TENANT = import_graphql_tag.default`mutation checkTenant($code: String!) { checkTenant(code: $code) { code name } }`;
52
- var GQL_FEDERATE_AUTH = import_graphql_tag.default`mutation federateAuthenticate($code: String!, $loginProvider: LoginProviderEnum!) { federateAuthenticate(code: $code, loginProvider: $loginProvider) { id orgs { code } } }`;
51
+ var GQL_CHECK_TENANT = import_graphql_tag.default`mutation checkTenant($code: String!) { checkTenant(code: $code) { id code name isEnabled createdOn } }`;
52
+ var GQL_FEDERATE_AUTH = import_graphql_tag.default`mutation federateAuthenticate($code: String!, $loginProvider: LoginProviderEnum!) { federateAuthenticate(code: $code, loginProvider: $loginProvider) { ...UserDetail } }`;
53
53
  var GQL_ON_PUBLIC_NOTIFY = import_graphql_tag.default`subscription onPublicNotify { onPublicNotify { __typename ... on DataChangeClientNotify { dataChangeType } } }`;
54
- var GQL_ORGS_CACHE = import_graphql_tag.default`query orgsCache { orgs { items { code name } } }`;
55
- var GQL_INIT_SETTINGS = import_graphql_tag.default`query initSettings { initSettings { name value } }`;
54
+ var GQL_ORGS_CACHE = import_graphql_tag.default`query orgsCache { orgs(take: 999) { items { ... OrgCacheItem } } }`;
55
+ var GQL_INIT_SETTINGS = import_graphql_tag.default`query initSettings { initSettings { ... SettingBrief } }`;
56
56
  function createTenantModule(injector) {
57
57
  const current = (0, import_core.signal)(null);
58
58
  return {
@@ -122,8 +122,8 @@ function createIdentityModule(injector) {
122
122
  if (userData.id === "000000000000000000000001") {
123
123
  allOwned = (0, import_util.deepCopy)(orgs);
124
124
  } else {
125
- const ownedCodes = userData.orgs.map((x) => x.code);
126
- allOwned = orgs.filter((o) => ownedCodes.some((code) => o.code.startsWith(code)));
125
+ const ownedCodes = userData.orgs?.map((x) => x.code);
126
+ allOwned = orgs.filter((o) => ownedCodes?.some((code) => o.code?.startsWith(code)));
127
127
  }
128
128
  }
129
129
  userOwnedOrgsSignal.set(allOwned);
package/dist/index.mjs CHANGED
@@ -11,11 +11,11 @@ import { CookieService, deepCopy } from "@delon/util";
11
11
  import gql from "graphql-tag";
12
12
  import { firstValueFrom, map, fromEvent } from "rxjs";
13
13
  import { debounceTime, switchMap } from "rxjs/operators";
14
- var GQL_CHECK_TENANT = gql`mutation checkTenant($code: String!) { checkTenant(code: $code) { code name } }`;
15
- var GQL_FEDERATE_AUTH = gql`mutation federateAuthenticate($code: String!, $loginProvider: LoginProviderEnum!) { federateAuthenticate(code: $code, loginProvider: $loginProvider) { id orgs { code } } }`;
14
+ var GQL_CHECK_TENANT = gql`mutation checkTenant($code: String!) { checkTenant(code: $code) { id code name isEnabled createdOn } }`;
15
+ var GQL_FEDERATE_AUTH = gql`mutation federateAuthenticate($code: String!, $loginProvider: LoginProviderEnum!) { federateAuthenticate(code: $code, loginProvider: $loginProvider) { ...UserDetail } }`;
16
16
  var GQL_ON_PUBLIC_NOTIFY = gql`subscription onPublicNotify { onPublicNotify { __typename ... on DataChangeClientNotify { dataChangeType } } }`;
17
- var GQL_ORGS_CACHE = gql`query orgsCache { orgs { items { code name } } }`;
18
- var GQL_INIT_SETTINGS = gql`query initSettings { initSettings { name value } }`;
17
+ var GQL_ORGS_CACHE = gql`query orgsCache { orgs(take: 999) { items { ... OrgCacheItem } } }`;
18
+ var GQL_INIT_SETTINGS = gql`query initSettings { initSettings { ... SettingBrief } }`;
19
19
  function createTenantModule(injector) {
20
20
  const current = signal(null);
21
21
  return {
@@ -85,8 +85,8 @@ function createIdentityModule(injector) {
85
85
  if (userData.id === "000000000000000000000001") {
86
86
  allOwned = deepCopy(orgs);
87
87
  } else {
88
- const ownedCodes = userData.orgs.map((x) => x.code);
89
- allOwned = orgs.filter((o) => ownedCodes.some((code) => o.code.startsWith(code)));
88
+ const ownedCodes = userData.orgs?.map((x) => x.code);
89
+ allOwned = orgs.filter((o) => ownedCodes?.some((code) => o.code?.startsWith(code)));
90
90
  }
91
91
  }
92
92
  userOwnedOrgsSignal.set(allOwned);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geexcode/geex-angular",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Angular adapter for Geex core.",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs",