Skip to content

Commit

Permalink
Fix modules (#596)
Browse files Browse the repository at this point in the history
* accepts more than one default con

* normalize ensName before adding it to contract list (#582)

* normalize ensName before adding it to contract list

* release 0.2.9

* fix bug in profile that prevented ENS name owners from creating a profile

* release profile and react

* Use latest react package in web (#591)

* fix bug in profile that prevented ENS name owners from creating a profile

* release profile and react

* use dm3-react v0.2.11 in web

* update yarn.lock

* use profile v0.2.2 (#592)

* use profile v0.2.2

* update yarn.lock

* use commonfJs instead of esnext

* replace dist.backend

* use node instead of ts-node

* remove billboard-widget and billdboard-client form packages

* push yarn lock

* remove old backend config

* lint ignore for billboard widget

* remove backend build from pipeline

* remove backen build from action.yml

* repair broken action.yml

* remove all eft over references to dist.backend

* fix global config

* use proper globalConfic Input

* add globa config to resolverEndpint deps
  • Loading branch information
AlexNi245 authored Sep 1, 2023
1 parent e8a734d commit 8c819cb
Show file tree
Hide file tree
Showing 82 changed files with 379 additions and 1,972 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
},
extends: ['prettier'],
plugins: ['no-only-tests'],
ignorePatterns: ['package.json', '**/*.js'],
ignorePatterns: ['package.json', '**/*.js', '**/billboard-widget/**'],
rules: {
'max-len': ['error', { code: 120 }],
'no-console': ['error'],
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jobs:
with:
name: lib-builds
path: packages/lib/**/dist/
- uses: actions/upload-artifact@master
with:
name: lib-backend-builds
path: packages/lib/**/dist.backend/
- uses: actions/upload-artifact@master
with:
name: lib-schema
Expand Down Expand Up @@ -174,4 +170,4 @@ jobs:
uses: ./test-action
with:
workspace-name: 'dm3-offchain-resolver'
package-pat: ${{ secrets.PACKAGE_PAT }}
package-pat: ${{ secrets.PACKAGE_PAT }}
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
"packages/lib/offchainResolver-api",
"packages/lib/billboard-api",
"packages/backend",
"packages/billboard-client",
"packages/react",
"packages/web",
"packages/billboard-widget",
"packages/integration-tests",
"packages/offchain-resolver",
"packages/messenger-widget",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/cli.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const lib = require('dm3-lib/dist.backend');
const lib = require('dm3-lib');

const main = async () => {
const encryptionKeyPair = await lib.crypto.createKeyPair();
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"scripts": {
"docker:up": "docker-compose up -d",
"start": "ts-node --transpile-only ./src/index.ts",
"start": "node ./dist/index.js",
"test": "npm run docker:up && jest --coverage --runInBand --transformIgnorePatterns 'node_modules/(?!(dm3-lib-\\w*)/)'",
"build": "yarn tsc && cp ./config.yml ./dist/config.yml | true",
"createDeliveryServiceProfile": "node --no-warnings ./cli.js"
Expand Down
7 changes: 2 additions & 5 deletions packages/backend/src/auth.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { validateSchema } from 'dm3-lib-shared/dist.backend';
import {
createChallenge,
createNewSessionToken,
} from 'dm3-lib-delivery/dist.backend';
import { validateSchema } from 'dm3-lib-shared';
import { createChallenge, createNewSessionToken } from 'dm3-lib-delivery';

import express from 'express';
import cors from 'cors';
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/cleanup/cleanUpPendingMessages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDatabase } from '../persistance/getDatabase';
import { logInfo } from 'dm3-lib-shared/dist.backend';
import { logInfo } from 'dm3-lib-shared';

//1 day
const DEFAULT_CLEANUP_INTERVAL = 86400000;
Expand Down
7 changes: 2 additions & 5 deletions packages/backend/src/config/getDeliveryServiceProperties.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { parse } from 'yaml';
import { existsSync, readFileSync } from 'fs';
import { resolve } from 'path';
import { logInfo, validateSchema } from 'dm3-lib-shared/dist.backend';
import {
schema,
DeliveryServiceProperties,
} from 'dm3-lib-delivery/dist.backend';
import { logInfo, validateSchema } from 'dm3-lib-shared';
import { schema, DeliveryServiceProperties } from 'dm3-lib-delivery';

const DEFAULT_CONFIG_FILE_PATH = resolve(__dirname, './../config.yml');
const DEFAULT_DELIVERY_SERVICE_PROPERTIES: DeliveryServiceProperties = {
Expand Down
10 changes: 3 additions & 7 deletions packages/backend/src/delivery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ import express from 'express';
import { IDatabase } from './persistance/getDatabase';
import { WithLocals } from './types';
import { auth } from './utils';
import {
schema,
getMessages,
Acknoledgment,
} from 'dm3-lib-delivery/dist.backend';
import { validateSchema } from 'dm3-lib-shared/dist.backend';
import { getConversationId } from 'dm3-lib-storage/dist.backend';
import { schema, getMessages, Acknoledgment } from 'dm3-lib-delivery';
import { validateSchema } from 'dm3-lib-shared';
import { getConversationId } from 'dm3-lib-storage';

const syncAcknoledgmentParamsSchema = {
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getDatabase } from './persistance/getDatabase';
import Profile from './profile';
import RpcProxy from './rpc/rpc-proxy';
import Storage from './storage';
import { logInfo } from 'dm3-lib-shared/dist.backend';
import { logInfo } from 'dm3-lib-shared';

import {
errorHandler,
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/src/messaging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Socket } from 'socket.io';
import { onConnection } from './messaging';
import { testData } from '../../../test-data/encrypted-envelops.test';
import { WithLocals } from './types';
import { Session } from 'dm3-lib-delivery/dist.backend';
import { UserProfile } from 'dm3-lib-profile/dist.backend';
import { createKeyPair } from 'dm3-lib-crypto/dist.backend';
import { ethersHelper } from 'dm3-lib-shared/dist.backend';
import { Session } from 'dm3-lib-delivery';
import { UserProfile } from 'dm3-lib-profile';
import { createKeyPair } from 'dm3-lib-crypto';
import { ethersHelper } from 'dm3-lib-shared';
const SENDER_ADDRESS = '0x25A643B6e52864d0eD816F1E43c0CF49C83B8292';
const RECEIVER_ADDRESS = '0xDd36ae7F9a8E34FACf1e110c6e9d37D0dc917855';

Expand Down
12 changes: 4 additions & 8 deletions packages/backend/src/messaging.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Socket } from 'socket.io';
import express from 'express';
import { WithLocals } from './types';
import { validateSchema } from 'dm3-lib-shared/dist.backend';
import { EncryptionEnvelop } from 'dm3-lib-messaging/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import {
schema,
checkToken,
incomingMessage,
} from 'dm3-lib-delivery/dist.backend';
import { validateSchema } from 'dm3-lib-shared';
import { EncryptionEnvelop } from 'dm3-lib-messaging';
import { normalizeEnsName } from 'dm3-lib-profile';
import { schema, checkToken, incomingMessage } from 'dm3-lib-delivery';

const pendingMessageSchema = {
type: 'object',
Expand Down
9 changes: 3 additions & 6 deletions packages/backend/src/persistance/getDatabase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {
Session as DSSession,
spamFilter,
} from 'dm3-lib-delivery/dist.backend';
import { EncryptionEnvelop } from 'dm3-lib-messaging/dist.backend';
import { UserStorage } from 'dm3-lib-storage/dist.backend';
import { Session as DSSession, spamFilter } from 'dm3-lib-delivery';
import { EncryptionEnvelop } from 'dm3-lib-messaging';
import { UserStorage } from 'dm3-lib-storage';
import { createClient } from 'redis';
import winston from 'winston';
import Messages from './messages';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Redis, IDatabase, getRedisClient, getDatabase } from '../getDatabase';
import winston from 'winston';
import {
DeliveryInformation,
EncryptionEnvelop,
} from 'dm3-lib-messaging/dist.backend';
import { DeliveryInformation, EncryptionEnvelop } from 'dm3-lib-messaging';

const SENDER_ADDRESS = '0x25A643B6e52864d0eD816F1E43c0CF49C83B8292';
const RECEIVER_ADDRESS = '0xDd36ae7F9a8E34FACf1e110c6e9d37D0dc917855';
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/persistance/messages/createMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
schema,
DeliveryInformation,
EncryptionEnvelop,
} from 'dm3-lib-messaging/dist.backend';
import { validateSchema, stringify } from 'dm3-lib-shared/dist.backend';
} from 'dm3-lib-messaging';
import { validateSchema, stringify } from 'dm3-lib-shared';
export function createMessage(redis: Redis) {
return async (
conversationId: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EncryptionEnvelop } from 'dm3-lib-messaging/dist.backend';
import { EncryptionEnvelop } from 'dm3-lib-messaging';
import { Redis, RedisPrefix } from '../getDatabase';
import { getMessages } from './getMessages';

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/messages/getMessages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EncryptionEnvelop } from 'dm3-lib-messaging/dist.backend';
import { EncryptionEnvelop } from 'dm3-lib-messaging';
import { Redis, RedisPrefix } from '../getDatabase';

export function getMessages(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile';
export function syncAcknoledgment(redis: Redis) {
return async (
conversationId: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/pending/addPending.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile';

export function addPending(redis: Redis) {
return async (ensName: string, contactEnsName: string): Promise<void> => {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/session/getIdEnsName.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile';

export function getIdEnsName(redis: Redis) {
return async (ensName: string) =>
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/session/getSession.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { Session, spamFilter } from 'dm3-lib-delivery/dist.backend';
import { Session, spamFilter } from 'dm3-lib-delivery';
import { getIdEnsName } from './getIdEnsName';

export function getSession(redis: Redis) {
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/persistance/session/setSession.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Redis, IDatabase, getRedisClient, getDatabase } from '../getDatabase';
import { UserProfile } from 'dm3-lib-profile/dist.backend';
import { Session } from 'dm3-lib-delivery/dist.backend';
import { UserProfile } from 'dm3-lib-profile';
import { Session } from 'dm3-lib-delivery';
import winston from 'winston';

const USER_ADDRESS = '0x25A643B6e52864d0eD816F1E43c0CF49C83B8292';
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/persistance/session/setSession.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { Session, schema } from 'dm3-lib-delivery/dist.backend';
import { validateSchema, stringify } from 'dm3-lib-shared/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { Session, schema } from 'dm3-lib-delivery';
import { validateSchema, stringify } from 'dm3-lib-shared';
import { normalizeEnsName } from 'dm3-lib-profile';
import { getIdEnsName } from './getIdEnsName';

export function setSession(redis: Redis) {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/storage/getUserStorage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Redis, RedisPrefix } from '../getDatabase';
import { UserStorage } from 'dm3-lib-storage/dist.backend';
import { UserStorage } from 'dm3-lib-storage';
import { getIdEnsName } from '../session/getIdEnsName';

export function getUserStorage(redis: Redis) {
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/persistance/storage/setUserStorage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { stringify } from 'dm3-lib-shared/dist.backend';
import { stringify } from 'dm3-lib-shared';
import { Redis, RedisPrefix } from '../getDatabase';
import { getIdEnsName } from '../session/getIdEnsName';

Expand Down
7 changes: 2 additions & 5 deletions packages/backend/src/profile.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import bodyParser from 'body-parser';

import {
UserProfile,
getProfileCreationMessage,
} from 'dm3-lib-profile/dist.backend';
import { stringify } from 'dm3-lib-shared/dist.backend';
import { UserProfile, getProfileCreationMessage } from 'dm3-lib-profile';
import { stringify } from 'dm3-lib-shared';
import { ethers } from 'ethers';
import express from 'express';
import request from 'supertest';
Expand Down
9 changes: 3 additions & 6 deletions packages/backend/src/profile.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import {
getUserProfile,
submitUserProfile,
} from 'dm3-lib-delivery/dist.backend';
import { normalizeEnsName, schema } from 'dm3-lib-profile/dist.backend';
import { validateSchema } from 'dm3-lib-shared/dist.backend';
import { getUserProfile, submitUserProfile } from 'dm3-lib-delivery';
import { normalizeEnsName, schema } from 'dm3-lib-profile';
import { validateSchema } from 'dm3-lib-shared';
import express, { NextFunction } from 'express';
import { WithLocals } from './types';
import { auth } from './utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { stringify } from 'dm3-lib-shared/dist.backend';
import { stringify } from 'dm3-lib-shared';
import express from 'express';

export function handleGetDeliveryServiceProperties(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Axios } from 'axios';
import { stringify } from 'dm3-lib-shared/dist.backend';
import { stringify } from 'dm3-lib-shared';
import express from 'express';
import { WithLocals } from '../../types';

Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/rpc/methods/handleSubmitMessage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { schema, incomingMessage } from 'dm3-lib-delivery/dist.backend';
import { EncryptionEnvelop } from 'dm3-lib-messaging/dist.backend';
import { validateSchema } from 'dm3-lib-shared/dist.backend';
import { schema, incomingMessage } from 'dm3-lib-delivery';
import { EncryptionEnvelop } from 'dm3-lib-messaging';
import { validateSchema } from 'dm3-lib-shared';
import 'dotenv/config';
import express from 'express';
import { WithLocals } from '../../types';
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/rpc/rpc-proxy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import request from 'supertest';
import RpcProxy from './rpc-proxy';
import { testData } from '../../../../test-data/encrypted-envelops.test';

import { createKeyPair } from 'dm3-lib-crypto/dist.backend';
import { normalizeEnsName, UserProfile } from 'dm3-lib-profile/dist.backend';
import { stringify } from 'dm3-lib-shared/dist.backend';
import { createKeyPair } from 'dm3-lib-crypto';
import { normalizeEnsName, UserProfile } from 'dm3-lib-profile';
import { stringify } from 'dm3-lib-shared';

// eslint-disable-next-line no-console
const log = (toLog: any) => console.log(toLog);
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import express from 'express';
import stringify from 'safe-stable-stringify';
import { WithLocals } from './types';
import { auth } from './utils';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile';

export default () => {
const router = express.Router();
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from 'ethers';
import express from 'express';
import { IDatabase } from './persistance/getDatabase';
import { DeliveryServiceProperties } from 'dm3-lib-delivery/dist.backend';
import { DeliveryServiceProperties } from 'dm3-lib-delivery';

export interface WithLocals {
locals: Record<string, any> &
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { Express, NextFunction, Request, Response } from 'express';
import { Socket } from 'socket.io';
import { ExtendedError } from 'socket.io/dist/namespace';
import { WithLocals } from './types';
import { normalizeEnsName } from 'dm3-lib-profile/dist.backend';
import { checkToken } from 'dm3-lib-delivery/dist.backend';
import { KeyPair } from 'dm3-lib-crypto/dist.backend';
import { normalizeEnsName } from 'dm3-lib-profile';
import { checkToken } from 'dm3-lib-delivery';
import { KeyPair } from 'dm3-lib-crypto';

export async function auth(
req: Request,
Expand Down
14 changes: 0 additions & 14 deletions packages/billboard-widget/.eslintrc.cjs

This file was deleted.

2 changes: 2 additions & 0 deletions packages/billboard-widget/src/components/CreateMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ declare module 'react' {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
extends AriaAttributes,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
DOMAttributes<T> {
enterkeyhint?: string;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/lib/billboard-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"module": "CommonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"outDir": "dist",
"sourceMap": true
},
Expand Down
Loading

0 comments on commit 8c819cb

Please sign in to comment.