@blocklet/did-space-js 1.1.8 → 1.1.10

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.
@@ -7,15 +7,16 @@ exports.ListObjectsCommand = void 0;
7
7
  const ufo_1 = require("ufo");
8
8
  const debug_1 = __importDefault(require("debug"));
9
9
  const pick_1 = __importDefault(require("lodash/pick"));
10
+ const meta_1 = require("../../meta");
10
11
  const base_1 = require("../base");
11
12
  const security_1 = require("../../security");
12
13
  const { name, version } = require('../../../package.json');
13
14
  const debug = (0, debug_1.default)(`${name}@${version}:list-objects`);
14
15
  class ListObjectsCommand extends base_1.BaseCommand {
15
16
  async getAxiosRequestConfig() {
16
- // TODO: 此处应该有 joi 校验
17
- const options = (0, pick_1.default)(this.input, ['recursive', 'ignoreDirectories']);
18
- const url = (0, ufo_1.withQuery)(this.getRequestUrl(this.input.key, 'lists/'), options);
17
+ const input = await meta_1.ListObjectsCommandInputSchema.parseAsync(this.input);
18
+ const options = (0, pick_1.default)(input, ['recursive', 'ignoreDirectories']);
19
+ const url = (0, ufo_1.withQuery)(this.getRequestUrl(input.key, 'lists/'), options);
19
20
  const requestHeaders = this.getRequestHeaders();
20
21
  const method = 'GET';
21
22
  debug('getAxiosRequestConfig.$url', url);
@@ -1,8 +1,28 @@
1
1
  import { Object } from '@did-space/core';
2
+ import { z } from 'zod';
2
3
  import { CommandInput, CommandOutput } from '../../protocol';
4
+ export declare const ListObjectsCommandInputSchema: z.ZodObject<{
5
+ key: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6
+ recursive: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
7
+ ignoreDirectories: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ key: string;
10
+ recursive?: boolean | null | undefined;
11
+ ignoreDirectories?: boolean | null | undefined;
12
+ }, {
13
+ key?: string | undefined;
14
+ recursive?: boolean | null | undefined;
15
+ ignoreDirectories?: boolean | null | undefined;
16
+ }>;
3
17
  export interface ListObjectsCommandInput extends CommandInput {
4
18
  key: string;
5
19
  recursive?: false | true;
20
+ /**
21
+ *
22
+ * @description only recursive is false, ignoreDirectories can be set
23
+ * @type {(false | true)}
24
+ * @memberof ListObjectsCommandInput
25
+ */
6
26
  ignoreDirectories?: false | true;
7
27
  }
8
28
  export type ListObjectsCommandOutput = CommandOutput<Object[]>;
@@ -1,2 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListObjectsCommandInputSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ListObjectsCommandInputSchema = zod_1.z.object({
6
+ key: zod_1.z.string().optional().default('/'),
7
+ recursive: zod_1.z.boolean().optional().nullable(),
8
+ ignoreDirectories: zod_1.z.boolean().optional().nullable(),
9
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/did-space-js",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -29,15 +29,15 @@
29
29
  "link": "yarn link"
30
30
  },
31
31
  "dependencies": {
32
- "@arcblock/did": "^1.20.15",
33
- "@arcblock/jwt": "^1.20.15",
34
- "@arcblock/validator": "^1.20.15",
32
+ "@arcblock/did": "^1.21.0",
33
+ "@arcblock/jwt": "^1.21.0",
34
+ "@arcblock/validator": "^1.21.0",
35
35
  "@blocklet/env": "^1.16.47-beta-20250714-035905-f63c5239",
36
- "@did-space/constants": "^1.1.8",
37
- "@did-space/core": "^1.1.8",
38
- "@ocap/mcrypto": "^1.20.15",
39
- "@ocap/util": "^1.20.15",
40
- "@ocap/wallet": "^1.20.15",
36
+ "@did-space/constants": "^1.1.10",
37
+ "@did-space/core": "^1.1.10",
38
+ "@ocap/mcrypto": "^1.21.0",
39
+ "@ocap/util": "^1.21.0",
40
+ "@ocap/wallet": "^1.21.0",
41
41
  "agentkeepalive": "^4.6.0",
42
42
  "axios": "^1.10.0",
43
43
  "base64-url": "^2.3.3",
@@ -78,5 +78,5 @@
78
78
  "ts-jest": "^28.0.8",
79
79
  "typescript": "^4.9.5"
80
80
  },
81
- "gitHead": "c2a3303156a2cd392c2e74b00eb10b8426326478"
81
+ "gitHead": "dfee90ee25fd4f9773300ab4a650afddd01cdd05"
82
82
  }