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 node:22-alpine AS base # <- We use alpine! | |
| FROM node:22-bookworm-slim | |
| ENV PNPM_HOME="/pnpm" | |
| ENV PATH="$PNPM_HOME:$PATH" | |
| RUN corepack enable | |
| COPY . /app | |
| WORKDIR /app |
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
| /** | |
| * To run this file: | |
| * - Install bun.js | |
| * - Run `bun gen_volunteers.js` | |
| */ | |
| import { randomUUID } from "node:crypto"; | |
| import { faker } from "@faker-js/faker"; | |
| const sectors = [ | |
| "healthcare", |
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
| { | |
| "trackedEntities": [ | |
| { | |
| "enrollments": [ | |
| { | |
| "attributes": [ | |
| { | |
| "attribute": "zDhUuAYrxNC", | |
| "displayName": "Last name", | |
| "value": "Kelly" |
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
| { | |
| "_id": "b33dbbc9-fb80-4477-984f-e5f8b552d4cb", | |
| "_rev": "1-1996c70d1124e60ff781da6d0a17ddcc", | |
| "form": "almanach_somaliav3", | |
| "type": "data_record", | |
| "content_type": "xml", | |
| "reported_date": 1731058479142, | |
| "contact": { | |
| "_id": "94ed12a8-8052-4bff-b5d7-cf6c00d337f8", | |
| "parent": { |
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
| // Parse CSV from string | |
| joe,you_wish | |
| // CSV parse can parse items as an array or object, subject to options | |
| // String -> JSON | |
| http.get('data.csv', (state) => { ..state, csvString: state.data }) | |
| parseCSV(state.csvString, { /* options */ }) // pass data as string (write an array of items to state.data) | |
| each(state.data, (state) => { |
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
| combine( | |
| // Step 1: find the user id for a given user name | |
| get( | |
| `https://api.twitter.com/2/users/by/username/${state.configuration.user_name}`, | |
| { | |
| headers: { | |
| 'Authorization': `Bearer ${state.configuration.key}`, | |
| }, | |
| }, | |
| state => { |