@nsshunt/stsoauth2plugin 0.4.22 → 0.4.23

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.
package/dist/index.js CHANGED
@@ -14,17 +14,30 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.STSOAuth2ManagerPlugin = void 0;
17
+ exports.STSOAuth2ManagerPlugin = exports.useSTSOAuth2ManagerPlugin = void 0;
18
+ const vue_1 = require("vue");
19
+ const stsPluginKeys_1 = require("./stsPluginKeys");
18
20
  const stsoauth2manager_1 = require("./stsoauth2manager");
19
21
  __exportStar(require("./stsoauth2types"), exports);
20
22
  __exportStar(require("./stsoauth2manager"), exports);
21
23
  __exportStar(require("./stsoauth2worker"), exports);
22
24
  __exportStar(require("./stores/testStore"), exports);
23
25
  __exportStar(require("./stores/stsoauth2store"), exports);
26
+ // Create our use composable. This pattern is also used by vue router library with the useRoute and useRouter composables.
27
+ // https://skirtles-code.github.io/vue-examples/patterns/global-properties.html#application-level-provide-inject
28
+ const useSTSOAuth2ManagerPlugin = () => (0, vue_1.inject)(stsPluginKeys_1.STSOAuth2ManagerPluginKey);
29
+ exports.useSTSOAuth2ManagerPlugin = useSTSOAuth2ManagerPlugin;
24
30
  exports.STSOAuth2ManagerPlugin = {
25
31
  install: (app, options) => {
26
32
  const om = new stsoauth2manager_1.STSOAuth2Manager(app, options);
33
+ // Assign plugin instance to global $sts object (legacy method - see below)
34
+ if (!app.config.globalProperties.$sts) {
35
+ app.config.globalProperties.$sts = {};
36
+ }
27
37
  app.config.globalProperties.$sts.om = om;
38
+ // Assign App level provide for this STS plugin using symbol keys
39
+ // https://vuejs.org/guide/components/provide-inject.html#working-with-symbol-keys
40
+ app.provide(stsPluginKeys_1.STSOAuth2ManagerPluginKey, om);
28
41
  }
29
42
  };
30
43
  //# 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":";;;;;;;;;;;;;;;;;AAAA,yDAAqD;AAGrD,mDAAgC;AAChC,qDAAkC;AAClC,oDAAiC;AAEjC,qDAAkC;AAClC,0DAAuC;AAE1B,QAAA,sBAAsB,GAAG;IACrC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAiC,EAAE,EAAE;QACnD,MAAM,EAAE,GAAG,IAAI,mCAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1C,CAAC;CACD,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6BAA4B;AAE5B,mDAA2D;AAE3D,yDAAqD;AAGrD,mDAAgC;AAChC,qDAAkC;AAClC,oDAAiC;AAEjC,qDAAkC;AAClC,0DAAuC;AAEvC,0HAA0H;AAC1H,gHAAgH;AACzG,MAAM,yBAAyB,GAAG,GAAqB,EAAE,CAAC,IAAA,YAAM,EAAC,yCAAyB,CAAqB,CAAA;AAAzG,QAAA,yBAAyB,6BAAgF;AAEzG,QAAA,sBAAsB,GAAG;IACrC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAiC,EAAE,EAAE;QACnD,MAAM,EAAE,GAAG,IAAI,mCAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE9C,2EAA2E;QAC3E,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;YACtC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,GAAG,EAAG,CAAC;SACvC;QACD,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEzC,iEAAiE;QACjE,kFAAkF;QAClF,GAAG,CAAC,OAAO,CAAC,yCAAyB,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;CACD,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STSOAuth2ManagerPluginKey = void 0;
4
+ // Individual STS plugin keys for provide/inject logic
5
+ exports.STSOAuth2ManagerPluginKey = Symbol();
6
+ //# sourceMappingURL=stsPluginKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stsPluginKeys.js","sourceRoot":"","sources":["../src/stsPluginKeys.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACzC,QAAA,yBAAyB,GAAG,MAAM,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsshunt/stsoauth2plugin",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "description": "STS OAuth2 VUE Plugin",
5
5
  "main": "dist/index.js",
6
6
  "types": "./types/index.d.ts",
@@ -29,19 +29,19 @@
29
29
  "homepage": "https://github.com/nsshunt/stsoauth2plugin#readme",
30
30
  "devDependencies": {
31
31
  "@babel/preset-env": "^7.20.2",
32
- "@babel/preset-typescript": "^7.18.6",
32
+ "@babel/preset-typescript": "^7.21.0",
33
33
  "@tsconfig/node18": "^1.0.0",
34
34
  "@types/debug": "^4.1.7",
35
35
  "@types/jest": "^29.4.0",
36
- "@typescript-eslint/eslint-plugin": "^5.50.0",
37
- "@typescript-eslint/parser": "^5.50.0",
38
- "eslint": "^8.33.0",
39
- "jest": "^29.4.1",
40
- "prettier": "^2.8.3",
36
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
37
+ "@typescript-eslint/parser": "^5.54.1",
38
+ "eslint": "^8.35.0",
39
+ "jest": "^29.5.0",
40
+ "prettier": "^2.8.4",
41
41
  "supertest": "^6.3.3",
42
42
  "ts-loader": "^9.4.2",
43
43
  "typescript": "^4.9.5",
44
- "vue": "^3.2.45"
44
+ "vue": "^3.2.47"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@vue/composition-api": "^1.0.0-rc.1",
@@ -55,14 +55,14 @@
55
55
  "dependencies": {
56
56
  "@nsshunt/stsinstrumentation": "^6.11.55",
57
57
  "@nsshunt/stsutils": "^1.15.6",
58
- "@types/js-cookie": "^3.0.2",
59
- "axios": "^1.3.1",
58
+ "@types/js-cookie": "^3.0.3",
59
+ "axios": "^1.3.4",
60
60
  "crypto-js": "^4.1.1",
61
61
  "debug": "^4.3.4",
62
62
  "http-status-codes": "^2.2.0",
63
63
  "js-cookie": "^3.0.1",
64
64
  "jwt-decode": "^3.1.2",
65
- "pinia": "^2.0.30",
65
+ "pinia": "^2.0.33",
66
66
  "vue-demi": "^0.13.11"
67
67
  }
68
68
  }
package/types/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
+ import { STSOAuth2Manager } from './stsoauth2manager';
1
2
  import { ISTSOAuth2ManagerOptions } from './stsoauth2types';
2
3
  export * from './stsoauth2types';
3
4
  export * from './stsoauth2manager';
4
5
  export * from './stsoauth2worker';
5
6
  export * from './stores/testStore';
6
7
  export * from './stores/stsoauth2store';
8
+ export declare const useSTSOAuth2ManagerPlugin: () => STSOAuth2Manager;
7
9
  export declare const STSOAuth2ManagerPlugin: {
8
10
  install: (app: any, options: ISTSOAuth2ManagerOptions) => void;
9
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AAEvC,eAAO,MAAM,sBAAsB;iCACV,wBAAwB;CAIhD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAE3D,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AAIvC,eAAO,MAAM,yBAAyB,QAAO,gBAAyE,CAAA;AAEtH,eAAO,MAAM,sBAAsB;iCACV,wBAAwB;CAahD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const STSOAuth2ManagerPluginKey: unique symbol;
2
+ //# sourceMappingURL=stsPluginKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stsPluginKeys.d.ts","sourceRoot":"","sources":["../src/stsPluginKeys.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,yBAAyB,eAAW,CAAA"}