update publish script

This commit is contained in:
Blake Joynes
2024-06-09 16:54:18 -04:00
parent 8df7fe2f2a
commit 1bf4063121
6 changed files with 18 additions and 94 deletions

View File

@@ -5,16 +5,16 @@ name: Node.js Package
on: on:
release: release:
types: [created] types: [published]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: '20.x'
- run: npm ci - run: npm ci
- run: npm test - run: npm test
@@ -22,13 +22,13 @@ jobs:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: '20.x'
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
- run: npm ci - run: npm ci
- run: npm run compile - run: npm run compile
- run: npm publish - run: npm publish --provenance --access public
env: env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

74
package-lock.json generated
View File

@@ -9,8 +9,7 @@
"version": "2.0.0", "version": "2.0.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0"
"query-string": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.4.0", "@eslint/js": "^9.4.0",
@@ -626,14 +625,6 @@
} }
} }
}, },
"node_modules/decode-uri-component": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz",
"integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==",
"engines": {
"node": ">=14.16"
}
},
"node_modules/deep-is": { "node_modules/deep-is": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
@@ -1007,17 +998,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/filter-obj": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz",
"integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==",
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/find-up": { "node_modules/find-up": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
@@ -1587,22 +1567,6 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/query-string": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-9.0.0.tgz",
"integrity": "sha512-4EWwcRGsO2H+yzq6ddHcVqkCQ2EFUSfDMEjF8ryp8ReymyZhIuaFRGLomeOQLkrzacMHoyky2HW0Qe30UbzkKw==",
"dependencies": {
"decode-uri-component": "^0.4.1",
"filter-obj": "^5.1.0",
"split-on-first": "^3.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/queue-microtask": { "node_modules/queue-microtask": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -1727,17 +1691,6 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/split-on-first": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz",
"integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/strip-ansi": { "node_modules/strip-ansi": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -2600,11 +2553,6 @@
"ms": "2.1.2" "ms": "2.1.2"
} }
}, },
"decode-uri-component": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz",
"integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ=="
},
"deep-is": { "deep-is": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
@@ -2874,11 +2822,6 @@
"to-regex-range": "^5.0.1" "to-regex-range": "^5.0.1"
} }
}, },
"filter-obj": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz",
"integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng=="
},
"find-up": { "find-up": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
@@ -3294,16 +3237,6 @@
"dev": true, "dev": true,
"peer": true "peer": true
}, },
"query-string": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-9.0.0.tgz",
"integrity": "sha512-4EWwcRGsO2H+yzq6ddHcVqkCQ2EFUSfDMEjF8ryp8ReymyZhIuaFRGLomeOQLkrzacMHoyky2HW0Qe30UbzkKw==",
"requires": {
"decode-uri-component": "^0.4.1",
"filter-obj": "^5.1.0",
"split-on-first": "^3.0.0"
}
},
"queue-microtask": { "queue-microtask": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -3371,11 +3304,6 @@
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true "dev": true
}, },
"split-on-first": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz",
"integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA=="
},
"strip-ansi": { "strip-ansi": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",

View File

@@ -44,8 +44,7 @@
"typescript-eslint": "^7.12.0" "typescript-eslint": "^7.12.0"
}, },
"dependencies": { "dependencies": {
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0"
"query-string": "^9.0.0"
}, },
"husky": { "husky": {
"hooks": { "hooks": {

View File

@@ -10,11 +10,11 @@ import {
PersonDetails, PersonDetails,
PersonMovieCredit, PersonMovieCredit,
PersonTvShowCredit, PersonTvShowCredit,
PopularPersons,
TaggedImages, TaggedImages,
Changes, Changes,
PersonChangeValue, PersonChangeValue,
LanguageOption, LanguageOption,
PopularPeople,
} from '../types'; } from '../types';
import { BaseEndpoint } from './base'; import { BaseEndpoint } from './base';
@@ -110,12 +110,7 @@ export class PeopleEndpoint extends BaseEndpoint {
return await this.api.get<PersonDetails>(`${BASE_PERSON}/latest`); return await this.api.get<PersonDetails>(`${BASE_PERSON}/latest`);
} }
async popular( async popular(options?: LanguageOption & PageOption): Promise<PopularPeople> {
options?: LanguageOption & PageOption return await this.api.get<PopularPeople>(`${BASE_PERSON}/popular`, options);
): Promise<PopularPersons> {
return await this.api.get<PopularPersons>(
`${BASE_PERSON}/popular`,
options
);
} }
} }

View File

@@ -1,3 +1,5 @@
import { CountryCode } from '../types';
export interface Gravatar { export interface Gravatar {
hash: string; hash: string;
} }
@@ -10,7 +12,7 @@ export interface AccountDetails {
avatar: Avatar; avatar: Avatar;
id: number; id: number;
include_adult: boolean; include_adult: boolean;
iso_3166_1: string; iso_3166_1: CountryCode;
iso_639_1: string; iso_639_1: string;
name: string; name: string;
username: string; username: string;

View File

@@ -104,7 +104,7 @@ export type PersonChangeValue =
}; };
}; };
export interface PopularPersons { export interface PopularPeople {
page: number; page: number;
results: Person[]; results: Person[];
total_results: number; total_results: number;