Skip to content

Commit 4f7d5bb

Browse files
Merge branch 'develop' into feature/add-optional-path-param-in-processProtectedData
2 parents 8b2614f + 040f8b7 commit 4f7d5bb

File tree

10 files changed

+60
-53
lines changed

10 files changed

+60
-53
lines changed

.drone.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -668,43 +668,49 @@ trigger:
668668
event:
669669
- promote
670670
target:
671-
# deploy the dataprotector subgraph
672-
- subgraph-deploy-dev
673671
# deploy the dataprotector subgraph for the staging environment
674672
- subgraph-deploy-staging
673+
# deploy the dataprotector subgraph
674+
- subgraph-deploy-tmp
675675
# deploy the dataprotector subgraph for the prod environment
676676
- subgraph-deploy-prod
677677
branch:
678678
- develop
679679
- main
680680

681681
steps:
682-
- name: deploy-v2-dev
682+
- name: install deps
683+
image: node:18.19
684+
pull: always
685+
commands:
686+
- cd packages/subgraph
687+
- npm ci
688+
689+
- name: deploy-v2-staging
683690
image: node:18.19
684691
params:
685692
- START_BLOCK
686693
environment:
687694
GRAPHNODE_URL:
688-
from_secret: graphnode-url
695+
from_secret: graphnode-url-staging
689696
IPFS_URL:
690-
from_secret: ipfs-url
691-
ENV: prod
697+
from_secret: ipfs-url-staging
698+
ENV: staging
692699
commands:
693700
- cd packages/subgraph
694-
- export SUBGRAPH_NAME=bellecour/dev-dataprotector-v2
701+
- export SUBGRAPH_NAME=bellecour/staging-dataprotector-v2
695702
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
696-
- npm ci
697703
- npm run codegen
698704
- npm run build
699705
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
700-
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $DRONE_COMMIT
706+
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $(npm pkg get version)
701707
when:
702708
target:
703-
- subgraph-deploy-dev
709+
- subgraph-deploy-staging
704710
branch:
705711
- develop
706712

707-
- name: deploy-v2-prod
713+
- name: deploy-v2-tmp
708714
image: node:18.19
709715
params:
710716
- START_BLOCK
@@ -716,20 +722,19 @@ steps:
716722
ENV: prod
717723
commands:
718724
- cd packages/subgraph
719-
- export SUBGRAPH_NAME=bellecour/dataprotector-v2
725+
- export SUBGRAPH_NAME=bellecour/tmp-dataprotector-v2
720726
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
721-
- npm ci
722727
- npm run codegen
723728
- npm run build
724729
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
725-
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $(npm pkg get version)
730+
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $DRONE_COMMIT
726731
when:
727732
target:
728-
- subgraph-deploy-prod
733+
- subgraph-deploy-tmp
729734
branch:
730735
- main
731736

732-
- name: deploy-v2-staging
737+
- name: deploy-v2-prod
733738
image: node:18.19
734739
params:
735740
- START_BLOCK
@@ -738,21 +743,20 @@ steps:
738743
from_secret: graphnode-url
739744
IPFS_URL:
740745
from_secret: ipfs-url
741-
ENV: staging
746+
ENV: prod
742747
commands:
743748
- cd packages/subgraph
744-
- export SUBGRAPH_NAME=bellecour/staging-dataprotector-v2
749+
- export SUBGRAPH_NAME=bellecour/dataprotector-v2
745750
- echo "deploying commit $DRONE_COMMIT on subgraph $SUBGRAPH_NAME"
746-
- npm ci
747751
- npm run codegen
748752
- npm run build
749753
- npx graph create --node $GRAPHNODE_URL $SUBGRAPH_NAME
750754
- npx graph deploy --node $GRAPHNODE_URL $SUBGRAPH_NAME --ipfs $IPFS_URL --version-label $(npm pkg get version)
751755
when:
752756
target:
753-
- subgraph-deploy-staging
757+
- subgraph-deploy-prod
754758
branch:
755-
- develop
759+
- main
756760

757761
---
758762
#pipeline to deploy app whitelist on iexec
@@ -937,7 +941,7 @@ steps:
937941
from_secret: nexus-password
938942
tags:
939943
- dev
940-
- 'dev-${DRONE_COMMIT}'
944+
- "dev-${DRONE_COMMIT}"
941945
when:
942946
branch:
943947
- develop

packages/sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Changed
88

99
- Add optional `path` param in `processProtectedData`
10+
- Moved `getResultFromCompletedTask` method from DataProtectorSharing module (DPS) to DataProtectorCore module (DPC).
1011

1112
## [2.0.0-beta.11] (2025-01-29)
1213

packages/sdk/src/lib/dataProtectorCore/IExecDataProtectorCore.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
ProcessProtectedDataResponse,
1111
ProtectDataParams,
1212
ProtectedData,
13+
GetResultFromCompletedTaskParams,
14+
GetResultFromCompletedTaskResponse,
1315
ProtectedDataWithSecretProps,
1416
RevokeAllAccessParams,
1517
RevokedAccess,
@@ -18,6 +20,7 @@ import {
1820
} from '../types/index.js';
1921
import { getGrantedAccess } from './getGrantedAccess.js';
2022
import { getProtectedData } from './getProtectedData.js';
23+
import { getResultFromCompletedTask } from './getResultFromCompletedTask.js';
2124
import { grantAccess } from './grantAccess.js';
2225
import { processProtectedData } from './processProtectedData.js';
2326
import { protectData } from './protectData.js';
@@ -84,6 +87,16 @@ class IExecDataProtectorCore extends IExecDataProtectorModule {
8487
): Promise<GrantedAccessResponse> {
8588
return getGrantedAccess({ ...args, iexec: this.iexec });
8689
}
90+
91+
async getResultFromCompletedTask(
92+
args: GetResultFromCompletedTaskParams
93+
): Promise<GetResultFromCompletedTaskResponse> {
94+
await isValidProvider(this.iexec);
95+
return getResultFromCompletedTask({
96+
...args,
97+
iexec: this.iexec,
98+
});
99+
}
87100
}
88101

89102
export { IExecDataProtectorCore };

packages/sdk/src/lib/dataProtectorSharing/getResultFromCompletedTask.ts renamed to packages/sdk/src/lib/dataProtectorCore/getResultFromCompletedTask.ts

File renamed without changes.

packages/sdk/src/lib/dataProtectorCore/processProtectedData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
validateOnStatusUpdateCallback,
2323
} from '../../utils/validators.js';
2424
import { isERC734 } from '../../utils/whitelist.js';
25-
import { getResultFromCompletedTask } from '../dataProtectorSharing/getResultFromCompletedTask.js';
25+
import { getResultFromCompletedTask } from './getResultFromCompletedTask.js';
2626
import {
2727
OnStatusUpdateFn,
2828
ProcessProtectedDataParams,

packages/sdk/src/lib/dataProtectorSharing/IExecDataProtectorSharing.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import {
2020
GetProtectedDataPricingParamsResponse,
2121
GetRentalsParams,
2222
GetRentalsResponse,
23-
GetResultFromCompletedTaskParams,
24-
GetResultFromCompletedTaskResponse,
2523
GetUserAppWhitelistParams,
2624
GetUserAppWhitelistResponse,
2725
RemoveCollectionParams,
@@ -50,7 +48,6 @@ import { getCollectionSubscriptions } from './getCollectionSubscriptions.js';
5048
import { getProtectedDataInCollections } from './getProtectedDataInCollections.js';
5149
import { getProtectedDataPricingParams } from './getProtectedDataPricingParams.js';
5250
import { getRentals } from './getRentals.js';
53-
import { getResultFromCompletedTask } from './getResultFromCompletedTask.js';
5451
import { getUserAddOnlyAppWhitelist } from './getUserAddOnlyAppWhitelist.js';
5552
import { removeCollection } from './removeCollection.js';
5653
import { removeProtectedDataForSale } from './removeProtectedDataForSale.js';
@@ -254,16 +251,6 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
254251
});
255252
}
256253

257-
async getResultFromCompletedTask(
258-
args: GetResultFromCompletedTaskParams
259-
): Promise<GetResultFromCompletedTaskResponse> {
260-
await isValidProvider(this.iexec);
261-
return getResultFromCompletedTask({
262-
...args,
263-
iexec: this.iexec,
264-
});
265-
}
266-
267254
// -------------------- Apps whitelist --------------------
268255

269256
async createAddOnlyAppWhitelist(): Promise<CreateAppWhitelistResponse> {

packages/sdk/src/lib/dataProtectorSharing/consumeProtectedData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
SharingContractConsumer,
2828
} from '../types/index.js';
2929
import { IExecConsumer } from '../types/internalTypes.js';
30-
import { getResultFromCompletedTask } from './getResultFromCompletedTask.js';
30+
import { getResultFromCompletedTask } from '../dataProtectorCore/getResultFromCompletedTask.js';
3131
import { getAppWhitelistContract } from './smartContract/getAddOnlyAppWhitelistContract.js';
3232
import { getSharingContract } from './smartContract/getSharingContract.js';
3333
import {

packages/sdk/src/lib/types/coreTypes.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,23 @@ export type GrantedAccessResponse = {
209209
grantedAccess: GrantedAccess[];
210210
};
211211

212+
// ---------------------GetResultFromCompletedTask Types------------------------------------
213+
214+
export type GetResultFromCompletedTaskStatuses =
215+
| 'CONSUME_RESULT_DOWNLOAD'
216+
| 'CONSUME_RESULT_DECRYPT';
217+
218+
export type GetResultFromCompletedTaskParams = {
219+
taskId: string;
220+
path?: string;
221+
pemPrivateKey?: string;
222+
onStatusUpdate?: OnStatusUpdateFn<GetResultFromCompletedTaskStatuses>;
223+
};
224+
225+
export type GetResultFromCompletedTaskResponse = {
226+
result: ArrayBuffer;
227+
};
228+
212229
// ---------------------RevokeAccess Types------------------------------------
213230
export type RevokeAllAccessStatuses =
214231
| 'RETRIEVE_ALL_GRANTED_ACCESS'

packages/sdk/src/lib/types/sharingTypes.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,6 @@ export type ConsumeProtectedDataResponse = {
120120
pemPrivateKey: string;
121121
};
122122

123-
export type GetResultFromCompletedTaskStatuses =
124-
| 'CONSUME_RESULT_DOWNLOAD'
125-
| 'CONSUME_RESULT_DECRYPT';
126-
127-
export type GetResultFromCompletedTaskParams = {
128-
taskId: string;
129-
path?: string;
130-
pemPrivateKey?: string;
131-
onStatusUpdate?: OnStatusUpdateFn<GetResultFromCompletedTaskStatuses>;
132-
};
133-
134-
export type GetResultFromCompletedTaskResponse = {
135-
result: ArrayBuffer;
136-
};
137-
138123
// ---------------------Collection Types------------------------------------
139124

140125
export type Collection = {

packages/sdk/tests/e2e/dataProtectorCore/processProtectedData.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe.skip('dataProtectorCore.processProtectedData()', () => {
8282

8383
const mockArrayBuffer = new ArrayBuffer(8);
8484
jest.unstable_mockModule(
85-
'../../../src/lib/dataProtectorSharing/getResultFromCompletedTask.js',
85+
'../../../src/lib/dataProtectorCore/getResultFromCompletedTask.js',
8686
() => {
8787
return {
8888
getResultFromCompletedTask: jest

0 commit comments

Comments
 (0)