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
process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED = "1"; | |
import { Entity, ElectroEventListener, Service, createWriteTransaction, createGetTransaction } from 'electrodb'; | |
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | |
const table = "electro"; | |
const configuration = { | |
endpoint: "http://localhost:8000", | |
region: "us-east-1", | |
}; |
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
{ | |
"name": "electro-test-2023-04-08", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "ts-node src/index.ts" | |
}, | |
"keywords": [], |
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 { DynamoDBClient as V3, ListTablesCommand, DeleteTableCommand, CreateTableCommand } from '@aws-sdk/client-dynamodb'; | |
import { Entity, QueryResponse, EntityItem } from 'electrodb'; | |
import { v4 as uuid } from 'uuid'; | |
const client = new V3({ | |
endpoint: 'http://localhost:8000', | |
region: 'us-east-1', | |
}); | |
const table = "pagination_test"; |
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 { Kinesis } from 'aws-sdk'; | |
import { Command } from 'commander'; | |
import { decodeMessage } from '@jupiterone/platform-sdk-message-codec'; | |
const kinesis = new Kinesis({ | |
apiVersion: '2013-12-02', | |
region: 'us-east-1' | |
}); | |
const noop = () => {}; |
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 { z } from 'zod'; | |
import { Entity, CustomAttributeType } from 'electrodb'; | |
import { v4 as uuid } from 'uuid'; | |
import { DocumentClient } from "aws-sdk/clients/dynamodb"; | |
const client = new DocumentClient(); | |
const table = 'my_table'; | |
const zUserDetail = z.object({ | |
firstName: z.string().min(1).max(18), |
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
const DynamoDB = require("aws-sdk/clients/dynamodb"); | |
const client = new DynamoDB.DocumentClient({ | |
region: "us-east-1", | |
endpoint: "http://localhost:8000" | |
}); | |
/** | |
* withNumbers demonstrates the update of a "composite" gsi sortkey without knowledge of the current | |
* composite value at the time of update. This works runs without error and operates as expected. | |
*/ |
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
/** | |
* The aim of this exercise is ultimately to inspire communication and be starting place to drive discussion | |
* on methodology, general approach, and universal best practices. To frame how best to think about this code is | |
* that it represents a happy path POC, and your task is to use your personal experience to identify and discuss | |
* improvements, recommendations and potental changes that you'd recommend to get this service production ready. | |
* | |
* Please examine this document, familize yourself, come up with any questions you have and ultimately lets meet | |
* and discuss your thoughts. You don't need to write any code in the meantime. | |
* | |
* Note: |
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
/** | |
* The aim of this exercise is ultimately to inspire communication and be starting place to drive discussion | |
* on methodology, general approach, and universal best practices. To frame how best to think about this code is | |
* that it represents a happy path POC, and your task is to use your personal experience to identify and discuss | |
* improvements, recommendations and potental changes that you'd recommend to get this service production ready. | |
* | |
* Please examine this document, familize yourself, come up with any questions you have and ultimately lets meet | |
* and discuss your thoughts. You don't need to write any code in the meantime. | |
* | |
* Note: |
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
// Modeling the example posed by Ashwin Bhat in ElectroDB | |
// https://medium.com/developing-koan/modeling-graph-relationships-in-dynamodb-c06141612a70 | |
const {Entity, Service} = require("electrodb"); | |
const Roles = { | |
"lead": "500", | |
"contributor": "400", | |
"team": "300", | |
} |
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
/********************************************** | |
* Zuul IoT Delegation Manager - ZUULJS.COM | |
* Example Code | |
* | |
* Tyler W. Walch | |
* TINKERTAMPER.COM [2017] | |
***********************************************/ | |
/* CONFIGURE SHARED VARIABLES. | |
* Shared light status variable allows for all functions to react |
NewerOlder