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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm install -g npm
- run: npm install
- run: npm run lint --workspaces --if-present
- run: npm run lint --workspaces --if-present -- --max-warnings=0
1 change: 1 addition & 0 deletions docs/generated/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Agent-JS Changelog</h1>
<section>
<h2>Version x.x.x</h2>
<ul>
<li>chore: cleaning up lint warnings</li>
<li>chore: cleans up github actions linting warnings</li>
<li>feat: replaces `secp256k1` npm package with `@noble/curves`</li>
<li>feat: enhances `.from` methods on public key classes to support unknown types, including PublicKey instances, ArrayBuffer-like objects, DER encoded public keys, and hex strings. Also introduces a new `bufFromBufLike` util</li>
Expand Down
4 changes: 2 additions & 2 deletions e2e/browser/cypress/utils/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export { idlFactory } from '../../src/declarations/whoami/whoami.did.js';
/**
*
* @param {string | import("@dfinity/principal").Principal} canisterId Canister ID of Agent
* @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options]
* @return {import("@dfinity/agent").ActorSubclass<import("./whoami.did.js")._SERVICE>}
* @param {{agentOptions?: import("@dfinity/agent").HttpAgentOptions; actorOptions?: import("@dfinity/agent").ActorConfig}} [options] - Options for creating the actor
* @returns {import("@dfinity/agent").ActorSubclass<import("./whoami.did.js")._SERVICE>} - Actor
*/
export const createActor = (canisterId, options) => {
const agent = new HttpAgent({ ...options?.agentOptions });
Expand Down
2 changes: 2 additions & 0 deletions e2e/node/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.d.ts
**/*.js
5 changes: 3 additions & 2 deletions packages/agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ export * from './utils/bls';
export * from './utils/buffer';
export * from './utils/random';
export * as polling from './polling';
import * as CanisterStatus from './canisterStatus';
export * as CanisterStatus from './canisterStatus';
/**
* The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths.
*
* You can request a canisters Controllers, ModuleHash, Candid interface, Subnet, or Time, or provide a custom path {@link CanisterStatus.CustomPath} and pass arbitrary buffers for valid paths identified in https://internetcomputer.org/docs/current/references/ic-interface-spec.
*
* The primary method for this namespace is {@link CanisterStatus.request}
*/
export * as CanisterStatus from './canisterStatus';

import { Agent, HttpAgent } from './agent';
import { IDL } from '@dfinity/candid';
Expand All @@ -37,7 +38,7 @@ export interface GlobalInternetComputer {
/**
* Simple advertisement of features in whoever is managing this `globalThis.ic`.
* Use Case
* * Scripts that know they need an ic feature can detect using this and, if not present
* - Scripts that know they need an ic feature can detect using this and, if not present
* (e.g. old bootstrap version), they can dynamically include their own and continue
* operating (e.g. polyfill).
* This is useful when adding features to bootstrap. You can still deploy your canister to
Expand Down
3 changes: 1 addition & 2 deletions packages/auth-client/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export type DBCreateOptions = {
*/
export class IdbKeyVal {
/**
*
* @param {DBCreateOptions} options {@link DbCreateOptions}
* @param {DBCreateOptions} options - DBCreateOptions
* @param {DBCreateOptions['dbName']} options.dbName name for the indexeddb database
* @default
* @param {DBCreateOptions['storeName']} options.storeName name for the indexeddb Data Store
Expand Down
6 changes: 3 additions & 3 deletions packages/auth-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ type AuthResponse = AuthResponseSuccess | AuthResponseFailure;
export class AuthClient {
/**
* Create an AuthClient to manage authentication and identity
* @constructs {@link AuthClient}
* @param {AuthClientCreateOptions} options
* @constructs
* @param {AuthClientCreateOptions} options - Options for creating an {@link AuthClient}
* @see {@link AuthClientCreateOptions}
* @param options.identity Optional Identity to use as the base
* @see {@link SignIdentity}
Expand Down Expand Up @@ -418,7 +418,7 @@ export class AuthClient {
/**
* AuthClient Login -
* Opens up a new window to authenticate with Internet Identity
* @param {AuthClientLoginOptions} options
* @param {AuthClientLoginOptions} options - Options for logging in
* @param options.identityProvider Identity provider
* @param options.maxTimeToLive Expiration of the authentication in nanoseconds
* @param options.derivationOrigin Origin for Identity Provider to use while generating the delegated identity
Expand Down
6 changes: 3 additions & 3 deletions packages/identity/src/identity/ecdsa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export class ECDSAKeyIdentity extends SignIdentity {

/**
* generates an identity from a public and private key. Please ensure that you are generating these keys securely and protect the user's private key
* @param keyPair a {@link CryptoKeyPair}
* @param subtleCrypto a {@link SubtleCrypto} interface in case one is not available globally
* @param keyPair a CryptoKeyPair
* @param subtleCrypto - a SubtleCrypto interface in case one is not available globally
* @returns an {@link ECDSAKeyIdentity}
*/
public static async fromKeyPair(
Expand Down Expand Up @@ -108,7 +108,7 @@ export class ECDSAKeyIdentity extends SignIdentity {

/**
* Return the internally-used key pair.
* @returns a {@link CryptoKeyPair}
* @returns a CryptoKeyPair
*/
public getKeyPair(): CryptoKeyPair {
return this._keyPair;
Expand Down