Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-audi committed Oct 10, 2021
2 parents 6442990 + 4c9a48c commit c48f318
Show file tree
Hide file tree
Showing 88 changed files with 1,133 additions and 648 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '2.2.3'
flutter-version: '2.5.0'

- name: Android Config
env:
Expand Down Expand Up @@ -89,14 +89,22 @@ jobs:
pod install --project-directory=ios/
- name: Build App Bundle (Android)
run: flutter build appbundle --build-number=42$GITHUB_RUN_NUMBER
run: |
flutter build appbundle --build-number=42$GITHUB_RUN_NUMBER
flutter build apk --split-per-abi --build-number=42$GITHUB_RUN_NUMBER
- name: Build IPA (IOS)
run: flutter build ipa --build-number=42$GITHUB_RUN_NUMBER
env:
CONNECT_USERNAME: ${{ secrets.CONNECT_USERNAME }}
CONNECT_PASSWORD: ${{ secrets.CONNECT_PASSWORD }}
run: |
flutter build ipa --build-number=42$GITHUB_RUN_NUMBER
xcodebuild -exportArchive -exportOptionsPlist ios/exportOptionsUpload.plist -archivePath build/ios/archive/Runner.xcarchive -exportPath build/ios/release/
xcrun altool --validate-app -t ios -f build/ios/release/app.ipa -u "$CONNECT_USERNAME" -p "$CONNECT_PASSWORD"
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/bundle/release/*.aab,build/ios/release/app.ipa"
artifacts: "build/app/outputs/bundle/release/*.aab,build/ios/release/app.ipa,build/app/outputs/apk/release/app-armeabi-v7a-release.apk,build/app/outputs/apk/release/app-arm64-v8a-release.apk,build/app/outputs/apk/release/app-x86_64-release.apk"
replacesArtifacts: false
token: ${{ secrets.GH_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '2.2.3'
flutter-version: '2.5.0'

- name: Android Config
env:
Expand Down Expand Up @@ -110,6 +110,7 @@ jobs:
packageName: com.mytiki.app
releaseFiles: build/app/outputs/bundle/release/app-release.aab
track: internal
status: completed

sentry_release:
name: Sentry Release
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.21'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
226 changes: 0 additions & 226 deletions ios/Podfile.lock

This file was deleted.

5 changes: 2 additions & 3 deletions lib/src/config/config_domain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ class ConfigDomain {
ConfigEnvironment.isLocal ? "localhost:10252" : "blockchain.mytiki.com";
static const String signup =
ConfigEnvironment.isLocal ? "localhost:3000" : "signup.mytiki.com";
static const String companyIndex = ConfigEnvironment.isLocal
? "localhost:10224"
: "company-index.mytiki.com";
static const String knowledge =
ConfigEnvironment.isLocal ? "localhost:10544" : "knowledge.mytiki.com";

static Uri asUri(String authority, String path,
[Map<String, dynamic>? query]) {
Expand Down
13 changes: 9 additions & 4 deletions lib/src/slices/api_app_data/api_app_data_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ class ApiAppDataService {
if (data != null) await _repository.delete(data.id!);
}

Future<void> logout() async {
Future<void> deleteUserData() async {
List<ApiAppDataKey> keysToDelete = [
ApiAppDataKey.userReferCode,
ApiAppDataKey.emailIndexLabel,
ApiAppDataKey.emailIndexEpoch,
ApiAppDataKey.emailIndexPage,
ApiAppDataKey.testCardsDone,
ApiAppDataKey.decisionOverlayShown,
];
keysToDelete.forEach((key) async {
await _repository.deleteByKey(key.value!);
});
}

Future<void> deleteAllData() async {
ApiAppDataKey.values.forEach((key) async {
await _repository.deleteByKey(key.value!);
});
}
}
23 changes: 13 additions & 10 deletions lib/src/slices/api_company/api_company_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,29 @@ import 'package:sqflite_sqlcipher/sqlite_api.dart';
import '../../utils/api/helper_api_auth.dart';
import '../../utils/api/helper_api_rsp.dart';
import '../../utils/api/helper_api_utils.dart';
import '../api_company/repository/api_company_repository_index.dart';
import '../api_company/repository/api_company_repository_local.dart';
import 'model/api_company_model_index.dart';
import '../api_knowledge/api_knowledge_service.dart';
import '../api_knowledge/model/company/api_knowledge_model_company.dart';
import 'model/api_company_model_local.dart';

class ApiCompanyService {
final HelperApiAuth helperApiAuth;
final ApiCompanyRepositoryLocal _repositoryLocal;
final ApiKnowledgeService _apiKnowledgeService;

ApiCompanyService({required Database database, required this.helperApiAuth})
: this._repositoryLocal = ApiCompanyRepositoryLocal(database);
ApiCompanyService(
{required Database database,
required this.helperApiAuth,
required ApiKnowledgeService apiKnowledgeService})
: this._repositoryLocal = ApiCompanyRepositoryLocal(database),
this._apiKnowledgeService = apiKnowledgeService;

Future<ApiCompanyModelLocal?> upsert(String domain) async {
if (domain.isNotEmpty) {
ApiCompanyModelLocal? local = await _repositoryLocal.getByDomain(domain);
if (local == null) {
HelperApiRsp<ApiCompanyModelIndex> indexRsp = await fetch(domain);
HelperApiRsp<ApiKnowledgeModelCompany> indexRsp =
await _apiKnowledgeService.getCompany(domain);
if (HelperApiUtils.is2xx(indexRsp.code))
return _repositoryLocal.insert(ApiCompanyModelLocal(
domain: domain,
Expand All @@ -37,7 +43,8 @@ class ApiCompanyService {
local.securityScore == null ||
local.modified!
.isBefore(DateTime.now().subtract(Duration(days: 30)))) {
HelperApiRsp<ApiCompanyModelIndex> indexRsp = await fetch(domain);
HelperApiRsp<ApiKnowledgeModelCompany> indexRsp =
await _apiKnowledgeService.getCompany(domain);
if (HelperApiUtils.is2xx(indexRsp.code))
return _repositoryLocal.update(ApiCompanyModelLocal(
companyId: local.companyId,
Expand All @@ -58,8 +65,4 @@ class ApiCompanyService {
var company = await _repositoryLocal.getById(companyId);
return company;
}

Future<HelperApiRsp<ApiCompanyModelIndex>> fetch(String domain) async =>
await helperApiAuth.proxy(
() => ApiCompanyRepositoryIndex.find(helperApiAuth.bearer, domain));
}
Loading

0 comments on commit c48f318

Please sign in to comment.