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
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ jobs:

- name: Publish the package to NPM
if: steps.check.outputs.changed == 'true'
run: cd dim-api-types && npm publish --access public --provenance
run: |
cd dim-api-types
npm install -g npm@latest
npm publish --access public --provenance
11 changes: 9 additions & 2 deletions api/routes/import.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { uniqBy } from 'es-toolkit';
import { isEmpty } from 'es-toolkit/compat';
import asyncHandler from 'express-async-handler';
import { ExportResponse } from '../shapes/export.js';
Expand Down Expand Up @@ -101,12 +102,18 @@ export async function statelyImport(
bungieMembershipId,
);

// The export will have duplicates because import saved to each profile
// instead of the one that was exported.
itemHashTags = uniqBy(itemHashTags, (a) => a.hash);
searches = uniqBy(searches, (s) => s.search.query);

const items: AnyItem[] = [];
items.push(...importLoadouts(loadouts));
items.push(...importTags(itemAnnotations));
// TODO: I guess save item hash tags to each platform? I should really
// refactor the import shape to have hashtags per platform, or merge/unique
// them.
for (const platformMembershipId of platformMembershipIds) {
// TODO: I guess save them to each platform? I should really refactor the
// import shape to have hashtags per platform, or merge/unique them.
items.push(...importHashTags(platformMembershipId, itemHashTags));
}
if (Array.isArray(triumphs)) {
Expand Down
2 changes: 1 addition & 1 deletion dim-api-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"repository": {
"type": "git",
"url": "https://github.com/DestinyItemManager/dim-api.git"
"url": "git+https://github.com/DestinyItemManager/dim-api.git"
},
"author": "Ben Hollis",
"license": "MIT",
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"version": "1.0.0",
"description": "Destiny Item Manager API Server",
"main": "api/index.js",
"repository": "https://github.com/DestinyItemManager/dim-api",
"repository": {
"type": "git",
"url": "git+https://github.com/DestinyItemManager/dim-api.git"
},
"private": true,
"author": "Ben Hollis <ben@benhollis.net>",
"license": "MIT",
Expand Down Expand Up @@ -87,4 +90,4 @@
"vhost": "^3.0.2"
},
"packageManager": "pnpm@8.9.0+sha256.8f5264ad1d100da11a6add6bb8a94c6f1e913f9e9261b2a551fabefad2ec0fec"
}
}