@wix/sdk 1.7.10 → 1.7.11

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,4 +1,3 @@
1
- import { jwtVerify, importSPKI } from 'jose';
2
1
  import { parsePublicKeyIfEncoded } from '../helpers.js';
3
2
  /**
4
3
  * Creates an authentication strategy for Wix Apps OAuth installation process.
@@ -190,6 +189,7 @@ export function WixAppOAuthStrategy(opts) {
190
189
  if (!opts.publicKey) {
191
190
  throw new Error('Missing public key. Make sure to pass it to the WixAppOAuthStrategy');
192
191
  }
192
+ const { jwtVerify, importSPKI } = await import('jose');
193
193
  const publicKey = await importSPKI(parsePublicKeyIfEncoded(opts.publicKey), 'RS256');
194
194
  const decoded = await jwtVerify(token, publicKey, verifyCallerClaims
195
195
  ? {
@@ -1,7 +1,29 @@
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.WixAppOAuthStrategy = void 0;
4
- const jose_1 = require("jose");
5
27
  const helpers_js_1 = require("../helpers.js");
6
28
  /**
7
29
  * Creates an authentication strategy for Wix Apps OAuth installation process.
@@ -193,8 +215,9 @@ function WixAppOAuthStrategy(opts) {
193
215
  if (!opts.publicKey) {
194
216
  throw new Error('Missing public key. Make sure to pass it to the WixAppOAuthStrategy');
195
217
  }
196
- const publicKey = await (0, jose_1.importSPKI)((0, helpers_js_1.parsePublicKeyIfEncoded)(opts.publicKey), 'RS256');
197
- const decoded = await (0, jose_1.jwtVerify)(token, publicKey, verifyCallerClaims
218
+ const { jwtVerify, importSPKI } = await Promise.resolve().then(() => __importStar(require('jose')));
219
+ const publicKey = await importSPKI((0, helpers_js_1.parsePublicKeyIfEncoded)(opts.publicKey), 'RS256');
220
+ const decoded = await jwtVerify(token, publicKey, verifyCallerClaims
198
221
  ? {
199
222
  issuer: 'wix.com',
200
223
  audience: opts.appId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk",
3
- "version": "1.7.10",
3
+ "version": "1.7.11",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -85,7 +85,7 @@
85
85
  "@wix/ecom": "^1.0.503",
86
86
  "@wix/events": "^1.0.155",
87
87
  "@wix/metro": "^1.0.73",
88
- "@wix/metro-runtime": "^1.1650.0",
88
+ "@wix/metro-runtime": "^1.1653.0",
89
89
  "@wix/sdk-runtime": "0.2.8",
90
90
  "eslint": "^8.56.0",
91
91
  "eslint-config-sdk": "0.0.0",
@@ -120,5 +120,5 @@
120
120
  "wallaby": {
121
121
  "autoDetect": true
122
122
  },
123
- "falconPackageHash": "a647b56bc41785f6b222e47243bb5ff69161a35bac1334d88ced9da6"
123
+ "falconPackageHash": "71fd96705487f56ef457e93ee780103c29750bdf928b39234632f113"
124
124
  }