@ocxp/client 0.2.0 → 0.2.3

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.
package/dist/index.d.cts CHANGED
@@ -635,6 +635,18 @@ type ContentReadResponse = {
635
635
  metadata?: {
636
636
  [key: string]: unknown;
637
637
  } | null;
638
+ /**
639
+ * Version Id
640
+ *
641
+ * S3 version ID
642
+ */
643
+ version_id?: string | null;
644
+ /**
645
+ * Is Latest
646
+ *
647
+ * Whether this is the latest version
648
+ */
649
+ is_latest?: boolean | null;
638
650
  };
639
651
  /**
640
652
  * ContentStatsResponse
@@ -669,6 +681,10 @@ type ContentTreeNode = {
669
681
  * Name
670
682
  */
671
683
  name: string;
684
+ /**
685
+ * Path
686
+ */
687
+ path: string;
672
688
  /**
673
689
  * Type
674
690
  */
@@ -677,6 +693,10 @@ type ContentTreeNode = {
677
693
  * Size
678
694
  */
679
695
  size?: number | null;
696
+ /**
697
+ * Version Id
698
+ */
699
+ version_id?: string | null;
680
700
  /**
681
701
  * Children
682
702
  */
@@ -746,6 +766,12 @@ type ContentWriteResponse = {
746
766
  * Etag
747
767
  */
748
768
  etag?: string | null;
769
+ /**
770
+ * Version Id
771
+ *
772
+ * S3 version ID of the written object
773
+ */
774
+ version_id?: string | null;
749
775
  };
750
776
  /**
751
777
  * CreateMemoRequest
@@ -2510,6 +2536,8 @@ type BulkReadContentData = {
2510
2536
  path: {
2511
2537
  /**
2512
2538
  * Content Type
2539
+ *
2540
+ * Content type (mission, project, context, code, etc.)
2513
2541
  */
2514
2542
  content_type: string;
2515
2543
  };
@@ -2539,6 +2567,8 @@ type BulkWriteContentData = {
2539
2567
  path: {
2540
2568
  /**
2541
2569
  * Content Type
2570
+ *
2571
+ * Content type (mission, project, context, code, etc.)
2542
2572
  */
2543
2573
  content_type: string;
2544
2574
  };
@@ -2568,6 +2598,8 @@ type BulkDeleteContentData = {
2568
2598
  path: {
2569
2599
  /**
2570
2600
  * Content Type
2601
+ *
2602
+ * Content type (mission, project, context, code, etc.)
2571
2603
  */
2572
2604
  content_type: string;
2573
2605
  };
@@ -4268,6 +4300,8 @@ type ListContentData = {
4268
4300
  path: {
4269
4301
  /**
4270
4302
  * Content Type
4303
+ *
4304
+ * Content type (mission, project, context, code, etc.)
4271
4305
  */
4272
4306
  content_type: string;
4273
4307
  };
@@ -4314,6 +4348,8 @@ type QueryContentData = {
4314
4348
  path: {
4315
4349
  /**
4316
4350
  * Content Type
4351
+ *
4352
+ * Content type (mission, project, context, code, etc.)
4317
4353
  */
4318
4354
  content_type: string;
4319
4355
  };
@@ -4347,6 +4383,8 @@ type SearchContentData = {
4347
4383
  path: {
4348
4384
  /**
4349
4385
  * Content Type
4386
+ *
4387
+ * Content type (mission, project, context, code, etc.)
4350
4388
  */
4351
4389
  content_type: string;
4352
4390
  };
@@ -4389,6 +4427,8 @@ type GetContentTreeData = {
4389
4427
  path: {
4390
4428
  /**
4391
4429
  * Content Type
4430
+ *
4431
+ * Content type (mission, project, context, code, etc.)
4392
4432
  */
4393
4433
  content_type: string;
4394
4434
  };
@@ -4405,6 +4445,12 @@ type GetContentTreeData = {
4405
4445
  * Maximum tree depth
4406
4446
  */
4407
4447
  depth?: number;
4448
+ /**
4449
+ * Includeversions
4450
+ *
4451
+ * Include S3 version IDs for files
4452
+ */
4453
+ includeVersions?: boolean;
4408
4454
  };
4409
4455
  url: '/ocxp/context/{content_type}/tree';
4410
4456
  };
@@ -4431,6 +4477,8 @@ type GetContentStatsData = {
4431
4477
  path: {
4432
4478
  /**
4433
4479
  * Content Type
4480
+ *
4481
+ * Content type (mission, project, context, code, etc.)
4434
4482
  */
4435
4483
  content_type: string;
4436
4484
  };
@@ -4467,6 +4515,8 @@ type DeleteContentData = {
4467
4515
  path: {
4468
4516
  /**
4469
4517
  * Content Type
4518
+ *
4519
+ * Content type (mission, project, context, code, etc.)
4470
4520
  */
4471
4521
  content_type: string;
4472
4522
  /**
@@ -4527,6 +4577,8 @@ type ReadContentData = {
4527
4577
  path: {
4528
4578
  /**
4529
4579
  * Content Type
4580
+ *
4581
+ * Content type (mission, project, context, code, etc.)
4530
4582
  */
4531
4583
  content_type: string;
4532
4584
  /**
@@ -4534,7 +4586,14 @@ type ReadContentData = {
4534
4586
  */
4535
4587
  content_id: string;
4536
4588
  };
4537
- query?: never;
4589
+ query?: {
4590
+ /**
4591
+ * Versionid
4592
+ *
4593
+ * S3 version ID to read a specific version
4594
+ */
4595
+ versionId?: string | null;
4596
+ };
4538
4597
  url: '/ocxp/context/{content_type}/{content_id}';
4539
4598
  };
4540
4599
  type ReadContentErrors = {
@@ -4564,6 +4623,8 @@ type WriteContentData = {
4564
4623
  path: {
4565
4624
  /**
4566
4625
  * Content Type
4626
+ *
4627
+ * Content type (mission, project, context, code, etc.)
4567
4628
  */
4568
4629
  content_type: string;
4569
4630
  /**
@@ -5234,7 +5295,7 @@ declare const deleteContent: <ThrowOnError extends boolean = false>(options: Opt
5234
5295
  /**
5235
5296
  * Read content
5236
5297
  *
5237
- * Reads content by type and path. Binary files are base64-encoded.
5298
+ * Reads content by type and path. Binary files are base64-encoded. Use versionId param to read a specific version.
5238
5299
  */
5239
5300
  declare const readContent: <ThrowOnError extends boolean = false>(options: Options<ReadContentData, ThrowOnError>) => RequestResult<ReadContentResponses, ReadContentErrors, ThrowOnError, "fields">;
5240
5301
  /**
@@ -5450,8 +5511,9 @@ declare class OCXPClient {
5450
5511
  }>;
5451
5512
  /**
5452
5513
  * Get hierarchical tree structure from S3 context
5514
+ * @param includeVersions - If true, includes S3 version IDs for files
5453
5515
  */
5454
- tree(type: ContentTypeValue, path?: string, depth?: number): Promise<ContentTreeResponse>;
5516
+ tree(type: ContentTypeValue, path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
5455
5517
  /**
5456
5518
  * Get content statistics
5457
5519
  */
@@ -5942,9 +6004,10 @@ declare class MissionNamespace {
5942
6004
  }>;
5943
6005
  /**
5944
6006
  * Get mission content tree structure from S3
5945
- * @example ocxp.mission.tree('subfolder', 5)
6007
+ * @param includeVersions - If true, includes S3 version IDs for files
6008
+ * @example ocxp.mission.tree('mission-id', 5, true)
5946
6009
  */
5947
- tree(path?: string, depth?: number): Promise<ContentTreeResponse>;
6010
+ tree(path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
5948
6011
  }
5949
6012
  /**
5950
6013
  * Project namespace for convenient project operations
@@ -6009,9 +6072,10 @@ declare class ProjectNamespace {
6009
6072
  removeMission(projectId: string, missionId: string): Promise<ProjectResponse>;
6010
6073
  /**
6011
6074
  * Get project content tree structure from S3
6012
- * @example ocxp.project.tree('subfolder', 5)
6075
+ * @param includeVersions - If true, includes S3 version IDs for files
6076
+ * @example ocxp.project.tree('subfolder', 5, true)
6013
6077
  */
6014
- tree(path?: string, depth?: number): Promise<ContentTreeResponse>;
6078
+ tree(path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
6015
6079
  }
6016
6080
  /**
6017
6081
  * Session namespace for convenient session operations
@@ -7071,6 +7135,7 @@ interface TreeNode {
7071
7135
  path: string;
7072
7136
  type: 'file' | 'directory';
7073
7137
  size?: number;
7138
+ version_id?: string;
7074
7139
  children?: TreeNode[];
7075
7140
  }
7076
7141
  /**
package/dist/index.d.ts CHANGED
@@ -635,6 +635,18 @@ type ContentReadResponse = {
635
635
  metadata?: {
636
636
  [key: string]: unknown;
637
637
  } | null;
638
+ /**
639
+ * Version Id
640
+ *
641
+ * S3 version ID
642
+ */
643
+ version_id?: string | null;
644
+ /**
645
+ * Is Latest
646
+ *
647
+ * Whether this is the latest version
648
+ */
649
+ is_latest?: boolean | null;
638
650
  };
639
651
  /**
640
652
  * ContentStatsResponse
@@ -669,6 +681,10 @@ type ContentTreeNode = {
669
681
  * Name
670
682
  */
671
683
  name: string;
684
+ /**
685
+ * Path
686
+ */
687
+ path: string;
672
688
  /**
673
689
  * Type
674
690
  */
@@ -677,6 +693,10 @@ type ContentTreeNode = {
677
693
  * Size
678
694
  */
679
695
  size?: number | null;
696
+ /**
697
+ * Version Id
698
+ */
699
+ version_id?: string | null;
680
700
  /**
681
701
  * Children
682
702
  */
@@ -746,6 +766,12 @@ type ContentWriteResponse = {
746
766
  * Etag
747
767
  */
748
768
  etag?: string | null;
769
+ /**
770
+ * Version Id
771
+ *
772
+ * S3 version ID of the written object
773
+ */
774
+ version_id?: string | null;
749
775
  };
750
776
  /**
751
777
  * CreateMemoRequest
@@ -2510,6 +2536,8 @@ type BulkReadContentData = {
2510
2536
  path: {
2511
2537
  /**
2512
2538
  * Content Type
2539
+ *
2540
+ * Content type (mission, project, context, code, etc.)
2513
2541
  */
2514
2542
  content_type: string;
2515
2543
  };
@@ -2539,6 +2567,8 @@ type BulkWriteContentData = {
2539
2567
  path: {
2540
2568
  /**
2541
2569
  * Content Type
2570
+ *
2571
+ * Content type (mission, project, context, code, etc.)
2542
2572
  */
2543
2573
  content_type: string;
2544
2574
  };
@@ -2568,6 +2598,8 @@ type BulkDeleteContentData = {
2568
2598
  path: {
2569
2599
  /**
2570
2600
  * Content Type
2601
+ *
2602
+ * Content type (mission, project, context, code, etc.)
2571
2603
  */
2572
2604
  content_type: string;
2573
2605
  };
@@ -4268,6 +4300,8 @@ type ListContentData = {
4268
4300
  path: {
4269
4301
  /**
4270
4302
  * Content Type
4303
+ *
4304
+ * Content type (mission, project, context, code, etc.)
4271
4305
  */
4272
4306
  content_type: string;
4273
4307
  };
@@ -4314,6 +4348,8 @@ type QueryContentData = {
4314
4348
  path: {
4315
4349
  /**
4316
4350
  * Content Type
4351
+ *
4352
+ * Content type (mission, project, context, code, etc.)
4317
4353
  */
4318
4354
  content_type: string;
4319
4355
  };
@@ -4347,6 +4383,8 @@ type SearchContentData = {
4347
4383
  path: {
4348
4384
  /**
4349
4385
  * Content Type
4386
+ *
4387
+ * Content type (mission, project, context, code, etc.)
4350
4388
  */
4351
4389
  content_type: string;
4352
4390
  };
@@ -4389,6 +4427,8 @@ type GetContentTreeData = {
4389
4427
  path: {
4390
4428
  /**
4391
4429
  * Content Type
4430
+ *
4431
+ * Content type (mission, project, context, code, etc.)
4392
4432
  */
4393
4433
  content_type: string;
4394
4434
  };
@@ -4405,6 +4445,12 @@ type GetContentTreeData = {
4405
4445
  * Maximum tree depth
4406
4446
  */
4407
4447
  depth?: number;
4448
+ /**
4449
+ * Includeversions
4450
+ *
4451
+ * Include S3 version IDs for files
4452
+ */
4453
+ includeVersions?: boolean;
4408
4454
  };
4409
4455
  url: '/ocxp/context/{content_type}/tree';
4410
4456
  };
@@ -4431,6 +4477,8 @@ type GetContentStatsData = {
4431
4477
  path: {
4432
4478
  /**
4433
4479
  * Content Type
4480
+ *
4481
+ * Content type (mission, project, context, code, etc.)
4434
4482
  */
4435
4483
  content_type: string;
4436
4484
  };
@@ -4467,6 +4515,8 @@ type DeleteContentData = {
4467
4515
  path: {
4468
4516
  /**
4469
4517
  * Content Type
4518
+ *
4519
+ * Content type (mission, project, context, code, etc.)
4470
4520
  */
4471
4521
  content_type: string;
4472
4522
  /**
@@ -4527,6 +4577,8 @@ type ReadContentData = {
4527
4577
  path: {
4528
4578
  /**
4529
4579
  * Content Type
4580
+ *
4581
+ * Content type (mission, project, context, code, etc.)
4530
4582
  */
4531
4583
  content_type: string;
4532
4584
  /**
@@ -4534,7 +4586,14 @@ type ReadContentData = {
4534
4586
  */
4535
4587
  content_id: string;
4536
4588
  };
4537
- query?: never;
4589
+ query?: {
4590
+ /**
4591
+ * Versionid
4592
+ *
4593
+ * S3 version ID to read a specific version
4594
+ */
4595
+ versionId?: string | null;
4596
+ };
4538
4597
  url: '/ocxp/context/{content_type}/{content_id}';
4539
4598
  };
4540
4599
  type ReadContentErrors = {
@@ -4564,6 +4623,8 @@ type WriteContentData = {
4564
4623
  path: {
4565
4624
  /**
4566
4625
  * Content Type
4626
+ *
4627
+ * Content type (mission, project, context, code, etc.)
4567
4628
  */
4568
4629
  content_type: string;
4569
4630
  /**
@@ -5234,7 +5295,7 @@ declare const deleteContent: <ThrowOnError extends boolean = false>(options: Opt
5234
5295
  /**
5235
5296
  * Read content
5236
5297
  *
5237
- * Reads content by type and path. Binary files are base64-encoded.
5298
+ * Reads content by type and path. Binary files are base64-encoded. Use versionId param to read a specific version.
5238
5299
  */
5239
5300
  declare const readContent: <ThrowOnError extends boolean = false>(options: Options<ReadContentData, ThrowOnError>) => RequestResult<ReadContentResponses, ReadContentErrors, ThrowOnError, "fields">;
5240
5301
  /**
@@ -5450,8 +5511,9 @@ declare class OCXPClient {
5450
5511
  }>;
5451
5512
  /**
5452
5513
  * Get hierarchical tree structure from S3 context
5514
+ * @param includeVersions - If true, includes S3 version IDs for files
5453
5515
  */
5454
- tree(type: ContentTypeValue, path?: string, depth?: number): Promise<ContentTreeResponse>;
5516
+ tree(type: ContentTypeValue, path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
5455
5517
  /**
5456
5518
  * Get content statistics
5457
5519
  */
@@ -5942,9 +6004,10 @@ declare class MissionNamespace {
5942
6004
  }>;
5943
6005
  /**
5944
6006
  * Get mission content tree structure from S3
5945
- * @example ocxp.mission.tree('subfolder', 5)
6007
+ * @param includeVersions - If true, includes S3 version IDs for files
6008
+ * @example ocxp.mission.tree('mission-id', 5, true)
5946
6009
  */
5947
- tree(path?: string, depth?: number): Promise<ContentTreeResponse>;
6010
+ tree(path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
5948
6011
  }
5949
6012
  /**
5950
6013
  * Project namespace for convenient project operations
@@ -6009,9 +6072,10 @@ declare class ProjectNamespace {
6009
6072
  removeMission(projectId: string, missionId: string): Promise<ProjectResponse>;
6010
6073
  /**
6011
6074
  * Get project content tree structure from S3
6012
- * @example ocxp.project.tree('subfolder', 5)
6075
+ * @param includeVersions - If true, includes S3 version IDs for files
6076
+ * @example ocxp.project.tree('subfolder', 5, true)
6013
6077
  */
6014
- tree(path?: string, depth?: number): Promise<ContentTreeResponse>;
6078
+ tree(path?: string, depth?: number, includeVersions?: boolean): Promise<ContentTreeResponse>;
6015
6079
  }
6016
6080
  /**
6017
6081
  * Session namespace for convenient session operations
@@ -7071,6 +7135,7 @@ interface TreeNode {
7071
7135
  path: string;
7072
7136
  type: 'file' | 'directory';
7073
7137
  size?: number;
7138
+ version_id?: string;
7074
7139
  children?: TreeNode[];
7075
7140
  }
7076
7141
  /**
package/dist/index.js CHANGED
@@ -1544,13 +1544,14 @@ var OCXPClient = class {
1544
1544
  // ============== Tree & Stats ==============
1545
1545
  /**
1546
1546
  * Get hierarchical tree structure from S3 context
1547
+ * @param includeVersions - If true, includes S3 version IDs for files
1547
1548
  */
1548
- async tree(type, path, depth) {
1549
+ async tree(type, path, depth, includeVersions) {
1549
1550
  const headers = await this.getHeaders();
1550
1551
  const response = await getContentTree({
1551
1552
  client: this.client,
1552
1553
  path: { content_type: type },
1553
- query: { path, depth },
1554
+ query: { path, depth, includeVersions },
1554
1555
  headers
1555
1556
  });
1556
1557
  return extractData(response);
@@ -2497,10 +2498,11 @@ var MissionNamespace = class {
2497
2498
  }
2498
2499
  /**
2499
2500
  * Get mission content tree structure from S3
2500
- * @example ocxp.mission.tree('subfolder', 5)
2501
+ * @param includeVersions - If true, includes S3 version IDs for files
2502
+ * @example ocxp.mission.tree('mission-id', 5, true)
2501
2503
  */
2502
- async tree(path, depth) {
2503
- return this.client.tree("mission", path, depth);
2504
+ async tree(path, depth, includeVersions) {
2505
+ return this.client.tree("mission", path, depth, includeVersions);
2504
2506
  }
2505
2507
  };
2506
2508
  var ProjectNamespace = class {
@@ -2578,10 +2580,11 @@ var ProjectNamespace = class {
2578
2580
  }
2579
2581
  /**
2580
2582
  * Get project content tree structure from S3
2581
- * @example ocxp.project.tree('subfolder', 5)
2583
+ * @param includeVersions - If true, includes S3 version IDs for files
2584
+ * @example ocxp.project.tree('subfolder', 5, true)
2582
2585
  */
2583
- async tree(path, depth) {
2584
- return this.client.tree("project", path, depth);
2586
+ async tree(path, depth, includeVersions) {
2587
+ return this.client.tree("project", path, depth, includeVersions);
2585
2588
  }
2586
2589
  };
2587
2590
  var SessionNamespace = class {
@@ -3410,6 +3413,7 @@ var TreeNodeSchema = z.lazy(
3410
3413
  path: z.string(),
3411
3414
  type: z.enum(["file", "directory"]),
3412
3415
  size: z.number().optional(),
3416
+ version_id: z.string().optional(),
3413
3417
  children: z.array(TreeNodeSchema).optional()
3414
3418
  })
3415
3419
  );