@onekeyfe/hd-core 1.2.0-alpha.171 → 1.2.0-alpha.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/firmware-update/firmware-update-v4-install-poll.test.ts +32 -3
- package/__tests__/pro2Wallpaper.test.ts +0 -66
- package/__tests__/protocol-v2.test.ts +50 -35
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +1 -2
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +79 -197
- package/dist/utils/pro2Wallpaper.d.ts +1 -3
- package/dist/utils/pro2Wallpaper.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +31 -35
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +2 -12
- package/src/core/index.ts +100 -6
- package/src/utils/pro2Wallpaper.ts +1 -197
|
@@ -73,7 +73,7 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
73
73
|
);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
test('writes the BLE Request and
|
|
76
|
+
test('writes the BLE Request and completes only from target status polling', async () => {
|
|
77
77
|
const method = new FirmwareUpdateV4({
|
|
78
78
|
id: 1,
|
|
79
79
|
payload: {
|
|
@@ -85,7 +85,30 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
85
85
|
const typedCall = jest
|
|
86
86
|
.fn()
|
|
87
87
|
.mockResolvedValueOnce({ type: 'Success', message: {} })
|
|
88
|
-
.mockResolvedValueOnce({
|
|
88
|
+
.mockResolvedValueOnce({
|
|
89
|
+
type: 'DeviceFirmwareUpdateStatus',
|
|
90
|
+
message: {
|
|
91
|
+
records: [
|
|
92
|
+
{
|
|
93
|
+
target_id: 6,
|
|
94
|
+
status: 'FW_MGMT_UPDATER_TASK_STATUS_IN_PROGRESS',
|
|
95
|
+
path: 'vol0:/coprocessor.bin',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
})
|
|
100
|
+
.mockResolvedValueOnce({
|
|
101
|
+
type: 'DeviceFirmwareUpdateStatus',
|
|
102
|
+
message: {
|
|
103
|
+
records: [
|
|
104
|
+
{
|
|
105
|
+
target_id: 6,
|
|
106
|
+
status: 'FW_MGMT_UPDATER_TASK_STATUS_FINISHED',
|
|
107
|
+
path: 'vol0:/coprocessor.bin',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
});
|
|
89
112
|
const call = jest.fn().mockResolvedValue({
|
|
90
113
|
type: 'WriteCompleted',
|
|
91
114
|
message: {},
|
|
@@ -96,6 +119,7 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
96
119
|
createProtocolV2UiPhaseMetadata: jest.fn().mockReturnValue(undefined),
|
|
97
120
|
toMessageObject: jest.fn().mockReturnValue({ connectId: 'pro2-ble' }),
|
|
98
121
|
setCancelableAction: jest.fn(),
|
|
122
|
+
clearCancelableAction: jest.fn(),
|
|
99
123
|
} as unknown as Device;
|
|
100
124
|
method.postMessage = jest.fn();
|
|
101
125
|
method.postProgressMessage = jest.fn();
|
|
@@ -116,13 +140,18 @@ describe('FirmwareUpdateV4 install polling', () => {
|
|
|
116
140
|
expect(call).toHaveBeenCalledWith(
|
|
117
141
|
'DeviceFirmwareUpdateRequest',
|
|
118
142
|
{},
|
|
119
|
-
{
|
|
143
|
+
expect.objectContaining({
|
|
144
|
+
returnAfterWrite: true,
|
|
145
|
+
expectedTypes: ['Success'],
|
|
146
|
+
onResponseAfterWrite: expect.any(Function),
|
|
147
|
+
})
|
|
120
148
|
);
|
|
121
149
|
expect(method.postProgressMessage).not.toHaveBeenCalled();
|
|
122
150
|
|
|
123
151
|
await firmwareUpdate.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
124
152
|
|
|
125
153
|
expect(typedCall.mock.calls[1]?.[0]).toBe('DeviceFirmwareUpdateStatusGet');
|
|
154
|
+
expect(typedCall.mock.calls[1]?.[1]).toBe('DeviceFirmwareUpdateStatus');
|
|
126
155
|
expect(method.postProgressMessage).toHaveBeenCalledWith(100, 'installingFirmware');
|
|
127
156
|
});
|
|
128
157
|
|
|
@@ -1,48 +1,5 @@
|
|
|
1
1
|
import { encodePro2Wallpaper } from '../src/utils/pro2Wallpaper';
|
|
2
2
|
|
|
3
|
-
// The test decoder mirrors LZ4's bit-packed token and offset format.
|
|
4
|
-
/* eslint-disable no-bitwise */
|
|
5
|
-
|
|
6
|
-
function decodeLz4Block(data: Uint8Array, expectedLength: number) {
|
|
7
|
-
const output = new Uint8Array(expectedLength);
|
|
8
|
-
let inputOffset = 0;
|
|
9
|
-
let outputOffset = 0;
|
|
10
|
-
|
|
11
|
-
const readLength = (initialLength: number) => {
|
|
12
|
-
let length = initialLength;
|
|
13
|
-
if (length === 0x0f) {
|
|
14
|
-
let extension = 0xff;
|
|
15
|
-
while (extension === 0xff) {
|
|
16
|
-
extension = data[inputOffset];
|
|
17
|
-
inputOffset += 1;
|
|
18
|
-
length += extension;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return length;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
while (inputOffset < data.byteLength) {
|
|
25
|
-
const token = data[inputOffset];
|
|
26
|
-
inputOffset += 1;
|
|
27
|
-
const literalLength = readLength(token >> 4);
|
|
28
|
-
output.set(data.subarray(inputOffset, inputOffset + literalLength), outputOffset);
|
|
29
|
-
inputOffset += literalLength;
|
|
30
|
-
outputOffset += literalLength;
|
|
31
|
-
if (inputOffset >= data.byteLength) break;
|
|
32
|
-
|
|
33
|
-
const matchOffset = data[inputOffset] | (data[inputOffset + 1] << 8);
|
|
34
|
-
inputOffset += 2;
|
|
35
|
-
const matchLength = readLength(token & 0x0f) + 4;
|
|
36
|
-
for (let index = 0; index < matchLength; index += 1) {
|
|
37
|
-
output[outputOffset] = output[outputOffset - matchOffset];
|
|
38
|
-
outputOffset += 1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
expect(outputOffset).toBe(expectedLength);
|
|
43
|
-
return output;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
3
|
describe('encodePro2Wallpaper', () => {
|
|
47
4
|
test('encodes opaque pixels as aligned LVGL v9 RGB565 data', () => {
|
|
48
5
|
const result = encodePro2Wallpaper({
|
|
@@ -71,29 +28,6 @@ describe('encodePro2Wallpaper', () => {
|
|
|
71
28
|
expect(Array.from(result.data.slice(12))).toEqual([0x1f, 0x00, 0xff, 0xff, 128, 255]);
|
|
72
29
|
});
|
|
73
30
|
|
|
74
|
-
test('encodes an I8 palette and pixel indices as an LVGL LZ4 block', () => {
|
|
75
|
-
const result = encodePro2Wallpaper({
|
|
76
|
-
width: 2,
|
|
77
|
-
height: 1,
|
|
78
|
-
rgba: new Uint8Array([255, 0, 0, 255, 0, 255, 0, 255]),
|
|
79
|
-
encoding: 'i8-lz4',
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
expect(result.colorFormat).toBe('I8');
|
|
83
|
-
expect(Array.from(result.data.slice(0, 12))).toEqual([
|
|
84
|
-
0x19, 0x0a, 0x08, 0, 2, 0, 1, 0, 2, 0, 0, 0,
|
|
85
|
-
]);
|
|
86
|
-
const view = new DataView(result.data.buffer, result.data.byteOffset, result.data.byteLength);
|
|
87
|
-
expect(view.getUint32(12, true)).toBe(2);
|
|
88
|
-
expect(view.getUint32(16, true)).toBe(result.data.byteLength - 24);
|
|
89
|
-
expect(view.getUint32(20, true)).toBe(1026);
|
|
90
|
-
|
|
91
|
-
const rawData = decodeLz4Block(result.data.slice(24), 1026);
|
|
92
|
-
expect(Array.from(rawData.slice(210 * 4, 210 * 4 + 4))).toEqual([0, 0, 255, 255]);
|
|
93
|
-
expect(Array.from(rawData.slice(36 * 4, 36 * 4 + 4))).toEqual([0, 255, 0, 255]);
|
|
94
|
-
expect(Array.from(rawData.slice(-2))).toEqual([210, 36]);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
31
|
test('rejects invalid dimensions and RGBA byte length', () => {
|
|
98
32
|
expect(() => encodePro2Wallpaper({ width: 0, height: 1, rgba: new Uint8Array() })).toThrow(
|
|
99
33
|
'width'
|
|
@@ -194,13 +194,7 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
194
194
|
refreshProtocolV2SettingsAfterMutation: jest.fn().mockResolvedValue({}),
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
jest.restoreAllMocks();
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
test('uses I8 with LZ4 when uploading a Pro2 wallpaper over BLE', async () => {
|
|
202
|
-
jest.spyOn(DataManager, 'getSettings').mockReturnValue('lowlevel');
|
|
203
|
-
jest.spyOn(DataManager, 'isBleConnect').mockReturnValue(true);
|
|
197
|
+
test('encodes, uploads and applies a Pro2 wallpaper', async () => {
|
|
204
198
|
const typedCall = jest.fn().mockImplementation((request, _response, params) => {
|
|
205
199
|
if (request === 'FilesystemDirMake') return { message: { message: 'directory ready' } };
|
|
206
200
|
if (request === 'FilesystemFileWrite') {
|
|
@@ -243,7 +237,7 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
243
237
|
});
|
|
244
238
|
expect(device.refreshProtocolV2SettingsAfterMutation).toHaveBeenCalledTimes(1);
|
|
245
239
|
expect(typedCall.mock.calls.some(call => call[0] === 'SetWallpaper')).toBe(false);
|
|
246
|
-
expect(result).toMatchObject({ colorFormat: '
|
|
240
|
+
expect(result).toMatchObject({ colorFormat: 'RGB565', message: 'wallpaper applied' });
|
|
247
241
|
const fileWriteCallCount = typedCall.mock.calls.filter(
|
|
248
242
|
call => call[0] === 'FilesystemFileWrite'
|
|
249
243
|
).length;
|
|
@@ -281,8 +275,6 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
281
275
|
});
|
|
282
276
|
|
|
283
277
|
test('returns success when wallpaper read-back fails after apply', async () => {
|
|
284
|
-
jest.spyOn(DataManager, 'getSettings').mockReturnValue('desktop-webusb');
|
|
285
|
-
jest.spyOn(DataManager, 'isBleConnect').mockReturnValue(false);
|
|
286
278
|
const typedCall = jest.fn().mockImplementation((request, _response, params) => {
|
|
287
279
|
if (request === 'FilesystemDirMake') return { message: {} };
|
|
288
280
|
if (request === 'FilesystemFileWrite') {
|
|
@@ -308,10 +300,7 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
308
300
|
(method as any).device = device;
|
|
309
301
|
method.init();
|
|
310
302
|
|
|
311
|
-
await expect(method.run()).resolves.toMatchObject({
|
|
312
|
-
colorFormat: 'RGB565',
|
|
313
|
-
message: 'wallpaper applied',
|
|
314
|
-
});
|
|
303
|
+
await expect(method.run()).resolves.toMatchObject({ message: 'wallpaper applied' });
|
|
315
304
|
expect(device.refreshProtocolV2SettingsAfterMutation).toHaveBeenCalledTimes(1);
|
|
316
305
|
});
|
|
317
306
|
|
|
@@ -328,19 +317,6 @@ describe('DeviceUploadWallpaper', () => {
|
|
|
328
317
|
expect(() => method.init()).toThrow('fileName');
|
|
329
318
|
});
|
|
330
319
|
|
|
331
|
-
test('rejects unsupported wallpaper encodings before device communication', () => {
|
|
332
|
-
const method = new DeviceUploadWallpaper({
|
|
333
|
-
id: 1,
|
|
334
|
-
payload: {
|
|
335
|
-
method: 'deviceUploadWallpaper',
|
|
336
|
-
jpegBase64: createJpegBase64(604, 1024),
|
|
337
|
-
encoding: 'gzip',
|
|
338
|
-
} as any,
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
expect(() => method.init()).toThrow('encoding');
|
|
342
|
-
});
|
|
343
|
-
|
|
344
320
|
test('rejects unsupported firmware before creating or writing files', async () => {
|
|
345
321
|
const typedCall = jest.fn();
|
|
346
322
|
const method = new DeviceUploadWallpaper({
|
|
@@ -4978,7 +4954,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4978
4954
|
expect(commands.mainId).toBe('usb-path');
|
|
4979
4955
|
});
|
|
4980
4956
|
|
|
4981
|
-
test('
|
|
4957
|
+
test('reacquires the same BLE peripheral by id without scanning during install recovery', async () => {
|
|
4982
4958
|
const method = new FirmwareUpdateV4({
|
|
4983
4959
|
id: 1,
|
|
4984
4960
|
payload: {
|
|
@@ -5000,7 +4976,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5000
4976
|
|
|
5001
4977
|
await (method as any).reconnectProtocolV2Device({ skipProtocolProbe: true });
|
|
5002
4978
|
|
|
5003
|
-
expect(enumerate).
|
|
4979
|
+
expect(enumerate).not.toHaveBeenCalled();
|
|
5004
4980
|
expect(acquire).toHaveBeenCalledWith('ble-id', null, true, 'V2', undefined, undefined, true);
|
|
5005
4981
|
expect(commands.disposed).toBe(false);
|
|
5006
4982
|
expect(commands.mainId).toBe('ble-id');
|
|
@@ -5571,7 +5547,11 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5571
5547
|
expect(call).toHaveBeenCalledWith(
|
|
5572
5548
|
'DeviceFirmwareUpdateRequest',
|
|
5573
5549
|
{},
|
|
5574
|
-
{
|
|
5550
|
+
expect.objectContaining({
|
|
5551
|
+
returnAfterWrite: true,
|
|
5552
|
+
expectedTypes: ['Success'],
|
|
5553
|
+
onResponseAfterWrite: expect.any(Function),
|
|
5554
|
+
})
|
|
5575
5555
|
);
|
|
5576
5556
|
expect(typedCall).not.toHaveBeenCalledWith('DeviceFirmwareUpdateRequest', 'Success', {});
|
|
5577
5557
|
expect((method as any).protocolV2InstallNeedsBleReconnect).toBe(true);
|
|
@@ -5679,7 +5659,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5679
5659
|
expect(method.postProgressMessage).toHaveBeenCalledWith(100, 'installingFirmware');
|
|
5680
5660
|
});
|
|
5681
5661
|
|
|
5682
|
-
test('keeps polling after
|
|
5662
|
+
test('keeps polling after an empty status response until the target finishes', async () => {
|
|
5683
5663
|
const method = new FirmwareUpdateV4({
|
|
5684
5664
|
id: 1,
|
|
5685
5665
|
payload: {
|
|
@@ -5688,7 +5668,10 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5688
5668
|
});
|
|
5689
5669
|
const typedCall = jest
|
|
5690
5670
|
.fn()
|
|
5691
|
-
.mockResolvedValueOnce({
|
|
5671
|
+
.mockResolvedValueOnce({
|
|
5672
|
+
type: 'DeviceFirmwareUpdateStatus',
|
|
5673
|
+
message: { records: [] },
|
|
5674
|
+
})
|
|
5692
5675
|
.mockResolvedValueOnce({
|
|
5693
5676
|
type: 'DeviceFirmwareUpdateStatus',
|
|
5694
5677
|
message: { records: [] },
|
|
@@ -5830,6 +5813,38 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5830
5813
|
expect(method.postProgressMessage).toHaveBeenCalledWith(100, 'installingFirmware');
|
|
5831
5814
|
});
|
|
5832
5815
|
|
|
5816
|
+
test('does not count a stale finished target when only another target was live', () => {
|
|
5817
|
+
const method = new FirmwareUpdateV4({
|
|
5818
|
+
id: 1,
|
|
5819
|
+
payload: {
|
|
5820
|
+
method: 'firmwareUpdateV4',
|
|
5821
|
+
},
|
|
5822
|
+
});
|
|
5823
|
+
const assertProtocolV2TargetStatus = (method as any).assertProtocolV2TargetStatus.bind(method);
|
|
5824
|
+
const expectedTargetIds = new Set([3, 4]);
|
|
5825
|
+
const expectedPaths = new Map([
|
|
5826
|
+
[3, 'vol0:/bootloader.bin'],
|
|
5827
|
+
[4, 'vol0:/application_p1.bin'],
|
|
5828
|
+
]);
|
|
5829
|
+
const liveTargetIds = new Set([4]);
|
|
5830
|
+
method.postProgressMessage = jest.fn();
|
|
5831
|
+
|
|
5832
|
+
const completed = assertProtocolV2TargetStatus(
|
|
5833
|
+
[
|
|
5834
|
+
{ target_id: 3, status: 2, path: 'vol0:/bootloader.bin' },
|
|
5835
|
+
{ target_id: 4, status: 2, path: 'vol0:/application_p1.bin' },
|
|
5836
|
+
],
|
|
5837
|
+
expectedTargetIds,
|
|
5838
|
+
expectedPaths,
|
|
5839
|
+
liveTargetIds
|
|
5840
|
+
);
|
|
5841
|
+
|
|
5842
|
+
expect(completed).toBe(false);
|
|
5843
|
+
expect((method as any).protocolV2CompletedTargetIds).toEqual(new Set([4]));
|
|
5844
|
+
expect(method.postProgressMessage).toHaveBeenCalledWith(50, 'installingFirmware');
|
|
5845
|
+
expect(method.postProgressMessage).not.toHaveBeenCalledWith(100, 'installingFirmware');
|
|
5846
|
+
});
|
|
5847
|
+
|
|
5833
5848
|
test('ignores stale failed records until the current install starts', async () => {
|
|
5834
5849
|
const method = new FirmwareUpdateV4({
|
|
5835
5850
|
id: 1,
|
|
@@ -6119,7 +6134,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6119
6134
|
});
|
|
6120
6135
|
const typedCall = jest
|
|
6121
6136
|
.fn()
|
|
6122
|
-
.mockResolvedValueOnce({ type: 'Success', message: {} })
|
|
6123
6137
|
.mockRejectedValueOnce(new Error('Pro2 is rebooting'))
|
|
6124
6138
|
.mockResolvedValueOnce({
|
|
6125
6139
|
type: 'DeviceFirmwareUpdateStatus',
|
|
@@ -6136,6 +6150,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6136
6150
|
(method as any).device = stubDevice({
|
|
6137
6151
|
getCommands: () => ({ typedCall }),
|
|
6138
6152
|
});
|
|
6153
|
+
(method as any).protocolV2InstallRequestConfirmed = true;
|
|
6139
6154
|
(method as any).reconnectProtocolV2Device = jest.fn().mockResolvedValue(undefined);
|
|
6140
6155
|
(method as any).verifyProtocolV2ReconnectIdentity = jest.fn().mockResolvedValue(deviceInfo);
|
|
6141
6156
|
(method as any).probeProtocolV2NormalMode = jest.fn().mockResolvedValue(true);
|
|
@@ -6566,7 +6581,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6566
6581
|
expect(reconnectProtocolV2Device).not.toHaveBeenCalled();
|
|
6567
6582
|
expect(typedCall).toHaveBeenCalledWith(
|
|
6568
6583
|
'DeviceFirmwareUpdateStatusGet',
|
|
6569
|
-
|
|
6584
|
+
'DeviceFirmwareUpdateStatus',
|
|
6570
6585
|
expect.anything(),
|
|
6571
6586
|
expect.anything()
|
|
6572
6587
|
);
|
|
@@ -6848,7 +6863,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6848
6863
|
});
|
|
6849
6864
|
expect(typedCall).toHaveBeenCalledWith(
|
|
6850
6865
|
'DeviceFirmwareUpdateStatusGet',
|
|
6851
|
-
|
|
6866
|
+
'DeviceFirmwareUpdateStatus',
|
|
6852
6867
|
{
|
|
6853
6868
|
fields: {
|
|
6854
6869
|
status: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkD,MAAM,qBAAqB,CAAC;AA0BlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AA+B/E,OAAO,KAAK,EAEV,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AAoErC,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,EAC5C,MAAM,EAAE,sBAAsB,EAC9B,0BAA0B,UAAQ,QAiCnC;AAuSD,eAAO,MAAM,oCAAoC,WACvC,WAAW,GAAG,UAAU,eACnB,MAAM,GAAG,SAAS,YAKhC,CAAC;AAEF,eAAO,MAAM,iCAAiC,0BACrB,MAAM,uBACR,MAAM,iBACZ,MAAM,eACR,MAAM,SAsBpB,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,OAAO,CAAC,8BAA8B,CAAC,CAAS;IAEhD,OAAO,CAAC,sBAAsB,CAAC,CAAS;IAExC,OAAO,CAAC,oCAAoC,CAAS;IAErD,qBAAqB;IAIrB,OAAO,CAAC,yBAAyB,CAA4B;IAE7D,OAAO,CAAC,2BAA2B,CAAS;IAE5C,OAAO,CAAC,iCA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,6BAA6B;YAkBrB,+BAA+B;IAkD7C,OAAO,CAAC,6BAA6B;YAkCvB,6BAA6B;YA0B7B,0CAA0C;YA6B1C,uBAAuB;YAiCvB,8BAA8B;YAwE9B,6BAA6B;IA8E3C,OAAO,CAAC,mCAAmC;YAI7B,0BAA0B;IAaxC,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,4BAA4B;IA6IpC,OAAO,CAAC,6BAA6B;IAcrC,OAAO,CAAC,qCAAqC;IAyB7C,OAAO,CAAC,kCAAkC;IAgB1C,OAAO,CAAC,8CAA8C;YAIxC,uCAAuC;YA2NvC,gCAAgC;YAehC,yBAAyB;IASvC,OAAO,CAAC,2BAA2B;YAMrB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAkBpB,mCAAmC;YAWnC,qCAAqC;YAmDrC,yBAAyB;YAgGzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAQ5B,cAAc;YAuCd,6BAA6B;YAW7B,0BAA0B;YAoB1B,6BAA6B;YA4E7B,gBAAgB;IAiB9B,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import { type Pro2WallpaperColorFormat
|
|
2
|
+
import { type Pro2WallpaperColorFormat } from '../../utils/pro2Wallpaper';
|
|
3
3
|
export type DeviceUploadWallpaperParams = {
|
|
4
4
|
jpegBase64: string;
|
|
5
5
|
fileName?: string;
|
|
6
6
|
chunkSize?: number;
|
|
7
|
-
encoding?: Pro2WallpaperEncoding;
|
|
8
7
|
};
|
|
9
8
|
export type DeviceUploadWallpaperResponse = {
|
|
10
9
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceUploadWallpaper.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadWallpaper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DeviceUploadWallpaper.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceUploadWallpaper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,EAGL,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,wBAAwB,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAmBF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IACxF,qBAAqB;IAIrB,OAAO,CAAC,OAAO,CAAC,CAA8D;IAE9E,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,IAAI,CAAM;IAElB,IAAI;YA2BU,kBAAkB;YAgBlB,eAAe;YAaf,MAAM;IAwBd,GAAG,IAAI,OAAO,CAAC,6BAA6B,CAAC;CAyBpD"}
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAoClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsB1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAYxD,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAmD,MAAM,WAAW,CA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AQ,YAAY;IAC5C,OAAO,CAAC,cAAc,CAAoB;IAE1C,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,cAAc,CAAC,CAAgB;IAGvC,OAAO,CAAC,sBAAsB,CAAoC;IAElE,OAAO,CAAC,iBAAiB,CAAoB;;IAS7C,OAAO,CAAC,cAAc;IA6BhB,aAAa,CAAC,OAAO,EAAE,WAAW;IAuExC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAOV,gBAAgB;CAiC/B;AAED,eAAO,MAAM,QAAQ,YAIpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAYzB,CAAC;AAMF,eAAO,MAAM,IAAI,aACL,eAAe,aACd,GAAG,WACL,6BAA6B,8BAiBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1113,13 +1113,11 @@ declare const switchTransport: ({ env, Transport, plugin, }: {
|
|
|
1113
1113
|
|
|
1114
1114
|
declare const PRO2_WALLPAPER_WIDTH = 604;
|
|
1115
1115
|
declare const PRO2_WALLPAPER_HEIGHT = 1024;
|
|
1116
|
-
type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8'
|
|
1117
|
-
type Pro2WallpaperEncoding = 'rgb565' | 'i8-lz4';
|
|
1116
|
+
type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
|
|
1118
1117
|
declare function encodePro2Wallpaper(options: {
|
|
1119
1118
|
width: number;
|
|
1120
1119
|
height: number;
|
|
1121
1120
|
rgba: Uint8Array | ArrayBuffer;
|
|
1122
|
-
encoding?: Pro2WallpaperEncoding;
|
|
1123
1121
|
}): {
|
|
1124
1122
|
data: Uint8Array;
|
|
1125
1123
|
colorFormat: Pro2WallpaperColorFormat;
|
|
@@ -1129,7 +1127,6 @@ type DeviceUploadWallpaperParams = {
|
|
|
1129
1127
|
jpegBase64: string;
|
|
1130
1128
|
fileName?: string;
|
|
1131
1129
|
chunkSize?: number;
|
|
1132
|
-
encoding?: Pro2WallpaperEncoding;
|
|
1133
1130
|
};
|
|
1134
1131
|
type DeviceUploadWallpaperResponse = {
|
|
1135
1132
|
path: string;
|