@blocklet/did-space-js 1.0.62 → 1.0.63
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/api/routes/audit-log-list.js +3 -3
- package/dist/commands/audit-log/post-objects-sync-command.js +2 -2
- package/dist/commands/audit-log/put-objects-sync-command.js +2 -2
- package/dist/commands/backup/backup-blocklet.js +4 -4
- package/dist/commands/base.js +2 -2
- package/dist/commands/incremental-backup/backup-blocklet.js +4 -4
- package/dist/commands/nft/put-nft-object.js +3 -2
- package/dist/commands/object/delete-object.js +2 -2
- package/dist/commands/object/get-object.js +2 -2
- package/dist/commands/object/list-object.d.ts +1 -1
- package/dist/commands/object/list-object.js +2 -2
- package/dist/commands/object/list-objects.d.ts +1 -1
- package/dist/commands/object/list-objects.js +2 -2
- package/dist/commands/object/put-object.js +2 -2
- package/dist/commands/preview/delete-preview-object.js +2 -2
- package/dist/commands/preview/get-preview-object.js +2 -2
- package/dist/commands/preview/put-preview-object.js +2 -2
- package/dist/commands/restore/restore-blocklet.js +4 -4
- package/dist/commands/space/head.js +2 -2
- package/dist/commands/sync/sync-folder-push.js +3 -2
- package/dist/meta/backup/post-app-backup-command.d.ts +2 -1
- package/dist/meta/backup/put-app-backup-command.js +3 -3
- package/dist/meta/restore/post-app-restore-command.d.ts +2 -1
- package/dist/meta/restore/put-app-restore-command.js +3 -3
- package/dist/meta/sync/post-objects-sync-command.d.ts +2 -1
- package/dist/meta/sync/put-objects-sync-command.d.ts +2 -1
- package/dist/meta/sync/put-objects-sync-command.js +2 -2
- package/package.json +4 -3
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.auditLogList = void 0;
|
|
4
4
|
const ufo_1 = require("ufo");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const
|
|
6
|
+
const constants_1 = require("@did-space/constants");
|
|
7
7
|
const libs_1 = require("../../libs");
|
|
8
8
|
const security_1 = require("../../security");
|
|
9
9
|
const QuerySchema = zod_1.z.object({
|
|
@@ -21,8 +21,8 @@ const QuerySchema = zod_1.z.object({
|
|
|
21
21
|
.string()
|
|
22
22
|
.default('0')
|
|
23
23
|
.transform((val) => parseInt(val, 10)),
|
|
24
|
-
status: zod_1.z.union([zod_1.z.nativeEnum(
|
|
25
|
-
actionType: zod_1.z.union([zod_1.z.nativeEnum(
|
|
24
|
+
status: zod_1.z.union([zod_1.z.nativeEnum(constants_1.AuditLogStatus), zod_1.z.array(zod_1.z.nativeEnum(constants_1.AuditLogStatus))]).optional(),
|
|
25
|
+
actionType: zod_1.z.union([zod_1.z.nativeEnum(constants_1.AuditLogAction), zod_1.z.array(zod_1.z.nativeEnum(constants_1.AuditLogAction))]).optional(),
|
|
26
26
|
});
|
|
27
27
|
/**
|
|
28
28
|
* @route /.well-known/service/api/did-space/audit-logs 借助 service 查询 space 审计日志
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostObjectsSyncCommand = void 0;
|
|
4
4
|
const ufo_1 = require("ufo");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const libs_1 = require("../../libs");
|
|
7
7
|
const sync_1 = require("../../meta/sync");
|
|
8
8
|
const security_1 = require("../../security");
|
|
@@ -22,7 +22,7 @@ class PostObjectsSyncCommand extends base_1.BaseCommand {
|
|
|
22
22
|
async resolveMiddleware() {
|
|
23
23
|
const url = (0, ufo_1.joinURL)(this.context.endpoint, 'audit-log');
|
|
24
24
|
const data = {
|
|
25
|
-
actionType:
|
|
25
|
+
actionType: constants_1.AuditLogAction.APP_OBJECTS_SYNC,
|
|
26
26
|
data: {
|
|
27
27
|
...this.input,
|
|
28
28
|
totalCount: 0,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PutObjectsSyncCommand = void 0;
|
|
4
4
|
const ufo_1 = require("ufo");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const libs_1 = require("../../libs");
|
|
7
7
|
const meta_1 = require("../../meta");
|
|
8
8
|
const security_1 = require("../../security");
|
|
@@ -26,7 +26,7 @@ class PutObjectsSyncCommand extends base_1.BaseCommand {
|
|
|
26
26
|
id,
|
|
27
27
|
status,
|
|
28
28
|
reason,
|
|
29
|
-
actionType:
|
|
29
|
+
actionType: constants_1.AuditLogAction.APP_OBJECTS_SYNC,
|
|
30
30
|
data: rest,
|
|
31
31
|
};
|
|
32
32
|
const method = 'PUT';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BackupBlockletCommand = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const sync_1 = require("../sync");
|
|
8
8
|
const post_app_backup_1 = require("./post-app-backup");
|
|
@@ -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:
|
|
43
|
+
status: constants_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:
|
|
53
|
+
status: constants_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:
|
|
64
|
+
status: constants_1.AuditLogStatus.FAILED,
|
|
65
65
|
message,
|
|
66
66
|
}, this.context)
|
|
67
67
|
.request()
|
package/dist/commands/base.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.BaseCommand = void 0;
|
|
|
7
7
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
8
8
|
const ufo_1 = require("ufo");
|
|
9
9
|
const did_1 = require("@arcblock/did");
|
|
10
|
-
const
|
|
10
|
+
const constants_1 = require("@did-space/constants");
|
|
11
11
|
const stream_1 = require("stream");
|
|
12
12
|
const libs_1 = require("../libs");
|
|
13
13
|
class BaseCommand extends stream_1.EventEmitter {
|
|
@@ -25,7 +25,7 @@ class BaseCommand extends stream_1.EventEmitter {
|
|
|
25
25
|
getKey(key, options = { encode: true }) {
|
|
26
26
|
const path = (0, isEmpty_1.default)(this.context.componentDid)
|
|
27
27
|
? key
|
|
28
|
-
: (0, ufo_1.joinURL)(
|
|
28
|
+
: (0, ufo_1.joinURL)(constants_1.APP.COMPONENT.FOLDER_PREFIX, this.context.componentDid, key);
|
|
29
29
|
return options.encode ? (0, libs_1.encode)(path) : path;
|
|
30
30
|
}
|
|
31
31
|
async request() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IncrementalBackupBlockletCommand = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const backup_1 = require("../backup");
|
|
8
8
|
const libs_1 = require("../../libs");
|
|
@@ -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:
|
|
44
|
+
status: constants_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:
|
|
54
|
+
status: constants_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:
|
|
65
|
+
status: constants_1.AuditLogStatus.FAILED,
|
|
66
66
|
message,
|
|
67
67
|
}, this.context)
|
|
68
68
|
.request()
|
|
@@ -11,6 +11,7 @@ const fs_extra_1 = require("fs-extra");
|
|
|
11
11
|
const form_data_1 = __importDefault(require("form-data"));
|
|
12
12
|
const core_1 = require("@did-space/core");
|
|
13
13
|
const ufo_1 = require("ufo");
|
|
14
|
+
const constants_1 = require("@did-space/constants");
|
|
14
15
|
const did_document_1 = require("../../did-document");
|
|
15
16
|
const base_1 = require("../base");
|
|
16
17
|
const security_1 = require("../../security");
|
|
@@ -107,8 +108,8 @@ class PutNftObjectCommand extends base_1.BaseCommand {
|
|
|
107
108
|
method,
|
|
108
109
|
data: formData,
|
|
109
110
|
headers: {
|
|
110
|
-
[
|
|
111
|
-
[
|
|
111
|
+
[constants_1.HEADERS.X_HASH]: this.tempCacheObjectHash,
|
|
112
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
112
113
|
},
|
|
113
114
|
wallet: this.context.wallet,
|
|
114
115
|
delegation: this.context.delegation,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeleteObjectCommand = void 0;
|
|
4
4
|
const ufo_1 = require("ufo");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const security_1 = require("../../security");
|
|
8
8
|
class DeleteObjectCommand extends base_1.BaseCommand {
|
|
@@ -14,7 +14,7 @@ class DeleteObjectCommand extends base_1.BaseCommand {
|
|
|
14
14
|
method,
|
|
15
15
|
data: {},
|
|
16
16
|
headers: {
|
|
17
|
-
[
|
|
17
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
18
18
|
},
|
|
19
19
|
wallet: this.context.wallet,
|
|
20
20
|
delegation: this.context.delegation,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetObjectCommand = void 0;
|
|
4
4
|
const ufo_1 = require("ufo");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const security_1 = require("../../security");
|
|
8
8
|
class GetObjectCommand extends base_1.BaseCommand {
|
|
@@ -14,7 +14,7 @@ class GetObjectCommand extends base_1.BaseCommand {
|
|
|
14
14
|
method,
|
|
15
15
|
data: {},
|
|
16
16
|
headers: {
|
|
17
|
-
[
|
|
17
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
18
18
|
},
|
|
19
19
|
wallet: this.context.wallet,
|
|
20
20
|
delegation: this.context.delegation,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ListObjectCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@did-space/constants");
|
|
5
5
|
const ufo_1 = require("ufo");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const security_1 = require("../../security");
|
|
@@ -14,7 +14,7 @@ class ListObjectCommand extends base_1.BaseCommand {
|
|
|
14
14
|
method,
|
|
15
15
|
data: {},
|
|
16
16
|
headers: {
|
|
17
|
-
[
|
|
17
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
18
18
|
},
|
|
19
19
|
wallet: this.context.wallet,
|
|
20
20
|
delegation: this.context.delegation,
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ListObjectsCommand = void 0;
|
|
7
|
-
const
|
|
7
|
+
const constants_1 = require("@did-space/constants");
|
|
8
8
|
const ufo_1 = require("ufo");
|
|
9
9
|
const debug_1 = __importDefault(require("debug"));
|
|
10
10
|
const pick_1 = __importDefault(require("lodash/pick"));
|
|
@@ -27,7 +27,7 @@ class ListObjectsCommand extends base_1.BaseCommand {
|
|
|
27
27
|
method,
|
|
28
28
|
data: {},
|
|
29
29
|
headers: {
|
|
30
|
-
[
|
|
30
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
31
31
|
},
|
|
32
32
|
wallet: this.context.wallet,
|
|
33
33
|
delegation: this.context.delegation,
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PutObjectCommand = void 0;
|
|
7
|
-
const
|
|
7
|
+
const constants_1 = require("@did-space/constants");
|
|
8
8
|
const form_data_1 = __importDefault(require("form-data"));
|
|
9
9
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
10
10
|
const ufo_1 = require("ufo");
|
|
@@ -33,7 +33,7 @@ class PutObjectCommand extends base_1.BaseCommand {
|
|
|
33
33
|
method,
|
|
34
34
|
data: body,
|
|
35
35
|
headers: {
|
|
36
|
-
[
|
|
36
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
37
37
|
},
|
|
38
38
|
wallet: this.context.wallet,
|
|
39
39
|
delegation: this.context.delegation,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeletePreviewObjectCommand = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const ufo_1 = require("ufo");
|
|
6
|
-
const
|
|
6
|
+
const constants_1 = require("@did-space/constants");
|
|
7
7
|
const meta_1 = require("../../meta");
|
|
8
8
|
const base_1 = require("../base");
|
|
9
9
|
const security_1 = require("../../security");
|
|
@@ -21,7 +21,7 @@ class DeletePreviewObjectCommand extends base_1.BaseCommand {
|
|
|
21
21
|
method,
|
|
22
22
|
data: {},
|
|
23
23
|
headers: {
|
|
24
|
-
[
|
|
24
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
25
25
|
},
|
|
26
26
|
wallet: this.context.wallet,
|
|
27
27
|
delegation: this.context.delegation,
|
|
@@ -7,7 +7,7 @@ exports.GetPreviewObjectCommand = void 0;
|
|
|
7
7
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const ufo_1 = require("ufo");
|
|
10
|
-
const
|
|
10
|
+
const constants_1 = require("@did-space/constants");
|
|
11
11
|
const meta_1 = require("../../meta");
|
|
12
12
|
const base_1 = require("../base");
|
|
13
13
|
const security_1 = require("../../security");
|
|
@@ -25,7 +25,7 @@ class GetPreviewObjectCommand extends base_1.BaseCommand {
|
|
|
25
25
|
method,
|
|
26
26
|
data: {},
|
|
27
27
|
headers: {
|
|
28
|
-
[
|
|
28
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
29
29
|
},
|
|
30
30
|
wallet: this.context.wallet,
|
|
31
31
|
delegation: this.context.delegation,
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PutPreviewObjectCommand = void 0;
|
|
7
|
-
const
|
|
7
|
+
const constants_1 = require("@did-space/constants");
|
|
8
8
|
const form_data_1 = __importDefault(require("form-data"));
|
|
9
9
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
10
10
|
const ufo_1 = require("ufo");
|
|
@@ -46,7 +46,7 @@ class PutPreviewObjectCommand extends base_1.BaseCommand {
|
|
|
46
46
|
method,
|
|
47
47
|
data,
|
|
48
48
|
headers: {
|
|
49
|
-
[
|
|
49
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
50
50
|
},
|
|
51
51
|
wallet: this.context.wallet,
|
|
52
52
|
delegation: this.context.delegation,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RestoreBlockletCommand = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
7
|
const sync_1 = require("../sync");
|
|
8
8
|
const post_app_restore_1 = require("./post-app-restore");
|
|
@@ -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:
|
|
40
|
+
status: constants_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:
|
|
50
|
+
status: constants_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:
|
|
61
|
+
status: constants_1.AuditLogStatus.FAILED,
|
|
62
62
|
message,
|
|
63
63
|
}, this.context)
|
|
64
64
|
.request()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HeadSpaceCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@did-space/constants");
|
|
5
5
|
const ufo_1 = require("ufo");
|
|
6
6
|
const libs_1 = require("../../libs");
|
|
7
7
|
const security_1 = require("../../security");
|
|
@@ -27,7 +27,7 @@ class HeadSpaceCommand extends base_1.BaseCommand {
|
|
|
27
27
|
method,
|
|
28
28
|
data: {},
|
|
29
29
|
headers: {
|
|
30
|
-
[
|
|
30
|
+
[constants_1.HEADERS.X_SIGNATURE_VERSION]: '2',
|
|
31
31
|
},
|
|
32
32
|
wallet: this.context.wallet,
|
|
33
33
|
delegation: this.context.delegation,
|
|
@@ -7,6 +7,7 @@ exports.SyncFolderPushCommand = void 0;
|
|
|
7
7
|
/* eslint-disable @typescript-eslint/indent */
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const core_1 = require("@did-space/core");
|
|
10
|
+
const constants_1 = require("@did-space/constants");
|
|
10
11
|
const path_1 = require("path");
|
|
11
12
|
const filehound_1 = __importDefault(require("filehound"));
|
|
12
13
|
const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
@@ -60,7 +61,7 @@ class SyncFolderPushCommand extends sync_folder_base_1.SyncFolderBaseCommand {
|
|
|
60
61
|
const { errorCount, count: totalCount, duration, size } = res.data;
|
|
61
62
|
await this.updateObjectsSyncAuditLog({
|
|
62
63
|
id: this.objectsSync.id,
|
|
63
|
-
status: errorCount === 0 ?
|
|
64
|
+
status: errorCount === 0 ? constants_1.AuditLogStatus.SUCCEEDED : constants_1.AuditLogStatus.FAILED,
|
|
64
65
|
reason: res.statusMessage,
|
|
65
66
|
errorCount,
|
|
66
67
|
totalCount,
|
|
@@ -155,7 +156,7 @@ class SyncFolderPushCommand extends sync_folder_base_1.SyncFolderBaseCommand {
|
|
|
155
156
|
if (this.objectsSync) {
|
|
156
157
|
await this.updateObjectsSyncAuditLog({
|
|
157
158
|
id: this.objectsSync.id,
|
|
158
|
-
status:
|
|
159
|
+
status: constants_1.AuditLogStatus.FAILED,
|
|
159
160
|
reason: (0, libs_1.getErrorMessage)(error),
|
|
160
161
|
totalCount: 0,
|
|
161
162
|
errorCount: 0,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppBackup
|
|
1
|
+
import { AppBackup } from '@did-space/core';
|
|
2
|
+
import { AuditLogStatus } from '@did-space/constants';
|
|
2
3
|
import type { ObjectSchema } from 'joi';
|
|
3
4
|
import type { CommandInput, CommandOutput } from '../../protocol';
|
|
4
5
|
export type AppBackupData = AppBackup & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PutAppBackupCommandInputSchema = void 0;
|
|
4
4
|
const validator_1 = require("@arcblock/validator");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
exports.PutAppBackupCommandInputSchema = validator_1.Joi.object({
|
|
7
7
|
id: validator_1.Joi.string().required(),
|
|
8
8
|
updateAt: validator_1.Joi.string()
|
|
@@ -12,7 +12,7 @@ exports.PutAppBackupCommandInputSchema = validator_1.Joi.object({
|
|
|
12
12
|
status: validator_1.Joi.string()
|
|
13
13
|
.optional()
|
|
14
14
|
.allow('')
|
|
15
|
-
.valid(...Object.values(
|
|
16
|
-
.default(
|
|
15
|
+
.valid(...Object.values(constants_1.AuditLogStatus))
|
|
16
|
+
.default(constants_1.AuditLogStatus.DEFAULT),
|
|
17
17
|
message: validator_1.Joi.string().optional().allow('').default(''),
|
|
18
18
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppRestore
|
|
1
|
+
import { AppRestore } from '@did-space/core';
|
|
2
|
+
import { AuditLogStatus } from '@did-space/constants';
|
|
2
3
|
import type { ObjectSchema } from 'joi';
|
|
3
4
|
import { CommandOutput, type CommandInput } from '../../protocol/command.protocol';
|
|
4
5
|
export type AppRestoreData = AppRestore & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PutAppRestoreCommandInputSchema = void 0;
|
|
4
4
|
const validator_1 = require("@arcblock/validator");
|
|
5
|
-
const
|
|
5
|
+
const constants_1 = require("@did-space/constants");
|
|
6
6
|
exports.PutAppRestoreCommandInputSchema = validator_1.Joi.object({
|
|
7
7
|
id: validator_1.Joi.string().required(),
|
|
8
8
|
updateAt: validator_1.Joi.string()
|
|
@@ -12,7 +12,7 @@ exports.PutAppRestoreCommandInputSchema = validator_1.Joi.object({
|
|
|
12
12
|
status: validator_1.Joi.string()
|
|
13
13
|
.optional()
|
|
14
14
|
.allow('')
|
|
15
|
-
.valid(...Object.values(
|
|
16
|
-
.default(
|
|
15
|
+
.valid(...Object.values(constants_1.AuditLogStatus))
|
|
16
|
+
.default(constants_1.AuditLogStatus.DEFAULT),
|
|
17
17
|
message: validator_1.Joi.string().optional().allow('').default(''),
|
|
18
18
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AuditLogModel
|
|
1
|
+
import { AuditLogModel } from '@did-space/core';
|
|
2
|
+
import { AuditLogAction } from '@did-space/constants';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import type { CommandInput, CommandOutput } from '../../protocol';
|
|
4
5
|
export declare const PostObjectsSyncCommandInputSchema: z.ZodObject<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AuditLogModel
|
|
1
|
+
import { AuditLogModel } from '@did-space/core';
|
|
2
|
+
import { AuditLogAction, AuditLogStatus } from '@did-space/constants';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import type { CommandInput, CommandOutput } from '../../protocol';
|
|
4
5
|
export declare const PutObjectsSyncCommandInputSchema: z.ZodObject<{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PutObjectsSyncCommandInputSchema = void 0;
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("@did-space/constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.PutObjectsSyncCommandInputSchema = zod_1.z.object({
|
|
7
7
|
id: zod_1.z.string().min(1),
|
|
8
|
-
status: zod_1.z.nativeEnum(
|
|
8
|
+
status: zod_1.z.nativeEnum(constants_1.AuditLogStatus),
|
|
9
9
|
reason: zod_1.z.string().optional(),
|
|
10
10
|
totalCount: zod_1.z.number(),
|
|
11
11
|
errorCount: zod_1.z.number(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/did-space-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"@arcblock/jwt": "^1.20.14",
|
|
34
34
|
"@arcblock/validator": "^1.20.14",
|
|
35
35
|
"@blocklet/env": "^1.16.44",
|
|
36
|
-
"@did-space/
|
|
36
|
+
"@did-space/constants": "^1.0.63",
|
|
37
|
+
"@did-space/core": "^1.0.63",
|
|
37
38
|
"@ocap/mcrypto": "^1.20.14",
|
|
38
39
|
"@ocap/util": "^1.20.14",
|
|
39
40
|
"@ocap/wallet": "^1.20.14",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"ts-jest": "^28.0.8",
|
|
78
79
|
"typescript": "^4.9.5"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "7412e2fc8d017cf57628b68bcbfff9e84fc4611f"
|
|
81
82
|
}
|