This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.codetheworld.tinycrm | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.telephony.TelephonyManager | |
import android.util.Log | |
import okhttp3.MediaType.Companion.toMediaTypeOrNull | |
import okhttp3.RequestBody.Companion.toRequestBody | |
import org.json.JSONObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="io.codetheworld.tinycrm"> | |
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | |
<uses-permission android:name="android.permission.READ_CALL_LOG" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application | |
android:allowBackup="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/application.ts b/src/application.ts | |
index e9b2e72..4eb841f 100644 | |
--- a/src/application.ts | |
+++ b/src/application.ts | |
@@ -1,4 +1,7 @@ | |
-import express, { Application as ExApplication } from 'express'; | |
+import express, { Application as ExApplication, Handler } from 'express'; | |
+import { controllers } from './controllers'; | |
+import { MetadataKeys } from './utils/metadata.keys'; | |
+import { IRouter } from './utils/decorators/handlers.decorator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Handler, Request } from 'express'; | |
import { CognitoIdentityServiceProvider } from 'aws-sdk'; | |
const identityServiceProvider = new CognitoIdentityServiceProvider({ | |
region: process.env.REGION || 'ap-northeast-1', | |
}); | |
export interface IUser { | |
id: string; | |
email: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import cognitoUserPoolHelper from './cognito.user.pool.helper'; | |
interface IUserController { | |
signUp: express.Handler, | |
signIn: express.Handler, | |
confirmSignUp: express.Handler, | |
getProfile: express.Handler, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'cross-fetch/polyfill'; | |
import { AuthenticationDetails, CognitoUser, CognitoUserAttribute, CognitoUserPool } from 'amazon-cognito-identity-js'; | |
export interface IUserToken { | |
accessToken: string; | |
refreshToken: string; | |
} | |
class CognitoUserPoolHelper { | |
public userPool: CognitoUserPool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mocked } from 'ts-jest/utils'; | |
import { Handler } from 'aws-lambda'; | |
import { middyfy } from '@libs/lambda'; | |
jest.mock('@libs/lambda'); | |
describe('hello', () => { | |
let main; | |
let mockedMiddyfy: jest.MockedFunction<typeof middyfy>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import middy from '@middy/core'; | |
import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda'; | |
import { formatJSONResponse } from './apiGateway'; | |
import { AppError } from './appError'; | |
import MiddlewareFunction = middy.MiddlewareFunction; | |
export const apiGatewayResponseMiddleware = (options: { enableErrorLogger?: boolean } = {}) => { | |
const after: MiddlewareFunction<APIGatewayProxyEvent, any> = async (request) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IProduct } from '../interfaces'; | |
import BasePO from './base.po'; | |
class CartPO extends BasePO { | |
private readonly $cartItem = '.cart_item'; | |
private readonly $cart = { | |
$name: '.inventory_item_name', | |
$price: '.inventory_item_price', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { IProduct } from '../interfaces'; | |
import BasePO from './base.po'; | |
class InventoryPO extends BasePO { | |
private readonly $productItem = '.inventory_item'; | |
private readonly $addCart = '.btn_inventory'; | |
private readonly $cartCount = '.shopping_cart_badge'; | |
private readonly $product = { | |
$name: '.inventory_item_name', | |
$price: '.inventory_item_price', |