@wix/sdk 1.6.3 → 1.6.4

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "main": "../../cjs/build/auth/VeloAuthStrategy.js"
3
+ }
@@ -0,0 +1,3 @@
1
+ import { AuthenticationStrategy } from '@wix/sdk-types';
2
+ export type VeloAuthStrategy = AuthenticationStrategy<undefined>;
3
+ export declare function VeloAuthStrategy(): VeloAuthStrategy;
@@ -0,0 +1,20 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
2
+ export function VeloAuthStrategy() {
3
+ return {
4
+ getAuthHeaders: async () => {
5
+ let authHeader;
6
+ if (globalThis.origin) {
7
+ authHeader =
8
+ // @ts-expect-error $ns is available in the closure created by Velo
9
+ $ns['wix-elementorySupport'].getRequestOptions().headers
10
+ .Authorization;
11
+ }
12
+ else {
13
+ authHeader =
14
+ // @ts-expect-error
15
+ process.domain.webMethodInfo.request.headers['x-wix-authorization'];
16
+ }
17
+ return { headers: { Authorization: authHeader } };
18
+ },
19
+ };
20
+ }
@@ -0,0 +1,3 @@
1
+ import { AuthenticationStrategy } from '@wix/sdk-types';
2
+ export type VeloAuthStrategy = AuthenticationStrategy<undefined>;
3
+ export declare function VeloAuthStrategy(): VeloAuthStrategy;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VeloAuthStrategy = void 0;
4
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
5
+ function VeloAuthStrategy() {
6
+ return {
7
+ getAuthHeaders: async () => {
8
+ let authHeader;
9
+ if (globalThis.origin) {
10
+ authHeader =
11
+ // @ts-expect-error $ns is available in the closure created by Velo
12
+ $ns['wix-elementorySupport'].getRequestOptions().headers
13
+ .Authorization;
14
+ }
15
+ else {
16
+ authHeader =
17
+ // @ts-expect-error
18
+ process.domain.webMethodInfo.request.headers['x-wix-authorization'];
19
+ }
20
+ return { headers: { Authorization: authHeader } };
21
+ },
22
+ };
23
+ }
24
+ exports.VeloAuthStrategy = VeloAuthStrategy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -30,6 +30,10 @@
30
30
  "./auth/wix-app-oauth": {
31
31
  "import": "./build/auth/WixAppOAuthStrategy.js",
32
32
  "require": "./cjs/build/auth/WixAppOAuthStrategy.js"
33
+ },
34
+ "./auth/velo": {
35
+ "import": "./build/auth/VeloAuthStrategy.js",
36
+ "require": "./cjs/build/auth/VeloAuthStrategy.js"
33
37
  }
34
38
  },
35
39
  "sideEffects": false,
@@ -105,5 +109,5 @@
105
109
  "wallaby": {
106
110
  "autoDetect": true
107
111
  },
108
- "falconPackageHash": "e357bd164f043691acc37f8047dd6acda066da9f6ece0a8dc4e76bd7"
112
+ "falconPackageHash": "16fe89900be2a97b0197aa9ae070fa9735a543d8affe31f1c1473037"
109
113
  }