sim 2.2.31 → 2.2.32-preview.312.1

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.
@@ -6,6 +6,9 @@ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
6
6
  commander
7
7
  Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
8
8
 
9
+ csv-parse
10
+ Copyright (c) 2010 Adaltas
11
+
9
12
  js-yaml
10
13
  Copyright (C) 2011-2015 by Vitaly Puzrin
11
14
 
@@ -0,0 +1,3 @@
1
+ import { type Command } from 'commander';
2
+ /** Adds a bounded CSV upload workflow over the existing revisioned import operations. */
3
+ export declare function attachSourcePermissionCommands(program: Command): void;
@@ -2451,6 +2451,59 @@ type CreateSandboxResponseRef0 = {
2451
2451
  export type CreateSandboxResponse = {
2452
2452
  data: CreateSandboxResponseRef0;
2453
2453
  };
2454
+ /** `POST /api/v2/organizations/[organizationId]/search/sources` */
2455
+ export type CreateSearchSourceParams = {
2456
+ organizationId: string;
2457
+ };
2458
+ export type CreateSearchSourceQuery = Record<string, unknown>;
2459
+ export type CreateSearchSourceBody = {
2460
+ connectorType: string;
2461
+ credentialId?: string;
2462
+ apiKey?: string;
2463
+ sourceConfig: Record<string, unknown>;
2464
+ accessMode?: 'admin' | 'members';
2465
+ permissionConfig?: {
2466
+ provider: 'gitlab';
2467
+ mode: 'administrator' | 'csv';
2468
+ expectedRevision?: number;
2469
+ userMapping?: {
2470
+ filename: string;
2471
+ content: string;
2472
+ };
2473
+ projectPermissions?: {
2474
+ filename: string;
2475
+ content: string;
2476
+ };
2477
+ };
2478
+ };
2479
+ export type CreateSearchSourceResponse = {
2480
+ data: {
2481
+ id: string;
2482
+ connectorType: string;
2483
+ credentialId: string | null;
2484
+ sourceConfig: Record<string, unknown>;
2485
+ status: 'active' | 'paused' | 'pending' | 'syncing' | 'error' | 'disabled';
2486
+ createdAt: string;
2487
+ updatedAt: string;
2488
+ accessMode: 'admin' | 'members';
2489
+ approved: boolean;
2490
+ permissionConfig: {
2491
+ provider: 'gitlab';
2492
+ mode: 'administrator' | 'csv';
2493
+ revision: number;
2494
+ userMapping: {
2495
+ filename: string;
2496
+ uploadedAt: string;
2497
+ rowCount: number;
2498
+ } | null;
2499
+ projectPermissions: {
2500
+ filename: string;
2501
+ uploadedAt: string;
2502
+ rowCount: number;
2503
+ } | null;
2504
+ } | null;
2505
+ };
2506
+ };
2454
2507
  /** `POST /api/v2/credentials` */
2455
2508
  export type CreateServiceAccountCredentialQuery = Record<string, unknown>;
2456
2509
  export type CreateServiceAccountCredentialBody = {
@@ -3348,6 +3401,18 @@ type DeleteSandboxResponseRef0 = {
3348
3401
  export type DeleteSandboxResponse = {
3349
3402
  data: DeleteSandboxResponseRef0;
3350
3403
  };
3404
+ /** `DELETE /api/v2/organizations/[organizationId]/search/sources/[sourceId]` */
3405
+ export type DeleteSearchSourceParams = {
3406
+ organizationId: string;
3407
+ sourceId: string;
3408
+ };
3409
+ export type DeleteSearchSourceQuery = Record<string, unknown>;
3410
+ export type DeleteSearchSourceResponse = {
3411
+ data: {
3412
+ id: string;
3413
+ deleted: true;
3414
+ };
3415
+ };
3351
3416
  /** `DELETE /api/v2/secrets/[name]` */
3352
3417
  export type DeleteSecretParams = {
3353
3418
  name: string;
@@ -5362,6 +5427,40 @@ type GetSandboxResponseRef0 = {
5362
5427
  export type GetSandboxResponse = {
5363
5428
  data: GetSandboxResponseRef0;
5364
5429
  };
5430
+ /** `GET /api/v2/organizations/[organizationId]/search/sources/[sourceId]` */
5431
+ export type GetSearchSourceParams = {
5432
+ organizationId: string;
5433
+ sourceId: string;
5434
+ };
5435
+ export type GetSearchSourceQuery = Record<string, unknown>;
5436
+ export type GetSearchSourceResponse = {
5437
+ data: {
5438
+ id: string;
5439
+ connectorType: string;
5440
+ credentialId: string | null;
5441
+ sourceConfig: Record<string, unknown>;
5442
+ status: 'active' | 'paused' | 'pending' | 'syncing' | 'error' | 'disabled';
5443
+ createdAt: string;
5444
+ updatedAt: string;
5445
+ accessMode: 'admin' | 'members';
5446
+ approved: boolean;
5447
+ permissionConfig: {
5448
+ provider: 'gitlab';
5449
+ mode: 'administrator' | 'csv';
5450
+ revision: number;
5451
+ userMapping: {
5452
+ filename: string;
5453
+ uploadedAt: string;
5454
+ rowCount: number;
5455
+ } | null;
5456
+ projectPermissions: {
5457
+ filename: string;
5458
+ uploadedAt: string;
5459
+ rowCount: number;
5460
+ } | null;
5461
+ } | null;
5462
+ };
5463
+ };
5365
5464
  /** `GET /api/v2/organizations/[organizationId]/search/sources/[sourceId]/permissions` */
5366
5465
  export type GetSearchSourcePermissionsParams = {
5367
5466
  organizationId: string;
@@ -7795,6 +7894,45 @@ export type ListSandboxesResponse = {
7795
7894
  data: Array<ListSandboxesResponseRef0>;
7796
7895
  nextCursor: string | null;
7797
7896
  };
7897
+ /** `GET /api/v2/organizations/[organizationId]/search/sources` */
7898
+ export type ListSearchSourcesParams = {
7899
+ organizationId: string;
7900
+ };
7901
+ export type ListSearchSourcesQuery = {
7902
+ sortBy?: 'connectorType' | 'createdAt' | 'updatedAt';
7903
+ sortOrder?: 'asc' | 'desc';
7904
+ limit?: number;
7905
+ cursor?: string;
7906
+ };
7907
+ export type ListSearchSourcesResponse = {
7908
+ data: Array<{
7909
+ id: string;
7910
+ connectorType: string;
7911
+ credentialId: string | null;
7912
+ sourceConfig: Record<string, unknown>;
7913
+ status: 'active' | 'paused' | 'pending' | 'syncing' | 'error' | 'disabled';
7914
+ createdAt: string;
7915
+ updatedAt: string;
7916
+ accessMode: 'admin' | 'members';
7917
+ approved: boolean;
7918
+ permissionConfig: {
7919
+ provider: 'gitlab';
7920
+ mode: 'administrator' | 'csv';
7921
+ revision: number;
7922
+ userMapping: {
7923
+ filename: string;
7924
+ uploadedAt: string;
7925
+ rowCount: number;
7926
+ } | null;
7927
+ projectPermissions: {
7928
+ filename: string;
7929
+ uploadedAt: string;
7930
+ rowCount: number;
7931
+ } | null;
7932
+ } | null;
7933
+ }>;
7934
+ nextCursor: string | null;
7935
+ };
7798
7936
  /** `GET /api/v2/secrets` */
7799
7937
  export type ListSecretsQuery = {
7800
7938
  workspaceId: string;
@@ -8554,6 +8692,20 @@ type MoveWorkflowsResponseRef0 = {
8554
8692
  export type MoveWorkflowsResponse = {
8555
8693
  data: MoveWorkflowsResponseRef0;
8556
8694
  };
8695
+ /** `POST /api/v2/organizations/[organizationId]/search/sources/prepare` */
8696
+ export type PrepareSearchSourcesParams = {
8697
+ organizationId: string;
8698
+ };
8699
+ export type PrepareSearchSourcesQuery = Record<string, unknown>;
8700
+ export type PrepareSearchSourcesBody = {
8701
+ connectorType: string;
8702
+ accessMode?: 'admin' | 'members';
8703
+ };
8704
+ export type PrepareSearchSourcesResponse = {
8705
+ data: {
8706
+ ready: true;
8707
+ };
8708
+ };
8557
8709
  /** `GET /api/v2/organizations/[organizationId]/access-requests/[requestId]/preview` */
8558
8710
  export type PreviewOrganizationAccessRequestParams = {
8559
8711
  organizationId: string;
@@ -11500,6 +11652,58 @@ type UpdateSandboxResponseRef0 = {
11500
11652
  export type UpdateSandboxResponse = {
11501
11653
  data: UpdateSandboxResponseRef0;
11502
11654
  };
11655
+ /** `PATCH /api/v2/organizations/[organizationId]/search/sources/[sourceId]` */
11656
+ export type UpdateSearchSourceParams = {
11657
+ organizationId: string;
11658
+ sourceId: string;
11659
+ };
11660
+ export type UpdateSearchSourceQuery = Record<string, unknown>;
11661
+ export type UpdateSearchSourceBody = {
11662
+ apiKey?: string;
11663
+ sourceConfig?: Record<string, unknown>;
11664
+ permissionConfig?: {
11665
+ provider: 'gitlab';
11666
+ mode: 'administrator' | 'csv';
11667
+ expectedRevision?: number;
11668
+ userMapping?: {
11669
+ filename: string;
11670
+ content: string;
11671
+ };
11672
+ projectPermissions?: {
11673
+ filename: string;
11674
+ content: string;
11675
+ };
11676
+ };
11677
+ status?: 'active' | 'paused';
11678
+ };
11679
+ export type UpdateSearchSourceResponse = {
11680
+ data: {
11681
+ id: string;
11682
+ connectorType: string;
11683
+ credentialId: string | null;
11684
+ sourceConfig: Record<string, unknown>;
11685
+ status: 'active' | 'paused' | 'pending' | 'syncing' | 'error' | 'disabled';
11686
+ createdAt: string;
11687
+ updatedAt: string;
11688
+ accessMode: 'admin' | 'members';
11689
+ approved: boolean;
11690
+ permissionConfig: {
11691
+ provider: 'gitlab';
11692
+ mode: 'administrator' | 'csv';
11693
+ revision: number;
11694
+ userMapping: {
11695
+ filename: string;
11696
+ uploadedAt: string;
11697
+ rowCount: number;
11698
+ } | null;
11699
+ projectPermissions: {
11700
+ filename: string;
11701
+ uploadedAt: string;
11702
+ rowCount: number;
11703
+ } | null;
11704
+ } | null;
11705
+ };
11706
+ };
11503
11707
  /** `PATCH /api/v2/skills/[skillId]` */
11504
11708
  export type UpdateSkillParams = {
11505
11709
  skillId: string;
@@ -13750,6 +13954,46 @@ export declare const V2_OPERATIONS: {
13750
13954
  };
13751
13955
  };
13752
13956
  };
13957
+ readonly createSearchSource: {
13958
+ readonly method: 'POST';
13959
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources';
13960
+ readonly pathParams: readonly ['organizationId'];
13961
+ readonly pathParamDocs: {
13962
+ readonly organizationId: 'Organization identifier.';
13963
+ };
13964
+ readonly responseMode: 'json';
13965
+ readonly summary: 'Create Search source';
13966
+ readonly body: {
13967
+ readonly connectorType: {
13968
+ readonly kind: 'string';
13969
+ readonly required: true;
13970
+ readonly describe: 'Registered connector type.';
13971
+ };
13972
+ readonly credentialId: {
13973
+ readonly kind: 'string';
13974
+ readonly describe: '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.';
13975
+ };
13976
+ readonly apiKey: {
13977
+ readonly kind: 'string';
13978
+ readonly describe: '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.';
13979
+ };
13980
+ readonly sourceConfig: {
13981
+ readonly kind: 'object';
13982
+ readonly required: true;
13983
+ readonly describe: 'Connector-specific source selection and filtering configuration.';
13984
+ };
13985
+ readonly accessMode: {
13986
+ readonly kind: 'enum';
13987
+ readonly values: readonly ['admin', 'members'];
13988
+ readonly default: 'admin';
13989
+ readonly describe: 'Source-managed permissions (admin), or individually connected member accounts (members).';
13990
+ };
13991
+ readonly permissionConfig: {
13992
+ readonly kind: 'object';
13993
+ readonly describe: 'Provider-specific permissions for initial setup. Large CSV snapshots use permission imports after creation.';
13994
+ };
13995
+ };
13996
+ };
13753
13997
  readonly createServiceAccountCredential: {
13754
13998
  readonly method: 'POST';
13755
13999
  readonly path: '/api/v2/credentials';
@@ -14517,6 +14761,17 @@ export declare const V2_OPERATIONS: {
14517
14761
  };
14518
14762
  };
14519
14763
  };
14764
+ readonly deleteSearchSource: {
14765
+ readonly method: 'DELETE';
14766
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources/[sourceId]';
14767
+ readonly pathParams: readonly ['organizationId', 'sourceId'];
14768
+ readonly pathParamDocs: {
14769
+ readonly organizationId: 'Organization identifier.';
14770
+ readonly sourceId: 'Search source identifier, also used by permission uploads.';
14771
+ };
14772
+ readonly responseMode: 'json';
14773
+ readonly summary: 'Delete Search source';
14774
+ };
14520
14775
  readonly deleteSecret: {
14521
14776
  readonly method: 'DELETE';
14522
14777
  readonly path: '/api/v2/secrets/[name]';
@@ -15861,6 +16116,17 @@ export declare const V2_OPERATIONS: {
15861
16116
  };
15862
16117
  };
15863
16118
  };
16119
+ readonly getSearchSource: {
16120
+ readonly method: 'GET';
16121
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources/[sourceId]';
16122
+ readonly pathParams: readonly ['organizationId', 'sourceId'];
16123
+ readonly pathParamDocs: {
16124
+ readonly organizationId: 'Organization identifier.';
16125
+ readonly sourceId: 'Search source identifier, also used by permission uploads.';
16126
+ };
16127
+ readonly responseMode: 'json';
16128
+ readonly summary: 'Get Search source';
16129
+ };
15864
16130
  readonly getSearchSourcePermissions: {
15865
16131
  readonly method: 'GET';
15866
16132
  readonly path: '/api/v2/organizations/[organizationId]/search/sources/[sourceId]/permissions';
@@ -18035,6 +18301,40 @@ export declare const V2_OPERATIONS: {
18035
18301
  };
18036
18302
  };
18037
18303
  };
18304
+ readonly listSearchSources: {
18305
+ readonly method: 'GET';
18306
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources';
18307
+ readonly pathParams: readonly ['organizationId'];
18308
+ readonly pathParamDocs: {
18309
+ readonly organizationId: 'Organization identifier.';
18310
+ };
18311
+ readonly responseMode: 'json';
18312
+ readonly summary: 'List Search sources';
18313
+ readonly query: {
18314
+ readonly sortBy: {
18315
+ readonly kind: 'enum';
18316
+ readonly values: readonly ['connectorType', 'createdAt', 'updatedAt'];
18317
+ readonly default: 'createdAt';
18318
+ readonly describe: 'Field used to sort the result.';
18319
+ };
18320
+ readonly sortOrder: {
18321
+ readonly kind: 'enum';
18322
+ readonly values: readonly ['asc', 'desc'];
18323
+ readonly default: 'desc';
18324
+ readonly describe: 'Sort direction.';
18325
+ };
18326
+ readonly limit: {
18327
+ readonly kind: 'integer';
18328
+ readonly default: 50;
18329
+ readonly maximum: 100;
18330
+ readonly describe: 'Maximum connectors to return per page. Must be a whole number from 1 to 100. Defaults to 50.';
18331
+ };
18332
+ readonly cursor: {
18333
+ readonly kind: 'string';
18334
+ readonly describe: 'Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.';
18335
+ };
18336
+ };
18337
+ };
18038
18338
  readonly listSecrets: {
18039
18339
  readonly method: 'GET';
18040
18340
  readonly path: '/api/v2/secrets';
@@ -18954,6 +19254,29 @@ export declare const V2_OPERATIONS: {
18954
19254
  };
18955
19255
  };
18956
19256
  };
19257
+ readonly prepareSearchSources: {
19258
+ readonly method: 'POST';
19259
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources/prepare';
19260
+ readonly pathParams: readonly ['organizationId'];
19261
+ readonly pathParamDocs: {
19262
+ readonly organizationId: 'Organization identifier.';
19263
+ };
19264
+ readonly responseMode: 'json';
19265
+ readonly summary: 'Prepare Search sources';
19266
+ readonly body: {
19267
+ readonly connectorType: {
19268
+ readonly kind: 'string';
19269
+ readonly required: true;
19270
+ readonly describe: 'Registered connector type.';
19271
+ };
19272
+ readonly accessMode: {
19273
+ readonly kind: 'enum';
19274
+ readonly values: readonly ['admin', 'members'];
19275
+ readonly default: 'admin';
19276
+ readonly describe: 'Source-managed permissions (admin), or individually connected member accounts (members).';
19277
+ };
19278
+ };
19279
+ };
18957
19280
  readonly previewOrganizationAccessRequest: {
18958
19281
  readonly method: 'GET';
18959
19282
  readonly path: '/api/v2/organizations/[organizationId]/access-requests/[requestId]/preview';
@@ -21445,6 +21768,36 @@ export declare const V2_OPERATIONS: {
21445
21768
  };
21446
21769
  };
21447
21770
  };
21771
+ readonly updateSearchSource: {
21772
+ readonly method: 'PATCH';
21773
+ readonly path: '/api/v2/organizations/[organizationId]/search/sources/[sourceId]';
21774
+ readonly pathParams: readonly ['organizationId', 'sourceId'];
21775
+ readonly pathParamDocs: {
21776
+ readonly organizationId: 'Organization identifier.';
21777
+ readonly sourceId: 'Search source identifier, also used by permission uploads.';
21778
+ };
21779
+ readonly responseMode: 'json';
21780
+ readonly summary: 'Update Search source';
21781
+ readonly body: {
21782
+ readonly apiKey: {
21783
+ readonly kind: 'string';
21784
+ readonly describe: '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.';
21785
+ };
21786
+ readonly sourceConfig: {
21787
+ readonly kind: 'object';
21788
+ readonly describe: 'Complete replacement source configuration. Read the existing configuration before editing it.';
21789
+ };
21790
+ readonly permissionConfig: {
21791
+ readonly kind: 'object';
21792
+ readonly describe: 'Provider-specific permission update, using the current expectedRevision. Omit to retain permissions.';
21793
+ };
21794
+ readonly status: {
21795
+ readonly kind: 'enum';
21796
+ readonly values: readonly ['active', 'paused'];
21797
+ readonly describe: 'Pause or resume this source without changing its ID or stored permissions.';
21798
+ };
21799
+ };
21800
+ };
21448
21801
  readonly updateSkill: {
21449
21802
  readonly method: 'PATCH';
21450
21803
  readonly path: '/api/v2/skills/[skillId]';
@@ -12,6 +12,7 @@ export declare class SimApiError extends Error {
12
12
  readonly exitCode: number;
13
13
  /** The server's id for the failed request (`x-request-id`), to quote to support. */
14
14
  readonly requestId: string | null;
15
+ retryAfterMs: number | null;
15
16
  constructor(message: string, status: number, code?: string | null, details?: unknown, exitCode?: number,
16
17
  /** The server's id for the failed request (`x-request-id`), to quote to support. */
17
18
  requestId?: string | null);
@@ -80,6 +81,14 @@ export declare const RAISE_TIMEOUT_HINT = "Raise SIM_TIMEOUT_SECONDS, or set it
80
81
  * the user asked for, which must keep reading as a cancellation.
81
82
  */
82
83
  export declare function isRequestTimeout(error: unknown): boolean;
84
+ /**
85
+ * Aborts when either signal does.
86
+ *
87
+ * `AbortSignal.any` arrived in Node 20.3 and this package supports Node 20, so
88
+ * on the earliest 20.x releases calling it would throw a bare `TypeError`
89
+ * before the request was ever made — turning a supported runtime into a crash.
90
+ */
91
+ export declare function combineSignals(caller: AbortSignal | undefined, timeout: AbortSignal | undefined): AbortSignal | undefined;
83
92
  /** Formats nested validation issues as readable, path-aware lines. */
84
93
  export declare function formatApiErrorDetails(details: unknown): string[];
85
94
  /**