wiki-graph 0.8.3 → 0.8.4

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.cjs CHANGED
@@ -3762,10 +3762,10 @@ async function runArchiveList(args) {
3762
3762
  continuationKind: "source-locators",
3763
3763
  targetUri: objectUri
3764
3764
  });
3765
- const readPage2 = async (cursor) => await archive.list({
3765
+ const readPage2 = async (cursor) => (await archive.list({
3766
3766
  ...cursor === void 0 ? {} : { cursor },
3767
3767
  ...args.limit === void 0 ? {} : { limit: args.limit }
3768
- });
3768
+ })).result;
3769
3769
  if (args.all === true) {
3770
3770
  await writeAllSourceLocators(
3771
3771
  readPage2,
@@ -3794,11 +3794,11 @@ async function runArchiveList(args) {
3794
3794
  const context = createArchiveOutputContext(scopedArgs, {
3795
3795
  continuationKind: "collection"
3796
3796
  });
3797
- const readPage = async (cursor, limit = args.limit) => await archive.list({
3797
+ const readPage = async (cursor, limit = args.limit) => (await archive.list({
3798
3798
  ...createCollectionOptions(scopedArgs),
3799
3799
  ...cursor === void 0 ? {} : { cursor },
3800
3800
  ...limit === void 0 ? {} : { limit }
3801
- });
3801
+ })).result;
3802
3802
  if (args.all === true) {
3803
3803
  if (args.limit !== void 0) {
3804
3804
  await writeAllFindHits(
@@ -3834,11 +3834,11 @@ async function runArchiveSearch(args) {
3834
3834
  const context = createArchiveOutputContext(scopedArgs);
3835
3835
  const findOptions = createSearchFindOptions(scopedArgs);
3836
3836
  const { archiveKey: _archiveKey, chapters, ...options } = findOptions;
3837
- const readPage = async (cursor) => await archive.search(scopedArgs.query, {
3837
+ const readPage = async (cursor) => (await archive.search(scopedArgs.query, {
3838
3838
  ...options,
3839
3839
  ...chapters === void 0 ? {} : { chapters },
3840
3840
  ...cursor === void 0 ? {} : { cursor }
3841
- });
3841
+ })).result;
3842
3842
  try {
3843
3843
  if (args.all === true) {
3844
3844
  await writeAllFindHits(readPage, context, args.format ?? "text");
@@ -3887,7 +3887,7 @@ async function runArchiveRelated(args) {
3887
3887
  targetUri: objectUri
3888
3888
  }
3889
3889
  );
3890
- const readPage = async (cursor) => await archive.related(objectUri, {
3890
+ const readPage = async (cursor) => (await archive.related(objectUri, {
3891
3891
  ...cursor === void 0 ? {} : { cursor },
3892
3892
  ...createOptionalEvidenceLimit(args),
3893
3893
  ...args.limit === void 0 ? {} : { limit: args.limit },
@@ -3897,7 +3897,7 @@ async function runArchiveRelated(args) {
3897
3897
  ...args.role === void 0 ? {} : { role: args.role },
3898
3898
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
3899
3899
  ...createOptionalSourceContext(args)
3900
- });
3900
+ })).result;
3901
3901
  if (args.all === true) {
3902
3902
  await writeAllRelatedItems(
3903
3903
  readPage,
@@ -3922,7 +3922,7 @@ async function runArchiveEvidence(args) {
3922
3922
  targetUri: objectUri
3923
3923
  }
3924
3924
  );
3925
- const readPage = async (cursor) => await archive.evidence(objectUri, {
3925
+ const readPage = async (cursor) => (await archive.evidence(objectUri, {
3926
3926
  ...cursor === void 0 ? {} : { cursor },
3927
3927
  ...args.limit === void 0 ? {} : { limit: args.limit },
3928
3928
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -3930,7 +3930,7 @@ async function runArchiveEvidence(args) {
3930
3930
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
3931
3931
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
3932
3932
  ...createOptionalSourceContext(args)
3933
- });
3933
+ })).result;
3934
3934
  if (args.all === true) {
3935
3935
  await writeAllEvidence(
3936
3936
  readPage,
@@ -3992,13 +3992,13 @@ async function runLibraryIndexArchiveCommand(args, target) {
3992
3992
  case "search": {
3993
3993
  const findOptions = createSearchFindOptions(args);
3994
3994
  if (objectUri === void 0) {
3995
- const search = async (cursor) => await (isArchiveMemberCollection ? libraries.searchArchiveMembers(target, args.query, {
3995
+ const search = async (cursor) => (await (isArchiveMemberCollection ? libraries.searchArchiveMembers(target, args.query, {
3996
3996
  ...findOptions,
3997
3997
  ...cursor === void 0 ? {} : { cursor }
3998
3998
  }) : libraries.search(target, args.query, {
3999
3999
  ...findOptions,
4000
4000
  ...cursor === void 0 ? {} : { cursor }
4001
- }));
4001
+ }))).result;
4002
4002
  if (args.all === true) {
4003
4003
  await writeAllFindHits(search, context, args.format ?? "text");
4004
4004
  return;
@@ -4012,17 +4012,17 @@ async function runLibraryIndexArchiveCommand(args, target) {
4012
4012
  }
4013
4013
  if (args.all === true) {
4014
4014
  await writeAllFindHits(
4015
- async (cursor) => await libraries.search(target, args.query, {
4015
+ async (cursor) => (await libraries.search(target, args.query, {
4016
4016
  ...findOptions,
4017
4017
  ...cursor === void 0 ? {} : { cursor }
4018
- }),
4018
+ })).result,
4019
4019
  context,
4020
4020
  args.format ?? "text"
4021
4021
  );
4022
4022
  return;
4023
4023
  }
4024
4024
  await writeFindHits(
4025
- await libraries.search(target, args.query, findOptions),
4025
+ (await libraries.search(target, args.query, findOptions)).result,
4026
4026
  context,
4027
4027
  args.format ?? "text"
4028
4028
  );
@@ -4038,10 +4038,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4038
4038
  if (args.limit !== void 0) {
4039
4039
  await writeAllFindHits(
4040
4040
  async (cursor) => createCollectionFindResult(
4041
- await libraries.objects(target, {
4041
+ (await libraries.objects(target, {
4042
4042
  ...createCollectionOptions(args),
4043
4043
  ...cursor === void 0 ? {} : { cursor }
4044
- })
4044
+ })).result
4045
4045
  ),
4046
4046
  listContext,
4047
4047
  args.format ?? "text"
@@ -4050,10 +4050,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4050
4050
  }
4051
4051
  await writeFindHitsWithoutContinuation(
4052
4052
  createCollectionFindResult(
4053
- await libraries.objects(target, {
4053
+ (await libraries.objects(target, {
4054
4054
  ...createCollectionOptions(args),
4055
4055
  limit: ALL_COLLECTION_OUTPUT_LIMIT
4056
- })
4056
+ })).result
4057
4057
  ),
4058
4058
  listContext,
4059
4059
  args.format ?? "text"
@@ -4062,7 +4062,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4062
4062
  }
4063
4063
  await writeFindHits(
4064
4064
  createCollectionFindResult(
4065
- await libraries.objects(target, createCollectionOptions(args))
4065
+ (await libraries.objects(target, createCollectionOptions(args))).result
4066
4066
  ),
4067
4067
  listContext,
4068
4068
  args.format ?? "text"
@@ -4073,10 +4073,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4073
4073
  if (args.limit !== void 0) {
4074
4074
  await writeAllFindHits(
4075
4075
  async (cursor) => createCollectionFindResult(
4076
- await libraries.objects(target, {
4076
+ (await libraries.objects(target, {
4077
4077
  ...createCollectionOptions(args),
4078
4078
  ...cursor === void 0 ? {} : { cursor }
4079
- })
4079
+ })).result
4080
4080
  ),
4081
4081
  listContext,
4082
4082
  args.format ?? "text"
@@ -4085,10 +4085,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4085
4085
  }
4086
4086
  await writeFindHitsWithoutContinuation(
4087
4087
  createCollectionFindResult(
4088
- await libraries.objects(target, {
4088
+ (await libraries.objects(target, {
4089
4089
  ...createCollectionOptions(args),
4090
4090
  limit: ALL_COLLECTION_OUTPUT_LIMIT
4091
- })
4091
+ })).result
4092
4092
  ),
4093
4093
  listContext,
4094
4094
  args.format ?? "text"
@@ -4097,7 +4097,9 @@ async function runLibraryIndexArchiveCommand(args, target) {
4097
4097
  }
4098
4098
  await writeFindHits(
4099
4099
  createCollectionFindResult(
4100
- await libraries.objects(target, createCollectionOptions(args))
4100
+ unwrapPageResult(
4101
+ await libraries.objects(target, createCollectionOptions(args))
4102
+ )
4101
4103
  ),
4102
4104
  listContext,
4103
4105
  args.format ?? "text"
@@ -4112,7 +4114,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4112
4114
  };
4113
4115
  await writeFindHits(
4114
4116
  createCollectionFindResult(
4115
- await libraries.objects(target, createCollectionOptions(args))
4117
+ (await libraries.objects(target, createCollectionOptions(args))).result
4116
4118
  ),
4117
4119
  getContext,
4118
4120
  args.format ?? "text"
@@ -4139,7 +4141,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4139
4141
  continuationKind: "related",
4140
4142
  targetUri: concreteObjectUri
4141
4143
  };
4142
- const readPage = async (cursor) => await libraries.related(target, concreteObjectUri, {
4144
+ const readPage = async (cursor) => (await libraries.related(target, concreteObjectUri, {
4143
4145
  ...cursor === void 0 ? {} : { cursor },
4144
4146
  ...createOptionalEvidenceLimit(args),
4145
4147
  ...args.limit === void 0 ? {} : { limit: args.limit },
@@ -4149,7 +4151,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4149
4151
  ...args.role === void 0 ? {} : { role: args.role },
4150
4152
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4151
4153
  ...createOptionalSourceContext(args)
4152
- });
4154
+ })).result;
4153
4155
  if (args.all === true) {
4154
4156
  await writeAllRelatedItems(
4155
4157
  readPage,
@@ -4175,7 +4177,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4175
4177
  };
4176
4178
  if (args.all === true) {
4177
4179
  await writeAllEvidence(
4178
- async (cursor) => await libraries.evidence(target, concreteObjectUri, {
4180
+ async (cursor) => (await libraries.evidence(target, concreteObjectUri, {
4179
4181
  ...cursor === void 0 ? {} : { cursor },
4180
4182
  ...args.limit === void 0 ? {} : { limit: args.limit },
4181
4183
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -4183,7 +4185,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4183
4185
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
4184
4186
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4185
4187
  ...createOptionalSourceContext(args)
4186
- }),
4188
+ })).result,
4187
4189
  args.cursor,
4188
4190
  evidenceContext,
4189
4191
  args.format ?? "text"
@@ -4191,7 +4193,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4191
4193
  return;
4192
4194
  }
4193
4195
  await writeEvidence(
4194
- await libraries.evidence(target, concreteObjectUri, {
4196
+ (await libraries.evidence(target, concreteObjectUri, {
4195
4197
  ...args.cursor === void 0 ? {} : { cursor: args.cursor },
4196
4198
  ...args.limit === void 0 ? {} : { limit: args.limit },
4197
4199
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -4199,7 +4201,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4199
4201
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
4200
4202
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4201
4203
  ...createOptionalSourceContext(args)
4202
- }),
4204
+ })).result,
4203
4205
  evidenceContext,
4204
4206
  args.format ?? "text"
4205
4207
  );
@@ -4223,6 +4225,9 @@ async function runLibraryIndexArchiveCommand(args, target) {
4223
4225
  );
4224
4226
  }
4225
4227
  }
4228
+ function unwrapPageResult(value) {
4229
+ return "result" in value ? value.result : value;
4230
+ }
4226
4231
  function createSearchFindOptions(args) {
4227
4232
  return createFindOptions(args);
4228
4233
  }
@@ -6415,7 +6420,7 @@ async function writeLibraryScopeCollection(target, json) {
6415
6420
  types: null
6416
6421
  };
6417
6422
  await writeFindHits(
6418
- createCollectionFindResult(await manager.objects(target)),
6423
+ createCollectionFindResult((await manager.objects(target)).result),
6419
6424
  context,
6420
6425
  json ? "json" : "text"
6421
6426
  );