Skip to content

Commit a469968

Browse files
authored
Merge pull request #62 from 0xPolygonID/feature/pid-556
Fix circular dependencies issue
2 parents 4ce1a1a + 5f46951 commit a469968

File tree

6 files changed

+33
-29
lines changed

6 files changed

+33
-29
lines changed

.github/workflows/ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
- name: Run ESLint
4141
run: npm run lint
4242

43-
# - name: Circular dependency check
44-
# run: npm run deps:check
45-
4643
- name: Run Build
4744
run: npm run build
4845

46+
- name: Circular dependency check
47+
run: npm run deps:check
48+
4949
- name: Download regular circuits for CI 'latest.zip' from S3
5050
run: mkdir ./tests/proofs/testdata && wget https://iden3-circuits-bucket.s3.eu-west-1.amazonaws.com/latest.zip -P ./tests/proofs/testdata
5151

src/iden3comm/types/index.ts

-10
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,3 @@ export * from './protocol/revocation';
66

77
export * from './packer';
88
export * from './packageManager';
9-
/**
10-
* Protocol message type
11-
*/
12-
export type ProtocolMessage = string;
13-
14-
type JSONValue = string | number | boolean | object | Array<object>;
15-
16-
export type JSONObject = {
17-
[x: string]: JSONValue;
18-
};

src/iden3comm/types/packageManager.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
import { IPacker, PackerParams } from './packer';
1+
import { BasicMessage, IPacker, PackerParams } from './packer';
22
import { MediaType } from '../constants';
3-
import { ProtocolMessage } from '.';
4-
5-
export type BasicMessage = {
6-
id: string;
7-
typ?: MediaType;
8-
type: ProtocolMessage;
9-
thid?: string;
10-
body?: unknown;
11-
from?: string;
12-
to?: string;
13-
};
143

154
/**
165
* Interface for defining the registry of packers

src/iden3comm/types/packer.ts

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
import { DID } from '@iden3/js-iden3-core';
22
import { DataPrepareHandlerFunc, VerificationHandlerFunc } from '../packers';
3-
import { BasicMessage } from './index';
43
import { ProvingMethodAlg } from '@iden3/js-jwz';
54
import { CircuitId } from '../../circuits';
65
import { MediaType } from '../constants';
76

7+
/**
8+
* Protocol message type
9+
*/
10+
export type ProtocolMessage = string;
11+
12+
/**
13+
* JSONValue
14+
*/
15+
type JSONValue = string | number | boolean | object | Array<object>;
16+
17+
/**
18+
* JSON object
19+
*/
20+
export type JSONObject = {
21+
[x: string]: JSONValue;
22+
};
23+
24+
export type BasicMessage = {
25+
id: string;
26+
typ?: MediaType;
27+
type: ProtocolMessage;
28+
thid?: string;
29+
body?: unknown;
30+
from?: string;
31+
to?: string;
32+
};
33+
834
/**
935
* parameters for any packer
1036
*/

src/iden3comm/types/protocol/auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ZKProof } from '@iden3/js-jwz';
22
import { MediaType } from '../../constants';
3-
import { JSONObject, ProtocolMessage } from '../index';
3+
import { JSONObject, ProtocolMessage } from '../packer';
44

55
/** AuthorizationResponseMessage is struct the represents iden3message authorization response */
66
export type AuthorizationResponseMessage = {

src/iden3comm/types/protocol/credentials.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { ProtocolMessage } from '../index';
2-
import { JSONObject } from '../index';
31
import { W3CCredential } from '../../../verifiable';
42
import { MediaType } from '../../constants';
3+
import { JSONObject, ProtocolMessage } from '../packer';
54

65
/** CredentialIssuanceRequestMessageBody represents data for credential issuance request */
76
export type CredentialIssuanceRequestMessageBody = {

0 commit comments

Comments
 (0)