cloud-function-cli 1.1.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/cli/get.js +12 -4
  2. package/package.json +1 -1
package/dist/cli/get.js CHANGED
@@ -17,8 +17,16 @@ const get = async (name, options) => {
17
17
  const apiRootDir = path_1.default.join(process.cwd(), 'api');
18
18
  if (parts.length === 1) {
19
19
  try {
20
- const res = await apiClient_1.apiClient.get(`/api/management/list/${group}`, { environment });
21
- const apis = res.data;
20
+ const res = await apiClient_1.apiClient.get(`/api/management/list/${encodeURIComponent(group)}`, {
21
+ environment,
22
+ page: 1,
23
+ limit: 2000
24
+ });
25
+ const apis = Array.isArray(res.data)
26
+ ? res.data
27
+ : Array.isArray(res.data?.items)
28
+ ? res.data.items
29
+ : [];
22
30
  if (apis.length === 0) {
23
31
  logger_1.logger.warn(`No APIs found in group ${group}`);
24
32
  return;
@@ -29,7 +37,7 @@ const get = async (name, options) => {
29
37
  logger_1.logger.success('All APIs retrieved successfully!');
30
38
  }
31
39
  catch (error) {
32
- logger_1.logger.error(`Failed to list APIs: ${error.response?.data?.error || error.message}`);
40
+ logger_1.logger.error(`Failed to list APIs in group ${group}: ${error.response?.data?.error || error.message}`);
33
41
  }
34
42
  }
35
43
  else {
@@ -40,7 +48,7 @@ const get = async (name, options) => {
40
48
  exports.get = get;
41
49
  const getFile = async (apiRootDir, group, api, environment) => {
42
50
  try {
43
- const res = await apiClient_1.apiClient.get(`/api/management/get/${group}/${api}`, { environment });
51
+ const res = await apiClient_1.apiClient.get(`/api/management/get/${encodeURIComponent(group)}/${encodeURIComponent(api)}`, { environment });
44
52
  const groupDir = path_1.default.join(apiRootDir, group);
45
53
  if (!fs_1.default.existsSync(groupDir)) {
46
54
  fs_1.default.mkdirSync(groupDir, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloud-function-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "CLI for Cloud Function System - Create, deploy, and manage serverless functions",
5
5
  "main": "dist/index.js",
6
6
  "bin": {