uawdijnntqw1x1x1
IP : 216.73.216.110
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
node_modules
/
object.pick
/
..
/
extend
/
..
/
xmlbuilder
/
..
/
..
/
4d695
/
libnpmhook.zip
/
/
PK�Z�\ B22package.jsonnu�[���{ "_id": "libnpmhook@10.0.5", "_inBundle": true, "_location": "/npm/libnpmhook", "_phantomChildren": {}, "_requiredBy": [ "/npm" ], "author": { "name": "GitHub Inc." }, "bugs": { "url": "https://github.com/npm/cli/issues" }, "dependencies": { "aproba": "^2.0.0", "npm-registry-fetch": "^17.0.1" }, "description": "programmatic API for managing npm registry hooks", "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/template-oss": "4.22.0", "nock": "^13.3.3", "tap": "^16.3.8" }, "engines": { "node": "^16.14.0 || >=18.0.0" }, "files": [ "bin/", "lib/" ], "homepage": "https://github.com/npm/cli#readme", "keywords": [ "npm", "hooks", "registry", "npm api" ], "license": "ISC", "main": "lib/index.js", "name": "libnpmhook", "repository": { "type": "git", "url": "git+https://github.com/npm/cli.git", "directory": "workspaces/libnpmhook" }, "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "npm run lint -- --fix", "postlint": "template-oss-check", "posttest": "npm run lint", "snap": "tap", "template-oss-apply": "template-oss-apply --force", "test": "tap" }, "tap": { "nyc-arg": [ "--exclude", "tap-snapshots/**" ] }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "version": "4.22.0", "content": "../../scripts/template-oss/index.js" }, "version": "10.0.5" } PK�Z�\c<|��lib/index.jsnu�[���'use strict' const fetch = require('npm-registry-fetch') const validate = require('aproba') const eu = encodeURIComponent const cmd = module.exports = {} cmd.add = (name, endpoint, secret, opts = {}) => { validate('SSSO', [name, endpoint, secret, opts]) let type = 'package' if (name.match(/^@[^/]+$/)) { type = 'scope' } if (name[0] === '~') { type = 'owner' name = name.slice(1) } return fetch.json('/-/npm/v1/hooks/hook', { ...opts, method: 'POST', body: { type, name, endpoint, secret }, }) } cmd.rm = (id, opts = {}) => { validate('SO', [id, opts]) return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, { ...opts, method: 'DELETE', }).catch(err => { if (err.code === 'E404') { return null } else { throw err } }) } cmd.update = (id, endpoint, secret, opts = {}) => { validate('SSSO', [id, endpoint, secret, opts]) return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, { ...opts, method: 'PUT', body: { endpoint, secret }, }) } cmd.find = (id, opts = {}) => { validate('SO', [id, opts]) return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts) } cmd.ls = (opts = {}) => { return cmd.ls.stream(opts).collect() } cmd.ls.stream = (opts = {}) => { const { package: pkg, limit, offset } = opts validate('S|Z', [pkg]) validate('N|Z', [limit]) validate('N|Z', [offset]) return fetch.json.stream('/-/npm/v1/hooks', 'objects.*', { ...opts, query: { package: pkg, limit, offset, }, }) } PK�Z�\g]�vv README.mdnu�[���# libnpmhook [](https://npm.im/libnpmhook) [](https://npm.im/libnpmhook) [](https://github.com/npm/cli/actions/workflows/ci-libnpmhook.yml) [`libnpmhook`](https://github.com/npm/libnpmhook) is a Node.js library for programmatically managing the npm registry's server-side hooks. For a more general introduction to managing hooks, see [the introductory blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm). ## Table of Contents * [Example](#example) * [Install](#install) * [Contributing](#contributing) * [API](#api) * [hook opts](#opts) * [`add()`](#add) * [`rm()`](#rm) * [`ls()`](#ls) * [`ls.stream()`](#ls-stream) * [`update()`](#update) ## Example ```js const hooks = require('libnpmhook') console.log(await hooks.ls('mypkg', {token: 'deadbeef'})) // array of hook objects on `mypkg`. ``` ## Install `$ npm install libnpmhook` ### API #### <a name="opts"></a> `opts` for `libnpmhook` commands `libnpmhook` uses [`npm-registry-fetch`](https://npm.im/npm-registry-fetch). All options are passed through directly to that library, so please refer to [its own `opts` documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) for options that can be passed in. A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. * `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmhook` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` #### <a name="add"></a> `> hooks.add(name, endpoint, secret, [opts]) -> Promise` `name` is the name of the package, org, or user/org scope to watch. The type is determined by the name syntax: `'@foo/bar'` and `'foo'` are treated as packages, `@foo` is treated as a scope, and `~user` is treated as an org name or scope. Each type will attach to different events. The `endpoint` should be a fully-qualified http URL for the endpoint the hook will send its payload to when it fires. `secret` is a shared secret that the hook will send to that endpoint to verify that it's actually coming from the registry hook. The returned Promise resolves to the full hook object that was created, including its generated `id`. See also: [`POST /v1/hooks/hook`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#post-v1hookshook) ##### Example ```javascript await hooks.add('~zkat', 'https://example.com/api/added', 'supersekrit', { token: 'myregistrytoken', otp: '694207' }) => { id: '16f7xoal', username: 'zkat', name: 'zkat', endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', updated: '2018-08-21T20:05:25.125Z', deleted: false, delivered: false, last_delivery: null, response_code: 0, status: 'active' } ``` #### <a name="find"></a> `> hooks.find(id, [opts]) -> Promise` Returns the hook identified by `id`. The returned Promise resolves to the full hook object that was found, or error with `err.code` of `'E404'` if it didn't exist. See also: [`GET /v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hookshookid) ##### Example ```javascript await hooks.find('16f7xoal', {token: 'myregistrytoken'}) => { id: '16f7xoal', username: 'zkat', name: 'zkat', endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', updated: '2018-08-21T20:05:25.125Z', deleted: false, delivered: false, last_delivery: null, response_code: 0, status: 'active' } ``` #### <a name="rm"></a> `> hooks.rm(id, [opts]) -> Promise` Removes the hook identified by `id`. The returned Promise resolves to the full hook object that was removed, if it existed, or `null` if no such hook was there (instead of erroring). See also: [`DELETE /v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#delete-v1hookshookid) ##### Example ```javascript await hooks.rm('16f7xoal', { token: 'myregistrytoken', otp: '694207' }) => { id: '16f7xoal', username: 'zkat', name: 'zkat', endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', updated: '2018-08-21T20:05:25.125Z', deleted: true, delivered: false, last_delivery: null, response_code: 0, status: 'active' } // Repeat it... await hooks.rm('16f7xoal', { token: 'myregistrytoken', otp: '694207' }) => null ``` #### <a name="update"></a> `> hooks.update(id, endpoint, secret, [opts]) -> Promise` The `id` should be a hook ID from a previously-created hook. The `endpoint` should be a fully-qualified http URL for the endpoint the hook will send its payload to when it fires. `secret` is a shared secret that the hook will send to that endpoint to verify that it's actually coming from the registry hook. The returned Promise resolves to the full hook object that was updated, if it existed. Otherwise, it will error with an `'E404'` error code. See also: [`PUT /v1/hooks/hook/:id`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#put-v1hookshookid) ##### Example ```javascript await hooks.update('16fxoal', 'https://example.com/api/other', 'newsekrit', { token: 'myregistrytoken', otp: '694207' }) => { id: '16f7xoal', username: 'zkat', name: 'zkat', endpoint: 'https://example.com/api/other', secret: 'newsekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', updated: '2018-08-21T20:14:41.964Z', deleted: false, delivered: false, last_delivery: null, response_code: 0, status: 'active' } ``` #### <a name="ls"></a> `> hooks.ls([opts]) -> Promise` Resolves to an array of hook objects associated with the account you're authenticated as. Results can be further filtered with three values that can be passed in through `opts`: * `opts.package` - filter results by package name * `opts.limit` - maximum number of hooks to return * `opts.offset` - pagination offset for results (use with `opts.limit`) See also: * [`hooks.ls.stream()`](#ls-stream) * [`GET /v1/hooks`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hooks) ##### Example ```javascript await hooks.ls({token: 'myregistrytoken'}) => [ { id: '16f7xoal', ... }, { id: 'wnyf98a1', ... }, ... ] ``` #### <a name="ls-stream"></a> `> hooks.ls.stream([opts]) -> Stream` Returns a stream of hook objects associated with the account you're authenticated as. The returned stream is a valid `Symbol.asyncIterator` on `node@>=10`. Results can be further filtered with three values that can be passed in through `opts`: * `opts.package` - filter results by package name * `opts.limit` - maximum number of hooks to return * `opts.offset` - pagination offset for results (use with `opts.limit`) See also: * [`hooks.ls()`](#ls) * [`GET /v1/hooks`](https://github.com/npm/registry/blob/master/docs/hooks/endpoints.md#get-v1hooks) ##### Example ```javascript for await (let hook of hooks.ls.stream({token: 'myregistrytoken'})) { console.log('found hook:', hook.id) } => // outputs: // found hook: 16f7xoal // found hook: wnyf98a1 ``` PK�Z�\g���� LICENSE.mdnu�[���ISC License Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. PK�Z�\ B22package.jsonnu�[���PK�Z�\c<|��nlib/index.jsnu�[���PK�Z�\g]�vv �README.mdnu�[���PK�Z�\g���� T*LICENSE.mdnu�[���PK+�-
/home/emeraadmin/www/node_modules/object.pick/../extend/../xmlbuilder/../../4d695/libnpmhook.zip