Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    [ProGet] [NativeApi] NpmPackages_DeletePackage not working.

    Scheduled Pinned Locked Moved Support
    2 Posts 2 Posters 9 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      andrey-ne_7936
      last edited by

      Hello!
      I'm trying to delete a npm package from a feed via native api.

      await fetch(`${host}/api/json/NpmPackages_DeletePackage`, 'post', {
                      'Content-Type': 'application/json'
                  }, JSON.stringify({
                      Feed_Name: 'npm',
                      Package_Name: name.split('/').pop(),  // `pkgname`
                      Scope_Name: name.split('/')[0],  // '@myscope`
                      API_Key: this.token,
                      Version_Text: pkg.Version.toString() // `2.3.4`
                  }));
      

      And it returns 200: OK with simple headers

        'content-length': '0',
          'cache-control': 'private',
          'x-proget-version': '5.3.24.7',
          'strict-transport-security': 'max-age=31536000; includeSubDomains',
          'x-frame-options': 'SAMEORIGIN',
          'x-content-type-options': 'nosniff',
          'x-xss-protection': '1; mode=block',
      

      But a package remains in a feed.

      How can I remove a package from npm feed with api?

      ProGet version 5.3.24 hosted on docker

      1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer
        last edited by

        Hello,

        That API will only delete package metadata from the database, not from disk. It's mostly intended for internal use only, and probably shouldn't be exposed to the API. In any case, we don't store the @ with internally, so if you change @myscope to myscope it should work.

        Note that the NPM doesn't provide a way to delete packages, and we never implemented it. There hasn't been any demand for it to date, as people don't really delete packages programmatically - but you're definitely welcome to submit a feature request and help us understand why it'd be a value (like, the workflow you use that requires deleting packages, etc).

        Alana

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation