Skip to content

Commit

Permalink
Merge branch 'main' into feat/add_batch_upsert_support
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuartu committed Sep 23, 2024
2 parents 6f0da3d + 8c6b6fc commit c2f53f6
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "204.0.0",
"version": "205.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion packages/notification-services-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.8.0]

### Changed

- Update UI export from MATIC to POL ([#4720](https://github.com/MetaMask/core/pull/4720))
- Bump `@metamask/profile-sync-controller` from `^0.8.0` to `^0.8.1` ([#4722]https://github.com/MetaMask/core/pull/4720)

## [0.7.0]

### Changed
Expand Down Expand Up @@ -159,7 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[0.8.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.7.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.6.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.5.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions packages/notification-services-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/notification-services-controller",
"version": "0.7.0",
"version": "0.8.0",
"description": "Manages New MetaMask decentralized Notification system",
"keywords": [
"MetaMask",
Expand Down Expand Up @@ -111,7 +111,7 @@
"@lavamoat/allow-scripts": "^3.0.4",
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-controller": "^17.2.1",
"@metamask/profile-sync-controller": "^0.8.0",
"@metamask/profile-sync-controller": "^0.8.1",
"@types/jest": "^27.4.1",
"@types/readable-stream": "^2.3.0",
"contentful": "^10.15.0",
Expand Down
14 changes: 13 additions & 1 deletion packages/profile-sync-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.8.1]

### Changed

- move and organize shared profile sync dependencies ([#4717](https://github.com/MetaMask/core/pull/4717))

### Fixed

- fix: profile-sync-controller mobile compilation issues ([#4721](https://github.com/MetaMask/core/pull/4721))
- mobile does not support exported async arrow functions, so needed to convert these into normal async functions

## [0.8.0]

### Fixed
Expand Down Expand Up @@ -204,7 +215,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/[email protected]
[0.8.1]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.8.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.7.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
[0.6.0]: https://github.com/MetaMask/core/compare/@metamask/[email protected]...@metamask/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/profile-sync-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/profile-sync-controller",
"version": "0.8.0",
"version": "0.8.1",
"description": "The profile sync helps developers synchronize data across multiple clients and devices in a privacy-preserving way. All data saved in the user storage database is encrypted client-side to preserve privacy. The user storage provides a modular design, giving developers the flexibility to construct and manage their storage spaces in a way that best suits their needs",
"keywords": [
"MetaMask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,70 @@ export const getMockUserStorageEndpoint = (
)}`;
};

export const createMockGetStorageResponse = async (
/**
* Creates a mock GET user-storage response
* @param data - data to encrypt
* @returns a realistic GET Response Body
*/
export async function createMockGetStorageResponse(
data?: string,
): Promise<GetUserStorageResponse> => ({
HashedKey: 'HASHED_KEY',
Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),
});
): Promise<GetUserStorageResponse> {
return {
HashedKey: 'HASHED_KEY',
Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),
};
}

export const createMockAllFeatureEntriesResponse = async (
/**
* Creates a mock GET ALL user-storage response
* @param dataArr - array of data to encrypt
* @returns a realistic GET ALL Response Body
*/
export async function createMockAllFeatureEntriesResponse(
dataArr: string[] = [MOCK_STORAGE_DATA],
): Promise<GetUserStorageAllFeatureEntriesResponse> =>
Promise.all(
dataArr.map(async (d) => ({
HashedKey: 'HASHED_KEY',
Data: await MOCK_ENCRYPTED_STORAGE_DATA(d),
})),
): Promise<GetUserStorageAllFeatureEntriesResponse> {
return await Promise.all(
dataArr.map(async function (d) {
const encryptedData = await MOCK_ENCRYPTED_STORAGE_DATA(d);
return {
HashedKey: 'HASHED_KEY',
Data: encryptedData,
};
}),
);
}

export const getMockUserStorageGetResponse = async (
/**
* Creates a mock user-storage api GET request
* @param path - path of the GET Url
* @returns mock GET API request. Can be used by e2e or unit mock servers
*/
export async function getMockUserStorageGetResponse(
path: UserStoragePathWithFeatureAndKey = 'notifications.notification_settings',
) => {
) {
return {
url: getMockUserStorageEndpoint(path),
requestMethod: 'GET',
response: await createMockGetStorageResponse(),
} satisfies MockResponse;
};
}

export const getMockUserStorageAllFeatureEntriesResponse = async (
/**
* Creates a mock user-storage api GET ALL request
* @param path - path of the GET url
* @param dataArr - data to encrypt
* @returns mock GET ALL API request. Can be used by e2e or unit mock servers
*/
export async function getMockUserStorageAllFeatureEntriesResponse(
path: UserStoragePathWithFeatureOnly = 'notifications',
dataArr?: string[],
) => {
) {
return {
url: getMockUserStorageEndpoint(path),
requestMethod: 'GET',
response: await createMockAllFeatureEntriesResponse(dataArr),
} satisfies MockResponse;
};
}

export const getMockUserStoragePutResponse = (
path: UserStoragePathWithFeatureAndKey = 'notifications.notification_settings',
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,7 @@ __metadata:
"@metamask/base-controller": "npm:^7.0.1"
"@metamask/controller-utils": "npm:^11.3.0"
"@metamask/keyring-controller": "npm:^17.2.1"
"@metamask/profile-sync-controller": "npm:^0.8.0"
"@metamask/profile-sync-controller": "npm:^0.8.1"
"@types/jest": "npm:^27.4.1"
"@types/readable-stream": "npm:^2.3.0"
bignumber.js: "npm:^4.1.0"
Expand Down Expand Up @@ -3269,7 +3269,7 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/profile-sync-controller@npm:^0.8.0, @metamask/profile-sync-controller@workspace:packages/profile-sync-controller":
"@metamask/profile-sync-controller@npm:^0.8.1, @metamask/profile-sync-controller@workspace:packages/profile-sync-controller":
version: 0.0.0-use.local
resolution: "@metamask/profile-sync-controller@workspace:packages/profile-sync-controller"
dependencies:
Expand Down

0 comments on commit c2f53f6

Please sign in to comment.