Skip to content

Commit aae7db1

Browse files
fix: stop exporting internal types
1 parent 578015e commit aae7db1

File tree

6 files changed

+48
-48
lines changed

6 files changed

+48
-48
lines changed

src/utils/subgraphQuery.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { GraphQLClient, gql } from 'graphql-request';
2-
import { Contact, GraphQLResponse, ProtectedDataQuery } from '../index.js';
2+
import { Contact } from '../index.js';
33
import { WorkflowError } from './errors.js';
4+
import {
5+
GraphQLResponse,
6+
ProtectedDataQuery,
7+
} from '../web3mail/internalTypes.js';
48

59
const checkProtectedDataQuery = gql`
610
query GetValidContacts(

src/web3mail/fetchMyContacts.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { booleanSchema, throwIfMissing } from '../utils/validators.js';
22
import { fetchUserContacts } from './fetchUserContacts.js';
33
import {
4-
Contact,
54
DappAddressConsumer,
65
DappWhitelistAddressConsumer,
7-
FetchMyContactsParams,
86
IExecConsumer,
97
SubgraphConsumer,
10-
} from './types.js';
8+
} from './internalTypes.js';
9+
import { Contact, FetchMyContactsParams } from './types.js';
1110

1211
export type FetchMyContacts = typeof fetchMyContacts;
1312

src/web3mail/fetchUserContacts.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ import {
1212
isEnsTest,
1313
throwIfMissing,
1414
} from '../utils/validators.js';
15+
import { Contact, FetchUserContactsParams } from './types.js';
1516
import {
16-
Contact,
1717
DappAddressConsumer,
1818
DappWhitelistAddressConsumer,
19-
FetchUserContactsParams,
2019
IExecConsumer,
2120
SubgraphConsumer,
22-
} from './types.js';
21+
} from './internalTypes.js';
2322

2423
export const fetchUserContacts = async ({
2524
graphQLClient = throwIfMissing(),

src/web3mail/internalTypes.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { IExec } from 'iexec';
2+
import { AddressOrENS } from './types.js';
3+
import { GraphQLClient } from 'graphql-request';
4+
5+
export type ProtectedDataQuery = {
6+
id: string;
7+
name: string;
8+
};
9+
10+
export type GraphQLResponse = {
11+
protectedDatas: ProtectedDataQuery[];
12+
};
13+
14+
export type DappAddressConsumer = {
15+
dappAddressOrENS: AddressOrENS;
16+
};
17+
18+
export type IpfsNodeConfigConsumer = {
19+
ipfsNode: string;
20+
};
21+
22+
export type IpfsGatewayConfigConsumer = {
23+
ipfsGateway: string;
24+
};
25+
26+
export type DappWhitelistAddressConsumer = {
27+
dappWhitelistAddress: string;
28+
};
29+
30+
export type IExecConsumer = {
31+
iexec: IExec;
32+
};
33+
34+
export type SubgraphConsumer = {
35+
graphQLClient: GraphQLClient;
36+
};

src/web3mail/sendEmail.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ import {
2626
checkUserVoucher,
2727
filterWorkerpoolOrders,
2828
} from './sendEmail.models.js';
29+
import { SendEmailParams, SendEmailResponse } from './types.js';
2930
import {
3031
DappAddressConsumer,
3132
DappWhitelistAddressConsumer,
3233
IExecConsumer,
3334
IpfsGatewayConfigConsumer,
3435
IpfsNodeConfigConsumer,
35-
SendEmailParams,
36-
SendEmailResponse,
3736
SubgraphConsumer,
38-
} from './types.js';
37+
} from './internalTypes.js';
3938

4039
export type SendEmail = typeof sendEmail;
4140

src/web3mail/types.ts

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import { GraphQLClient } from 'graphql-request';
2-
import { EnhancedWallet, IExec } from 'iexec';
1+
import { EnhancedWallet } from 'iexec';
32
import { IExecConfigOptions } from 'iexec/IExecConfig';
43

54
export type Web3SignerProvider = EnhancedWallet;
65

7-
export type IExecConsumer = {
8-
iexec: IExec;
9-
};
10-
116
export type ENS = string;
127

138
export type AddressOrENS = Address | ENS;
@@ -58,22 +53,6 @@ export type SendEmailResponse = {
5853
taskId: string;
5954
};
6055

61-
/**
62-
* Internal props for querying the subgraph
63-
*/
64-
export type ProtectedDataQuery = {
65-
id: string;
66-
name: string;
67-
};
68-
69-
export type GraphQLResponse = {
70-
protectedDatas: ProtectedDataQuery[];
71-
};
72-
73-
export type SubgraphConsumer = {
74-
graphQLClient: GraphQLClient;
75-
};
76-
7756
/**
7857
* Configuration options for Web3Mail.
7958
*/
@@ -121,19 +100,3 @@ export type Web3MailConfigOptions = {
121100
*/
122101
allowExperimentalNetworks?: boolean;
123102
};
124-
125-
export type DappAddressConsumer = {
126-
dappAddressOrENS: AddressOrENS;
127-
};
128-
129-
export type IpfsNodeConfigConsumer = {
130-
ipfsNode: string;
131-
};
132-
133-
export type IpfsGatewayConfigConsumer = {
134-
ipfsGateway: string;
135-
};
136-
137-
export type DappWhitelistAddressConsumer = {
138-
dappWhitelistAddress: string;
139-
};

0 commit comments

Comments
 (0)