Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ PGUSER=postgres
PGPASSWORD=postgres
PGSSL=false
JWT_SECRET=dummysecret
VHOST=api.destinyitemmanager.com
STATELY_STORE_ID=4691621389625154
STATELY_REGION=us-west-2
VHOST=api.destinyitemmanager.com
STATELY_ACCESS_KEY="CAISRzBFAiEAhBwlEIYOXbLFzWyqZsTn3iLbyBUCjOVL8HzaAwDz6WkCIBf1QSVzt5VLV0VckmSsv2D3OHvnzHnctfTDDPifUOsDGgkI0sHq9_DVqAM"
VHOST=api.destinyitemmanager.com
3 changes: 0 additions & 3 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ jobs:

- name: Test
run: pnpm test
env:
STATELY_STORE_ID: ${{ vars.STATELY_STORE_ID}}
STATELY_ACCESS_KEY: ${{ secrets.STATELY_ACCESS_KEY }}
9 changes: 0 additions & 9 deletions api/db/apps-queries.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ClientBase, QueryResult } from 'pg';
import { ApiApp } from '../shapes/app.js';
import { camelize, KeysToSnakeCase, TypesForKeys } from '../utils.js';
import { transaction } from './index.js';

/**
* Get all registered apps.
Expand All @@ -16,14 +15,6 @@ export async function getAllApps(client: ClientBase): Promise<ApiApp[]> {

// TODO: Add a last modified column to apps and use that for more efficient syncing. This will require us to be able to disable apps rather than deleting them. And we need an index on that column.

export async function addAllApps(apps: ApiApp[]): Promise<void> {
await transaction(async (client) => {
for (const app of apps) {
await insertApp(client, app);
}
});
}

/**
* Get an app by its ID.
*/
Expand Down
37 changes: 0 additions & 37 deletions api/db/loadout-share-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,43 +62,6 @@ values ($1, $2, $3, $4, $5, $6, $7, $8, $9)`,
return response;
}

/**
* Insert a loadout share, but ignore if the share ID already exists. This is
* used for backfilling from Stately where we don't want to overwrite existing
* shares, but we also don't want to fail the whole batch if there's a
* duplicate.
*/
export async function addLoadoutShareIgnoring(
client: ClientBase,
bungieMembershipId: number | undefined,
platformMembershipId: string,
shareId: string,
loadout: Loadout,
viewCount = 0,
): Promise<boolean> {
const response = await client.query({
name: 'add_loadout_share_ignoring',
text: `insert into loadout_shares (id, membership_id, platform_membership_id, name, notes, class_type, items, parameters, view_count)
values ($1, $2, $3, $4, $5, $6, $7, $8, $9) on conflict (id) do nothing`,
values: [
shareId,
bungieMembershipId,
platformMembershipId,
loadout.name,
loadout.notes,
loadout.classType,
{
equipped: loadout.equipped.map(cleanItem),
unequipped: loadout.unequipped.map(cleanItem),
},
loadout.parameters,
viewCount,
],
});

return (response.rowCount ?? 0) > 1;
}

/**
* Touch the last_accessed_at and visits fields to keep track of access. This returns the loadout, if it exists.
*/
Expand Down
Loading
Loading