static getAPIItems()

in src/explorer.ts [134:165]


  static getAPIItems(apis: PontAPI[], modName: string, specName: string) {
    return (apis || []).map((api) => {
      return {
        specName: specName,
        modName,
        apiName: api?.name,
        contextValue: "API",
        resourceUri: vscode.Uri.parse(`pontx-manager://spec/${specName}/apis/${api.name}`),
        label: `${api.name}`,
        iconPath: api.deprecated
          ? vscode.Uri.joinPath(alicloudAPIMessageService.context.extensionUri, "resources/deprecated.svg")
          : vscode.Uri.joinPath(alicloudAPIMessageService.context.extensionUri, "resources/api-outline.svg"),
        description: api?.title || api?.summary || "",
        tooltip: api?.description || api?.summary || api?.name,
        collapsibleState: vscode.TreeItemCollapsibleState.None,
        command: {
          command: "alicloud.api.openDocument",
          title: "open",
          arguments: [
            {
              specName: specName,
              modName: modName,
              spec: api,
              name: api?.name,
              pageType: "document",
              schemaType: "api",
            },
          ],
        },
      };
    });
  }