Skip to content

Commit d0dc6de

Browse files
committed
feat(search): manage sources and permission uploads through the CLI
1 parent 5858006 commit d0dc6de

32 files changed

Lines changed: 6715 additions & 2325 deletions

‎apps/docs/content/docs/cli/organizations.mdx‎

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,39 @@ sim organizations search sources permissions imports create <sourceId> [options]
293293

294294
API request and response schemas: [createSourcePermissionImport](/api-reference/organizations/createSourcePermissionImport).
295295

296+
### Replace source permissions from two CSV files, uploaded in bounded parts
297+
298+
```bash
299+
sim organizations search sources permissions upload <sourceId> [options]
300+
```
301+
302+
**Arguments**
303+
304+
<CommandTable>
305+
306+
| Argument | Required | Description |
307+
| --- | --- | --- |
308+
| `sourceId` | Yes | Search source identifier |
309+
310+
</CommandTable>
311+
312+
**Options**
313+
314+
<CommandTable>
315+
316+
| Option | Required | Description |
317+
| --- | --- | --- |
318+
| `--organization <id>` | Yes | Organization identifier. |
319+
| `--provider <provider>` | Yes | Permission provider. Accepted values: `gitlab`. |
320+
| `--expected-revision <number>` | Yes | Revision read before exporting the CSVs. |
321+
| `--user-mapping <path>` | Yes | Complete user mapping CSV. |
322+
| `--project-permissions <path>` | Yes | Complete project permissions CSV. |
323+
| `-y, --yes` | Yes | Confirm replacement of all source permissions. |
324+
325+
</CommandTable>
326+
327+
API request and response schemas: [createSourcePermissionImport](/api-reference/organizations/createSourcePermissionImport), [putSourcePermissionImportPart](/api-reference/organizations/putSourcePermissionImportPart), [completeSourcePermissionImport](/api-reference/organizations/completeSourcePermissionImport).
328+
296329
### Complete source permission import
297330

298331
This replaces the source’s permission grants. Readers omitted from the new grants lose access.
@@ -1206,6 +1239,168 @@ sim organizations sso policy update [options]
12061239

12071240
API request and response schemas: [updateSsoPolicy](/api-reference/organizations/updateSsoPolicy).
12081241

1242+
## Other commands
1243+
1244+
### List search sources
1245+
1246+
```bash
1247+
sim organizations search sources list [options]
1248+
```
1249+
1250+
**Options**
1251+
1252+
<CommandTable>
1253+
1254+
| Option | Required | Description |
1255+
| --- | --- | --- |
1256+
| `--organization <value>` | Yes | Organization identifier. |
1257+
| `--sort-by <value>` | No | Field used to sort the result. Defaults to "createdAt". Accepted values: `connectorType`, `createdAt`, `updatedAt`. |
1258+
| `--sort-order <value>` | No | Sort direction. Defaults to "desc". Accepted values: `asc`, `desc`. |
1259+
| `--limit <n>` | No | Maximum items to return (0 for everything). Defaults to `100`. |
1260+
| `--cursor <value>` | No | Continue from nextCursor returned by a previous result. |
1261+
1262+
</CommandTable>
1263+
1264+
API request and response schemas: [listSearchSources](/api-reference/organizations/listSearchSources).
1265+
1266+
### Get search source
1267+
1268+
```bash
1269+
sim organizations search sources get <sourceId> [options]
1270+
```
1271+
1272+
**Arguments**
1273+
1274+
<CommandTable>
1275+
1276+
| Argument | Required | Description |
1277+
| --- | --- | --- |
1278+
| `sourceId` | Yes | Search source identifier, also used by permission uploads. |
1279+
1280+
</CommandTable>
1281+
1282+
**Options**
1283+
1284+
<CommandTable>
1285+
1286+
| Option | Required | Description |
1287+
| --- | --- | --- |
1288+
| `--organization <value>` | Yes | Organization identifier. |
1289+
1290+
</CommandTable>
1291+
1292+
API request and response schemas: [getSearchSource](/api-reference/organizations/getSearchSource).
1293+
1294+
### Create search source
1295+
1296+
```bash
1297+
sim organizations search sources create [options]
1298+
```
1299+
1300+
**Options**
1301+
1302+
<CommandTable>
1303+
1304+
| Option | Required | Description |
1305+
| --- | --- | --- |
1306+
| `--organization <value>` | Yes | Organization identifier. |
1307+
| `--connector-type <value>` | Yes | Registered connector type. |
1308+
| `--credential-id <value>` | No | OAuth credential identifier for connector types whose `auth.mode` is `oauth` (see connector types), or a saved credential for an `apiKey` connector type that declares `auth.savedCredential` (such as Amazon S3 with a saved AWS credential); otherwise omit it for `apiKey` connectors. |
1309+
| `--api-key <value\|@file>` | No | Write-only API key for connector types whose `auth.mode` is `apiKey` (see connector types), or a personal access token for an OAuth connector that also accepts one, such as GitHub. Send it instead of `credentialId`. Pass a raw key, or a secret reference written as the whole value `{{SECRET_NAME}}`, which the server resolves; `$SECRET_NAME` is not a reference. (@path / @- reads a file or stdin verbatim, including trailing newlines; @@value for a literal leading @). |
1310+
| `--source-config <json\|@file>` | Yes | Connector-specific source selection and filtering configuration. (JSON, or @path / @- to read a file or stdin). |
1311+
| `--access-mode <value>` | No | Source-managed permissions (admin), or individually connected member accounts (members). Defaults to "admin". Accepted values: `admin`, `members`. |
1312+
| `--permission-config <json\|@file>` | No | Provider-specific permissions for initial setup. Large CSV snapshots use permission imports after creation. (JSON, or @path / @- to read a file or stdin). |
1313+
1314+
</CommandTable>
1315+
1316+
API request and response schemas: [createSearchSource](/api-reference/organizations/createSearchSource).
1317+
1318+
### Update search source
1319+
1320+
This updates source settings and may replace its permission grants.
1321+
1322+
```bash
1323+
sim organizations search sources update <sourceId> [options]
1324+
```
1325+
1326+
**Arguments**
1327+
1328+
<CommandTable>
1329+
1330+
| Argument | Required | Description |
1331+
| --- | --- | --- |
1332+
| `sourceId` | Yes | Search source identifier, also used by permission uploads. |
1333+
1334+
</CommandTable>
1335+
1336+
**Options**
1337+
1338+
<CommandTable>
1339+
1340+
| Option | Required | Description |
1341+
| --- | --- | --- |
1342+
| `--organization <value>` | Yes | Organization identifier. |
1343+
| `--api-key <value\|@file>` | No | Replacement token for providers supporting credential updates (currently GitLab). For GitLab, supply permissionConfig with the current expectedRevision; omitted CSVs retain grants. Omit to keep the saved token. (@path / @- reads a file or stdin verbatim, including trailing newlines; @@value for a literal leading @). |
1344+
| `--source-config <json\|@file>` | No | Complete replacement source configuration. Read the existing configuration before editing it. (JSON, or @path / @- to read a file or stdin). |
1345+
| `--permission-config <json\|@file>` | No | Provider-specific permission update, using the current expectedRevision. Omit to retain permissions. (JSON, or @path / @- to read a file or stdin). |
1346+
| `--status <value>` | No | Pause or resume this source without changing its ID or stored permissions. Accepted values: `active`, `paused`. |
1347+
| `-y, --yes` | Yes | Confirm this operation. |
1348+
1349+
</CommandTable>
1350+
1351+
API request and response schemas: [updateSearchSource](/api-reference/organizations/updateSearchSource).
1352+
1353+
### Delete search source
1354+
1355+
This removes the source and its permission grants.
1356+
1357+
```bash
1358+
sim organizations search sources delete <sourceId> [options]
1359+
```
1360+
1361+
**Arguments**
1362+
1363+
<CommandTable>
1364+
1365+
| Argument | Required | Description |
1366+
| --- | --- | --- |
1367+
| `sourceId` | Yes | Search source identifier, also used by permission uploads. |
1368+
1369+
</CommandTable>
1370+
1371+
**Options**
1372+
1373+
<CommandTable>
1374+
1375+
| Option | Required | Description |
1376+
| --- | --- | --- |
1377+
| `--organization <value>` | Yes | Organization identifier. |
1378+
| `-y, --yes` | Yes | Confirm this operation. |
1379+
1380+
</CommandTable>
1381+
1382+
API request and response schemas: [deleteSearchSource](/api-reference/organizations/deleteSearchSource).
1383+
1384+
### Prepare search sources
1385+
1386+
```bash
1387+
sim organizations search sources prepare [options]
1388+
```
1389+
1390+
**Options**
1391+
1392+
<CommandTable>
1393+
1394+
| Option | Required | Description |
1395+
| --- | --- | --- |
1396+
| `--organization <value>` | Yes | Organization identifier. |
1397+
| `--connector-type <value>` | Yes | Registered connector type. |
1398+
| `--access-mode <value>` | No | Source-managed permissions (admin), or individually connected member accounts (members). Defaults to "admin". Accepted values: `admin`, `members`. |
1399+
1400+
</CommandTable>
1401+
1402+
API request and response schemas: [prepareSearchSources](/api-reference/organizations/prepareSearchSources).
1403+
12091404
## Related docs
12101405

12111406
- [Organizations](/platform/organization)

0 commit comments

Comments
 (0)