Skip to content

Commit

Permalink
chore: Update planx-core (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Oct 18, 2023
1 parent 3515034 commit 017f77c
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 79 deletions.
2 changes: 1 addition & 1 deletion api.planx.uk/inviteToPay/createPaymentSendEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const createPaymentSendEvents = async (
const now = new Date();
const combinedResponse: CombinedResponse = {};

const session = await $api.getSessionById(payload.sessionId);
const session = await $api.session.find(payload.sessionId);
if (!session) {
return next({
status: 400,
Expand Down
6 changes: 3 additions & 3 deletions api.planx.uk/inviteToPay/inviteToPay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function inviteToPay(
}

// lock session before creating a payment request
const locked = await $api.lockSession(sessionId);
const locked = await $api.session.lock(sessionId);
if (locked === null) {
return next(
new ServerError({
Expand All @@ -63,7 +63,7 @@ export async function inviteToPay(

let paymentRequest: PaymentRequest | undefined;
try {
paymentRequest = await $api.createPaymentRequest({
paymentRequest = await $api.paymentRequest.create({
sessionId,
applicantName,
payeeName,
Expand All @@ -72,7 +72,7 @@ export async function inviteToPay(
});
} catch (e: unknown) {
// revert the session lock on failure
await $api.unlockSession(sessionId);
await $api.session.unlock(sessionId);
return next(
new ServerError({
message:
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@airbrake/node": "^2.1.8",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3a85966",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#c2d6f35",
"@types/isomorphic-fetch": "^0.0.36",
"adm-zip": "^0.5.10",
"aws-sdk": "^2.1467.0",
Expand Down
9 changes: 5 additions & 4 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/tests/api-driven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"dependencies": {
"@cucumber/cucumber": "^9.3.0",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3a85966",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#c2d6f35",
"axios": "^1.4.0",
"dotenv": "^16.3.1",
"dotenv-expand": "^10.0.0",
Expand Down
29 changes: 9 additions & 20 deletions e2e/tests/api-driven/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion e2e/tests/api-driven/src/permissions/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const setup = async () => {
return world;
};

export type GQLQueryResult = unknown[] | Record<"returning", unknown[]> | null;

export const performGQLQuery = async ({
world,
action,
Expand All @@ -66,7 +68,7 @@ export const performGQLQuery = async ({
const query = queries[table][action];
const variables = buildVariables(query, world);
const client = (await getClient(world.activeUserEmail)).client;
const { result } = await client.request<Record<"result", any>>(
const { result } = await client.request<Record<"result", GQLQueryResult>>(
query,
variables,
);
Expand Down
3 changes: 2 additions & 1 deletion e2e/tests/api-driven/src/permissions/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { strict as assert } from "node:assert";
import { getUser } from "../globalHelpers";
import {
Action,
GQLQueryResult,
Table,
addUserToTeam,
cleanup,
Expand All @@ -28,7 +29,7 @@ export class CustomWorld extends World {
activeUserEmail!: string;

error?: Error = undefined;
result: unknown[] | Record<"returning", unknown[]> | null = null;
result: GQLQueryResult = null;
}

Before<CustomWorld>("@team-admin-permissions", async function () {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/ui-driven/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"postinstall": "./install-dependencies.sh"
},
"dependencies": {
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3a85966",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#c2d6f35",
"axios": "^1.4.0",
"dotenv": "^16.3.1",
"eslint": "^8.44.0",
Expand Down
29 changes: 9 additions & 20 deletions e2e/tests/ui-driven/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions e2e/tests/ui-driven/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface Context {
team: {
id?: number;
name: string;
slug?: string;
slug: string;
logo: string;
primaryColor: string;
homepage: string;
Expand Down Expand Up @@ -50,13 +50,13 @@ export const contextDefaults: Context = {
export async function setUpTestContext(
initialContext: Context,
): Promise<Context> {
const core = getCoreDomainClient();
const $admin = getCoreDomainClient();
const context: Context = { ...initialContext };
if (context.user) {
context.user.id = await core.createUser(context.user);
context.user.id = await $admin.user.create(context.user);
}
if (context.team) {
context.team.id = await core.createTeam({
context.team.id = await $admin.team.create({
slug: context.team.slug,
name: context.team.name,
logo: context.team.logo,
Expand All @@ -71,12 +71,12 @@ export async function setUpTestContext(
context.team?.id &&
context.user?.id
) {
context.flow.id = await core.createFlow({
context.flow.id = await $admin.flow.create({
slug: context.flow.slug,
teamId: context.team.id,
data: context.flow!.data!,
});
context.flow.publishedId = await core.publishFlow({
context.flow.publishedId = await $admin.flow.publish({
flow: {
id: context.flow.id,
data: context.flow!.data!,
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@mui/styles": "^5.14.5",
"@mui/utils": "^5.14.5",
"@opensystemslab/map": "^0.7.5",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3a85966",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#c2d6f35",
"@tiptap/core": "^2.0.3",
"@tiptap/extension-bold": "^2.0.3",
"@tiptap/extension-bubble-menu": "^2.1.6",
Expand Down
Loading

0 comments on commit 017f77c

Please sign in to comment.