@saasquatch/squatch-js 2.3.1-2 → 2.3.1-3

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/SECURITY.md CHANGED
@@ -1,10 +1,10 @@
1
- # Reporting Security Issues
2
- The SaaSquatch team takes security bugs seriously. We appreciate your efforts to responsibly disclose your findings.
3
-
4
- To report a security issue, email security@referralsaasquatch.com and provide as much information as you can about the discovered issue.
5
-
6
- The SaaSquatch team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix, and may ask for additional information or guidance.
7
-
8
- Report security bugs in third-party modules to the person or team maintaining the module.
9
-
10
- For more information, please see SaaSquatch's Responsible Disclosure Policy at https://www.saasquatch.com/disclosure/.
1
+ # Reporting Security Issues
2
+ The SaaSquatch team takes security bugs seriously. We appreciate your efforts to responsibly disclose your findings.
3
+
4
+ To report a security issue, email security@referralsaasquatch.com and provide as much information as you can about the discovered issue.
5
+
6
+ The SaaSquatch team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix, and may ask for additional information or guidance.
7
+
8
+ Report security bugs in third-party modules to the person or team maintaining the module.
9
+
10
+ For more information, please see SaaSquatch's Responsible Disclosure Policy at https://www.saasquatch.com/disclosure/.
package/babelregister.js CHANGED
@@ -1,16 +1,16 @@
1
- // Cucumber babel config file
2
- // overrides node's require and runs through babel/typescript
3
- // based on https://github.com/microsoft/TypeScript-Babel-Starter/blob/master/.babelrc
4
- require("@babel/register")({
5
- extensions: [".js", ".jsx", ".ts", ".tsx"],
6
- presets: ["@babel/preset-env", "@babel/preset-typescript"],
7
- plugins: [
8
- [
9
- "@babel/plugin-transform-runtime",
10
- {
11
- corejs: 2,
12
- },
13
- ],
14
- "@babel/plugin-proposal-class-properties",
15
- ],
16
- });
1
+ // Cucumber babel config file
2
+ // overrides node's require and runs through babel/typescript
3
+ // based on https://github.com/microsoft/TypeScript-Babel-Starter/blob/master/.babelrc
4
+ require("@babel/register")({
5
+ extensions: [".js", ".jsx", ".ts", ".tsx"],
6
+ presets: ["@babel/preset-env", "@babel/preset-typescript"],
7
+ plugins: [
8
+ [
9
+ "@babel/plugin-transform-runtime",
10
+ {
11
+ corejs: 2,
12
+ },
13
+ ],
14
+ "@babel/plugin-proposal-class-properties",
15
+ ],
16
+ });
package/cucumber.js CHANGED
@@ -1,45 +1,45 @@
1
- // cucumber.js
2
- // const dotenv = require('dotenv');
3
- const os = require("os");
4
- // dotenv.config();
5
-
6
- /**
7
- *
8
- * Configures Cucumber
9
- *
10
- * Sets up the required stuff to make React code operate nicely in a Node environment
11
- *
12
- * Source: https://medium.com/@Charles_Stover/behavior-driven-react-development-with-cucumber-faf596d9d71b
13
- *
14
- */
15
- const CPU_COUNT = os.cpus().length;
16
- const IS_DEV = process.env.NODE_ENV === "development";
17
- const FAIL_FAST = IS_DEV ? ["--fail-fast"] : [];
18
- const FORMAT =
19
- process.env.CI || !process.stdout.isTTY ? "progress" : "progress-bar";
20
-
21
- exports.default = [
22
- ...FAIL_FAST,
23
- `--format ${FORMAT}`,
24
- `--parallel ${CPU_COUNT}`,
25
-
26
- // "test/**/*.feature",
27
- "../blackbox-testing/features/**/*.feature",
28
-
29
- `--tags "@testsuite:squatch-js and not @skip"`,
30
-
31
- // Babel and jsDom make our code work as if it's in the browser
32
- // "--require-module jsdom-global/register",
33
- // "--require-module ts-node/register",
34
- "--require-module " + __dirname + "/babelregister.js",
35
- // '--require-module source-map-support/register',
36
-
37
- // Order matters -- these setups need to happen first
38
- // "--require tests/cucumber-setup/loaders.ts",
39
-
40
- // Step definitions go last
41
- "--require test/step_definitions/**/*.ts",
42
- "--require test/step_definitions/**/*.tsx",
43
-
44
- // '--format usage',
45
- ].join(" ");
1
+ // cucumber.js
2
+ // const dotenv = require('dotenv');
3
+ const os = require("os");
4
+ // dotenv.config();
5
+
6
+ /**
7
+ *
8
+ * Configures Cucumber
9
+ *
10
+ * Sets up the required stuff to make React code operate nicely in a Node environment
11
+ *
12
+ * Source: https://medium.com/@Charles_Stover/behavior-driven-react-development-with-cucumber-faf596d9d71b
13
+ *
14
+ */
15
+ const CPU_COUNT = os.cpus().length;
16
+ const IS_DEV = process.env.NODE_ENV === "development";
17
+ const FAIL_FAST = IS_DEV ? ["--fail-fast"] : [];
18
+ const FORMAT =
19
+ process.env.CI || !process.stdout.isTTY ? "progress" : "progress-bar";
20
+
21
+ exports.default = [
22
+ ...FAIL_FAST,
23
+ `--format ${FORMAT}`,
24
+ `--parallel ${CPU_COUNT}`,
25
+
26
+ // "test/**/*.feature",
27
+ "../blackbox-testing/features/**/*.feature",
28
+
29
+ `--tags "@testsuite:squatch-js and not @skip"`,
30
+
31
+ // Babel and jsDom make our code work as if it's in the browser
32
+ // "--require-module jsdom-global/register",
33
+ // "--require-module ts-node/register",
34
+ "--require-module " + __dirname + "/babelregister.js",
35
+ // '--require-module source-map-support/register',
36
+
37
+ // Order matters -- these setups need to happen first
38
+ // "--require tests/cucumber-setup/loaders.ts",
39
+
40
+ // Step definitions go last
41
+ "--require test/step_definitions/**/*.ts",
42
+ "--require test/step_definitions/**/*.tsx",
43
+
44
+ // '--format usage',
45
+ ].join(" ");
package/demo/generate.tsx CHANGED
@@ -1,3 +1,3 @@
1
- import { fromURL, popup } from "./sandbox";
2
-
3
- window["sandbox"] = fromURL();
1
+ import { fromURL, popup } from "./sandbox";
2
+
3
+ window["sandbox"] = fromURL();
package/demo/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- declare interface Sandbox {
2
- script: string;
3
- version?: string;
4
- domain: string;
5
- tenantAlias: string;
6
- debug?: boolean;
7
- initObj: {
8
- widgetType: string;
9
- engagementMedium: string;
10
- user: {
11
- [key: string]: any;
12
- };
13
- jwt: string;
14
- };
15
- }
1
+ declare interface Sandbox {
2
+ script: string;
3
+ version?: string;
4
+ domain: string;
5
+ tenantAlias: string;
6
+ debug?: boolean;
7
+ initObj: {
8
+ widgetType: string;
9
+ engagementMedium: string;
10
+ user: {
11
+ [key: string]: any;
12
+ };
13
+ jwt: string;
14
+ };
15
+ }
package/demo/sandbox.ts CHANGED
@@ -1,122 +1,122 @@
1
- import { getQueryStringParams } from "./util";
2
-
3
- export const tenantAlias = "test_aojsrf4r06zi0";
4
- export const domain = "https://staging.referralsaasquatch.com";
5
- export const script = "https://fast.ssqt.io/squatch-js@2";
6
-
7
- export const user = {
8
- id: "5b980d34e4b0cabee07f2cb0",
9
- accountId: "AZJZSVG0LS1LB19R",
10
- email: "chesterscott.uexwltgh@mailosaur.io",
11
- };
12
- export const badJwtUser = {
13
- ...user,
14
- firstName: "Bad JWT",
15
- };
16
- export const noIds = {
17
- firstName: "No IDs",
18
- };
19
- export const noUserId = {
20
- accountId: "abc_123",
21
- firstName: "No UserID",
22
- };
23
- export const noAccountId = {
24
- id: "abc_123",
25
- firstName: "No AccountID",
26
- };
27
-
28
- export const users = [user, badJwtUser, noIds, noUserId, noAccountId, {}];
29
-
30
- export const popup: Sandbox = {
31
- script,
32
- domain,
33
- tenantAlias,
34
- debug: true,
35
- initObj: {
36
- widgetType: "REFERRER_WIDGET",
37
- engagementMedium: "POPUP",
38
- user: user,
39
- jwt:
40
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
41
- },
42
- };
43
-
44
- export const embed: Sandbox = {
45
- script,
46
- domain,
47
- tenantAlias,
48
- initObj: {
49
- widgetType: "REFERRER_WIDGET",
50
- engagementMedium: "EMBED",
51
- user: {
52
- id: "5b980d34e4b0cabee07f2cb0",
53
- accountId: "AZJZSVG0LS1LB19R",
54
- email: "chesterscott.uexwltgh@mailosaur.io",
55
- },
56
- jwt:
57
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
58
- },
59
- };
60
-
61
- export const embedNew: Sandbox = {
62
- ...embed,
63
- initObj: {
64
- ...embed.initObj,
65
- widgetType: "p/tuesday-text/w/referrerWidget",
66
- },
67
- };
68
-
69
- export const embedReferred: Sandbox = {
70
- ...embed,
71
- initObj: {
72
- ...embed.initObj,
73
- widgetType: "CONVERSION_WIDGET",
74
- },
75
- };
76
-
77
- export const popupReferred: Sandbox = {
78
- ...popup,
79
- initObj: {
80
- ...popup.initObj,
81
- widgetType: "CONVERSION_WIDGET",
82
- },
83
- };
84
-
85
- export const popupNew: Sandbox = {
86
- ...popup,
87
- initObj: {
88
- ...popup.initObj,
89
- widgetType: "p/tuesday-test/w/referrerWidget",
90
- },
91
- };
92
-
93
- export function fromURL() {
94
- let urlSandbox;
95
- try {
96
- urlSandbox = JSON.parse(
97
- window.atob(getQueryStringParams(window.location.search).sandbox)
98
- );
99
- } catch (e) {
100
- urlSandbox = {};
101
- }
102
-
103
- const sandbox = {
104
- ...popup,
105
- ...urlSandbox,
106
- };
107
- return sandbox;
108
- }
109
-
110
- export function toURL(sandbox: Sandbox) {
111
- window.location.href = href(sandbox);
112
- }
113
-
114
- export function href(sandbox: Sandbox) {
115
- const param = window.btoa(JSON.stringify(sandbox));
116
- var url = window.location.href;
117
- if (url.indexOf("?") > 0) {
118
- url = url.substring(0, url.indexOf("?"));
119
- }
120
- url += `?sandbox=${encodeURIComponent(param)}`;
121
- return url;
122
- }
1
+ import { getQueryStringParams } from "./util";
2
+
3
+ export const tenantAlias = "test_aojsrf4r06zi0";
4
+ export const domain = "https://staging.referralsaasquatch.com";
5
+ export const script = "https://fast.ssqt.io/squatch-js@2";
6
+
7
+ export const user = {
8
+ id: "5b980d34e4b0cabee07f2cb0",
9
+ accountId: "AZJZSVG0LS1LB19R",
10
+ email: "chesterscott.uexwltgh@mailosaur.io",
11
+ };
12
+ export const badJwtUser = {
13
+ ...user,
14
+ firstName: "Bad JWT",
15
+ };
16
+ export const noIds = {
17
+ firstName: "No IDs",
18
+ };
19
+ export const noUserId = {
20
+ accountId: "abc_123",
21
+ firstName: "No UserID",
22
+ };
23
+ export const noAccountId = {
24
+ id: "abc_123",
25
+ firstName: "No AccountID",
26
+ };
27
+
28
+ export const users = [user, badJwtUser, noIds, noUserId, noAccountId, {}];
29
+
30
+ export const popup: Sandbox = {
31
+ script,
32
+ domain,
33
+ tenantAlias,
34
+ debug: true,
35
+ initObj: {
36
+ widgetType: "REFERRER_WIDGET",
37
+ engagementMedium: "POPUP",
38
+ user: user,
39
+ jwt:
40
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
41
+ },
42
+ };
43
+
44
+ export const embed: Sandbox = {
45
+ script,
46
+ domain,
47
+ tenantAlias,
48
+ initObj: {
49
+ widgetType: "REFERRER_WIDGET",
50
+ engagementMedium: "EMBED",
51
+ user: {
52
+ id: "5b980d34e4b0cabee07f2cb0",
53
+ accountId: "AZJZSVG0LS1LB19R",
54
+ email: "chesterscott.uexwltgh@mailosaur.io",
55
+ },
56
+ jwt:
57
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNWI5ODBkMzRlNGIwY2FiZWUwN2YyY2IwIiwiYWNjb3VudElkIjoiQVpKWlNWRzBMUzFMQjE5UiIsImVtYWlsIjoiY2hlc3RlcnNjb3R0LnVleHdsdGdoQG1haWxvc2F1ci5pbyJ9fQ.MkrO7-980M7NRJcOUcdqCO1JftqmynLMK8bTEB3WObo",
58
+ },
59
+ };
60
+
61
+ export const embedNew: Sandbox = {
62
+ ...embed,
63
+ initObj: {
64
+ ...embed.initObj,
65
+ widgetType: "p/tuesday-text/w/referrerWidget",
66
+ },
67
+ };
68
+
69
+ export const embedReferred: Sandbox = {
70
+ ...embed,
71
+ initObj: {
72
+ ...embed.initObj,
73
+ widgetType: "CONVERSION_WIDGET",
74
+ },
75
+ };
76
+
77
+ export const popupReferred: Sandbox = {
78
+ ...popup,
79
+ initObj: {
80
+ ...popup.initObj,
81
+ widgetType: "CONVERSION_WIDGET",
82
+ },
83
+ };
84
+
85
+ export const popupNew: Sandbox = {
86
+ ...popup,
87
+ initObj: {
88
+ ...popup.initObj,
89
+ widgetType: "p/tuesday-test/w/referrerWidget",
90
+ },
91
+ };
92
+
93
+ export function fromURL() {
94
+ let urlSandbox;
95
+ try {
96
+ urlSandbox = JSON.parse(
97
+ window.atob(getQueryStringParams(window.location.search).sandbox)
98
+ );
99
+ } catch (e) {
100
+ urlSandbox = {};
101
+ }
102
+
103
+ const sandbox = {
104
+ ...popup,
105
+ ...urlSandbox,
106
+ };
107
+ return sandbox;
108
+ }
109
+
110
+ export function toURL(sandbox: Sandbox) {
111
+ window.location.href = href(sandbox);
112
+ }
113
+
114
+ export function href(sandbox: Sandbox) {
115
+ const param = window.btoa(JSON.stringify(sandbox));
116
+ var url = window.location.href;
117
+ if (url.indexOf("?") > 0) {
118
+ url = url.substring(0, url.indexOf("?"));
119
+ }
120
+ url += `?sandbox=${encodeURIComponent(param)}`;
121
+ return url;
122
+ }
package/demo/styles.css CHANGED
@@ -1,24 +1,24 @@
1
- .lds-dual-ring {
2
- display: inline-block;
3
- width: 32px;
4
- height: 32px;
5
- }
6
- .lds-dual-ring:after {
7
- content: " ";
8
- display: block;
9
- width: 23px;
10
- height: 23px;
11
- margin: 1px;
12
- border-radius: 50%;
13
- border: 3px solid #000;
14
- border-color: #000 transparent #000 transparent;
15
- animation: lds-dual-ring 1.2s linear infinite;
16
- }
17
- @keyframes lds-dual-ring {
18
- 0% {
19
- transform: rotate(0deg);
20
- }
21
- 100% {
22
- transform: rotate(360deg);
23
- }
24
- }
1
+ .lds-dual-ring {
2
+ display: inline-block;
3
+ width: 32px;
4
+ height: 32px;
5
+ }
6
+ .lds-dual-ring:after {
7
+ content: " ";
8
+ display: block;
9
+ width: 23px;
10
+ height: 23px;
11
+ margin: 1px;
12
+ border-radius: 50%;
13
+ border: 3px solid #000;
14
+ border-color: #000 transparent #000 transparent;
15
+ animation: lds-dual-ring 1.2s linear infinite;
16
+ }
17
+ @keyframes lds-dual-ring {
18
+ 0% {
19
+ transform: rotate(0deg);
20
+ }
21
+ 100% {
22
+ transform: rotate(360deg);
23
+ }
24
+ }