This file contains hidden or 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
    
  
  
    
  | echo '{"itemRecord":{"value":[{"longValue":"12345"},{"stringValue":{"number":"false","$t":"this is a string value"}},{"moneyValue":{"number":"true","currencyId":"USD","text":"123.45","$t":"104.95"}},{"moneyValue":{"currencyId":"USD","$t":"104.95"}},{"longValue":"0","bool":{"id":"0","$t":"true"}},{"longValue":"0"},{"dateValue":"2012-02-16T17:03:33.000-07:00"},{"stringValue":"SmDZ8RlMIjDvlEW3KUibzj2Q"},{"text":"42.42"}]}}' | curl \ | |
| --request POST \ | |
| --header "Content-Type: application/json" \ | |
| --data @- \ | |
| http://localhost:3001/2015-03-31/functions/SampleFunction/invocations | 
  
    
      This file contains hidden or 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
    
  
  
    
  | AWSTemplateFormatVersion : '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: A sample AWS Lambda Function | |
| Resources: | |
| SampleFunction: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| Handler: dist/index.handler | |
| Runtime: nodejs8.10 | |
| CodeUri: ./ | 
  
    
      This file contains hidden or 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
    
  
  
    
  | version: '3.6' | |
| services: | |
| sam_app: | |
| build: . | |
| command: ["$PWD"] | |
| ports: | |
| - "3001:3001" | |
| volumes: | |
| - .:/app | |
| - /var/run/docker.sock:/var/run/docker.sock | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #!/bin/bash | |
| set -o errexit | |
| BASEDIR="$1" | |
| /usr/local/bin/sam local start-lambda \ | |
| --template dist/template.yaml \ | |
| --host 0.0.0.0 \ | |
| --docker-volume-basedir "${BASEDIR}" \ | |
| --docker-network monsoon-samples_default \ | |
| --skip-pull-image | 
  
    
      This file contains hidden or 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
    
  
  
    
  | FROM python:alpine | |
| RUN apk update && \ | |
| apk upgrade && \ | |
| apk add bash && \ | |
| apk add --no-cache --virtual build-deps build-base gcc && \ | |
| pip install aws-sam-cli && \ | |
| apk del build-deps | |
| RUN mkdir /app | |
| WORKDIR /app | |
| EXPOSE 3001 | 
  
    
      This file contains hidden or 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
    
  
  
    
  | version: '3.6' | |
| services: | |
| lambda_npm_app: | |
| image: lambci/lambda:build-nodejs8.10 | |
| volumes: | |
| - .:/var/task | 
  
    
      This file contains hidden or 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
    
  
  
    
  | { | |
| "private": true, | |
| "description": "Dockerized SAM", | |
| "main": "index.js", | |
| "scripts": { | |
| "tsc": "tsc" | |
| }, | |
| "dependencies": { | |
| "xml2json": "^0.11.2" | |
| }, | 
  
    
      This file contains hidden or 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 * as xml2json from 'xml2json'; | |
| import { Callback, Context, Handler } from 'aws-lambda'; | |
| const handler: Handler = (event: any, context: Context, callback: Callback): void => { | |
| console.log("received event: %j", event); | |
| const xml = xml2json.toXml(event); | |
| callback(null, xml); | |
| }; | |
| export { handler } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | DROP TABLE price_history_events CASCADE; | |
| CREATE TABLE price_history_events ( | |
| id SERIAL PRIMARY KEY, | |
| tenant_id INTEGER, | |
| product_id INTEGER, | |
| price MONEY, | |
| created_date DATE DEFAULT NOW(), | |
| created_at TIMESTAMPTZ DEFAULT NOW() | |
| ); | 
  
    
      This file contains hidden or 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
    
  
  
    
  | CREATE OR REPLACE FUNCTION hstore_merge(left HSTORE, right HSTORE) RETURNS HSTORE AS $$ | |
| SELECT $1 || $2; | |
| $$ LANGUAGE SQL; | |
| CREATE AGGREGATE hstore_merge (HSTORE) ( | |
| SFUNC = hstore_merge, | |
| STYPE = HSTORE, | |
| INITCOND = '' | |
| ); | 
NewerOlder