Code Monkey home page Code Monkey logo

pnp-auth's People

Contributors

koltyakov avatar s-kainet avatar spwizard01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pnp-auth's Issues

Error with sp.createIsolated()

Hello,
I'm using pnp-auth a lot :) thank you for providing this lib

I'm trying to use isolated sp objects with pnp-auth but I get the following error :

TypeError: safe_global_js_1.safeGlobal.fetch is not a function
(node:13276) UnhandledPromiseRejectionWarning: TypeError: safe_global_js_1.safeGlobal.fetch is not a function
at FetchClient.fetch (C:\Projects\sptoolkit-projects\packages\common\net.ts:66:27)
at SPHttpClient.retry (C:\Projects\sptoolkit-projects\packages\sp\sphttpclient.ts:122:24)
at C:\Projects\sptoolkit-projects\packages\sp\sphttpclient.ts:144:19
at new Promise ()
at SPHttpClient.fetchRaw (C:\Projects\sptoolkit-projects\packages\sp\sphttpclient.ts:142:16)
at SPHttpClient. (C:\Projects\sptoolkit-projects\packages\sp\sphttpclient.ts:82:21)

packages used :

 "@pnp/nodejs-commonjs": "^2.6.0",
  "@pnp/sp-commonjs": "^2.6.0",
   "pnp-auth": "^2.0.0",

Code that produces the error:

   import { bootstrap, } from 'pnp-auth';
   import { sp } from '@pnp/sp-commonjs';
   import { AuthConfig, } from 'node-sp-auth-config'
   
   const isolatedSP = await sp.createIsolated()
   const authConfig = new AuthConfig({
		authOptions: thecredsobject
	});
   bootstrap(isolatedSP, authConfig)

The same code works with the standard sp object (from the import)

     .....
      bootstrap(sp, authConfig)

I hope you can point me to my error or fix the problem ?

thanks again
gr

Compilation Errors - @pnp/sp @pnp/pnpjs ^2.0.3 and pnp-auth

Hello,

I have installed

@pnp/sp - 2.0.3
@pnp/pnpjs - 2.0.3
@pnp/common - 2.03
@pnp/logging - 2.0.3
@pnp/nodejs-commonjs - 2.0.3 -- added but not used
@pnp/sp-common - 2.0.3 -- added but not used
@pnp/odata - 2.0.3
pnp-auth - 0.0.4
sp-pnp-node: 2.2.0

and trying to do a simple

import {sp} from '@pnp/sp
bootstap(sp, ..private.json, siteURL)

I am getting the below compilation errors

  1. FetchOption
    node-modules/pnp-auth/lib/NodeFetchClient.d.ts:1:26 - error TS274 : Module ..../@pnp/common has no exported member 'FetchOption' Did you mean IFetchOption

2.HttpClientImpl
node-modules/pnp-auth/lib/NodeFetchClient.d.ts:1:26 - error TS274 : Module ..../@pnp/common has no exported member 'HttpClientImpl' Did you mean IHttpClientImpl

Any suggestions on where I am going wrong ..

Thanks

@pnp v3?

Is there a way to use this with the v3 @pnp libraries?

Provide custom fetch

I have a misbehaving SP with frequent timeouts that I can't do anything about. I would like to make it so GET requests have a short timeout (default seems to be 15 minutes) and are retried 3 times when they time out.

It seems that I have to monkey-patch node-fetch's fetch to do so, but it would be nice to provide a custom fetch function instead.

TypeError: sp.setup is not a function

Hi,

I installed pnp-auth v2.0.0 and @pnp/sp-commonjs v2.11.0 and I'm using them in my project in this way:

const bootstrap = require("pnp-auth").bootstrap;
const taxonomy = import("@pnp/sp-commonjs/taxonomy/index.js");

let url = settings.sharepoint365.url;

bootstrap(taxonomy, {
    username: settings.sharepoint.auth.username, 
    password: settings.sharepoint.auth.password }, 
    url);

But I send my request, I get this error:

C:\my-project\node_modules\pnp-auth\lib\index.js:17
    sp.setup({
       ^

TypeError: sp.setup is not a function
    at bootstrap (C:\my-project\node_modules\pnp-auth\lib\index.js:17:8)
...
..., etc.

Am I doing anything wrong or is this a bug?

Thank you.

Compilation error

Hi,

I am getting this error while compiling my project.

Module not found: Error: Can't resolve 'readline' in './node_modules/node-sp-auth-config/node_modules/inquirer/lib/ui/baseUI.js'

I am using Create React app using this https://create-react-app.dev then followed this stackoverflow to add pnpjs to connect to my on prem sharepoint 2013 site
https://sharepoint.stackexchange.com/questions/246264/pnpjs-with-on-prem-sharepoint

It looks like pnp-auth uses node-sp-suth-config as dependecy and node-sp-suth-config as dependecy uses inquirer.js. Hovering on var readline = require('readline');, it takes me to
TypeScript\3.6\node_modules@types\node

Now, I m wondering problem in the version of typescript. Please someone help me to the resolve this issues.

My packages:

"dependencies": {
"@pnp/common": "^1.3.5",
"@pnp/graph": "^1.3.5",
"@pnp/logging": "^1.3.5",
"@pnp/nodejs": "^1.3.5",
"@pnp/odata": "^1.3.5",
"@pnp/sp": "^1.3.5",
"@types/jest": "24.0.18",
"@types/node": "12.7.4",
"@types/react": "16.9.2",
"@types/react-dom": "16.9.0",
"fetch": "^1.1.0",
"office-ui-fabric-react": "^7.31.1",
"pnp-auth": "0.0.4",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1",
"typescript": "3.6"
},

node version: v8.11.1
npm version: v5.6.0

Thank you !

Module not Working with new NodeJS Version 13.2 on TypeScript

Hello Guys,
i recently came up with the Problem that i couldnt compile my project.
The following error came up
Bildschirmfoto 2020-04-29 um 11 11 22

So i looked into your code and saw that your tsconfig.json was compiling to "es6".
To remove the Error i changed "es6" to "es5" and i had to add the option "lib": ["es2015"]

The new tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "sourceMap": true,
    "declaration": true,
    "moduleResolution": "node",
    "noImplicitAny": true,
    "removeComments": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noUnusedLocals": true,
    "noStrictGenericChecks": true,
    "skipLibCheck": true,
    "outDir": "./lib",
    "lib": ["es2015"]
  },
  "include": [
    "src/**/*.ts"
  ]
}

I also added some dependencies to the package.json but i guess it will work without them.
Just if it matters here are the libraries i came up with:

"dependencies": {
    "@pnp/common": "^1.3.11", (new)
    "@pnp/logging": "^2.0.4", (new)
    "@pnp/odata": "^2.0.4", (new)
    "@pnp/sp": "^2.0.4", (new)
    "@pnp/sp-commonjs": "^2.0.4", (new)
    "node-fetch": "^2.2.0",
    "node-sp-auth": "^2.5.5",
    "node-sp-auth-config": "^2.5.6"
  }

Im not a pro at coding but i hope the changes help you.
Wish you the best, nice project!

Need for bootstrapping @pnp/sp-taxonomy?

This package is awesome. Thanks for your work on this, it made it so easy to drop @pnp/sp into node.js. I have a need to do the same thing with @pnp/sp-taxonomy. I'm thinking about forking and adding that capability, but am wondering if anyone else would see the benefit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.