@abpjs/saas 2.2.0 → 2.7.0

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
@@ -3,7 +3,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  /**
5
5
  * SaaS Models
6
- * Translated from @volo/abp.ng.saas v2.0.0
6
+ * Translated from @volo/abp.ng.saas v2.4.0
7
+ *
8
+ * @updated 2.4.0 - Updated CreateTenantRequest and UpdateTenantRequest types
7
9
  */
8
10
 
9
11
  /**
@@ -53,22 +55,19 @@ declare namespace Saas {
53
55
  }
54
56
  /**
55
57
  * Create tenant request
58
+ * @updated 2.4.0 - adminEmailAddress and adminPassword are now required
56
59
  */
57
60
  interface CreateTenantRequest {
61
+ adminEmailAddress: string;
62
+ adminPassword: string;
58
63
  name: string;
59
64
  editionId?: string;
60
- adminEmailAddress?: string;
61
- adminPassword?: string;
62
65
  }
63
66
  /**
64
67
  * Update tenant request
68
+ * @updated 2.4.0 - Now uses Omit<Tenant, 'editionName'> pattern
65
69
  */
66
- interface UpdateTenantRequest {
67
- id?: string;
68
- name: string;
69
- editionId?: string;
70
- concurrencyStamp?: string;
71
- }
70
+ type UpdateTenantRequest = Omit<Tenant, 'editionName'>;
72
71
  /**
73
72
  * Create edition request
74
73
  */
@@ -118,6 +117,42 @@ declare const SAAS_ROUTES: {
118
117
  routes: ABP.FullRoute[];
119
118
  };
120
119
 
120
+ /**
121
+ * SaaS Component Identifiers
122
+ * Used for component registration and routing
123
+ *
124
+ * @since 2.4.0
125
+ * @updated 2.7.0 - Changed from enum to const object
126
+ */
127
+ declare const eSaasComponents: {
128
+ readonly Editions: "Saas.EditionsComponent";
129
+ readonly Tenants: "Saas.TenantsComponent";
130
+ };
131
+ /**
132
+ * Type for SaaS component key values
133
+ */
134
+ type SaasComponentKey = (typeof eSaasComponents)[keyof typeof eSaasComponents];
135
+
136
+ /**
137
+ * SaaS Route Names
138
+ * Translated from @volo/abp.ng.saas v2.7.0
139
+ */
140
+ /**
141
+ * Enum-like const object for SaaS route names.
142
+ * Used for localization and navigation configuration.
143
+ * @since 2.7.0
144
+ */
145
+ declare const eSaasRouteNames: {
146
+ readonly Administration: "AbpUiNavigation::Menu:Administration";
147
+ readonly Saas: "Saas::Menu:Saas";
148
+ readonly Tenants: "Saas::Tenants";
149
+ readonly Editions: "Saas::Editions";
150
+ };
151
+ /**
152
+ * Type for SaaS route name values
153
+ */
154
+ type SaasRouteNameKey = (typeof eSaasRouteNames)[keyof typeof eSaasRouteNames];
155
+
121
156
  /**
122
157
  * SaaS Service
123
158
  * Translated from @volo/abp.ng.saas v2.0.0
@@ -131,9 +166,15 @@ declare const SAAS_ROUTES: {
131
166
  * This service wraps all REST API calls for the SaaS module.
132
167
  *
133
168
  * @since 2.0.0
169
+ * @updated 2.4.0 - Added apiName property
134
170
  */
135
171
  declare class SaasService {
136
172
  private restService;
173
+ /**
174
+ * API name for multi-API configurations
175
+ * @since 2.4.0
176
+ */
177
+ apiName: string;
137
178
  constructor(restService: RestService);
138
179
  /**
139
180
  * Get paginated list of tenants
@@ -618,4 +659,4 @@ interface EditionsComponentProps {
618
659
  */
619
660
  declare function EditionsComponent({ onEditionCreated, onEditionUpdated, onEditionDeleted, onManageFeatures, }: EditionsComponentProps): react_jsx_runtime.JSX.Element;
620
661
 
621
- export { type EditionOperationResult, EditionsComponent, type EditionsComponentProps, SAAS_ROUTES, Saas, SaasService, SaasStateService, type SortOrder$1 as SortOrder, type TenantOperationResult, TenantsComponent, type TenantsComponentProps, type UseEditionsReturn, type UseTenantsReturn, useEditions, useTenants };
662
+ export { type EditionOperationResult, EditionsComponent, type EditionsComponentProps, SAAS_ROUTES, Saas, type SaasComponentKey, type SaasRouteNameKey, SaasService, SaasStateService, type SortOrder$1 as SortOrder, type TenantOperationResult, TenantsComponent, type TenantsComponentProps, type UseEditionsReturn, type UseTenantsReturn, eSaasComponents, eSaasRouteNames, useEditions, useTenants };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,9 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  /**
5
5
  * SaaS Models
6
- * Translated from @volo/abp.ng.saas v2.0.0
6
+ * Translated from @volo/abp.ng.saas v2.4.0
7
+ *
8
+ * @updated 2.4.0 - Updated CreateTenantRequest and UpdateTenantRequest types
7
9
  */
8
10
 
9
11
  /**
@@ -53,22 +55,19 @@ declare namespace Saas {
53
55
  }
54
56
  /**
55
57
  * Create tenant request
58
+ * @updated 2.4.0 - adminEmailAddress and adminPassword are now required
56
59
  */
57
60
  interface CreateTenantRequest {
61
+ adminEmailAddress: string;
62
+ adminPassword: string;
58
63
  name: string;
59
64
  editionId?: string;
60
- adminEmailAddress?: string;
61
- adminPassword?: string;
62
65
  }
63
66
  /**
64
67
  * Update tenant request
68
+ * @updated 2.4.0 - Now uses Omit<Tenant, 'editionName'> pattern
65
69
  */
66
- interface UpdateTenantRequest {
67
- id?: string;
68
- name: string;
69
- editionId?: string;
70
- concurrencyStamp?: string;
71
- }
70
+ type UpdateTenantRequest = Omit<Tenant, 'editionName'>;
72
71
  /**
73
72
  * Create edition request
74
73
  */
@@ -118,6 +117,42 @@ declare const SAAS_ROUTES: {
118
117
  routes: ABP.FullRoute[];
119
118
  };
120
119
 
120
+ /**
121
+ * SaaS Component Identifiers
122
+ * Used for component registration and routing
123
+ *
124
+ * @since 2.4.0
125
+ * @updated 2.7.0 - Changed from enum to const object
126
+ */
127
+ declare const eSaasComponents: {
128
+ readonly Editions: "Saas.EditionsComponent";
129
+ readonly Tenants: "Saas.TenantsComponent";
130
+ };
131
+ /**
132
+ * Type for SaaS component key values
133
+ */
134
+ type SaasComponentKey = (typeof eSaasComponents)[keyof typeof eSaasComponents];
135
+
136
+ /**
137
+ * SaaS Route Names
138
+ * Translated from @volo/abp.ng.saas v2.7.0
139
+ */
140
+ /**
141
+ * Enum-like const object for SaaS route names.
142
+ * Used for localization and navigation configuration.
143
+ * @since 2.7.0
144
+ */
145
+ declare const eSaasRouteNames: {
146
+ readonly Administration: "AbpUiNavigation::Menu:Administration";
147
+ readonly Saas: "Saas::Menu:Saas";
148
+ readonly Tenants: "Saas::Tenants";
149
+ readonly Editions: "Saas::Editions";
150
+ };
151
+ /**
152
+ * Type for SaaS route name values
153
+ */
154
+ type SaasRouteNameKey = (typeof eSaasRouteNames)[keyof typeof eSaasRouteNames];
155
+
121
156
  /**
122
157
  * SaaS Service
123
158
  * Translated from @volo/abp.ng.saas v2.0.0
@@ -131,9 +166,15 @@ declare const SAAS_ROUTES: {
131
166
  * This service wraps all REST API calls for the SaaS module.
132
167
  *
133
168
  * @since 2.0.0
169
+ * @updated 2.4.0 - Added apiName property
134
170
  */
135
171
  declare class SaasService {
136
172
  private restService;
173
+ /**
174
+ * API name for multi-API configurations
175
+ * @since 2.4.0
176
+ */
177
+ apiName: string;
137
178
  constructor(restService: RestService);
138
179
  /**
139
180
  * Get paginated list of tenants
@@ -618,4 +659,4 @@ interface EditionsComponentProps {
618
659
  */
619
660
  declare function EditionsComponent({ onEditionCreated, onEditionUpdated, onEditionDeleted, onManageFeatures, }: EditionsComponentProps): react_jsx_runtime.JSX.Element;
620
661
 
621
- export { type EditionOperationResult, EditionsComponent, type EditionsComponentProps, SAAS_ROUTES, Saas, SaasService, SaasStateService, type SortOrder$1 as SortOrder, type TenantOperationResult, TenantsComponent, type TenantsComponentProps, type UseEditionsReturn, type UseTenantsReturn, useEditions, useTenants };
662
+ export { type EditionOperationResult, EditionsComponent, type EditionsComponentProps, SAAS_ROUTES, Saas, type SaasComponentKey, type SaasRouteNameKey, SaasService, SaasStateService, type SortOrder$1 as SortOrder, type TenantOperationResult, TenantsComponent, type TenantsComponentProps, type UseEditionsReturn, type UseTenantsReturn, eSaasComponents, eSaasRouteNames, useEditions, useTenants };
package/dist/index.js CHANGED
@@ -25,6 +25,8 @@ __export(index_exports, {
25
25
  SaasService: () => SaasService,
26
26
  SaasStateService: () => SaasStateService,
27
27
  TenantsComponent: () => TenantsComponent,
28
+ eSaasComponents: () => eSaasComponents,
29
+ eSaasRouteNames: () => eSaasRouteNames,
28
30
  useEditions: () => useEditions,
29
31
  useTenants: () => useTenants
30
32
  });
@@ -56,10 +58,29 @@ var SAAS_ROUTES = {
56
58
  ]
57
59
  };
58
60
 
61
+ // src/enums/components.ts
62
+ var eSaasComponents = {
63
+ Editions: "Saas.EditionsComponent",
64
+ Tenants: "Saas.TenantsComponent"
65
+ };
66
+
67
+ // src/enums/route-names.ts
68
+ var eSaasRouteNames = {
69
+ Administration: "AbpUiNavigation::Menu:Administration",
70
+ Saas: "Saas::Menu:Saas",
71
+ Tenants: "Saas::Tenants",
72
+ Editions: "Saas::Editions"
73
+ };
74
+
59
75
  // src/services/saas.service.ts
60
76
  var SaasService = class {
61
77
  constructor(restService) {
62
78
  this.restService = restService;
79
+ /**
80
+ * API name for multi-API configurations
81
+ * @since 2.4.0
82
+ */
83
+ this.apiName = "default";
63
84
  }
64
85
  // ==================== Tenant Operations ====================
65
86
  /**
@@ -847,6 +868,8 @@ function TenantsComponent({
847
868
  const [filter, setFilter] = (0, import_react3.useState)("");
848
869
  const [tenantName, setTenantName] = (0, import_react3.useState)("");
849
870
  const [tenantEditionId, setTenantEditionId] = (0, import_react3.useState)("");
871
+ const [adminEmailAddress, setAdminEmailAddress] = (0, import_react3.useState)("");
872
+ const [adminPassword, setAdminPassword] = (0, import_react3.useState)("");
850
873
  const [connStringUseShared, setConnStringUseShared] = (0, import_react3.useState)(true);
851
874
  const [connString, setConnString] = (0, import_react3.useState)("");
852
875
  (0, import_react3.useEffect)(() => {
@@ -873,6 +896,8 @@ function TenantsComponent({
873
896
  setSelectedTenant(null);
874
897
  setTenantName("");
875
898
  setTenantEditionId("");
899
+ setAdminEmailAddress("");
900
+ setAdminPassword("");
876
901
  setModalType("tenant");
877
902
  setModalVisible(true);
878
903
  }, [setSelectedTenant]);
@@ -945,6 +970,8 @@ function TenantsComponent({
945
970
  }
946
971
  } else {
947
972
  const result = await createTenant({
973
+ adminEmailAddress,
974
+ adminPassword,
948
975
  name: tenantName,
949
976
  editionId: tenantEditionId || void 0
950
977
  });
@@ -965,6 +992,8 @@ function TenantsComponent({
965
992
  }, [
966
993
  tenantName,
967
994
  tenantEditionId,
995
+ adminEmailAddress,
996
+ adminPassword,
968
997
  selectedTenant,
969
998
  updateTenant,
970
999
  createTenant,
@@ -1134,7 +1163,27 @@ function TenantsComponent({
1134
1163
  editions.map((edition) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: edition.id, children: edition.displayName }, edition.id))
1135
1164
  ]
1136
1165
  }
1137
- ) }) })
1166
+ ) }) }),
1167
+ !selectedTenant && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_shared.FormField, { label: t("Saas::AdminEmailAddress"), required: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1169
+ import_react4.Input,
1170
+ {
1171
+ type: "email",
1172
+ value: adminEmailAddress,
1173
+ onChange: (e) => setAdminEmailAddress(e.target.value),
1174
+ placeholder: t("Saas::AdminEmailAddress")
1175
+ }
1176
+ ) }),
1177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_shared.FormField, { label: t("Saas::AdminPassword"), required: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1178
+ import_react4.Input,
1179
+ {
1180
+ type: "password",
1181
+ value: adminPassword,
1182
+ onChange: (e) => setAdminPassword(e.target.value),
1183
+ placeholder: t("Saas::AdminPassword")
1184
+ }
1185
+ ) })
1186
+ ] })
1138
1187
  ] }),
1139
1188
  modalType === "connectionString" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.VStack, { gap: 4, align: "stretch", children: [
1140
1189
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Flex, { alignItems: "center", gap: 2, children: [
@@ -1420,6 +1469,8 @@ function EditionsComponent({
1420
1469
  SaasService,
1421
1470
  SaasStateService,
1422
1471
  TenantsComponent,
1472
+ eSaasComponents,
1473
+ eSaasRouteNames,
1423
1474
  useEditions,
1424
1475
  useTenants
1425
1476
  });
package/dist/index.mjs CHANGED
@@ -24,10 +24,29 @@ var SAAS_ROUTES = {
24
24
  ]
25
25
  };
26
26
 
27
+ // src/enums/components.ts
28
+ var eSaasComponents = {
29
+ Editions: "Saas.EditionsComponent",
30
+ Tenants: "Saas.TenantsComponent"
31
+ };
32
+
33
+ // src/enums/route-names.ts
34
+ var eSaasRouteNames = {
35
+ Administration: "AbpUiNavigation::Menu:Administration",
36
+ Saas: "Saas::Menu:Saas",
37
+ Tenants: "Saas::Tenants",
38
+ Editions: "Saas::Editions"
39
+ };
40
+
27
41
  // src/services/saas.service.ts
28
42
  var SaasService = class {
29
43
  constructor(restService) {
30
44
  this.restService = restService;
45
+ /**
46
+ * API name for multi-API configurations
47
+ * @since 2.4.0
48
+ */
49
+ this.apiName = "default";
31
50
  }
32
51
  // ==================== Tenant Operations ====================
33
52
  /**
@@ -791,7 +810,7 @@ import {
791
810
  Badge
792
811
  } from "@chakra-ui/react";
793
812
  import { NativeSelectRoot, NativeSelectField } from "@chakra-ui/react";
794
- import { jsx, jsxs } from "react/jsx-runtime";
813
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
795
814
  function TenantsComponent({
796
815
  onTenantCreated,
797
816
  onTenantUpdated,
@@ -824,6 +843,8 @@ function TenantsComponent({
824
843
  const [filter, setFilter] = useState3("");
825
844
  const [tenantName, setTenantName] = useState3("");
826
845
  const [tenantEditionId, setTenantEditionId] = useState3("");
846
+ const [adminEmailAddress, setAdminEmailAddress] = useState3("");
847
+ const [adminPassword, setAdminPassword] = useState3("");
827
848
  const [connStringUseShared, setConnStringUseShared] = useState3(true);
828
849
  const [connString, setConnString] = useState3("");
829
850
  useEffect(() => {
@@ -850,6 +871,8 @@ function TenantsComponent({
850
871
  setSelectedTenant(null);
851
872
  setTenantName("");
852
873
  setTenantEditionId("");
874
+ setAdminEmailAddress("");
875
+ setAdminPassword("");
853
876
  setModalType("tenant");
854
877
  setModalVisible(true);
855
878
  }, [setSelectedTenant]);
@@ -922,6 +945,8 @@ function TenantsComponent({
922
945
  }
923
946
  } else {
924
947
  const result = await createTenant({
948
+ adminEmailAddress,
949
+ adminPassword,
925
950
  name: tenantName,
926
951
  editionId: tenantEditionId || void 0
927
952
  });
@@ -942,6 +967,8 @@ function TenantsComponent({
942
967
  }, [
943
968
  tenantName,
944
969
  tenantEditionId,
970
+ adminEmailAddress,
971
+ adminPassword,
945
972
  selectedTenant,
946
973
  updateTenant,
947
974
  createTenant,
@@ -1111,7 +1138,27 @@ function TenantsComponent({
1111
1138
  editions.map((edition) => /* @__PURE__ */ jsx("option", { value: edition.id, children: edition.displayName }, edition.id))
1112
1139
  ]
1113
1140
  }
1114
- ) }) })
1141
+ ) }) }),
1142
+ !selectedTenant && /* @__PURE__ */ jsxs(Fragment, { children: [
1143
+ /* @__PURE__ */ jsx(FormField, { label: t("Saas::AdminEmailAddress"), required: true, children: /* @__PURE__ */ jsx(
1144
+ Input,
1145
+ {
1146
+ type: "email",
1147
+ value: adminEmailAddress,
1148
+ onChange: (e) => setAdminEmailAddress(e.target.value),
1149
+ placeholder: t("Saas::AdminEmailAddress")
1150
+ }
1151
+ ) }),
1152
+ /* @__PURE__ */ jsx(FormField, { label: t("Saas::AdminPassword"), required: true, children: /* @__PURE__ */ jsx(
1153
+ Input,
1154
+ {
1155
+ type: "password",
1156
+ value: adminPassword,
1157
+ onChange: (e) => setAdminPassword(e.target.value),
1158
+ placeholder: t("Saas::AdminPassword")
1159
+ }
1160
+ ) })
1161
+ ] })
1115
1162
  ] }),
1116
1163
  modalType === "connectionString" && /* @__PURE__ */ jsxs(VStack, { gap: 4, align: "stretch", children: [
1117
1164
  /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
@@ -1404,6 +1451,8 @@ export {
1404
1451
  SaasService,
1405
1452
  SaasStateService,
1406
1453
  TenantsComponent,
1454
+ eSaasComponents,
1455
+ eSaasRouteNames,
1407
1456
  useEditions,
1408
1457
  useTenants
1409
1458
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abpjs/saas",
3
- "version": "2.2.0",
3
+ "version": "2.7.0",
4
4
  "description": "ABP Framework SaaS components for React - translated from @volo/abp.ng.saas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,12 +27,12 @@
27
27
  "dependencies": {
28
28
  "@chakra-ui/react": "^3.2.0",
29
29
  "@emotion/react": "^11.11.0",
30
- "@abpjs/core": "2.2.0",
31
- "@abpjs/theme-shared": "2.2.0",
32
- "@abpjs/feature-management": "2.2.0"
30
+ "@abpjs/core": "2.7.0",
31
+ "@abpjs/feature-management": "2.7.0",
32
+ "@abpjs/theme-shared": "2.7.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@volo/abp.ng.saas": "2.2.0",
35
+ "@volo/abp.ng.saas": "2.7.0",
36
36
  "@testing-library/jest-dom": "^6.9.1",
37
37
  "@testing-library/react": "^14.0.0",
38
38
  "@testing-library/user-event": "^14.6.1",