Skip to content

Commit

Permalink
Release 2.1.16 (#1552)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
7 people authored Dec 2, 2024
1 parent e0ef5cf commit b7282b8
Show file tree
Hide file tree
Showing 60 changed files with 566 additions and 496 deletions.
4 changes: 2 additions & 2 deletions demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"start": "vite serve ./src --port 9232 --config vite.config.ts",
"clean": "echo 'nothing to clean'"
},
"version": "2.1.15",
"version": "2.1.16",
"devDependencies": {
"@prosopo/dotenv": "2.1.15",
"@prosopo/dotenv": "2.1.16",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
Expand Down
16 changes: 8 additions & 8 deletions demos/client-example-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/client-example-server",
"version": "2.1.15",
"version": "2.1.16",
"description": "Backend for client-example",
"main": "dist/app.js",
"type": "module",
Expand Down Expand Up @@ -32,12 +32,12 @@
"@noble/hashes": "1.5.0",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/common": "2.1.15",
"@prosopo/contract": "2.1.15",
"@prosopo/dotenv": "2.1.15",
"@prosopo/server": "2.1.15",
"@prosopo/types": "2.1.15",
"@prosopo/util": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/contract": "2.1.16",
"@prosopo/dotenv": "2.1.16",
"@prosopo/server": "2.1.16",
"@prosopo/types": "2.1.16",
"@prosopo/util": "2.1.16",
"@typegoose/auto-increment": "4.6.0",
"cors": "2.8.5",
"express": "4.21.1",
Expand All @@ -47,7 +47,7 @@
"zod": "3.23.8"
},
"devDependencies": {
"@prosopo/config": "2.1.15",
"@prosopo/config": "2.1.16",
"@types/jsonwebtoken": "9.0.6",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
Expand Down
22 changes: 11 additions & 11 deletions demos/client-example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/client-example",
"version": "2.1.15",
"version": "2.1.16",
"private": true,
"type": "module",
"engines": {
Expand All @@ -13,14 +13,14 @@
"@mui/material": "5.9.1",
"@polkadot/extension-dapp": "0.46.9",
"@polkadot/extension-inject": "0.46.9",
"@prosopo/common": "2.1.15",
"@prosopo/locale-browser": "2.1.15",
"@prosopo/procaptcha-frictionless": "2.1.15",
"@prosopo/procaptcha-pow": "2.1.15",
"@prosopo/procaptcha-react": "2.1.15",
"@prosopo/server": "2.1.15",
"@prosopo/types": "2.1.15",
"@prosopo/vite-plugin-watch-workspace": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/locale-browser": "2.1.16",
"@prosopo/procaptcha-frictionless": "2.1.16",
"@prosopo/procaptcha-pow": "2.1.16",
"@prosopo/procaptcha-react": "2.1.16",
"@prosopo/server": "2.1.16",
"@prosopo/types": "2.1.16",
"@prosopo/vite-plugin-watch-workspace": "2.1.16",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"express": "4.21.1",
Expand All @@ -41,8 +41,8 @@
}
},
"devDependencies": {
"@prosopo/config": "2.1.15",
"@prosopo/dotenv": "2.1.15",
"@prosopo/config": "2.1.16",
"@prosopo/dotenv": "2.1.16",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
Expand Down
4 changes: 2 additions & 2 deletions demos/cypress-shared/cypress/e2e/captcha.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
type IUserSettings,
} from "@prosopo/types";
import { at } from "@prosopo/util";
import { checkboxClass } from "../support/commands.js";
import { checkboxClass, getWidgetElement } from "../support/commands.js";

describe("Captchas", () => {
before(async () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("Captchas", () => {

// visit the base URL specified on command line when running cypress
return cy.visit(Cypress.env("default_page")).then(() => {
cy.get(checkboxClass).should("be.visible");
getWidgetElement(checkboxClass).should("be.visible");
// wrap the solutions to make them available to the tests
cy.wrap(solutions).as("solutions");
});
Expand Down
12 changes: 4 additions & 8 deletions demos/cypress-shared/cypress/e2e/correct.captcha.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
type Captcha,
type IUserSettings,
} from "@prosopo/types";
import { checkboxClass } from "../support/commands.js";
import { checkboxClass, getWidgetElement } from "../support/commands.js";

describe("Captchas", () => {
before(async () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("Captchas", () => {

// visit the base URL specified on command line when running cypress
return cy.visit(Cypress.env("default_page")).then(() => {
cy.get(checkboxClass).should("be.visible");
getWidgetElement(checkboxClass).should("be.visible");
// wrap the solutions to make them available to the tests
cy.wrap(solutions).as("solutions");
});
Expand All @@ -90,9 +90,7 @@ describe("Captchas", () => {
cy.clickNextButton();
});
});
cy.get("input[type='checkbox']").then((checkboxes) => {
cy.wrap(checkboxes).first().should("not.be.checked");
});
getWidgetElement(checkboxClass).first().should("not.be.checked");
});

// check the logs by going through all recorded calls
Expand All @@ -115,9 +113,7 @@ describe("Captchas", () => {
})
.then(() => {
// Get inputs of type checkbox
cy.get("input[type='checkbox']").then((checkboxes) => {
cy.wrap(checkboxes).first().should("be.checked");
});
getWidgetElement(checkboxClass).first().should("be.checked");
});
});
});
Expand Down
9 changes: 6 additions & 3 deletions demos/cypress-shared/cypress/e2e/correct.captcha.signup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
type Captcha,
type IUserSettings,
} from "@prosopo/types";
import { checkboxClass } from "../support/commands.js";
import { checkboxClass, getWidgetElement } from "../support/commands.js";

describe("Captchas", () => {
before(async () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe("Captchas", () => {

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

// Get checked checkboxes
cy.get("input[type='checkbox']:checked").should("have.length.gte", 1);
getWidgetElement(`${checkboxClass}:checked`).should(
"have.length.gte",
1,
);

const uniqueId = `test${Cypress._.random(0, 1e6)}`;
cy.get('input[type="password"]').type("password");
Expand Down
52 changes: 36 additions & 16 deletions demos/cypress-shared/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,38 @@ declare global {
// biome-ignore lint/suspicious/noExplicitAny: TODO fix any
interface Chainable<Subject = any> {
clickIAmHuman(): Cypress.Chainable<Captcha[]>;

captchaImages(): Cypress.Chainable<JQuery<HTMLElement>>;

clickCorrectCaptchaImages(
captcha: Captcha,
): Chainable<JQuery<HTMLElement>>;

getSelectors(captcha: Captcha): Cypress.Chainable<string[]>;

clickNextButton(): Cypress.Chainable<void>;

elementExists(element: string): Chainable<Subject>;
}
}
}

export const checkboxClass = '[type="checkbox"]';

export function getWidgetElement(
selector: string,
options: object = {},
): Chainable<JQuery<HTMLElement>> {
options = { ...options, includeShadowDom: true };

return cy.get(selector, options);
}

function clickIAmHuman(): Cypress.Chainable<Captcha[]> {
cy.intercept("POST", "**/prosopo/provider/client/captcha/**").as(
"getCaptcha",
);
cy.get(checkboxClass, { timeout: 12000 }).first().click();
getWidgetElement(checkboxClass, { timeout: 12000 }).first().click();

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

function captchaImages(): Cypress.Chainable<JQuery<HTMLElement>> {
return cy
.xpath("//p[contains(text(),'all containing')]", { timeout: 4000 })
.should("be.visible")
.parent()
.parent()
.parent()
.parent()
.children()
.next()
.children()
.first()
.children()
.as("captchaImages");
return getWidgetElement("p").then(($p) => {
const $pWithText = $p.filter((index, el) => {
return Cypress.$(el).text().includes("all containing");
});

cy.wrap($pWithText)
.should("be.visible")
.parent()
.parent()
.parent()
.parent()
.children()
.next()
.children()
.first()
.children()
.as("captchaImages");
});
}

function getSelectors(captcha: Captcha) {
Expand Down Expand Up @@ -121,7 +141,7 @@ function clickCorrectCaptchaImages(
cy.getSelectors(captcha).then((selectors: string[]) => {
console.log("captchaId", captcha.captchaId, "selectors", selectors);
// Click the correct images
cy.get(selectors.join(", ")).then((elements) => {
getWidgetElement(selectors.join(", ")).then((elements) => {
if (elements.length > 0) {
cy.wrap(elements).click({ multiple: true });
}
Expand All @@ -137,7 +157,7 @@ function clickNextButton() {
"postSolution",
);
// Go to the next captcha or submit solution
cy.get('button[data-cy="button-next"]').click({ force: true });
getWidgetElement('button[data-cy="button-next"]').click({ force: true });
cy.wait(0);
}

Expand Down
12 changes: 6 additions & 6 deletions demos/cypress-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "@prosopo/cypress-shared",
"version": "2.1.15",
"version": "2.1.16",
"private": true,
"type": "module",
"engines": {
"node": "20",
"npm": ">=9"
},
"dependencies": {
"@prosopo/types": "2.1.15",
"@prosopo/util": "2.1.15",
"@prosopo/types": "2.1.16",
"@prosopo/util": "2.1.16",
"express": "4.21.1"
},
"devDependencies": {
"@cypress/xpath": "2.0.3",
"@prosopo/common": "2.1.15",
"@prosopo/datasets": "2.1.15",
"@prosopo/types-database": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/datasets": "2.1.16",
"@prosopo/types-database": "2.1.16",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
Expand Down
8 changes: 4 additions & 4 deletions demos/provider-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/provider-mock",
"version": "2.1.15",
"version": "2.1.16",
"author": "PROSOPO LIMITED <info@prosopo.io>",
"license": "Apache-2.0",
"main": "./dist/index.js",
Expand All @@ -16,9 +16,9 @@
"build:cjs": "echo 'no cjs build'"
},
"dependencies": {
"@prosopo/common": "2.1.15",
"@prosopo/provider": "2.1.15",
"@prosopo/types": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/provider": "2.1.16",
"@prosopo/types": "2.1.16",
"cors": "2.8.5",
"express": "4.21.1"
},
Expand Down
8 changes: 4 additions & 4 deletions dev/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/config",
"version": "2.1.15",
"version": "2.1.16",
"description": "Prosopo config library",
"main": "./dist/index.js",
"type": "module",
Expand Down Expand Up @@ -36,9 +36,9 @@
"@babel/plugin-transform-react-jsx": "7.25.2",
"@babel/plugin-transform-runtime": "7.25.4",
"@babel/preset-env": "7.25.4",
"@prosopo/common": "2.1.15",
"@prosopo/types": "2.1.15",
"@prosopo/util": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/types": "2.1.16",
"@prosopo/util": "2.1.16",
"@rollup/plugin-alias": "5.1.0",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "26.0.1",
Expand Down
10 changes: 5 additions & 5 deletions dev/flux/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/flux",
"version": "2.1.15",
"version": "2.1.16",
"description": "Tools for managing Flux deployment",
"main": "dist/index.js",
"bin": {
Expand All @@ -24,10 +24,10 @@
"@noble/curves": "1.6.0",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/common": "2.1.15",
"@prosopo/config": "2.1.15",
"@prosopo/dotenv": "2.1.15",
"@prosopo/util": "2.1.15",
"@prosopo/common": "2.1.16",
"@prosopo/config": "2.1.16",
"@prosopo/dotenv": "2.1.16",
"@prosopo/util": "2.1.16",
"express": "4.21.1",
"openpgp": "5.11.2",
"qs": "6.13.0",
Expand Down
2 changes: 1 addition & 1 deletion dev/gh-actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/gh-actions",
"version": "2.1.15",
"version": "2.1.16",
"description": "",
"private": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions dev/lint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/lint",
"version": "2.1.15",
"version": "2.1.16",
"description": "",
"private": true,
"scripts": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"npm": ">=9"
},
"dependencies": {
"@prosopo/util": "2.1.15",
"@prosopo/util": "2.1.16",
"express": "4.21.1",
"fast-glob": "3.3.2",
"zod": "3.23.8"
Expand Down
Loading

0 comments on commit b7282b8

Please sign in to comment.