diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b7926e4..c7fb75e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/api/routes/import.ts b/api/routes/import.ts index ecfb26d..92cd0f0 100644 --- a/api/routes/import.ts +++ b/api/routes/import.ts @@ -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'; @@ -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)) { diff --git a/dim-api-types/package.json b/dim-api-types/package.json index 60f1847..afd7f69 100644 --- a/dim-api-types/package.json +++ b/dim-api-types/package.json @@ -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", diff --git a/package.json b/package.json index 8d9ca2d..8e11535 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "MIT", @@ -87,4 +90,4 @@ "vhost": "^3.0.2" }, "packageManager": "pnpm@8.9.0+sha256.8f5264ad1d100da11a6add6bb8a94c6f1e913f9e9261b2a551fabefad2ec0fec" -} \ No newline at end of file +}