@blocklet/did-space-js 0.5.78 → 0.5.80
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/dist/commands/backup/backup-blocklet.js +3 -3
- package/dist/commands/incremental-backup/backup-blocklet.js +3 -3
- package/dist/commands/restore/restore-blocklet.js +3 -3
- package/dist/libs/api.d.ts +1 -2
- package/dist/meta/backup/post-app-backup-command.d.ts +11 -3
- package/dist/meta/backup/put-app-backup-command.d.ts +3 -3
- package/dist/meta/backup/put-app-backup-command.js +3 -3
- package/dist/meta/restore/post-app-restore-command.d.ts +11 -3
- package/dist/meta/restore/put-app-restore-command.d.ts +3 -3
- package/dist/meta/restore/put-app-restore-command.js +3 -3
- package/package.json +13 -13
|
@@ -40,7 +40,7 @@ class BackupBlockletCommand extends base_1.BaseCommand {
|
|
|
40
40
|
if (res.data.errorCount !== 0) {
|
|
41
41
|
await new put_app_backup_1.PutAppBackupCommand({
|
|
42
42
|
id: appBackup.id,
|
|
43
|
-
status: core_1.
|
|
43
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
44
44
|
message: res?.statusMessage,
|
|
45
45
|
}, this.context)
|
|
46
46
|
.request()
|
|
@@ -50,7 +50,7 @@ class BackupBlockletCommand extends base_1.BaseCommand {
|
|
|
50
50
|
// 仅仅是触发一下接口,更新一下 updateAt
|
|
51
51
|
await new put_app_backup_1.PutAppBackupCommand({
|
|
52
52
|
id: appBackup.id,
|
|
53
|
-
status: core_1.
|
|
53
|
+
status: core_1.AuditLogStatus.SUCCEEDED,
|
|
54
54
|
}, this.context).request();
|
|
55
55
|
return res;
|
|
56
56
|
}
|
|
@@ -61,7 +61,7 @@ class BackupBlockletCommand extends base_1.BaseCommand {
|
|
|
61
61
|
if (appBackup) {
|
|
62
62
|
await new put_app_backup_1.PutAppBackupCommand({
|
|
63
63
|
id: appBackup.id,
|
|
64
|
-
status: core_1.
|
|
64
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
65
65
|
message,
|
|
66
66
|
}, this.context)
|
|
67
67
|
.request()
|
|
@@ -41,7 +41,7 @@ class IncrementalBackupBlockletCommand extends base_1.BaseCommand {
|
|
|
41
41
|
if (res.data.errorCount !== 0) {
|
|
42
42
|
await new backup_1.PutAppBackupCommand({
|
|
43
43
|
id: appBackup.id,
|
|
44
|
-
status: core_1.
|
|
44
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
45
45
|
message: res?.statusMessage,
|
|
46
46
|
}, this.context)
|
|
47
47
|
.request()
|
|
@@ -51,7 +51,7 @@ class IncrementalBackupBlockletCommand extends base_1.BaseCommand {
|
|
|
51
51
|
// 仅仅是触发一下接口,更新一下 updateAt
|
|
52
52
|
await new backup_1.PutAppBackupCommand({
|
|
53
53
|
id: appBackup.id,
|
|
54
|
-
status: core_1.
|
|
54
|
+
status: core_1.AuditLogStatus.SUCCEEDED,
|
|
55
55
|
}, this.context).request();
|
|
56
56
|
return res;
|
|
57
57
|
}
|
|
@@ -62,7 +62,7 @@ class IncrementalBackupBlockletCommand extends base_1.BaseCommand {
|
|
|
62
62
|
if (appBackup) {
|
|
63
63
|
await new backup_1.PutAppBackupCommand({
|
|
64
64
|
id: appBackup.id,
|
|
65
|
-
status: core_1.
|
|
65
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
66
66
|
message,
|
|
67
67
|
}, this.context)
|
|
68
68
|
.request()
|
|
@@ -37,7 +37,7 @@ class RestoreBlockletCommand extends base_1.BaseCommand {
|
|
|
37
37
|
if (res.data.errorCount !== 0) {
|
|
38
38
|
await new put_app_restore_1.PutAppRestoreCommand({
|
|
39
39
|
id: appRestore.id,
|
|
40
|
-
status: core_1.
|
|
40
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
41
41
|
message: res?.statusMessage,
|
|
42
42
|
}, this.context)
|
|
43
43
|
.request()
|
|
@@ -47,7 +47,7 @@ class RestoreBlockletCommand extends base_1.BaseCommand {
|
|
|
47
47
|
// 仅仅是触发一下接口,更新一下 updateAt
|
|
48
48
|
await new put_app_restore_1.PutAppRestoreCommand({
|
|
49
49
|
id: appRestore.id,
|
|
50
|
-
status: core_1.
|
|
50
|
+
status: core_1.AuditLogStatus.SUCCEEDED,
|
|
51
51
|
}, this.context).request();
|
|
52
52
|
return res;
|
|
53
53
|
}
|
|
@@ -58,7 +58,7 @@ class RestoreBlockletCommand extends base_1.BaseCommand {
|
|
|
58
58
|
if (appRestore) {
|
|
59
59
|
await new put_app_restore_1.PutAppRestoreCommand({
|
|
60
60
|
id: appRestore.id,
|
|
61
|
-
status: core_1.
|
|
61
|
+
status: core_1.AuditLogStatus.FAILED,
|
|
62
62
|
message,
|
|
63
63
|
}, this.context)
|
|
64
64
|
.request()
|
package/dist/libs/api.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { AppBackup } from '@did-space/core';
|
|
1
|
+
import { AppBackup, AuditLogStatus } from '@did-space/core';
|
|
2
2
|
import type { ObjectSchema } from 'joi';
|
|
3
3
|
import type { CommandOutput } from '../../protocol';
|
|
4
|
+
export type AppBackupData = AppBackup & {
|
|
5
|
+
id: string;
|
|
6
|
+
userDid: string;
|
|
7
|
+
status: AuditLogStatus;
|
|
8
|
+
message: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
};
|
|
4
12
|
export declare const PostAppBackupCommandInputSchema: ObjectSchema<any>;
|
|
5
|
-
export interface PostAppBackupCommandInput extends Pick<
|
|
13
|
+
export interface PostAppBackupCommandInput extends Pick<AppBackupData, 'userDid' | 'referrer' | 'appName' | 'appDescription' | 'serverDid' | 'signerDid'> {
|
|
6
14
|
}
|
|
7
|
-
export interface PostAppBackupCommandOutput extends CommandOutput<Required<
|
|
15
|
+
export interface PostAppBackupCommandOutput extends CommandOutput<Required<AppBackupData>> {
|
|
8
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AppBackup } from '@did-space/core';
|
|
2
1
|
import type { ObjectSchema } from 'joi';
|
|
3
2
|
import type { CommandOutput } from '../../protocol';
|
|
3
|
+
import { AppBackupData } from './post-app-backup-command';
|
|
4
4
|
export declare const PutAppBackupCommandInputSchema: ObjectSchema<any>;
|
|
5
|
-
export type PutAppBackupCommandInput = Required<Pick<
|
|
6
|
-
export interface PutAppBackupCommandOutput extends CommandOutput<Required<
|
|
5
|
+
export type PutAppBackupCommandInput = Required<Pick<AppBackupData, 'id'>> & Partial<AppBackupData>;
|
|
6
|
+
export interface PutAppBackupCommandOutput extends CommandOutput<Required<AppBackupData>> {
|
|
7
7
|
}
|
|
@@ -8,11 +8,11 @@ exports.PutAppBackupCommandInputSchema = validator_1.Joi.object({
|
|
|
8
8
|
updateAt: validator_1.Joi.string()
|
|
9
9
|
.optional()
|
|
10
10
|
.default(() => new Date().toISOString()),
|
|
11
|
-
// 默认是
|
|
11
|
+
// 默认是 AuditLogStatus.DEFAULT 是因为我要兼容以前的旧版本的数据
|
|
12
12
|
status: validator_1.Joi.string()
|
|
13
13
|
.optional()
|
|
14
14
|
.allow('')
|
|
15
|
-
.valid(...Object.values(core_1.
|
|
16
|
-
.default(core_1.
|
|
15
|
+
.valid(...Object.values(core_1.AuditLogStatus))
|
|
16
|
+
.default(core_1.AuditLogStatus.DEFAULT),
|
|
17
17
|
message: validator_1.Joi.string().optional().allow('').default(''),
|
|
18
18
|
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { AppRestore } from '@did-space/core';
|
|
1
|
+
import { AppRestore, AuditLogStatus } from '@did-space/core';
|
|
2
2
|
import type { ObjectSchema } from 'joi';
|
|
3
3
|
import { CommandOutput } from '../../protocol/command.protocol';
|
|
4
|
+
export type AppRestoreData = AppRestore & {
|
|
5
|
+
id: string;
|
|
6
|
+
userDid: string;
|
|
7
|
+
status: AuditLogStatus;
|
|
8
|
+
message: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
};
|
|
4
12
|
export declare const PostAppRestoreCommandInputSchema: ObjectSchema<any>;
|
|
5
|
-
export interface PostAppRestoreCommandInput extends Pick<
|
|
13
|
+
export interface PostAppRestoreCommandInput extends Pick<AppRestoreData, 'userDid' | 'referrer' | 'serverDid'> {
|
|
6
14
|
}
|
|
7
|
-
export interface PostAppRestoreCommandOutput extends CommandOutput<Required<
|
|
15
|
+
export interface PostAppRestoreCommandOutput extends CommandOutput<Required<AppRestoreData>> {
|
|
8
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AppRestore } from '@did-space/core';
|
|
2
1
|
import type { ObjectSchema } from 'joi';
|
|
3
2
|
import type { CommandOutput } from '../../protocol';
|
|
3
|
+
import { AppRestoreData } from './post-app-restore-command';
|
|
4
4
|
export declare const PutAppRestoreCommandInputSchema: ObjectSchema<any>;
|
|
5
|
-
export type PutAppRestoreCommandInput = Required<Pick<
|
|
6
|
-
export interface PutAppRestoreCommandOutput extends CommandOutput<Required<
|
|
5
|
+
export type PutAppRestoreCommandInput = Required<Pick<AppRestoreData, 'id'>> & Partial<AppRestoreData>;
|
|
6
|
+
export interface PutAppRestoreCommandOutput extends CommandOutput<Required<AppRestoreData>> {
|
|
7
7
|
}
|
|
@@ -8,11 +8,11 @@ exports.PutAppRestoreCommandInputSchema = validator_1.Joi.object({
|
|
|
8
8
|
updateAt: validator_1.Joi.string()
|
|
9
9
|
.optional()
|
|
10
10
|
.default(() => new Date().toISOString()),
|
|
11
|
-
// 默认是
|
|
11
|
+
// 默认是 AuditLogStatus.DEFAULT 是因为我要兼容以前的旧版本的数据
|
|
12
12
|
status: validator_1.Joi.string()
|
|
13
13
|
.optional()
|
|
14
14
|
.allow('')
|
|
15
|
-
.valid(...Object.values(core_1.
|
|
16
|
-
.default(core_1.
|
|
15
|
+
.valid(...Object.values(core_1.AuditLogStatus))
|
|
16
|
+
.default(core_1.AuditLogStatus.DEFAULT),
|
|
17
17
|
message: validator_1.Joi.string().optional().allow('').default(''),
|
|
18
18
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/did-space-js",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.80",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"link": "yarn link"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@arcblock/did": "^1.18.
|
|
33
|
-
"@arcblock/jwt": "^1.18.
|
|
34
|
-
"@arcblock/validator": "^1.18.
|
|
35
|
-
"@blocklet/env": "^1.16.34-beta-
|
|
36
|
-
"@did-space/core": "^0.5.
|
|
37
|
-
"@ocap/mcrypto": "^1.18.
|
|
38
|
-
"@ocap/util": "^1.18.
|
|
39
|
-
"@ocap/wallet": "^1.18.
|
|
32
|
+
"@arcblock/did": "^1.18.161",
|
|
33
|
+
"@arcblock/jwt": "^1.18.161",
|
|
34
|
+
"@arcblock/validator": "^1.18.161",
|
|
35
|
+
"@blocklet/env": "^1.16.34-beta-20241214-102147-410be539",
|
|
36
|
+
"@did-space/core": "^0.5.80",
|
|
37
|
+
"@ocap/mcrypto": "^1.18.161",
|
|
38
|
+
"@ocap/util": "^1.18.161",
|
|
39
|
+
"@ocap/wallet": "^1.18.161",
|
|
40
40
|
"agentkeepalive": "^4.5.0",
|
|
41
|
-
"axios": "^1.7.
|
|
41
|
+
"axios": "^1.7.9",
|
|
42
42
|
"base64-url": "^2.3.3",
|
|
43
43
|
"dayjs": "^1.11.13",
|
|
44
|
-
"debug": "^4.
|
|
44
|
+
"debug": "^4.4.0",
|
|
45
45
|
"filehound": "^1.17.6",
|
|
46
46
|
"form-data": "^4.0.1",
|
|
47
47
|
"fs-extra": "^11.2.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"p-queue": "6.6.2",
|
|
58
58
|
"ufo": "^1.5.4",
|
|
59
59
|
"xbytes": "^1.9.1",
|
|
60
|
-
"zod": "^3.
|
|
60
|
+
"zod": "^3.24.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"ts-jest": "^28.0.8",
|
|
77
77
|
"typescript": "^4.9.5"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "16c29f7cfe40d7d54a438fd4047b94519d51062e"
|
|
80
80
|
}
|