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
8 changes: 5 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -43,6 +47,4 @@ jobs:

- name: Publish the package to NPM
if: steps.check.outputs.changed == 'true'
run: cd dim-api-types && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # NPM will automatically authenticate with this
run: cd dim-api-types && npm publish --access public --provenance
1 change: 1 addition & 0 deletions api/routes/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ async function statelyProfile(
extra: { syncToken: response.syncToken },
});
}
metrics.increment(response.sync ? `profile.response.sync` : `profile.response.full`, 1);
return response;
}

Expand Down
2 changes: 1 addition & 1 deletion api/stately/bulk-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async function exportDataForProfile(platformMembershipId: string): Promise<Expor
export async function getProfile(
platformMembershipId: string | bigint,
destinyVersion: DestinyVersion,
suffix?: string,
suffix: string,
): Promise<{ profile: ProfileResponse; token: ListToken }> {
const prefix = keyPath`/p-${BigInt(platformMembershipId)}/d-${destinyVersion}` + suffix;

Expand Down
25 changes: 25 additions & 0 deletions api/stately/generated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Schema Info

This is an auto-generated README file to help you understand your schema!

* SchemaID => `8030842688320564`
* Schema Version => `8`
* See schema on the [Stately Console](https://console.stately.cloud/1org/schemas/8030842688320564).

### Key Path Layout

| Group | Key Path | Item Type | primary | required | syncable | txn type |
|:------------------|:---------------------|:---------------|:--------|:---------|:---------|:---------|
| `/apps-*` | `/apps-*/app-*` | ApiApp | Yes | Yes | Yes | group |
| `/gs-*` | `/gs-*` | GlobalSettings | Yes | Yes | Yes | group |
| `/loadoutShare-*` | `/loadoutShare-*` | LoadoutShare | Yes | Yes | Yes | group |
| `/member-*` | `/member-*/settings` | Settings | Yes | Yes | Yes | group |
| `/p-*` | `/p-*/d-*/ia-*` | ItemAnnotation | Yes | Yes | Yes | group |
| `/p-*` | `/p-*/d-*/iht-*` | ItemHashTag | Yes | Yes | Yes | group |
| `/p-*` | `/p-*/d-*/loadout-*` | Loadout | Yes | Yes | Yes | group |
| `/p-*` | `/p-*/d-*/search-*` | Search | Yes | Yes | Yes | group |
| `/p-*` | `/p-*/d-*/triumph-*` | Triumph | Yes | Yes | Yes | group |

### TODO:

What else should we add here? Let us know!
4 changes: 2 additions & 2 deletions api/stately/loadouts-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ export function statConstraintsToStately(statConstraints: StatConstraint[] | und
statHash: c.statHash,
minTier: Math.max(0, Math.floor(c.minTier ?? 0)),
maxTier: Math.min(Math.ceil(c.maxTier ?? 10), 10),
minStat: Math.max(0, Math.floor(c.minStat ?? 0)),
maxStat: Math.min(Math.ceil(c.maxStat ?? 200), 200),
minStat: Math.max(0, Math.min(Math.floor(c.minStat ?? 0), 200)),
maxStat: Math.max(0, Math.min(Math.ceil(c.maxStat ?? 200), 200)),
}))
: [];
}
Expand Down
21 changes: 21 additions & 0 deletions dim-api-types/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Destiny Item Manager

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions dim-api-types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DIM API Types

This package contains TypeScript types plus some defaults and enums that are useful when using the DIM API. Every request and response type is included, along with sensible defaults for Settings and LoadoutParameters.
13 changes: 10 additions & 3 deletions dim-api-types/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"name": "@destinyitemmanager/dim-api-types",
"version": "1.38.0",
"version": "1.39.0",
"description": "TypeScript types for the DIM API",
"main": "./index.cjs",
"types": "./index.d.ts",
"module": "./index.js",
"type": "module",
"sideEffects": false,
"scripts": {},
"files": [
"index.cjs",
"index.d.ts",
"index.js",
"README.md",
"LICENSE.md",
"package.json"
],
"repository": {
"type": "git",
"url": "https://github.com/DestinyItemManager/dim-api.git"
Expand All @@ -29,4 +36,4 @@
"typescript": "^4.1.3"
},
"dependencies": {}
}
}
4 changes: 0 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default {
],

output: [
{
file: 'dim-api-types/' + pkg.main,
format: 'cjs',
},
{
file: 'dim-api-types/' + pkg.module,
format: 'es',
Expand Down