@abpjs/saas 2.2.0 → 2.4.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,17 @@ 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
+ */
126
+ declare enum eSaasComponents {
127
+ Editions = "Saas.EditionsComponent",
128
+ Tenants = "Saas.TenantsComponent"
129
+ }
130
+
121
131
  /**
122
132
  * SaaS Service
123
133
  * Translated from @volo/abp.ng.saas v2.0.0
@@ -131,9 +141,15 @@ declare const SAAS_ROUTES: {
131
141
  * This service wraps all REST API calls for the SaaS module.
132
142
  *
133
143
  * @since 2.0.0
144
+ * @updated 2.4.0 - Added apiName property
134
145
  */
135
146
  declare class SaasService {
136
147
  private restService;
148
+ /**
149
+ * API name for multi-API configurations
150
+ * @since 2.4.0
151
+ */
152
+ apiName: string;
137
153
  constructor(restService: RestService);
138
154
  /**
139
155
  * Get paginated list of tenants
@@ -618,4 +634,4 @@ interface EditionsComponentProps {
618
634
  */
619
635
  declare function EditionsComponent({ onEditionCreated, onEditionUpdated, onEditionDeleted, onManageFeatures, }: EditionsComponentProps): react_jsx_runtime.JSX.Element;
620
636
 
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 };
637
+ 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, eSaasComponents, 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,17 @@ 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
+ */
126
+ declare enum eSaasComponents {
127
+ Editions = "Saas.EditionsComponent",
128
+ Tenants = "Saas.TenantsComponent"
129
+ }
130
+
121
131
  /**
122
132
  * SaaS Service
123
133
  * Translated from @volo/abp.ng.saas v2.0.0
@@ -131,9 +141,15 @@ declare const SAAS_ROUTES: {
131
141
  * This service wraps all REST API calls for the SaaS module.
132
142
  *
133
143
  * @since 2.0.0
144
+ * @updated 2.4.0 - Added apiName property
134
145
  */
135
146
  declare class SaasService {
136
147
  private restService;
148
+ /**
149
+ * API name for multi-API configurations
150
+ * @since 2.4.0
151
+ */
152
+ apiName: string;
137
153
  constructor(restService: RestService);
138
154
  /**
139
155
  * Get paginated list of tenants
@@ -618,4 +634,4 @@ interface EditionsComponentProps {
618
634
  */
619
635
  declare function EditionsComponent({ onEditionCreated, onEditionUpdated, onEditionDeleted, onManageFeatures, }: EditionsComponentProps): react_jsx_runtime.JSX.Element;
620
636
 
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 };
637
+ 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, eSaasComponents, useEditions, useTenants };
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ __export(index_exports, {
25
25
  SaasService: () => SaasService,
26
26
  SaasStateService: () => SaasStateService,
27
27
  TenantsComponent: () => TenantsComponent,
28
+ eSaasComponents: () => eSaasComponents,
28
29
  useEditions: () => useEditions,
29
30
  useTenants: () => useTenants
30
31
  });
@@ -56,10 +57,22 @@ var SAAS_ROUTES = {
56
57
  ]
57
58
  };
58
59
 
60
+ // src/enums/components.ts
61
+ var eSaasComponents = /* @__PURE__ */ ((eSaasComponents2) => {
62
+ eSaasComponents2["Editions"] = "Saas.EditionsComponent";
63
+ eSaasComponents2["Tenants"] = "Saas.TenantsComponent";
64
+ return eSaasComponents2;
65
+ })(eSaasComponents || {});
66
+
59
67
  // src/services/saas.service.ts
60
68
  var SaasService = class {
61
69
  constructor(restService) {
62
70
  this.restService = restService;
71
+ /**
72
+ * API name for multi-API configurations
73
+ * @since 2.4.0
74
+ */
75
+ this.apiName = "default";
63
76
  }
64
77
  // ==================== Tenant Operations ====================
65
78
  /**
@@ -847,6 +860,8 @@ function TenantsComponent({
847
860
  const [filter, setFilter] = (0, import_react3.useState)("");
848
861
  const [tenantName, setTenantName] = (0, import_react3.useState)("");
849
862
  const [tenantEditionId, setTenantEditionId] = (0, import_react3.useState)("");
863
+ const [adminEmailAddress, setAdminEmailAddress] = (0, import_react3.useState)("");
864
+ const [adminPassword, setAdminPassword] = (0, import_react3.useState)("");
850
865
  const [connStringUseShared, setConnStringUseShared] = (0, import_react3.useState)(true);
851
866
  const [connString, setConnString] = (0, import_react3.useState)("");
852
867
  (0, import_react3.useEffect)(() => {
@@ -873,6 +888,8 @@ function TenantsComponent({
873
888
  setSelectedTenant(null);
874
889
  setTenantName("");
875
890
  setTenantEditionId("");
891
+ setAdminEmailAddress("");
892
+ setAdminPassword("");
876
893
  setModalType("tenant");
877
894
  setModalVisible(true);
878
895
  }, [setSelectedTenant]);
@@ -945,6 +962,8 @@ function TenantsComponent({
945
962
  }
946
963
  } else {
947
964
  const result = await createTenant({
965
+ adminEmailAddress,
966
+ adminPassword,
948
967
  name: tenantName,
949
968
  editionId: tenantEditionId || void 0
950
969
  });
@@ -965,6 +984,8 @@ function TenantsComponent({
965
984
  }, [
966
985
  tenantName,
967
986
  tenantEditionId,
987
+ adminEmailAddress,
988
+ adminPassword,
968
989
  selectedTenant,
969
990
  updateTenant,
970
991
  createTenant,
@@ -1134,7 +1155,27 @@ function TenantsComponent({
1134
1155
  editions.map((edition) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: edition.id, children: edition.displayName }, edition.id))
1135
1156
  ]
1136
1157
  }
1137
- ) }) })
1158
+ ) }) }),
1159
+ !selectedTenant && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1160
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_shared.FormField, { label: t("Saas::AdminEmailAddress"), required: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1161
+ import_react4.Input,
1162
+ {
1163
+ type: "email",
1164
+ value: adminEmailAddress,
1165
+ onChange: (e) => setAdminEmailAddress(e.target.value),
1166
+ placeholder: t("Saas::AdminEmailAddress")
1167
+ }
1168
+ ) }),
1169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme_shared.FormField, { label: t("Saas::AdminPassword"), required: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1170
+ import_react4.Input,
1171
+ {
1172
+ type: "password",
1173
+ value: adminPassword,
1174
+ onChange: (e) => setAdminPassword(e.target.value),
1175
+ placeholder: t("Saas::AdminPassword")
1176
+ }
1177
+ ) })
1178
+ ] })
1138
1179
  ] }),
1139
1180
  modalType === "connectionString" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.VStack, { gap: 4, align: "stretch", children: [
1140
1181
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Flex, { alignItems: "center", gap: 2, children: [
@@ -1420,6 +1461,7 @@ function EditionsComponent({
1420
1461
  SaasService,
1421
1462
  SaasStateService,
1422
1463
  TenantsComponent,
1464
+ eSaasComponents,
1423
1465
  useEditions,
1424
1466
  useTenants
1425
1467
  });
package/dist/index.mjs CHANGED
@@ -24,10 +24,22 @@ var SAAS_ROUTES = {
24
24
  ]
25
25
  };
26
26
 
27
+ // src/enums/components.ts
28
+ var eSaasComponents = /* @__PURE__ */ ((eSaasComponents2) => {
29
+ eSaasComponents2["Editions"] = "Saas.EditionsComponent";
30
+ eSaasComponents2["Tenants"] = "Saas.TenantsComponent";
31
+ return eSaasComponents2;
32
+ })(eSaasComponents || {});
33
+
27
34
  // src/services/saas.service.ts
28
35
  var SaasService = class {
29
36
  constructor(restService) {
30
37
  this.restService = restService;
38
+ /**
39
+ * API name for multi-API configurations
40
+ * @since 2.4.0
41
+ */
42
+ this.apiName = "default";
31
43
  }
32
44
  // ==================== Tenant Operations ====================
33
45
  /**
@@ -791,7 +803,7 @@ import {
791
803
  Badge
792
804
  } from "@chakra-ui/react";
793
805
  import { NativeSelectRoot, NativeSelectField } from "@chakra-ui/react";
794
- import { jsx, jsxs } from "react/jsx-runtime";
806
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
795
807
  function TenantsComponent({
796
808
  onTenantCreated,
797
809
  onTenantUpdated,
@@ -824,6 +836,8 @@ function TenantsComponent({
824
836
  const [filter, setFilter] = useState3("");
825
837
  const [tenantName, setTenantName] = useState3("");
826
838
  const [tenantEditionId, setTenantEditionId] = useState3("");
839
+ const [adminEmailAddress, setAdminEmailAddress] = useState3("");
840
+ const [adminPassword, setAdminPassword] = useState3("");
827
841
  const [connStringUseShared, setConnStringUseShared] = useState3(true);
828
842
  const [connString, setConnString] = useState3("");
829
843
  useEffect(() => {
@@ -850,6 +864,8 @@ function TenantsComponent({
850
864
  setSelectedTenant(null);
851
865
  setTenantName("");
852
866
  setTenantEditionId("");
867
+ setAdminEmailAddress("");
868
+ setAdminPassword("");
853
869
  setModalType("tenant");
854
870
  setModalVisible(true);
855
871
  }, [setSelectedTenant]);
@@ -922,6 +938,8 @@ function TenantsComponent({
922
938
  }
923
939
  } else {
924
940
  const result = await createTenant({
941
+ adminEmailAddress,
942
+ adminPassword,
925
943
  name: tenantName,
926
944
  editionId: tenantEditionId || void 0
927
945
  });
@@ -942,6 +960,8 @@ function TenantsComponent({
942
960
  }, [
943
961
  tenantName,
944
962
  tenantEditionId,
963
+ adminEmailAddress,
964
+ adminPassword,
945
965
  selectedTenant,
946
966
  updateTenant,
947
967
  createTenant,
@@ -1111,7 +1131,27 @@ function TenantsComponent({
1111
1131
  editions.map((edition) => /* @__PURE__ */ jsx("option", { value: edition.id, children: edition.displayName }, edition.id))
1112
1132
  ]
1113
1133
  }
1114
- ) }) })
1134
+ ) }) }),
1135
+ !selectedTenant && /* @__PURE__ */ jsxs(Fragment, { children: [
1136
+ /* @__PURE__ */ jsx(FormField, { label: t("Saas::AdminEmailAddress"), required: true, children: /* @__PURE__ */ jsx(
1137
+ Input,
1138
+ {
1139
+ type: "email",
1140
+ value: adminEmailAddress,
1141
+ onChange: (e) => setAdminEmailAddress(e.target.value),
1142
+ placeholder: t("Saas::AdminEmailAddress")
1143
+ }
1144
+ ) }),
1145
+ /* @__PURE__ */ jsx(FormField, { label: t("Saas::AdminPassword"), required: true, children: /* @__PURE__ */ jsx(
1146
+ Input,
1147
+ {
1148
+ type: "password",
1149
+ value: adminPassword,
1150
+ onChange: (e) => setAdminPassword(e.target.value),
1151
+ placeholder: t("Saas::AdminPassword")
1152
+ }
1153
+ ) })
1154
+ ] })
1115
1155
  ] }),
1116
1156
  modalType === "connectionString" && /* @__PURE__ */ jsxs(VStack, { gap: 4, align: "stretch", children: [
1117
1157
  /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
@@ -1404,6 +1444,7 @@ export {
1404
1444
  SaasService,
1405
1445
  SaasStateService,
1406
1446
  TenantsComponent,
1447
+ eSaasComponents,
1407
1448
  useEditions,
1408
1449
  useTenants
1409
1450
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abpjs/saas",
3
- "version": "2.2.0",
3
+ "version": "2.4.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.4.0",
31
+ "@abpjs/theme-shared": "2.4.0",
32
+ "@abpjs/feature-management": "2.4.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@volo/abp.ng.saas": "2.2.0",
35
+ "@volo/abp.ng.saas": "2.4.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",