@kwiz/node 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import { AuthContextType, ITenantInfo } from "@kwiz/common";
2
2
  export declare function ConfigureSPOAuth(config?: AuthContextType): void;
3
- export declare function getAxiosConfigSharePoint(tenantInfo: ITenantInfo, siteUrl: string): Promise<import("axios").AxiosRequestConfig<any>>;
3
+ export declare function getAxiosConfigSharePoint(tenantInfo: ITenantInfo, hostName: string): Promise<import("axios").AxiosRequestConfig<any>>;
@@ -9,13 +9,13 @@ function ConfigureSPOAuth(config) {
9
9
  auth = config;
10
10
  }
11
11
  exports.ConfigureSPOAuth = ConfigureSPOAuth;
12
- async function getAxiosConfigSharePoint(tenantInfo, siteUrl) {
12
+ async function getAxiosConfigSharePoint(tenantInfo, hostName) {
13
13
  if ((0, common_1.isNullOrUndefined)(auth))
14
14
  throw Error("Call ConfigureSPOAuth first");
15
15
  // only certificate supported
16
16
  // DisableCustomAppAuthentication property, that disable this kind of auth., however it can be overriden using this command:
17
17
  // Set-SPOTenant -DisableCustomAppAuthentication $false
18
- let token = await (0, msal_1.GetMSALToken)(tenantInfo, (0, common_1.GetMSALSiteScope)(siteUrl), auth);
18
+ let token = await (0, msal_1.GetMSALToken)(tenantInfo, (0, common_1.GetMSALSiteScope)(hostName), auth);
19
19
  let config = (0, axios_1.getAxiosConfigBearer)(token, { contantType: "application/json; odata=nometadata" });
20
20
  return config;
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/SPO/common.ts"],"names":[],"mappings":";;;AAAA,yCAAiG;AACjG,uCAA4C;AAC5C,oCAAgD;AAEhD,IAAI,IAAI,GAAoB,IAAI,CAAC;AACjC,SAAgB,gBAAgB,CAAC,MAAwB;IACrD,IAAI,GAAG,MAAM,CAAC;AAClB,CAAC;AAFD,4CAEC;AACM,KAAK,UAAU,wBAAwB,CAAC,UAAuB,EAAE,OAAe;IACnF,IAAI,IAAA,0BAAiB,EAAC,IAAI,CAAC;QAAE,MAAM,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACxE,6BAA6B;IAC7B,4HAA4H;IAC5H,uDAAuD;IACvD,IAAI,KAAK,GAAG,MAAM,IAAA,mBAAY,EAAC,UAAU,EAAE,IAAA,yBAAgB,EAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IAC5E,IAAI,MAAM,GAAG,IAAA,4BAAoB,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAChG,OAAO,MAAM,CAAC;AAClB,CAAC;AARD,4DAQC"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/spo/common.ts"],"names":[],"mappings":";;;AAAA,yCAAiG;AACjG,uCAA4C;AAC5C,oCAAgD;AAEhD,IAAI,IAAI,GAAoB,IAAI,CAAC;AACjC,SAAgB,gBAAgB,CAAC,MAAwB;IACrD,IAAI,GAAG,MAAM,CAAC;AAClB,CAAC;AAFD,4CAEC;AACM,KAAK,UAAU,wBAAwB,CAAC,UAAuB,EAAE,QAAgB;IACpF,IAAI,IAAA,0BAAiB,EAAC,IAAI,CAAC;QAAE,MAAM,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACxE,6BAA6B;IAC7B,4HAA4H;IAC5H,uDAAuD;IACvD,IAAI,KAAK,GAAG,MAAM,IAAA,mBAAY,EAAC,UAAU,EAAE,IAAA,yBAAgB,EAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;IAC7E,IAAI,MAAM,GAAG,IAAA,4BAAoB,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC,CAAC;IAChG,OAAO,MAAM,CAAC;AAClB,CAAC;AARD,4DAQC"}
@@ -0,0 +1 @@
1
+ export * from "./common";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./common"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
@@ -0,0 +1,2 @@
1
+ export * from "./discovery";
2
+ export * from "./msal";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./discovery"), exports);
18
+ __exportStar(require("./msal"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB"}
package/dist/index.d.ts CHANGED
@@ -0,0 +1,3 @@
1
+ export * from "./auth";
2
+ export * from "./axios";
3
+ export * from "./spo";
package/dist/index.js CHANGED
@@ -1 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./axios"), exports);
19
+ __exportStar(require("./spo"), exports);
1
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,wCAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/node",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "KWIZ utilities and helpers for node applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@azure/msal-node": "^2.6.4",
66
- "@kwiz/common": "^1.0.7",
66
+ "@kwiz/common": "^1.0.8",
67
67
  "axios": "^1.6.7",
68
68
  "esbuild": "^0.19.12",
69
69
  "get-tsconfig": "^4.7.2",
@@ -0,0 +1,2 @@
1
+ export * from "./discovery";
2
+ export * from "./msal";
package/src/index.ts CHANGED
@@ -0,0 +1,4 @@
1
+ export * from "./auth";
2
+ export * from "./axios";
3
+ export * from "./spo";
4
+
@@ -6,12 +6,12 @@ var auth: AuthContextType = null;
6
6
  export function ConfigureSPOAuth(config?: AuthContextType) {
7
7
  auth = config;
8
8
  }
9
- export async function getAxiosConfigSharePoint(tenantInfo: ITenantInfo, siteUrl: string) {
9
+ export async function getAxiosConfigSharePoint(tenantInfo: ITenantInfo, hostName: string) {
10
10
  if (isNullOrUndefined(auth)) throw Error("Call ConfigureSPOAuth first");
11
11
  // only certificate supported
12
12
  // DisableCustomAppAuthentication property, that disable this kind of auth., however it can be overriden using this command:
13
13
  // Set-SPOTenant -DisableCustomAppAuthentication $false
14
- let token = await GetMSALToken(tenantInfo, GetMSALSiteScope(siteUrl), auth);
14
+ let token = await GetMSALToken(tenantInfo, GetMSALSiteScope(hostName), auth);
15
15
  let config = getAxiosConfigBearer(token, { contantType: "application/json; odata=nometadata" });
16
16
  return config;
17
- }
17
+ }
@@ -0,0 +1 @@
1
+ export * from "./common";