openxiangda 1.0.100 → 1.0.102

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/lib/cli.js CHANGED
@@ -6763,9 +6763,31 @@ async function publishDataViewResources(config, target, dataViews, result) {
6763
6763
  action: existing ? 'update' : 'create',
6764
6764
  id: data?.id,
6765
6765
  });
6766
+ if (Array.isArray(body.permissionGroups)) {
6767
+ await publishDataViewPermissionGroups(config, target, dataViewItem.code, body.permissionGroups);
6768
+ result.published.push({
6769
+ kind: 'dataViewPermissionGroup',
6770
+ code: dataViewItem.code,
6771
+ action: 'replace',
6772
+ });
6773
+ }
6766
6774
  }
6767
6775
  }
6768
6776
 
6777
+ async function publishDataViewPermissionGroups(config, target, dataViewCode, permissionGroups) {
6778
+ await requestWithAuth(
6779
+ config,
6780
+ target.profileName,
6781
+ `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/data-views/${encodeURIComponent(dataViewCode)}/permission-groups`,
6782
+ {
6783
+ method: 'PUT',
6784
+ body: {
6785
+ groups: permissionGroups,
6786
+ },
6787
+ }
6788
+ );
6789
+ }
6790
+
6769
6791
  async function publishRouteResources(config, target, routes, result) {
6770
6792
  for (const route of routes) {
6771
6793
  const code = route.code || route.resourceCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.100",
3
+ "version": "1.0.102",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -4625,6 +4625,8 @@ var OpenXiangdaPageProvider = ({
4625
4625
  const app = toRuntimeRecord(bootstrap?.app);
4626
4626
  const user = toRuntimeRecord(bootstrap?.user);
4627
4627
  const permissions = bootstrap?.permissions;
4628
+ const unauthenticatedRuntime = !bootstrap?.user && runtime.error?.type === "unauthenticated";
4629
+ const runtimeGuestUser = unauthenticatedRuntime || user.isGuest === true || user.userType === "guest" || Boolean(getRecordValue3(user, "publicAccess"));
4628
4630
  const tenantId = toStringValue(getRecordValue3(app, "tenantId")) || toStringValue(getRecordValue3(user, "tenantId")) || toStringValue(getRecordValue3(app, "tenantCode")) || "";
4629
4631
  const appType = runtime.appType || bootstrap?.appType || toStringValue(getRecordValue3(app, "appType"));
4630
4632
  const routeInfo = buildBrowserRouteInfo(route);
@@ -4654,11 +4656,11 @@ var OpenXiangdaPageProvider = ({
4654
4656
  },
4655
4657
  user: {
4656
4658
  ...user,
4657
- id: toStringValue(getRecordValue3(user, "id")) || (user.isGuest ? "guest" : "current"),
4658
- username: toStringValue(getRecordValue3(user, "username")) || toStringValue(getRecordValue3(user, "name")) || (user.isGuest ? "guest" : "current"),
4659
+ id: toStringValue(getRecordValue3(user, "id")) || (runtimeGuestUser ? "guest" : "current"),
4660
+ username: toStringValue(getRecordValue3(user, "username")) || toStringValue(getRecordValue3(user, "name")) || (runtimeGuestUser ? "guest" : "current"),
4659
4661
  tenantId,
4660
- isGuest: user.isGuest === true || user.userType === "guest" || Boolean(getRecordValue3(user, "publicAccess")),
4661
- userType: user.userType === "guest" || user.isGuest === true ? "guest" : "normal"
4662
+ isGuest: runtimeGuestUser,
4663
+ userType: runtimeGuestUser ? "guest" : "normal"
4662
4664
  },
4663
4665
  env: {
4664
4666
  appType,