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.js CHANGED
@@ -3782,10 +3782,10 @@ async function runArchiveList(args) {
3782
3782
  continuationKind: "source-locators",
3783
3783
  targetUri: objectUri
3784
3784
  });
3785
- const readPage2 = async (cursor) => await archive.list({
3785
+ const readPage2 = async (cursor) => (await archive.list({
3786
3786
  ...cursor === void 0 ? {} : { cursor },
3787
3787
  ...args.limit === void 0 ? {} : { limit: args.limit }
3788
- });
3788
+ })).result;
3789
3789
  if (args.all === true) {
3790
3790
  await writeAllSourceLocators(
3791
3791
  readPage2,
@@ -3814,11 +3814,11 @@ async function runArchiveList(args) {
3814
3814
  const context = createArchiveOutputContext(scopedArgs, {
3815
3815
  continuationKind: "collection"
3816
3816
  });
3817
- const readPage = async (cursor, limit = args.limit) => await archive.list({
3817
+ const readPage = async (cursor, limit = args.limit) => (await archive.list({
3818
3818
  ...createCollectionOptions(scopedArgs),
3819
3819
  ...cursor === void 0 ? {} : { cursor },
3820
3820
  ...limit === void 0 ? {} : { limit }
3821
- });
3821
+ })).result;
3822
3822
  if (args.all === true) {
3823
3823
  if (args.limit !== void 0) {
3824
3824
  await writeAllFindHits(
@@ -3854,11 +3854,11 @@ async function runArchiveSearch(args) {
3854
3854
  const context = createArchiveOutputContext(scopedArgs);
3855
3855
  const findOptions = createSearchFindOptions(scopedArgs);
3856
3856
  const { archiveKey: _archiveKey, chapters, ...options } = findOptions;
3857
- const readPage = async (cursor) => await archive.search(scopedArgs.query, {
3857
+ const readPage = async (cursor) => (await archive.search(scopedArgs.query, {
3858
3858
  ...options,
3859
3859
  ...chapters === void 0 ? {} : { chapters },
3860
3860
  ...cursor === void 0 ? {} : { cursor }
3861
- });
3861
+ })).result;
3862
3862
  try {
3863
3863
  if (args.all === true) {
3864
3864
  await writeAllFindHits(readPage, context, args.format ?? "text");
@@ -3907,7 +3907,7 @@ async function runArchiveRelated(args) {
3907
3907
  targetUri: objectUri
3908
3908
  }
3909
3909
  );
3910
- const readPage = async (cursor) => await archive.related(objectUri, {
3910
+ const readPage = async (cursor) => (await archive.related(objectUri, {
3911
3911
  ...cursor === void 0 ? {} : { cursor },
3912
3912
  ...createOptionalEvidenceLimit(args),
3913
3913
  ...args.limit === void 0 ? {} : { limit: args.limit },
@@ -3917,7 +3917,7 @@ async function runArchiveRelated(args) {
3917
3917
  ...args.role === void 0 ? {} : { role: args.role },
3918
3918
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
3919
3919
  ...createOptionalSourceContext(args)
3920
- });
3920
+ })).result;
3921
3921
  if (args.all === true) {
3922
3922
  await writeAllRelatedItems(
3923
3923
  readPage,
@@ -3942,7 +3942,7 @@ async function runArchiveEvidence(args) {
3942
3942
  targetUri: objectUri
3943
3943
  }
3944
3944
  );
3945
- const readPage = async (cursor) => await archive.evidence(objectUri, {
3945
+ const readPage = async (cursor) => (await archive.evidence(objectUri, {
3946
3946
  ...cursor === void 0 ? {} : { cursor },
3947
3947
  ...args.limit === void 0 ? {} : { limit: args.limit },
3948
3948
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -3950,7 +3950,7 @@ async function runArchiveEvidence(args) {
3950
3950
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
3951
3951
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
3952
3952
  ...createOptionalSourceContext(args)
3953
- });
3953
+ })).result;
3954
3954
  if (args.all === true) {
3955
3955
  await writeAllEvidence(
3956
3956
  readPage,
@@ -4012,13 +4012,13 @@ async function runLibraryIndexArchiveCommand(args, target) {
4012
4012
  case "search": {
4013
4013
  const findOptions = createSearchFindOptions(args);
4014
4014
  if (objectUri === void 0) {
4015
- const search = async (cursor) => await (isArchiveMemberCollection ? libraries.searchArchiveMembers(target, args.query, {
4015
+ const search = async (cursor) => (await (isArchiveMemberCollection ? libraries.searchArchiveMembers(target, args.query, {
4016
4016
  ...findOptions,
4017
4017
  ...cursor === void 0 ? {} : { cursor }
4018
4018
  }) : libraries.search(target, args.query, {
4019
4019
  ...findOptions,
4020
4020
  ...cursor === void 0 ? {} : { cursor }
4021
- }));
4021
+ }))).result;
4022
4022
  if (args.all === true) {
4023
4023
  await writeAllFindHits(search, context, args.format ?? "text");
4024
4024
  return;
@@ -4032,17 +4032,17 @@ async function runLibraryIndexArchiveCommand(args, target) {
4032
4032
  }
4033
4033
  if (args.all === true) {
4034
4034
  await writeAllFindHits(
4035
- async (cursor) => await libraries.search(target, args.query, {
4035
+ async (cursor) => (await libraries.search(target, args.query, {
4036
4036
  ...findOptions,
4037
4037
  ...cursor === void 0 ? {} : { cursor }
4038
- }),
4038
+ })).result,
4039
4039
  context,
4040
4040
  args.format ?? "text"
4041
4041
  );
4042
4042
  return;
4043
4043
  }
4044
4044
  await writeFindHits(
4045
- await libraries.search(target, args.query, findOptions),
4045
+ (await libraries.search(target, args.query, findOptions)).result,
4046
4046
  context,
4047
4047
  args.format ?? "text"
4048
4048
  );
@@ -4058,10 +4058,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4058
4058
  if (args.limit !== void 0) {
4059
4059
  await writeAllFindHits(
4060
4060
  async (cursor) => createCollectionFindResult(
4061
- await libraries.objects(target, {
4061
+ (await libraries.objects(target, {
4062
4062
  ...createCollectionOptions(args),
4063
4063
  ...cursor === void 0 ? {} : { cursor }
4064
- })
4064
+ })).result
4065
4065
  ),
4066
4066
  listContext,
4067
4067
  args.format ?? "text"
@@ -4070,10 +4070,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4070
4070
  }
4071
4071
  await writeFindHitsWithoutContinuation(
4072
4072
  createCollectionFindResult(
4073
- await libraries.objects(target, {
4073
+ (await libraries.objects(target, {
4074
4074
  ...createCollectionOptions(args),
4075
4075
  limit: ALL_COLLECTION_OUTPUT_LIMIT
4076
- })
4076
+ })).result
4077
4077
  ),
4078
4078
  listContext,
4079
4079
  args.format ?? "text"
@@ -4082,7 +4082,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4082
4082
  }
4083
4083
  await writeFindHits(
4084
4084
  createCollectionFindResult(
4085
- await libraries.objects(target, createCollectionOptions(args))
4085
+ (await libraries.objects(target, createCollectionOptions(args))).result
4086
4086
  ),
4087
4087
  listContext,
4088
4088
  args.format ?? "text"
@@ -4093,10 +4093,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4093
4093
  if (args.limit !== void 0) {
4094
4094
  await writeAllFindHits(
4095
4095
  async (cursor) => createCollectionFindResult(
4096
- await libraries.objects(target, {
4096
+ (await libraries.objects(target, {
4097
4097
  ...createCollectionOptions(args),
4098
4098
  ...cursor === void 0 ? {} : { cursor }
4099
- })
4099
+ })).result
4100
4100
  ),
4101
4101
  listContext,
4102
4102
  args.format ?? "text"
@@ -4105,10 +4105,10 @@ async function runLibraryIndexArchiveCommand(args, target) {
4105
4105
  }
4106
4106
  await writeFindHitsWithoutContinuation(
4107
4107
  createCollectionFindResult(
4108
- await libraries.objects(target, {
4108
+ (await libraries.objects(target, {
4109
4109
  ...createCollectionOptions(args),
4110
4110
  limit: ALL_COLLECTION_OUTPUT_LIMIT
4111
- })
4111
+ })).result
4112
4112
  ),
4113
4113
  listContext,
4114
4114
  args.format ?? "text"
@@ -4117,7 +4117,9 @@ async function runLibraryIndexArchiveCommand(args, target) {
4117
4117
  }
4118
4118
  await writeFindHits(
4119
4119
  createCollectionFindResult(
4120
- await libraries.objects(target, createCollectionOptions(args))
4120
+ unwrapPageResult(
4121
+ await libraries.objects(target, createCollectionOptions(args))
4122
+ )
4121
4123
  ),
4122
4124
  listContext,
4123
4125
  args.format ?? "text"
@@ -4132,7 +4134,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4132
4134
  };
4133
4135
  await writeFindHits(
4134
4136
  createCollectionFindResult(
4135
- await libraries.objects(target, createCollectionOptions(args))
4137
+ (await libraries.objects(target, createCollectionOptions(args))).result
4136
4138
  ),
4137
4139
  getContext,
4138
4140
  args.format ?? "text"
@@ -4159,7 +4161,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4159
4161
  continuationKind: "related",
4160
4162
  targetUri: concreteObjectUri
4161
4163
  };
4162
- const readPage = async (cursor) => await libraries.related(target, concreteObjectUri, {
4164
+ const readPage = async (cursor) => (await libraries.related(target, concreteObjectUri, {
4163
4165
  ...cursor === void 0 ? {} : { cursor },
4164
4166
  ...createOptionalEvidenceLimit(args),
4165
4167
  ...args.limit === void 0 ? {} : { limit: args.limit },
@@ -4169,7 +4171,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4169
4171
  ...args.role === void 0 ? {} : { role: args.role },
4170
4172
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4171
4173
  ...createOptionalSourceContext(args)
4172
- });
4174
+ })).result;
4173
4175
  if (args.all === true) {
4174
4176
  await writeAllRelatedItems(
4175
4177
  readPage,
@@ -4195,7 +4197,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4195
4197
  };
4196
4198
  if (args.all === true) {
4197
4199
  await writeAllEvidence(
4198
- async (cursor) => await libraries.evidence(target, concreteObjectUri, {
4200
+ async (cursor) => (await libraries.evidence(target, concreteObjectUri, {
4199
4201
  ...cursor === void 0 ? {} : { cursor },
4200
4202
  ...args.limit === void 0 ? {} : { limit: args.limit },
4201
4203
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -4203,7 +4205,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4203
4205
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
4204
4206
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4205
4207
  ...createOptionalSourceContext(args)
4206
- }),
4208
+ })).result,
4207
4209
  args.cursor,
4208
4210
  evidenceContext,
4209
4211
  args.format ?? "text"
@@ -4211,7 +4213,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4211
4213
  return;
4212
4214
  }
4213
4215
  await writeEvidence(
4214
- await libraries.evidence(target, concreteObjectUri, {
4216
+ (await libraries.evidence(target, concreteObjectUri, {
4215
4217
  ...args.cursor === void 0 ? {} : { cursor: args.cursor },
4216
4218
  ...args.limit === void 0 ? {} : { limit: args.limit },
4217
4219
  ...args.reverse === true ? { order: "doc-desc" } : {},
@@ -4219,7 +4221,7 @@ async function runLibraryIndexArchiveCommand(args, target) {
4219
4221
  ...args.queryMode === void 0 ? {} : { queryMode: args.queryMode },
4220
4222
  ...args.skipUnindexed === true ? { skipUnindexed: true } : {},
4221
4223
  ...createOptionalSourceContext(args)
4222
- }),
4224
+ })).result,
4223
4225
  evidenceContext,
4224
4226
  args.format ?? "text"
4225
4227
  );
@@ -4243,6 +4245,9 @@ async function runLibraryIndexArchiveCommand(args, target) {
4243
4245
  );
4244
4246
  }
4245
4247
  }
4248
+ function unwrapPageResult(value) {
4249
+ return "result" in value ? value.result : value;
4250
+ }
4246
4251
  function createSearchFindOptions(args) {
4247
4252
  return createFindOptions(args);
4248
4253
  }
@@ -6439,7 +6444,7 @@ async function writeLibraryScopeCollection(target, json) {
6439
6444
  types: null
6440
6445
  };
6441
6446
  await writeFindHits(
6442
- createCollectionFindResult(await manager.objects(target)),
6447
+ createCollectionFindResult((await manager.objects(target)).result),
6443
6448
  context,
6444
6449
  json ? "json" : "text"
6445
6450
  );