Skip to content

Commit b7282b8

Browse files
prosoponatorforgetsoHughParrygoastlerhckhanh
authored
Release 2.1.16 (#1552)
Co-authored-by: Chris <forgetso86@gmail.com> Co-authored-by: Hugh <90424587+HughParry@users.noreply.github.com> Co-authored-by: George Oastler <goastler4@gmail.com> Co-authored-by: Khánh Hoàng <hoangchaukhanh93@gmail.com> Co-authored-by: George Oastler <goastler@users.noreply.github.com> Co-authored-by: Maxim Akimov <61589446+light-source@users.noreply.github.com>
1 parent e0ef5cf commit b7282b8

File tree

60 files changed

+566
-496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+566
-496
lines changed

demos/client-bundle-example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"start": "vite serve ./src --port 9232 --config vite.config.ts",
1414
"clean": "echo 'nothing to clean'"
1515
},
16-
"version": "2.1.15",
16+
"version": "2.1.16",
1717
"devDependencies": {
18-
"@prosopo/dotenv": "2.1.15",
18+
"@prosopo/dotenv": "2.1.16",
1919
"@types/node": "22.5.5",
2020
"@vitest/coverage-v8": "2.1.1",
2121
"concurrently": "9.0.1",

demos/client-example-server/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/client-example-server",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"description": "Backend for client-example",
55
"main": "dist/app.js",
66
"type": "module",
@@ -32,12 +32,12 @@
3232
"@noble/hashes": "1.5.0",
3333
"@polkadot/util": "12.6.2",
3434
"@polkadot/util-crypto": "12.6.2",
35-
"@prosopo/common": "2.1.15",
36-
"@prosopo/contract": "2.1.15",
37-
"@prosopo/dotenv": "2.1.15",
38-
"@prosopo/server": "2.1.15",
39-
"@prosopo/types": "2.1.15",
40-
"@prosopo/util": "2.1.15",
35+
"@prosopo/common": "2.1.16",
36+
"@prosopo/contract": "2.1.16",
37+
"@prosopo/dotenv": "2.1.16",
38+
"@prosopo/server": "2.1.16",
39+
"@prosopo/types": "2.1.16",
40+
"@prosopo/util": "2.1.16",
4141
"@typegoose/auto-increment": "4.6.0",
4242
"cors": "2.8.5",
4343
"express": "4.21.1",
@@ -47,7 +47,7 @@
4747
"zod": "3.23.8"
4848
},
4949
"devDependencies": {
50-
"@prosopo/config": "2.1.15",
50+
"@prosopo/config": "2.1.16",
5151
"@types/jsonwebtoken": "9.0.6",
5252
"@vitest/coverage-v8": "2.1.1",
5353
"concurrently": "9.0.1",

demos/client-example/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/client-example",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"private": true,
55
"type": "module",
66
"engines": {
@@ -13,14 +13,14 @@
1313
"@mui/material": "5.9.1",
1414
"@polkadot/extension-dapp": "0.46.9",
1515
"@polkadot/extension-inject": "0.46.9",
16-
"@prosopo/common": "2.1.15",
17-
"@prosopo/locale-browser": "2.1.15",
18-
"@prosopo/procaptcha-frictionless": "2.1.15",
19-
"@prosopo/procaptcha-pow": "2.1.15",
20-
"@prosopo/procaptcha-react": "2.1.15",
21-
"@prosopo/server": "2.1.15",
22-
"@prosopo/types": "2.1.15",
23-
"@prosopo/vite-plugin-watch-workspace": "2.1.15",
16+
"@prosopo/common": "2.1.16",
17+
"@prosopo/locale-browser": "2.1.16",
18+
"@prosopo/procaptcha-frictionless": "2.1.16",
19+
"@prosopo/procaptcha-pow": "2.1.16",
20+
"@prosopo/procaptcha-react": "2.1.16",
21+
"@prosopo/server": "2.1.16",
22+
"@prosopo/types": "2.1.16",
23+
"@prosopo/vite-plugin-watch-workspace": "2.1.16",
2424
"@types/react-dom": "18.3.0",
2525
"@vitejs/plugin-react": "4.3.1",
2626
"express": "4.21.1",
@@ -41,8 +41,8 @@
4141
}
4242
},
4343
"devDependencies": {
44-
"@prosopo/config": "2.1.15",
45-
"@prosopo/dotenv": "2.1.15",
44+
"@prosopo/config": "2.1.16",
45+
"@prosopo/dotenv": "2.1.16",
4646
"@types/node": "22.5.5",
4747
"@vitest/coverage-v8": "2.1.1",
4848
"concurrently": "9.0.1",

demos/cypress-shared/cypress/e2e/captcha.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
type IUserSettings,
2424
} from "@prosopo/types";
2525
import { at } from "@prosopo/util";
26-
import { checkboxClass } from "../support/commands.js";
26+
import { checkboxClass, getWidgetElement } from "../support/commands.js";
2727

2828
describe("Captchas", () => {
2929
before(async () => {
@@ -69,7 +69,7 @@ describe("Captchas", () => {
6969

7070
// visit the base URL specified on command line when running cypress
7171
return cy.visit(Cypress.env("default_page")).then(() => {
72-
cy.get(checkboxClass).should("be.visible");
72+
getWidgetElement(checkboxClass).should("be.visible");
7373
// wrap the solutions to make them available to the tests
7474
cy.wrap(solutions).as("solutions");
7575
});

demos/cypress-shared/cypress/e2e/correct.captcha.cy.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
type Captcha,
2323
type IUserSettings,
2424
} from "@prosopo/types";
25-
import { checkboxClass } from "../support/commands.js";
25+
import { checkboxClass, getWidgetElement } from "../support/commands.js";
2626

2727
describe("Captchas", () => {
2828
before(async () => {
@@ -69,7 +69,7 @@ describe("Captchas", () => {
6969

7070
// visit the base URL specified on command line when running cypress
7171
return cy.visit(Cypress.env("default_page")).then(() => {
72-
cy.get(checkboxClass).should("be.visible");
72+
getWidgetElement(checkboxClass).should("be.visible");
7373
// wrap the solutions to make them available to the tests
7474
cy.wrap(solutions).as("solutions");
7575
});
@@ -90,9 +90,7 @@ describe("Captchas", () => {
9090
cy.clickNextButton();
9191
});
9292
});
93-
cy.get("input[type='checkbox']").then((checkboxes) => {
94-
cy.wrap(checkboxes).first().should("not.be.checked");
95-
});
93+
getWidgetElement(checkboxClass).first().should("not.be.checked");
9694
});
9795

9896
// check the logs by going through all recorded calls
@@ -115,9 +113,7 @@ describe("Captchas", () => {
115113
})
116114
.then(() => {
117115
// Get inputs of type checkbox
118-
cy.get("input[type='checkbox']").then((checkboxes) => {
119-
cy.wrap(checkboxes).first().should("be.checked");
120-
});
116+
getWidgetElement(checkboxClass).first().should("be.checked");
121117
});
122118
});
123119
});

demos/cypress-shared/cypress/e2e/correct.captcha.signup.cy.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
type Captcha,
2323
type IUserSettings,
2424
} from "@prosopo/types";
25-
import { checkboxClass } from "../support/commands.js";
25+
import { checkboxClass, getWidgetElement } from "../support/commands.js";
2626

2727
describe("Captchas", () => {
2828
before(async () => {
@@ -69,7 +69,7 @@ describe("Captchas", () => {
6969

7070
// visit the base URL specified on command line when running cypress
7171
return cy.visit(Cypress.env("default_page")).then(() => {
72-
cy.get(checkboxClass).should("be.visible");
72+
getWidgetElement(checkboxClass).should("be.visible");
7373
// wrap the solutions to make them available to the tests
7474
cy.wrap(solutions).as("solutions");
7575
});
@@ -100,7 +100,10 @@ describe("Captchas", () => {
100100
cy.wait("@postSolution");
101101

102102
// Get checked checkboxes
103-
cy.get("input[type='checkbox']:checked").should("have.length.gte", 1);
103+
getWidgetElement(`${checkboxClass}:checked`).should(
104+
"have.length.gte",
105+
1,
106+
);
104107

105108
const uniqueId = `test${Cypress._.random(0, 1e6)}`;
106109
cy.get('input[type="password"]').type("password");

demos/cypress-shared/cypress/support/commands.ts

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,38 @@ declare global {
2222
// biome-ignore lint/suspicious/noExplicitAny: TODO fix any
2323
interface Chainable<Subject = any> {
2424
clickIAmHuman(): Cypress.Chainable<Captcha[]>;
25+
2526
captchaImages(): Cypress.Chainable<JQuery<HTMLElement>>;
27+
2628
clickCorrectCaptchaImages(
2729
captcha: Captcha,
2830
): Chainable<JQuery<HTMLElement>>;
31+
2932
getSelectors(captcha: Captcha): Cypress.Chainable<string[]>;
33+
3034
clickNextButton(): Cypress.Chainable<void>;
35+
3136
elementExists(element: string): Chainable<Subject>;
3237
}
3338
}
3439
}
3540

3641
export const checkboxClass = '[type="checkbox"]';
42+
43+
export function getWidgetElement(
44+
selector: string,
45+
options: object = {},
46+
): Chainable<JQuery<HTMLElement>> {
47+
options = { ...options, includeShadowDom: true };
48+
49+
return cy.get(selector, options);
50+
}
51+
3752
function clickIAmHuman(): Cypress.Chainable<Captcha[]> {
3853
cy.intercept("POST", "**/prosopo/provider/client/captcha/**").as(
3954
"getCaptcha",
4055
);
41-
cy.get(checkboxClass, { timeout: 12000 }).first().click();
56+
getWidgetElement(checkboxClass, { timeout: 12000 }).first().click();
4257

4358
return cy
4459
.wait("@getCaptcha", { timeout: 36000 })
@@ -69,19 +84,24 @@ function clickIAmHuman(): Cypress.Chainable<Captcha[]> {
6984
}
7085

7186
function captchaImages(): Cypress.Chainable<JQuery<HTMLElement>> {
72-
return cy
73-
.xpath("//p[contains(text(),'all containing')]", { timeout: 4000 })
74-
.should("be.visible")
75-
.parent()
76-
.parent()
77-
.parent()
78-
.parent()
79-
.children()
80-
.next()
81-
.children()
82-
.first()
83-
.children()
84-
.as("captchaImages");
87+
return getWidgetElement("p").then(($p) => {
88+
const $pWithText = $p.filter((index, el) => {
89+
return Cypress.$(el).text().includes("all containing");
90+
});
91+
92+
cy.wrap($pWithText)
93+
.should("be.visible")
94+
.parent()
95+
.parent()
96+
.parent()
97+
.parent()
98+
.children()
99+
.next()
100+
.children()
101+
.first()
102+
.children()
103+
.as("captchaImages");
104+
});
85105
}
86106

87107
function getSelectors(captcha: Captcha) {
@@ -121,7 +141,7 @@ function clickCorrectCaptchaImages(
121141
cy.getSelectors(captcha).then((selectors: string[]) => {
122142
console.log("captchaId", captcha.captchaId, "selectors", selectors);
123143
// Click the correct images
124-
cy.get(selectors.join(", ")).then((elements) => {
144+
getWidgetElement(selectors.join(", ")).then((elements) => {
125145
if (elements.length > 0) {
126146
cy.wrap(elements).click({ multiple: true });
127147
}
@@ -137,7 +157,7 @@ function clickNextButton() {
137157
"postSolution",
138158
);
139159
// Go to the next captcha or submit solution
140-
cy.get('button[data-cy="button-next"]').click({ force: true });
160+
getWidgetElement('button[data-cy="button-next"]').click({ force: true });
141161
cy.wait(0);
142162
}
143163

demos/cypress-shared/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"name": "@prosopo/cypress-shared",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"private": true,
55
"type": "module",
66
"engines": {
77
"node": "20",
88
"npm": ">=9"
99
},
1010
"dependencies": {
11-
"@prosopo/types": "2.1.15",
12-
"@prosopo/util": "2.1.15",
11+
"@prosopo/types": "2.1.16",
12+
"@prosopo/util": "2.1.16",
1313
"express": "4.21.1"
1414
},
1515
"devDependencies": {
1616
"@cypress/xpath": "2.0.3",
17-
"@prosopo/common": "2.1.15",
18-
"@prosopo/datasets": "2.1.15",
19-
"@prosopo/types-database": "2.1.15",
17+
"@prosopo/common": "2.1.16",
18+
"@prosopo/datasets": "2.1.16",
19+
"@prosopo/types-database": "2.1.16",
2020
"@types/node": "22.5.5",
2121
"@vitest/coverage-v8": "2.1.1",
2222
"concurrently": "9.0.1",

demos/provider-mock/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/provider-mock",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"author": "PROSOPO LIMITED <info@prosopo.io>",
55
"license": "Apache-2.0",
66
"main": "./dist/index.js",
@@ -16,9 +16,9 @@
1616
"build:cjs": "echo 'no cjs build'"
1717
},
1818
"dependencies": {
19-
"@prosopo/common": "2.1.15",
20-
"@prosopo/provider": "2.1.15",
21-
"@prosopo/types": "2.1.15",
19+
"@prosopo/common": "2.1.16",
20+
"@prosopo/provider": "2.1.16",
21+
"@prosopo/types": "2.1.16",
2222
"cors": "2.8.5",
2323
"express": "4.21.1"
2424
},

dev/config/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/config",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"description": "Prosopo config library",
55
"main": "./dist/index.js",
66
"type": "module",
@@ -36,9 +36,9 @@
3636
"@babel/plugin-transform-react-jsx": "7.25.2",
3737
"@babel/plugin-transform-runtime": "7.25.4",
3838
"@babel/preset-env": "7.25.4",
39-
"@prosopo/common": "2.1.15",
40-
"@prosopo/types": "2.1.15",
41-
"@prosopo/util": "2.1.15",
39+
"@prosopo/common": "2.1.16",
40+
"@prosopo/types": "2.1.16",
41+
"@prosopo/util": "2.1.16",
4242
"@rollup/plugin-alias": "5.1.0",
4343
"@rollup/plugin-babel": "6.0.4",
4444
"@rollup/plugin-commonjs": "26.0.1",

dev/flux/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/flux",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"description": "Tools for managing Flux deployment",
55
"main": "dist/index.js",
66
"bin": {
@@ -24,10 +24,10 @@
2424
"@noble/curves": "1.6.0",
2525
"@polkadot/util": "12.6.2",
2626
"@polkadot/util-crypto": "12.6.2",
27-
"@prosopo/common": "2.1.15",
28-
"@prosopo/config": "2.1.15",
29-
"@prosopo/dotenv": "2.1.15",
30-
"@prosopo/util": "2.1.15",
27+
"@prosopo/common": "2.1.16",
28+
"@prosopo/config": "2.1.16",
29+
"@prosopo/dotenv": "2.1.16",
30+
"@prosopo/util": "2.1.16",
3131
"express": "4.21.1",
3232
"openpgp": "5.11.2",
3333
"qs": "6.13.0",

dev/gh-actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/gh-actions",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"description": "",
55
"private": true,
66
"scripts": {

dev/lint/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prosopo/lint",
3-
"version": "2.1.15",
3+
"version": "2.1.16",
44
"description": "",
55
"private": true,
66
"scripts": {
@@ -37,7 +37,7 @@
3737
"npm": ">=9"
3838
},
3939
"dependencies": {
40-
"@prosopo/util": "2.1.15",
40+
"@prosopo/util": "2.1.16",
4141
"express": "4.21.1",
4242
"fast-glob": "3.3.2",
4343
"zod": "3.23.8"

0 commit comments

Comments
 (0)