integration

package
v0.0.0-...-94d9944 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package integration hosts `olares-cli settings integration`. Mirrors the SPA's Settings -> Integration page (S3 / Dropbox / Google Drive / Tencent COS / Olares Space accounts). Backed by user-service's account.controller.ts, all routes wrapped with returnSucceed/returnError, so the CLI sees a uniform BFL envelope.

Package integration implements the `olares-cli settings integration` subtree (Settings -> Integration). Backed by user-service's account.controller.ts. The cookie / cloud-binding / NFT subsets are browser-/wallet-bound and stay out of CLI scope; only the headless account CRUD is in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccountsCommand

func NewAccountsCommand(f *cmdutil.Factory) *cobra.Command

`olares-cli settings integration accounts ...`

Backed by user-service's /api/account/* (account.controller.ts):

GET  /api/account/all                   → mini list                (list verb)
GET  /api/account/:type                 → mini list per type       (list-by-type verb)
POST /api/account/retrieve {name}       → single full record       (get verb)

`GET /api/account/:type` upstream returns `[]IntegrationAccountMiniData` (same shape as `/all` but filtered to one type/name) — see account.service.ts:88-95 `getIntegrationAccountByAccountType` → `IntegrationAccountMiniData[]`. The SPA hits a *different* endpoint for the full record: settings/src/stores/settings/integration.ts:166-174 `getAccountFullData` → `POST /api/account/retrieve { name: key }` where `key = "integration-account:<type>:<name>"`. The CLI mirrors that split:

accounts list                          // GET  /api/account/all
accounts list-by-type <type>           // GET  /api/account/<type>     -> []mini
accounts get <type> <name>             // POST /api/account/retrieve   -> full

The mini list omits raw_data/tokens; the per-account GET returns the full IntegrationAccount including raw_data. We never print raw_data in --output table, but pass --output json to get it back.

The cookie store and Olares-Space NFT cloud-binding flows live behind separate routes that need browser/wallet context, so they stay out of CLI scope.

func NewIntegrationCommand

func NewIntegrationCommand(f *cmdutil.Factory) *cobra.Command

NewIntegrationCommand returns the `settings integration` parent: inspect, add (object-storage credentials only) and delete external integration accounts.

Types

type Doer

type Doer interface {
	DoJSON(ctx context.Context, method, path string, body, out interface{}) error
}

type Format

type Format string
const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL