Move utility functions

This avoids importing most dependencies when not used.
This commit is contained in:
Samuel Elliott
2022-05-21 23:52:36 +01:00
parent 5f6004bd57
commit 967a063220
82 changed files with 458 additions and 398 deletions

View File

@@ -1,7 +1,7 @@
import fetch from 'node-fetch';
import createDebug from 'debug';
import { ErrorResponse } from './util.js';
import { version } from '../util.js';
import { version } from '../util/product.js';
const debugS2s = createDebug('nxapi:api:s2s');
const debugFlapg = createDebug('nxapi:api:flapg');

View File

@@ -1,7 +1,7 @@
import fetch from 'node-fetch';
import createDebug from 'debug';
import { ErrorResponse } from './util.js';
import { JwtPayload } from '../util.js';
import { JwtPayload } from '../util/jwt.js';
const debug = createDebug('nxapi:api:na');

View File

@@ -3,7 +3,7 @@ import createDebug from 'debug';
import { ActiveEvent, Announcements, CurrentUser, Event, Friend, Presence, PresencePermissions, User, WebService, WebServiceToken, ZncStatus, ZncSuccessResponse } from './znc-types.js';
import { ErrorResponse } from './util.js';
import ZncApi from './znc.js';
import { version } from '../util.js';
import { version } from '../util/product.js';
import { NintendoAccountUser } from './na.js';
import { SavedToken } from '../common/auth/nso.js';

View File

@@ -5,7 +5,7 @@ import { flapg, FlapgIid, genfc } from './f.js';
import { AccountLogin, AccountToken, Announcements, CurrentUser, CurrentUserPermissions, Event, Friends, GetActiveEventResult, PresencePermissions, User, WebServices, WebServiceToken, ZncResponse, ZncStatus } from './znc-types.js';
import { getNintendoAccountToken, getNintendoAccountUser, NintendoAccountUser } from './na.js';
import { ErrorResponse } from './util.js';
import { JwtPayload } from '../util.js';
import { JwtPayload } from '../util/jwt.js';
const debug = createDebug('nxapi:api:znc');