Skip to content

Commit 8bb815c

Browse files
committed
initial commit
0 parents  commit 8bb815c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+29545
-0
lines changed

.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Iterable API Configuration
2+
ITERABLE_API_KEY=your-api-key-here
3+
ITERABLE_BASE_URL=https://api.iterable.com
4+
API_TIMEOUT=30000
5+
ITERABLE_DEBUG=false
6+
ITERABLE_DEBUG_VERBOSE=false
7+
8+
# Logging Configuration
9+
LOG_LEVEL=info
10+
LOG_JSON=false
11+
LOG_FILE=
12+
LOG_STDERR=true
13+
14+
# Node Environment
15+
NODE_ENV=development

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test (Node ${{ matrix.node-version }})
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18, 20, 22]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Setup Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: "pnpm"
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Run checks
35+
run: pnpm check
36+
37+
- name: Build
38+
run: pnpm build
39+
40+
- name: Run unit tests
41+
run: pnpm test:unit

.github/workflows/codeql.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze (${{ matrix.language }})
12+
# Runner size impacts CodeQL analysis time. To learn more, please see:
13+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
14+
# - https://gh.io/supported-runners-and-hardware-resources
15+
# - https://gh.io/using-larger-runners (GitHub.com only)
16+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
17+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
18+
permissions:
19+
# required for all workflows
20+
security-events: write
21+
22+
# required to fetch internal or private CodeQL packs
23+
packages: read
24+
25+
# only required for workflows in private repositories
26+
actions: read
27+
contents: read
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- language: actions
34+
build-mode: none
35+
- language: javascript-typescript
36+
build-mode: none
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v4
44+
with:
45+
languages: ${{ matrix.language }}
46+
build-mode: ${{ matrix.build-mode }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
51+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
52+
queries: security-extended,security-and-quality
53+
54+
# If the analyze step fails for one of the languages you are analyzing with
55+
# "We were unable to automatically build your code", modify the matrix above
56+
# to set the build mode to "manual" for that language. Then modify this step
57+
# to build your code.
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
60+
- name: Run manual build steps
61+
if: matrix.build-mode == 'manual'
62+
shell: bash
63+
run: |
64+
echo 'If you are using a "manual" build mode for one or more of the' \
65+
'languages you are analyzing, replace this with the commands to build' \
66+
'your code, for example:'
67+
echo ' make bootstrap'
68+
echo ' make release'
69+
exit 1
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v4
73+
with:
74+
category: "/language:${{matrix.language}}"

.github/workflows/publish.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version_type:
9+
description: "Version bump type"
10+
required: true
11+
default: "patch"
12+
type: choice
13+
options:
14+
- patch
15+
- minor
16+
- major
17+
18+
jobs:
19+
publish:
20+
name: Publish package
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
id-token: write # needed for OIDC token generation
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Setup pnpm
33+
uses: pnpm/action-setup@v4
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 22
39+
cache: "pnpm"
40+
41+
- name: Update npm for OIDC support
42+
run: npm install -g npm@latest # Needs 11.5.1+ for npm trusted publishing
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Run unit tests
48+
run: pnpm test:unit
49+
50+
- name: Build package
51+
run: pnpm build
52+
53+
- name: Configure git (for version bump)
54+
if: github.event_name == 'workflow_dispatch'
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "github-actions[bot]@users.noreply.github.com"
58+
59+
- name: Bump version and create tag
60+
if: github.event_name == 'workflow_dispatch'
61+
id: version
62+
run: |
63+
npm version ${{ github.event.inputs.version_type }}
64+
echo "new_version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
65+
git push --follow-tags
66+
67+
- name: Publish to npm
68+
run: npm publish --provenance
69+
70+
- name: Create GitHub release (manual trigger only)
71+
if: github.event_name == 'workflow_dispatch'
72+
run: |
73+
gh release create v${{ steps.version.outputs.new_version }} \
74+
--title "Release v${{ steps.version.outputs.new_version }}" \
75+
--generate-notes
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
*.tsbuildinfo
11+
12+
# Environment variables
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
# IDE files
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# OS files
27+
.DS_Store
28+
Thumbs.db
29+
30+
# Logs
31+
logs
32+
*.log
33+
34+
# Coverage directory used by tools like istanbul
35+
coverage/
36+
37+
# nyc test coverage
38+
.nyc_output
39+
40+
# ESLint cache
41+
.eslintcache
42+
43+
# TypeScript cache
44+
*.tsbuildinfo
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional REPL history
50+
.node_repl_history
51+
52+
# Output of 'npm pack'
53+
*.tgz
54+
55+
# Yarn Integrity file
56+
.yarn-integrity
57+
58+
# parcel-bundler cache (https://parceljs.org/)
59+
.cache
60+
.parcel-cache
61+
62+
# Temporary folders
63+
tmp/
64+
temp/
65+

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/*

.prettierignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
build/
7+
8+
# Coverage reports
9+
coverage/
10+
11+
# Logs
12+
*.log
13+
14+
# Environment files
15+
.env
16+
.env.local
17+
.env.*.local
18+
19+
# Package manager files
20+
package-lock.json
21+
pnpm-lock.yaml
22+
yarn.lock
23+
24+
# Config files that might have specific formatting
25+
*.config.js
26+
*.config.mjs
27+
*.config.ts
28+
29+
# Generated files
30+
*.d.ts

.prettierrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "lf",
11+
"quoteProps": "as-needed",
12+
"bracketSameLine": false,
13+
"proseWrap": "preserve"
14+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Greg Methvin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)