Skip to content

Commit a69ccb4

Browse files
committed
refactor(docs): update iApp documentation to enhance clarity and consistency in terminology
1 parent 841ed30 commit a69ccb4

File tree

6 files changed

+259
-413
lines changed

6 files changed

+259
-413
lines changed

src/references/iapp-generator/sdk/getGrantedAccess.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
title: getGrantedAccess
33
description:
4-
Retrieve all granted access details for a protected data object with iExec's
4+
Retrieve all granted access details for an iApp with iExec's
55
getGrantedAccess method. Filter access by user, application, or both, and
66
manage access with pagination.
77
---
88

99
# getGrantedAccess
1010

1111
This method provides a listing of all access grants given for the specified
12-
protected data object. Options for filtering include specifying an authorized
13-
user, an authorized app, or both.
12+
iApp. Options for filtering include specifying an authorized
13+
user, an authorized protected data, or both.
1414

1515
## Usage
1616

@@ -25,8 +25,8 @@ const web3Provider = getWeb3Provider('PRIVATE_KEY');
2525
const dataProtectorCore = new IExecIApp(web3Provider);
2626
// ---cut---
2727
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
28-
protectedData: '0x123abc...',
29-
authorizedApp: '0x456def...',
28+
iapp: '0x123abc...',
29+
authorizedProtectedData: '0x456def...',
3030
authorizedUser: '0x789cba...',
3131
page: 1,
3232
pageSize: 100,
@@ -39,14 +39,14 @@ const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
3939
import { type GetGrantedAccessParams } from '@mage-sombre/iapp';
4040
```
4141

42-
### protectedData <OptionalBadge />
42+
### iapp <OptionalBadge />
4343

4444
**Type:** `AddressOrENS`
4545

46-
Address of the protected data object for which you are querying access
46+
Address of the iApp for which you are querying access
4747
authorization grants. It's a representation of ethereum address or ENS name
4848
(Ethereum Name Service). If no address is specified, it will return all granted
49-
access for any protected data.
49+
access for any iApp.
5050

5151
**Usage example:**
5252

@@ -57,18 +57,18 @@ const web3Provider = getWeb3Provider('PRIVATE_KEY');
5757
const dataProtectorCore = new IExecIApp(web3Provider);
5858
// ---cut---
5959
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
60-
protectedData: '0x123abc...', // [!code focus]
60+
iapp: '0x123abc...', // [!code focus]
6161
});
6262
```
6363

64-
### authorizedApp <OptionalBadge />
64+
### authorizedProtectedData <OptionalBadge />
6565

6666
**Type:** `AddressOrENS`
6767

6868
Optional filter to restrict the results to include only authorizations for the
69-
specified application. It's a representation of ethereum address or ENS name
69+
specified protected data. It's a representation of ethereum address or ENS name
7070
(Ethereum Name Service). If no address is specified, it will return all granted
71-
access for any application.
71+
access for any protected data.
7272

7373
**Usage example:**
7474

@@ -79,19 +79,19 @@ const web3Provider = getWeb3Provider('PRIVATE_KEY');
7979
const dataProtectorCore = new IExecIApp(web3Provider);
8080
// ---cut---
8181
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
82-
authorizedApp: '0x456def...', // [!code focus]
82+
authorizedProtectedData: '0x456def...', // [!code focus]
8383
});
8484
```
8585

8686
::: tip
8787

88-
If you specified an application whitelist when using
89-
[`grantAccess`](/references/dataProtector/dataProtectorCore/grantAccess), you
88+
If you specified a protected data whitelist when using
89+
[`grantAccess`](/references/iapp-generator/sdk/grantAccess), you
9090
must specify that same whitelist address when using this filtering option. The
9191
`getGrantedAccess` method does not check against whitelist smart contracts when
92-
aggregating results. If you granted authorization to a whitelist but specify an
93-
application address for the `authorizedApp` parameter, you will not receive any
94-
results unless you _also_ explicitly granted access to that application address.
92+
aggregating results. If you granted authorization to a whitelist but specify a
93+
protected data address for the `authorizedProtectedData` parameter, you will not receive any
94+
results unless you _also_ explicitly granted access to that protected data address.
9595

9696
:::
9797

@@ -133,8 +133,8 @@ const dataProtectorCore = new IExecIApp(web3Provider);
133133
// ---cut---
134134

135135
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
136-
protectedData: '0x123abc...',
137-
authorizedApp: '0x456def...',
136+
iapp: '0x123abc...',
137+
authorizedProtectedData: '0x456def...',
138138
authorizedUser: '0x789cba...',
139139
isUserStrict: true, // [!code focus]
140140
});
@@ -160,7 +160,7 @@ const web3Provider = getWeb3Provider('PRIVATE_KEY');
160160
const dataProtectorCore = new IExecIApp(web3Provider);
161161
// ---cut---
162162
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
163-
protectedData: '0x123abc...',
163+
iapp: '0x123abc...',
164164
page: 1, // [!code focus]
165165
pageSize: 100,
166166
});
@@ -185,7 +185,7 @@ const web3Provider = getWeb3Provider('PRIVATE_KEY');
185185
const dataProtectorCore = new IExecIApp(web3Provider);
186186
// ---cut---
187187
const listGrantedAccess = await dataProtectorCore.getGrantedAccess({
188-
protectedData: '0x123abc...',
188+
iapp: '0x123abc...',
189189
page: 1,
190190
pageSize: 100, // [!code focus]
191191
});
@@ -201,7 +201,7 @@ The return value for this method has two fields: a `count` parameter indicating
201201
the number of results, and an array of `GrantedAccess` objects containing all
202202
access data. When using the optional paging parameters, the `count` will be
203203
limited by the selected `pageSize` parameter. You may use these result objects
204-
in conjunction with the [revokeOneAccess](revokeOneAccess.md) method to revoke a
204+
in conjunction with the [revokeOneAccess](/references/iapp-generator/sdk/revokeOneAccess) method to revoke a
205205
previously granted authorization for access.
206206

207207
### count

src/references/iapp-generator/sdk/getIApp.md

Lines changed: 59 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
---
22
title: getIApp
33
description:
4-
Retrieve all protected data for a specific owner or schema with the getIApp
5-
method in iExec DataProtector. Easily access encrypted data and metadata,
4+
Retrieve all iApps for a specific owner or filter by creation date with the getIApp
5+
method in iExec iApp Generator SDK. Easily access iApp metadata and information,
66
sorted by creation date.
77
---
88

99
# getIApp
1010

11-
This method allows the user to retrieve all protected data for a given owner,
12-
data schema, or both.
11+
This method allows the user to retrieve all iApps for a given owner or filter by creation timestamp.
1312

1413
Results are ordered by `creationTimestamp` desc.
1514

1615
::: tip
1716

18-
A data schema is the metadata describing the contents of the protected data
19-
object. The schema is returned as part of the [protectData](protectData.md)
20-
method invocation.
17+
An iApp is a confidential computing application that runs in secure TEE environments.
18+
The method returns iApp metadata including name, address, owner, and creation timestamp.
2119

2220
:::
2321

@@ -29,113 +27,67 @@ import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
2927
const web3Provider = getWeb3Provider('PRIVATE_KEY');
3028
const dataProtectorCore = new IExecIApp(web3Provider);
3129
// ---cut---
32-
const listProtectedData = await dataProtectorCore.getIApp({
30+
const listIApps = await dataProtectorCore.getIApp({
3331
owner: '0xa0c15e...',
34-
requiredSchema: {
35-
email: 'string',
36-
},
32+
createdAfterTimestamp: 1640995200,
33+
page: 1,
34+
pageSize: 20,
3735
});
3836
```
3937

4038
## Parameters
4139

4240
```ts twoslash
43-
import { type GetProtectedDataParams } from '@mage-sombre/iapp';
41+
import { type GetIAppParams } from '@mage-sombre/iapp';
4442
```
4543

46-
### protectedDataAddress <OptionalBadge />
44+
### iapp <OptionalBadge />
4745

4846
**Type:** `AddressOrENS`
4947

50-
Returns the protected data associated with this address.
51-
Returns an empty array if the protected data is not found.
52-
53-
```ts twoslash
54-
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
55-
56-
const web3Provider = getWeb3Provider('PRIVATE_KEY');
57-
const dataProtectorCore = new IExecIApp(web3Provider);
58-
// ---cut---
59-
const oneProtectedData = await dataProtectorCore.getIApp({
60-
protectedDataAddress: '0x123abc...', // [!code focus]
61-
});
62-
```
63-
64-
### requiredSchema <OptionalBadge />
65-
66-
**Type:** `SearchableDataSchema`
67-
68-
Provides a list of protected data objects matching this schema.
69-
70-
<!-- prettier-ignore-start -->
71-
```ts twoslash
72-
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
73-
74-
const web3Provider = getWeb3Provider('PRIVATE_KEY');
75-
const dataProtectorCore = new IExecIApp(web3Provider);
76-
// ---cut---
77-
const listProtectedData = await dataProtectorCore.getIApp({
78-
requiredSchema: { // [!code focus]
79-
email: 'string', // [!code focus]
80-
}, // [!code focus]
81-
});
82-
```
83-
<!-- prettier-ignore-end -->
84-
85-
It's also possible to provide a list of accepted types for one schema field:
48+
Returns the iApp associated with this address.
49+
Returns an empty array if the iApp is not found.
8650

87-
<!-- prettier-ignore-start -->
8851
```ts twoslash
8952
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
9053

9154
const web3Provider = getWeb3Provider('PRIVATE_KEY');
9255
const dataProtectorCore = new IExecIApp(web3Provider);
9356
// ---cut---
94-
const listProtectedData = await dataProtectorCore.getIApp({
95-
requiredSchema: { // [!code focus]
96-
picture: ['image/png', 'image/jpeg'], // [!code focus]
97-
}, // [!code focus]
57+
const oneIApp = await dataProtectorCore.getIApp({
58+
iapp: '0x123abc...', // [!code focus]
9859
});
9960
```
100-
<!-- prettier-ignore-end -->
101-
102-
Available types are listed
103-
[here](/references/dataProtector/dataProtectorCore/protectData#schema).
10461

10562
### owner <OptionalBadge />
10663

10764
**Type:** `AddressOrENS`
10865

109-
Provides a list of protected data objects owned by the user with this ETH
110-
address.
66+
Returns all iApps owned by this address.
11167

11268
```ts twoslash
11369
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
11470

11571
const web3Provider = getWeb3Provider('PRIVATE_KEY');
11672
const dataProtectorCore = new IExecIApp(web3Provider);
11773
// ---cut---
118-
const listProtectedData = await dataProtectorCore.getIApp({
74+
const iAppsByOwner = await dataProtectorCore.getIApp({
11975
owner: '0xa0c15e...', // [!code focus]
12076
});
121-
```
122-
12377
### createdAfterTimestamp <OptionalBadge />
12478

12579
**Type:** `number`
12680

127-
Provides a list of protected data objects created after this timestamp value.
128-
The provided value should be in seconds.
81+
Returns all iApps created after this timestamp (Unix timestamp in seconds).
12982

13083
```ts twoslash
13184
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
13285
13386
const web3Provider = getWeb3Provider('PRIVATE_KEY');
13487
const dataProtectorCore = new IExecIApp(web3Provider);
13588
// ---cut---
136-
const listProtectedData = await dataProtectorCore.getIApp({
137-
owner: '0xa0c15e...',
138-
createdAfterTimestamp: 1710257612, // March 12, 2024 15:33:32 GMT // [!code focus]
89+
const recentIApps = await dataProtectorCore.getIApp({
90+
createdAfterTimestamp: 1640995200, // [!code focus]
13991
});
14092
```
14193

@@ -144,54 +96,76 @@ const listProtectedData = await dataProtectorCore.getIApp({
14496
**Type:** `number`
14597
**Default:** `0`
14698

147-
Specifies the results page to return. Pages are indexed starting at page 0. If
148-
using this field you may also specify a `pageSize` to control the size of the
149-
results.
99+
Specifies the page number of the result set to return. Pages are zero-based indexed.
150100

151101
```ts twoslash
152102
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
153103
154104
const web3Provider = getWeb3Provider('PRIVATE_KEY');
155105
const dataProtectorCore = new IExecIApp(web3Provider);
156106
// ---cut---
157-
const listProtectedData = await dataProtectorCore.getIApp({
158-
owner: '0xa0c15e...',
159-
createdAfterTimestamp: 1710257612, // March 12, 2024 15:33:32 GMT
107+
const iAppsPage = await dataProtectorCore.getIApp({
160108
page: 1, // [!code focus]
109+
pageSize: 20,
161110
});
162111
```
163112

164113
### pageSize <OptionalBadge />
165114

166115
**Type:** `number`
167-
**Default:** `1000`
168-
**Range:** `[10...1000]`
116+
**Default:** `20`
169117

170-
Specifies the number of records in each page of the result set. This is used in
171-
conjunction with the optional `page` parameter to constrain the size of the
172-
result.
118+
Specifies the number of records to include in each page of the result set.
173119

174120
```ts twoslash
175121
import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
176122
177123
const web3Provider = getWeb3Provider('PRIVATE_KEY');
178124
const dataProtectorCore = new IExecIApp(web3Provider);
179125
// ---cut---
180-
const listProtectedData = await dataProtectorCore.getIApp({
181-
owner: '0xa0c15e...',
182-
createdAfterTimestamp: 1710257612, // March 12, 2024 15:33:32 GMT
126+
const iAppsPage = await dataProtectorCore.getIApp({
183127
page: 1,
184-
pageSize: 100, // [!code focus]
128+
pageSize: 50, // [!code focus]
185129
});
186130
```
187131

188132
## Return Value
189133

190134
```ts twoslash
191-
import { type ProtectedData } from '@mage-sombre/iapp';
135+
import { type IApp } from '@mage-sombre/iapp';
192136
```
193137

194-
See [`ProtectedData`](/references/iapp-generator/sdk/types#protecteddata)
138+
The method returns an array of `IApp` objects containing the following fields:
139+
140+
### name
141+
142+
`string`
143+
144+
The name of the iApp.
145+
146+
### address
147+
148+
`Address`
149+
150+
The Ethereum address of the iApp.
151+
152+
### owner
153+
154+
`Address`
155+
156+
The Ethereum address of the iApp owner.
157+
158+
### creationTimestamp
159+
160+
`number`
161+
162+
The Unix timestamp (in seconds) when the iApp was created.
163+
164+
### multiaddr
165+
166+
`string` (optional)
167+
168+
The multiaddress for P2P communication with the iApp.
195169

196170
<script setup>
197171
import OptionalBadge from '@/components/OptionalBadge.vue'

0 commit comments

Comments
 (0)