mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Remove uuid
This commit is contained in:
parent
0a9e5d859d
commit
7bdf9f578a
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -25,7 +25,6 @@
|
|||
"supports-color": "^8.1.1",
|
||||
"tslib": "^2.4.1",
|
||||
"undici": "^5.22.1",
|
||||
"uuid": "^8.3.2",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"bin": {
|
||||
|
|
@ -51,7 +50,6 @@
|
|||
"@types/react": "^17.0.45",
|
||||
"@types/react-native": "^0.67.7",
|
||||
"@types/read": "^0.0.29",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/yargs": "^17.0.14",
|
||||
"electron": "^21.3.1",
|
||||
"electron-builder": "^23.6.0",
|
||||
|
|
@ -632,12 +630,6 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/uuid": {
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",
|
||||
"integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/verror": {
|
||||
"version": "1.10.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.6.tgz",
|
||||
|
|
@ -5045,12 +5037,6 @@
|
|||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/uuid": {
|
||||
"version": "8.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz",
|
||||
"integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/verror": {
|
||||
"version": "1.10.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.6.tgz",
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
"supports-color": "^8.1.1",
|
||||
"tslib": "^2.4.1",
|
||||
"undici": "^5.22.1",
|
||||
"uuid": "^8.3.2",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -75,7 +74,6 @@
|
|||
"@types/react": "^17.0.45",
|
||||
"@types/react-native": "^0.67.7",
|
||||
"@types/read": "^0.0.29",
|
||||
"@types/uuid": "^8.3.4",
|
||||
"@types/yargs": "^17.0.14",
|
||||
"electron": "^21.3.1",
|
||||
"electron-builder": "^23.6.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { randomUUID } from 'node:crypto';
|
||||
import { fetch, Response } from 'undici';
|
||||
import { v4 as uuidgen } from 'uuid';
|
||||
import createDebug from '../util/debug.js';
|
||||
import { JwtPayload } from '../util/jwt.js';
|
||||
import { timeoutSignal } from '../util/misc.js';
|
||||
|
|
@ -185,7 +185,7 @@ export default class CoralApi implements CoralApiInterface {
|
|||
url: string, parameter = {},
|
||||
/** @internal */ _autoRenewToken = true
|
||||
) {
|
||||
const uuid = uuidgen();
|
||||
const uuid = randomUUID();
|
||||
|
||||
return this.fetch<T>(url, 'POST', JSON.stringify({
|
||||
parameter,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import process from 'node:process';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { fetch, Headers } from 'undici';
|
||||
import { v4 as uuidgen } from 'uuid';
|
||||
import { defineResponse, ErrorResponse } from './util.js';
|
||||
import createDebug from '../util/debug.js';
|
||||
import { timeoutSignal } from '../util/misc.js';
|
||||
|
|
@ -91,7 +91,7 @@ export type FlapgApiError = IminkFError;
|
|||
|
||||
export class ZncaApiFlapg extends ZncaApi {
|
||||
async genf(token: string, hash_method: HashMethod) {
|
||||
const request_id = uuidgen();
|
||||
const request_id = randomUUID();
|
||||
|
||||
const result = await flapg(hash_method, token, undefined, request_id, this.useragent);
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ export interface IminkFError {
|
|||
|
||||
export class ZncaApiImink extends ZncaApi {
|
||||
async genf(token: string, hash_method: HashMethod, user?: {na_id: string; coral_user_id?: string;}) {
|
||||
const request_id = uuidgen();
|
||||
const request_id = randomUUID();
|
||||
|
||||
const result = await iminkf(hash_method, token, undefined, request_id, user, this.useragent);
|
||||
|
||||
|
|
@ -271,7 +271,7 @@ export class ZncaApiNxapi extends ZncaApi {
|
|||
}
|
||||
|
||||
async genf(token: string, hash_method: HashMethod, user?: {na_id: string; coral_user_id?: string}) {
|
||||
const request_id = uuidgen();
|
||||
const request_id = randomUUID();
|
||||
|
||||
const result = await genf(this.url + '/f', hash_method, token, undefined, request_id,
|
||||
user, this.app, this.useragent);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { randomUUID } from 'node:crypto';
|
||||
import { Cookie, fetch, FormData, getSetCookies } from 'undici';
|
||||
import { v4 as uuidgen } from 'uuid';
|
||||
import { WebServiceToken } from './coral-types.js';
|
||||
import { NintendoAccountUser } from './na.js';
|
||||
import { defineResponse, ErrorResponse } from './util.js';
|
||||
|
|
@ -193,7 +193,7 @@ export default class SplatNet2Api {
|
|||
}
|
||||
|
||||
async shareProfile(stage: string, colour: ShareColour) {
|
||||
const boundary = uuidgen();
|
||||
const boundary = randomUUID();
|
||||
|
||||
const data = `--${boundary}
|
||||
Content-Disposition: form-data; name="stage"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import * as net from 'node:net';
|
||||
import * as os from 'node:os';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import * as persist from 'node-persist';
|
||||
import express, { Request, RequestHandler, Response } from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import { v4 as uuidgen } from 'uuid';
|
||||
import type { Arguments as ParentArguments } from '../nso.js';
|
||||
import CoralApi, { CoralApiInterface, CoralErrorResponse } from '../../api/coral.js';
|
||||
import { Announcement, CoralStatus, CurrentUser, Friend, FriendCodeUrl, FriendCodeUser, Presence } from '../../api/coral-types.js';
|
||||
|
|
@ -361,7 +361,8 @@ class Server extends HttpServer {
|
|||
}
|
||||
|
||||
async handleCreateTokenRequest({req, user}: RequestDataWithUser) {
|
||||
const token = uuidgen();
|
||||
const token = randomUUID();
|
||||
|
||||
const auth: AuthToken = {
|
||||
user: user.data.user.id,
|
||||
policy: req.body.policy,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user