Skip to content

Commit

Permalink
sync: hosted cloud (#1276)
Browse files Browse the repository at this point in the history
Co-authored-by: Chambers <chenbochao@vikadata.com>
Co-authored-by: ziqiang <zhaozhiqiang@vikadata.com>
Co-authored-by: Michael Xiaoliang Chan <111508006+yo-ooiii@users.noreply.github.com>
Co-authored-by: Kilian <wangkailang@users.noreply.github.com>
Co-authored-by: Kelly Peilin Chan <kelly@apitable.com>
Co-authored-by: Caedman Ziwen Lan <lanziwen@apitable.com>
Co-authored-by: Aria <sujian@apitable.com>
Co-authored-by: Shawn Deng <dengguiheng@apitable.com>
Co-authored-by: William Chan <root@williamchan.me>
Co-authored-by: Harry Yep <git@hode.co.uk>
Co-authored-by: Guofeng Chen <66124783+functionChenGuoFeng@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: magic conch <38741725+Enternalcode@users.noreply.github.com>
Co-authored-by: Kelly Peilin Chan <kelly@vikadata.com>
Co-authored-by: yechen <18412022+SmileChen518@users.noreply.github.com>
Co-authored-by: Robot Ye Chen <262000730@qq.com>
Co-authored-by: Zoe <zhengxu@apitable.com>
Co-authored-by: Binson <zoubingshun@aitable.ai>
Co-authored-by: Binson <zoubingshun1@apitable.com>
Co-authored-by: paylm penglong feng <fengpenglong@vikadata.com>
Co-authored-by: liuyi <liuyi@vikadata.com>
Co-authored-by: Evie Wanmei Huang <37546178+wmEvie@users.noreply.github.com>
Co-authored-by: Kelvin Jiawen Pan <panjiawen@apitable.com>
Co-authored-by: Evie <huangwanmei@apitable.com>
Co-authored-by: XuKecheng <wsad8254695@outlook.com>
Co-authored-by: vac (Brendan) <wangjintao@apitable.com>
Co-authored-by: Alex (hufeng) <hufeng@vikadata.com>
Co-authored-by: Kelvin <panjiawen@vikadata.com>
Co-authored-by: wangkailang <wangkailang@vikadata.com>
  • Loading branch information
30 people committed Sep 4, 2023
1 parent 4fd852f commit a1f76e8
Show file tree
Hide file tree
Showing 257 changed files with 15,126 additions and 1,886 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.99.1
current_version = 1.0.0
commit = False
tag = False

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ name: Lint

on:
push:
branches: ["develop", "release/v*"]
branches: [ "develop", "release/v*" ]
pull_request:
# The branches below must be a subset of the branches above
branches: ["develop"]
branches: [ "develop" ]

jobs:
eslint:
Expand All @@ -27,7 +27,7 @@ jobs:
# only required for a private repository by
# github/codeql-action/upload-sarif
# to get the Action run status
actions: read
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
################################
# Run Linter against code base #
################################
- name: Lint Code
- name: Lint Code
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
Expand All @@ -97,7 +97,7 @@ jobs:
VALIDATE_RUST_2015: false
VALIDATE_RUST_2018: false
VALIDATE_RUST_CLIPPY: false
FILTER_REGEX_EXCLUDE: .*ui-autotest/.*|.*datasheet/.*|.*src/test.*
FILTER_REGEX_EXCLUDE: .*ui-autotest/.*|.*datasheet/.*|.*src/test.*|.*databusclient/.*
VALIDATE_GOOGLE_JAVA_FORMAT: false
JAVA_FILE_NAME: checkstyle.xml
VALIDATE_SHELL_SHFMT: false
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,6 @@ eslint-results.sarif
/packages/i18n-lang/src/config/language.manifest.origin.json
/packages/room-native-api/target/**
/packages/room-native-api/Cargo.lock

# openapi generated
/backend-server/application/.openapi-generator/
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.99.1
1.0.0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ We always search for good talents for APITable:

Regardless of time and conditions, if you want to get involved to the team of APITable, do not hesitate to [fill out this form](https://aitable.ai/share/shrDNBDeVlLvB1eFDMWhl) or send your CV to <talent@aitable.ai>.


## 📺 Screenshot

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion backend-server/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.99.1
1.0.0
43 changes: 43 additions & 0 deletions backend-server/application/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

.github/
.openapi-generator/
api/
docs/
gradle/
build.gradle
.gitignore
.travis.yml
build.sbt
git_push.sh
gradle.properties
gradlew
gradlew.bat
pom.xml
README.md
settings.gradle
src/main/AndroidManifest.xml
src/test/java/com/apitable/databusclient/

4 changes: 4 additions & 0 deletions backend-server/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ dependencies {
implementation rootProject.ext.dependencies['spring-cloud-sleuth-otel']
implementation rootProject.ext.dependencies['opentelemetry-exporter-jaeger']
implementation rootProject.ext.dependencies['okhttp3']
implementation rootProject.ext.dependencies['okhttp3-logging-interceptor']
implementation rootProject.ext.dependencies['rs-api']
implementation rootProject.ext.dependencies['gson-fire']
implementation rootProject.ext.dependencies['jackson-databind-nullable']
implementation rootProject.ext.dependencies['jsoup']
implementation rootProject.ext.dependencies['protobuf-java']
implementation rootProject.ext.dependencies['io-grpc']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* APITable <https://github.com/apitable/apitable>
* Copyright (C) 2022 APITable Ltd. <https://apitable.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.apitable.automation.controller;

import com.apitable.automation.model.AutomationVO;
import com.apitable.automation.service.IAutomationRobotService;
import com.apitable.core.support.ResponseData;
import com.apitable.databusclient.ApiException;
import com.apitable.shared.component.scanner.annotation.ApiResource;
import com.apitable.shared.component.scanner.annotation.GetResource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
* Automation run history controller.
*/
@RestController
@Tag(name = "Authorization related interface")
@ApiResource(path = {"/automation/robots"})
@Slf4j
public class AutomationRobotController {

@Resource
private IAutomationRobotService iAutomationRobotService;

/**
* Get automation run history.
*
* @param resourceId resource id
* @return {@link ResponseData}
*/
@GetResource(path = "", requiredPermission = false)
@Operation(summary = "Get automation run history")
@Parameter(name = "resourceId", description = "resource id", required = true, schema = @Schema(type =
"string"), in = ParameterIn.QUERY, example = "dst****")
public ResponseData<List<AutomationVO>> getResourceRobots(
@RequestParam("resourceId") String resourceId)
throws ApiException {
return ResponseData.success(iAutomationRobotService.getRobotsByResourceId(resourceId));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* APITable <https://github.com/apitable/apitable>
* Copyright (C) 2022 APITable Ltd. <https://apitable.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.apitable.automation.controller;

import com.apitable.automation.model.AutomationRunHistoryRo;
import com.apitable.automation.service.IAutomationRunHistoryService;
import com.apitable.core.support.ResponseData;
import com.apitable.databusclient.ApiException;
import com.apitable.shared.component.scanner.annotation.ApiResource;
import com.apitable.shared.component.scanner.annotation.PostResource;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.annotation.Resource;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

/**
* Automation run history controller.
*/
@RestController
@Tag(name = "Authorization related interface")
@ApiResource(path = {"/automation/run-history"})
@Slf4j
public class AutomationRunHistoryController {

@Resource
private IAutomationRunHistoryService iAutomationRunHistoryService;

/**
* Get automation run history.
*
* @param query query object
* @return {@link ResponseData}
*/
@PostResource(path = "/", requiredPermission = false)
@Operation(summary = "Get automation run history")
public ResponseData<Void> getRunHistory(@Valid final AutomationRunHistoryRo query)
throws ApiException {
iAutomationRunHistoryService.getRobotRunHistory(query.getRobotId());
return ResponseData.success();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public class AutomationRobotEntity implements Serializable {
/**
* Is it active
*/
private Integer isActive;
private Boolean isActive;

/**
* Delete Tag(0: No, 1: Yes)
*/
@TableLogic
private Integer isDeleted;
private Boolean isDeleted;

/**
* Creator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public class AutomationTriggerEntity implements Serializable {
*/
private String triggerId;

/**
* Previous Trigger ID
*/
private String prevTriggerId;

/**
* Resource ID(link#xxxx_node#node_id)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ public enum AutomationException implements BaseException {

DST_ROBOT_LIMIT(1101, "The single-table robot has reached the upper limit"),

DST_ROBOT_REPEAT(1102, "Do not recreate");
DST_ROBOT_REPEAT(1102, "Do not recreate"),

AUTOMATION_ERROR(1103, "Server error"),

;

private final Integer code;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@

import com.apitable.automation.entity.AutomationActionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Collection;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface AutomationActionMapper extends BaseMapper<AutomationActionEntity> {

List<AutomationActionEntity> selectByRobotIdIds(
@Param("robotIds") Collection<String> robotIds);

void insertList(@Param("entities") Collection<AutomationActionEntity> entities);

int updateActionTypeIdAndInputByRobotId(@Param("robotId") String robotId,
@Param("updatedActionTypeId") String updatedActionTypeId,
@Param("updatedInput") String updatedInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,33 @@

import com.apitable.automation.entity.AutomationRobotEntity;
import com.apitable.automation.model.AutomationRobotDto;
import com.apitable.automation.model.RobotTriggerDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Collection;
import java.util.List;
import org.apache.ibatis.annotations.Param;


public interface AutomationRobotMapper extends BaseMapper<AutomationRobotEntity> {

List<AutomationRobotDto> getRobotsByResourceId(@Param("resourceId") String resourceId);
List<AutomationRobotDto> selectRobotsByResourceIds(
@Param("resourceIds") Collection<String> resourceIds);

List<AutomationRobotEntity> selectByResourceIds(
@Param("resourceIds") Collection<String> resourceIds);

int insertList(@Param("entities") Collection<AutomationRobotEntity> entities);

void updateNameByResourceId(@Param("resourceId") String resourceId, @Param("name") String name);

void updateByRobotId(@Param("robotId") String robotId, @Param("name") String name,
@Param("description") String description, @Param("resourceId") String resourceId);

void updateIsDeletedByResourceIds(@Param("userId") Long userId,
@Param("resourceIds") List<String> resourceIds, @Param("isDeleted") Boolean isDeleted);

void removeByRobotIds(@Param("robotIds") List<String> robotIds);

List<RobotTriggerDto> getRobotTriggers(@Param("seqId") String seqId,
@Param("resourceId") String resourceId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
import com.apitable.automation.entity.AutomationTriggerEntity;
import com.apitable.automation.model.AutomationTriggerDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Collection;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface AutomationTriggerMapper extends BaseMapper<AutomationTriggerEntity> {

/**
* Get triggers.
*/
List<AutomationTriggerDto> getTriggers(@Param("seqId") String seqId,
@Param("robotResourceId") String robotResourceId);
List<AutomationTriggerDto> selectTriggersByRobotIds(
@Param("robotIds") Collection<String> robotIds);

List<AutomationTriggerEntity> selectByRobotIds(
@Param("robotIds") Collection<String> robotIds);

int insertList(@Param("entities") Collection<AutomationTriggerEntity> entities);

/**
* Update trigger.
Expand Down
Loading

0 comments on commit a1f76e8

Please sign in to comment.