@warmhub/sdk-ts 0.82.3 → 0.84.0
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/{chunk-PMLASUR6.js → chunk-CLDVXOJD.js} +478 -165
- package/dist/chunk-CLDVXOJD.js.map +1 -0
- package/dist/index.d.ts +339 -62
- package/dist/index.js +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-PMLASUR6.js.map +0 -1
|
@@ -56,6 +56,12 @@ var DEFAULT_STREAM_APPEND_CHUNK_SIZE = 1e3;
|
|
|
56
56
|
var MAX_STREAM_APPEND_OPERATION_COUNT = 1e4;
|
|
57
57
|
|
|
58
58
|
// ../rules/src/commit-types.ts
|
|
59
|
+
var COMMIT_OPERATION_KINDS = [
|
|
60
|
+
"shape",
|
|
61
|
+
"thing",
|
|
62
|
+
"assertion",
|
|
63
|
+
"collection"
|
|
64
|
+
];
|
|
59
65
|
function splitLocalPath(name) {
|
|
60
66
|
const idx = name.indexOf("/");
|
|
61
67
|
if (idx === -1) return null;
|
|
@@ -184,26 +190,6 @@ function constantTimeEqualHex(a, b) {
|
|
|
184
190
|
return diff === 0;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
// ../rules/src/repo-auth-scopes.ts
|
|
188
|
-
var REPO_AUTH_SCOPES = [
|
|
189
|
-
"repo:read",
|
|
190
|
-
"repo:write",
|
|
191
|
-
"repo:configure",
|
|
192
|
-
"repo:admin",
|
|
193
|
-
// GH-4679: the repo-scoped twin of `org:action-callback`. A narrow capability
|
|
194
|
-
// for acknowledging a repo-scoped action run's delivery (the async webhook
|
|
195
|
-
// callback). Deliberately NOT implied by `repo:write` — a webhook handler
|
|
196
|
-
// (e.g. a component) can be granted exactly this without standing authority to
|
|
197
|
-
// write things/shapes. The callback gate currently ALSO accepts `repo:write`
|
|
198
|
-
// so existing consumers (the Veritas worker) keep acking; that broad
|
|
199
|
-
// acceptance is dropped once consumers move to this scope. Held by
|
|
200
|
-
// owner/admin roles; grantable to a token (or component manifest) on its own.
|
|
201
|
-
"repo:action-callback"
|
|
202
|
-
];
|
|
203
|
-
|
|
204
|
-
// ../rules/src/component-manifest-contract-internals.ts
|
|
205
|
-
new Set(REPO_AUTH_SCOPES);
|
|
206
|
-
|
|
207
193
|
// ../rules/src/field-name-safety.ts
|
|
208
194
|
var ESCAPE_DISPLAY_MAX_CHARS = 120;
|
|
209
195
|
var DANGEROUS_FORMAT_CODEPOINTS = /* @__PURE__ */ new Set([
|
|
@@ -6755,13 +6741,6 @@ function isFieldOptional(fieldKey, typeSpec) {
|
|
|
6755
6741
|
return optionalByKey || normalizeOptionalTypeSpec(typeSpec).optionalByType;
|
|
6756
6742
|
}
|
|
6757
6743
|
|
|
6758
|
-
// ../rules/src/name-charset.ts
|
|
6759
|
-
var RESERVED_NAME_SEGMENT_CHARS = ["?", "#", "@", ":", "$"];
|
|
6760
|
-
function escapeForCharClass(char) {
|
|
6761
|
-
return char.replace(/[\\\]^-]/g, "\\$&");
|
|
6762
|
-
}
|
|
6763
|
-
RESERVED_NAME_SEGMENT_CHARS.map(escapeForCharClass).join("");
|
|
6764
|
-
|
|
6765
6744
|
// ../rules/src/tokens.ts
|
|
6766
6745
|
var COMMIT_TOKEN_SYNTAX_REMOVED_MESSAGE = "$N/#N commit-token syntax is no longer supported. Use explicit names and explicit wrefs. For assertions about newly created things, create the thing with a deterministic name and set about to that wref in the same commit.";
|
|
6767
6746
|
var ANY_TOKEN_RE = /[$#]\d+/;
|
|
@@ -7053,39 +7032,6 @@ function preflightCommitDiagnostics2(operations, options) {
|
|
|
7053
7032
|
return preflightCommitDiagnostics(operations, options);
|
|
7054
7033
|
}
|
|
7055
7034
|
|
|
7056
|
-
// ../rules/src/reserved-orgs.ts
|
|
7057
|
-
var RESERVED_RAW_CONTENT_TOP_LEVEL_NAMES = [
|
|
7058
|
-
"_app",
|
|
7059
|
-
"_static",
|
|
7060
|
-
"api",
|
|
7061
|
-
"health",
|
|
7062
|
-
"healthz",
|
|
7063
|
-
"mcp",
|
|
7064
|
-
"readyz",
|
|
7065
|
-
"robots.txt",
|
|
7066
|
-
"sse",
|
|
7067
|
-
"trpc",
|
|
7068
|
-
"version"
|
|
7069
|
-
];
|
|
7070
|
-
var RESERVED_ORG_NAMES = [
|
|
7071
|
-
...RESERVED_RAW_CONTENT_TOP_LEVEL_NAMES,
|
|
7072
|
-
"admin",
|
|
7073
|
-
"billing",
|
|
7074
|
-
"blog",
|
|
7075
|
-
"docs",
|
|
7076
|
-
"help",
|
|
7077
|
-
"login",
|
|
7078
|
-
"public",
|
|
7079
|
-
"settings",
|
|
7080
|
-
"signup",
|
|
7081
|
-
"status",
|
|
7082
|
-
"support",
|
|
7083
|
-
"system",
|
|
7084
|
-
"warmhub",
|
|
7085
|
-
"www"
|
|
7086
|
-
];
|
|
7087
|
-
new Set(RESERVED_ORG_NAMES);
|
|
7088
|
-
|
|
7089
7035
|
// ../rules/src/shape-field-key.ts
|
|
7090
7036
|
function foldFieldName(name) {
|
|
7091
7037
|
const stripped = name.endsWith("?") ? name.slice(0, -1) : name;
|
|
@@ -7843,67 +7789,6 @@ function validateShapeDefinition(data, options = {}) {
|
|
|
7843
7789
|
return { valid: true };
|
|
7844
7790
|
}
|
|
7845
7791
|
|
|
7846
|
-
// ../rules/src/system-components/system.ts
|
|
7847
|
-
var SYSTEM_COMPONENT_ID = "com.warmhub.system";
|
|
7848
|
-
var COMPONENT_INSTALL_FIELDS = {
|
|
7849
|
-
componentId: "string",
|
|
7850
|
-
name: "string",
|
|
7851
|
-
version: "string",
|
|
7852
|
-
source: "string",
|
|
7853
|
-
"sourceKind?": "string",
|
|
7854
|
-
"sourceRef?": "string",
|
|
7855
|
-
"resolvedSha?": "string",
|
|
7856
|
-
"registeredComponentRef?": "string",
|
|
7857
|
-
manifestHash: "string",
|
|
7858
|
-
state: "string",
|
|
7859
|
-
manifest: "string",
|
|
7860
|
-
installedAt: "string",
|
|
7861
|
-
installedByUserId: "string?",
|
|
7862
|
-
"installId?": "string",
|
|
7863
|
-
"updatedAt?": "string"
|
|
7864
|
-
};
|
|
7865
|
-
var COMPONENT_CONFIG_FIELDS = {};
|
|
7866
|
-
var SYSTEM_MANIFEST = {
|
|
7867
|
-
component: {
|
|
7868
|
-
id: SYSTEM_COMPONENT_ID,
|
|
7869
|
-
name: "system",
|
|
7870
|
-
version: "1.0.0"
|
|
7871
|
-
},
|
|
7872
|
-
shapes: [
|
|
7873
|
-
{ name: "ComponentInstall", fields: COMPONENT_INSTALL_FIELDS },
|
|
7874
|
-
{ name: "ComponentConfig", fields: COMPONENT_CONFIG_FIELDS }
|
|
7875
|
-
],
|
|
7876
|
-
credentials: [],
|
|
7877
|
-
subscriptions: [],
|
|
7878
|
-
seeds: [],
|
|
7879
|
-
health: {
|
|
7880
|
-
requires: { shapes: ["ComponentInstall", "ComponentConfig"] }
|
|
7881
|
-
},
|
|
7882
|
-
teardown: {},
|
|
7883
|
-
runtimeAccess: { reads: [], writes: [] }
|
|
7884
|
-
};
|
|
7885
|
-
var SYSTEM_COMPONENT = {
|
|
7886
|
-
componentId: SYSTEM_COMPONENT_ID,
|
|
7887
|
-
name: SYSTEM_MANIFEST.component.name,
|
|
7888
|
-
version: SYSTEM_MANIFEST.component.version,
|
|
7889
|
-
manifest: SYSTEM_MANIFEST,
|
|
7890
|
-
installInfra: true,
|
|
7891
|
-
shapes: [
|
|
7892
|
-
{ name: "ComponentInstall", fields: COMPONENT_INSTALL_FIELDS },
|
|
7893
|
-
{ name: "ComponentConfig", fields: COMPONENT_CONFIG_FIELDS }
|
|
7894
|
-
]
|
|
7895
|
-
};
|
|
7896
|
-
|
|
7897
|
-
// ../rules/src/system-components/index.ts
|
|
7898
|
-
var SYSTEM_COMPONENTS = [
|
|
7899
|
-
SYSTEM_COMPONENT
|
|
7900
|
-
];
|
|
7901
|
-
new Set(
|
|
7902
|
-
SYSTEM_COMPONENTS.filter((entry) => entry.installInfra === true).flatMap(
|
|
7903
|
-
(entry) => entry.shapes.map((s) => s.name)
|
|
7904
|
-
)
|
|
7905
|
-
);
|
|
7906
|
-
|
|
7907
7792
|
// src/shape-preflight.ts
|
|
7908
7793
|
function shapeDefinitionPreflightError(name, data, verb) {
|
|
7909
7794
|
const result = validateShapeDefinition(
|
|
@@ -8018,9 +7903,9 @@ function normalizeOptionalName(value) {
|
|
|
8018
7903
|
|
|
8019
7904
|
// src/operation-normalize.ts
|
|
8020
7905
|
function toBackendStreamOperation(operation) {
|
|
8021
|
-
if (operation.expectedVersion !== void 0 && operation.operation !== "revise") {
|
|
7906
|
+
if (operation.expectedVersion !== void 0 && operation.operation !== "revise" && operation.operation !== "retract") {
|
|
8022
7907
|
throw new Error(
|
|
8023
|
-
"expectedVersion is only valid on revise operations \u2014 set operation
|
|
7908
|
+
"expectedVersion is only valid on revise or retract operations \u2014 set an explicit operation discriminator"
|
|
8024
7909
|
);
|
|
8025
7910
|
}
|
|
8026
7911
|
if (operation.operation === "retract") {
|
|
@@ -8029,6 +7914,7 @@ function toBackendStreamOperation(operation) {
|
|
|
8029
7914
|
name: operation.name,
|
|
8030
7915
|
...operation.kind ? { kind: operation.kind } : {},
|
|
8031
7916
|
...operation.reason ? { reason: operation.reason } : {},
|
|
7917
|
+
...operation.expectedVersion !== void 0 ? { expectedVersion: operation.expectedVersion } : {},
|
|
8032
7918
|
...operation.leaseId ? { leaseId: operation.leaseId } : {}
|
|
8033
7919
|
};
|
|
8034
7920
|
}
|
|
@@ -8133,8 +8019,8 @@ var PartialStreamSubmissionError = class extends Error {
|
|
|
8133
8019
|
code = "PARTIAL_STREAM_SUBMISSION";
|
|
8134
8020
|
/**
|
|
8135
8021
|
* Operations the SDK confirmed completed before the ambiguous or failing
|
|
8136
|
-
* append. The
|
|
8137
|
-
*
|
|
8022
|
+
* append. The attempted append may or may not have landed; do not blindly
|
|
8023
|
+
* replay it.
|
|
8138
8024
|
*/
|
|
8139
8025
|
completedOperations;
|
|
8140
8026
|
/**
|
|
@@ -8143,19 +8029,36 @@ var PartialStreamSubmissionError = class extends Error {
|
|
|
8143
8029
|
* returns sparse or empty result rows.
|
|
8144
8030
|
*/
|
|
8145
8031
|
acknowledgedOperationCount;
|
|
8032
|
+
/**
|
|
8033
|
+
* Last repository sequence returned by an acknowledged chunk that persisted
|
|
8034
|
+
* an event. This is a lower bound for known completed work, never evidence
|
|
8035
|
+
* that the attempted append did not land.
|
|
8036
|
+
*/
|
|
8037
|
+
lastAcknowledgedRepoSeq;
|
|
8038
|
+
/**
|
|
8039
|
+
* Authoritative outcome of the attempted append. `not_applied` is used only
|
|
8040
|
+
* when the SDK received explicit server rejection evidence; `unknown` means
|
|
8041
|
+
* callers must stop writes and reconcile from a later verified checkpoint.
|
|
8042
|
+
*/
|
|
8043
|
+
attemptedAppendOutcome;
|
|
8146
8044
|
/**
|
|
8147
8045
|
* Underlying error that triggered the partial submission, preserved for
|
|
8148
|
-
* diagnostics.
|
|
8046
|
+
* diagnostics. Do not infer append outcome from this field; branch on
|
|
8047
|
+
* `attemptedAppendOutcome` instead.
|
|
8149
8048
|
*/
|
|
8150
8049
|
cause;
|
|
8151
8050
|
constructor(input) {
|
|
8152
8051
|
super(
|
|
8153
|
-
"Stream submission
|
|
8052
|
+
"Stream submission outcome is incomplete or unknown. Stop sending writes; once any outstanding append can no longer apply, obtain a later verified checkpoint and reconcile before replanning."
|
|
8154
8053
|
);
|
|
8155
8054
|
this.name = "WarmHubError";
|
|
8156
8055
|
this.cause = input.cause;
|
|
8157
8056
|
this.completedOperations = input.completedOperations;
|
|
8158
8057
|
this.acknowledgedOperationCount = input.acknowledgedOperationCount ?? input.completedOperations.length;
|
|
8058
|
+
this.attemptedAppendOutcome = input.attemptedAppendOutcome;
|
|
8059
|
+
if (input.lastAcknowledgedRepoSeq !== void 0) {
|
|
8060
|
+
this.lastAcknowledgedRepoSeq = input.lastAcknowledgedRepoSeq;
|
|
8061
|
+
}
|
|
8159
8062
|
}
|
|
8160
8063
|
};
|
|
8161
8064
|
var AllStreamOperationsFailedError = class extends Error {
|
|
@@ -8310,6 +8213,9 @@ function isTransientStreamFailure(cause) {
|
|
|
8310
8213
|
function isFetchNetworkTypeError(cause) {
|
|
8311
8214
|
return cause instanceof TypeError && /fetch/i.test(cause.message);
|
|
8312
8215
|
}
|
|
8216
|
+
function isReplaySafeOperation(operation) {
|
|
8217
|
+
return operation.operation !== "revise" || operation.expectedVersion !== void 0;
|
|
8218
|
+
}
|
|
8313
8219
|
function computeBackoffDelayMs(attempt, policy) {
|
|
8314
8220
|
const exponential = policy.baseDelayMs * 2 ** Math.max(0, attempt - 1);
|
|
8315
8221
|
const jitter = Math.random() * policy.baseDelayMs;
|
|
@@ -8366,7 +8272,8 @@ async function submitOperationsViaStream(client, args) {
|
|
|
8366
8272
|
)) {
|
|
8367
8273
|
let attempt = 1;
|
|
8368
8274
|
let priorAttemptAmbiguous = false;
|
|
8369
|
-
const
|
|
8275
|
+
const chunkIsSingleOperation = chunk.length === 1;
|
|
8276
|
+
const chunkIsReplaySafe = chunk.every(isReplaySafeOperation);
|
|
8370
8277
|
while (true) {
|
|
8371
8278
|
try {
|
|
8372
8279
|
const appendResult = await client.stream.append({
|
|
@@ -8396,7 +8303,7 @@ async function submitOperationsViaStream(client, args) {
|
|
|
8396
8303
|
if (acknowledgedOperationCount === 0 && !priorAttemptAmbiguous && isDefiniteClientError(cause)) {
|
|
8397
8304
|
throw cause;
|
|
8398
8305
|
}
|
|
8399
|
-
if (acknowledgedOperationCount === 0 &&
|
|
8306
|
+
if (acknowledgedOperationCount === 0 && chunkIsSingleOperation && chunkIsReplaySafe && policy !== false && attempt < policy.maxAttempts && isTransientStreamFailure(cause)) {
|
|
8400
8307
|
await sleep(computeBackoffDelayMs(attempt, policy));
|
|
8401
8308
|
attempt += 1;
|
|
8402
8309
|
priorAttemptAmbiguous = true;
|
|
@@ -8421,7 +8328,9 @@ async function submitOperationsViaStream(client, args) {
|
|
|
8421
8328
|
throw new PartialStreamSubmissionError({
|
|
8422
8329
|
cause,
|
|
8423
8330
|
completedOperations,
|
|
8424
|
-
acknowledgedOperationCount
|
|
8331
|
+
acknowledgedOperationCount,
|
|
8332
|
+
lastAcknowledgedRepoSeq: repoSeq,
|
|
8333
|
+
attemptedAppendOutcome: !priorAttemptAmbiguous && isDefiniteClientError(cause) ? "not_applied" : "unknown"
|
|
8425
8334
|
});
|
|
8426
8335
|
}
|
|
8427
8336
|
}
|
|
@@ -8443,7 +8352,9 @@ async function submitOperationsViaStream(client, args) {
|
|
|
8443
8352
|
throw new PartialStreamSubmissionError({
|
|
8444
8353
|
cause: failure,
|
|
8445
8354
|
completedOperations: completedOperationsFrom(result),
|
|
8446
|
-
acknowledgedOperationCount
|
|
8355
|
+
acknowledgedOperationCount,
|
|
8356
|
+
lastAcknowledgedRepoSeq: repoSeq,
|
|
8357
|
+
attemptedAppendOutcome: "unknown"
|
|
8447
8358
|
});
|
|
8448
8359
|
}
|
|
8449
8360
|
throw failure;
|
|
@@ -8570,7 +8481,7 @@ var SDK_DEVELOPMENT_VERSION = "0.0.0-development";
|
|
|
8570
8481
|
function sdkVersionIsDevelopment(version) {
|
|
8571
8482
|
return version === SDK_DEVELOPMENT_VERSION;
|
|
8572
8483
|
}
|
|
8573
|
-
var SDK_VERSION = "0.
|
|
8484
|
+
var SDK_VERSION = "0.84.0" ;
|
|
8574
8485
|
|
|
8575
8486
|
// src/component-cli.ts
|
|
8576
8487
|
var SUPPORTED_METHODS = /* @__PURE__ */ new Set([
|
|
@@ -8810,13 +8721,7 @@ function normalizeReviseKind(op, name) {
|
|
|
8810
8721
|
}
|
|
8811
8722
|
function toBackendOp(op) {
|
|
8812
8723
|
if (op.operation === "retract") {
|
|
8813
|
-
return
|
|
8814
|
-
operation: "retract",
|
|
8815
|
-
name: op.name,
|
|
8816
|
-
...op.kind ? { kind: op.kind } : {},
|
|
8817
|
-
...op.reason ? { reason: op.reason } : {},
|
|
8818
|
-
...op.leaseId ? { leaseId: op.leaseId } : {}
|
|
8819
|
-
};
|
|
8724
|
+
return toBackendStreamOperation(op);
|
|
8820
8725
|
}
|
|
8821
8726
|
if (op.operation === "add") {
|
|
8822
8727
|
const kind2 = normalizeAddKind(op);
|
|
@@ -9069,7 +8974,8 @@ var OperationBuilder = class {
|
|
|
9069
8974
|
/**
|
|
9070
8975
|
* Add a retract operation.
|
|
9071
8976
|
*
|
|
9072
|
-
* Pass a wref string shorthand or an object with
|
|
8977
|
+
* Pass a wref string shorthand or an object with retract options such as a
|
|
8978
|
+
* kind safety hint, reason, expected version, or lease ID.
|
|
9073
8979
|
*/
|
|
9074
8980
|
retract(target) {
|
|
9075
8981
|
this.assertCanModify();
|
|
@@ -9078,6 +8984,7 @@ var OperationBuilder = class {
|
|
|
9078
8984
|
name: target.name,
|
|
9079
8985
|
...target.kind ? { kind: target.kind } : {},
|
|
9080
8986
|
...target.reason ? { reason: target.reason } : {},
|
|
8987
|
+
...target.expectedVersion !== void 0 ? { expectedVersion: target.expectedVersion } : {},
|
|
9081
8988
|
...target.leaseId ? { leaseId: target.leaseId } : {}
|
|
9082
8989
|
});
|
|
9083
8990
|
this.ops.push(op);
|
|
@@ -9400,20 +9307,31 @@ function assertPaginatedCursorAdvanced(cursor, nextCursor, seenCursors) {
|
|
|
9400
9307
|
);
|
|
9401
9308
|
}
|
|
9402
9309
|
}
|
|
9403
|
-
|
|
9310
|
+
function assertIncrementalLowerBound(sinceRepoSeq) {
|
|
9311
|
+
if (sinceRepoSeq === void 0) {
|
|
9312
|
+
throw new WarmHubError(
|
|
9313
|
+
"VALIDATION_ERROR",
|
|
9314
|
+
"sinceRepoSeq is required for an incremental read"
|
|
9315
|
+
);
|
|
9316
|
+
}
|
|
9317
|
+
}
|
|
9318
|
+
async function* paginatePages(fetchPage, initialCursor) {
|
|
9404
9319
|
let cursor = initialCursor;
|
|
9405
9320
|
const seenCursors = /* @__PURE__ */ new Set();
|
|
9406
9321
|
for (; ; ) {
|
|
9407
9322
|
if (cursor) seenCursors.add(cursor);
|
|
9408
9323
|
const page = await fetchPage(cursor);
|
|
9409
|
-
|
|
9410
|
-
yield item;
|
|
9411
|
-
}
|
|
9324
|
+
yield page;
|
|
9412
9325
|
if (!page.nextCursor) return;
|
|
9413
9326
|
assertPaginatedCursorAdvanced(cursor, page.nextCursor, seenCursors);
|
|
9414
9327
|
cursor = page.nextCursor;
|
|
9415
9328
|
}
|
|
9416
9329
|
}
|
|
9330
|
+
async function* paginate(fetchPage, extractItems, initialCursor) {
|
|
9331
|
+
for await (const page of paginatePages(fetchPage, initialCursor)) {
|
|
9332
|
+
yield* extractItems(page);
|
|
9333
|
+
}
|
|
9334
|
+
}
|
|
9417
9335
|
async function collectPaginatedPages(fetchPage, extractItems, max, initialCursor) {
|
|
9418
9336
|
if (max !== void 0 && (!Number.isFinite(max) || Math.trunc(max) !== max || max < 0)) {
|
|
9419
9337
|
throw new WarmHubError(
|
|
@@ -9422,11 +9340,7 @@ async function collectPaginatedPages(fetchPage, extractItems, max, initialCursor
|
|
|
9422
9340
|
);
|
|
9423
9341
|
}
|
|
9424
9342
|
const items = [];
|
|
9425
|
-
|
|
9426
|
-
const seenCursors = /* @__PURE__ */ new Set();
|
|
9427
|
-
for (; ; ) {
|
|
9428
|
-
if (cursor) seenCursors.add(cursor);
|
|
9429
|
-
const page = await fetchPage(cursor);
|
|
9343
|
+
for await (const page of paginatePages(fetchPage, initialCursor)) {
|
|
9430
9344
|
const pageItems = extractItems(page);
|
|
9431
9345
|
if (max !== void 0 && items.length + pageItems.length > max) {
|
|
9432
9346
|
throw new WarmHubError(
|
|
@@ -9435,7 +9349,34 @@ async function collectPaginatedPages(fetchPage, extractItems, max, initialCursor
|
|
|
9435
9349
|
);
|
|
9436
9350
|
}
|
|
9437
9351
|
items.push(...pageItems);
|
|
9438
|
-
|
|
9352
|
+
}
|
|
9353
|
+
return items;
|
|
9354
|
+
}
|
|
9355
|
+
function assertRepoExploreBrowseMode(opts) {
|
|
9356
|
+
if (opts?.slugs !== void 0) {
|
|
9357
|
+
throw new WarmHubError(
|
|
9358
|
+
"VALIDATION_ERROR",
|
|
9359
|
+
"repo.explore pagination helpers do not support slugs mode"
|
|
9360
|
+
);
|
|
9361
|
+
}
|
|
9362
|
+
}
|
|
9363
|
+
async function collectIncrementalPages(fetchPage) {
|
|
9364
|
+
const items = [];
|
|
9365
|
+
let cursor;
|
|
9366
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
9367
|
+
for (; ; ) {
|
|
9368
|
+
if (cursor) seenCursors.add(cursor);
|
|
9369
|
+
const page = await fetchPage(cursor);
|
|
9370
|
+
items.push(...page.items);
|
|
9371
|
+
if (!page.nextCursor) {
|
|
9372
|
+
if (page.repoSeq === void 0) {
|
|
9373
|
+
throw new WarmHubError(
|
|
9374
|
+
"VALIDATION_ERROR",
|
|
9375
|
+
"Incremental read completed without repoSeq"
|
|
9376
|
+
);
|
|
9377
|
+
}
|
|
9378
|
+
return { items, repoSeq: page.repoSeq };
|
|
9379
|
+
}
|
|
9439
9380
|
assertPaginatedCursorAdvanced(cursor, page.nextCursor, seenCursors);
|
|
9440
9381
|
cursor = page.nextCursor;
|
|
9441
9382
|
}
|
|
@@ -9451,6 +9392,9 @@ function chunkArray(items, chunkSize) {
|
|
|
9451
9392
|
}
|
|
9452
9393
|
return chunks;
|
|
9453
9394
|
}
|
|
9395
|
+
function narrowKind(kind) {
|
|
9396
|
+
return kind !== void 0 && COMMIT_OPERATION_KINDS.includes(kind) ? kind : void 0;
|
|
9397
|
+
}
|
|
9454
9398
|
function toSubscriptionRef(args) {
|
|
9455
9399
|
const [first, repoName, name] = args;
|
|
9456
9400
|
return typeof first === "string" ? { orgName: first, repoName, name } : first;
|
|
@@ -9979,11 +9923,40 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
9979
9923
|
throw toWarmHubError(error);
|
|
9980
9924
|
}
|
|
9981
9925
|
},
|
|
9926
|
+
/**
|
|
9927
|
+
* Iterate installed components. Cursors resume the same query and result
|
|
9928
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
9929
|
+
* `cursor`.
|
|
9930
|
+
*/
|
|
9931
|
+
listIter: (orgName, repoName, opts) => {
|
|
9932
|
+
return paginate(
|
|
9933
|
+
(cursor) => this.component.list(orgName, repoName, { ...opts, cursor }),
|
|
9934
|
+
(page) => page.items,
|
|
9935
|
+
opts?.cursor
|
|
9936
|
+
);
|
|
9937
|
+
},
|
|
9938
|
+
/**
|
|
9939
|
+
* Materialize installed components. Cursors resume the same query and
|
|
9940
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
9941
|
+
* without `cursor`.
|
|
9942
|
+
*/
|
|
9943
|
+
listAll: async (orgName, repoName, opts) => {
|
|
9944
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
9945
|
+
return await collectPaginatedPages(
|
|
9946
|
+
(cursor) => this.component.list(orgName, repoName, { ...pageOpts, cursor }),
|
|
9947
|
+
(page) => page.items,
|
|
9948
|
+
max,
|
|
9949
|
+
pageOpts.cursor
|
|
9950
|
+
);
|
|
9951
|
+
},
|
|
9982
9952
|
/**
|
|
9983
9953
|
* Search registered components visible to the caller across all orgs
|
|
9984
9954
|
* (GH-4383): public components plus private components the caller can
|
|
9985
9955
|
* read. Distinct from listing components installed in a repo
|
|
9986
9956
|
* (`component.list`).
|
|
9957
|
+
*
|
|
9958
|
+
* Cursor contract: cursors resume the same query and result scope; on
|
|
9959
|
+
* `VALIDATION_ERROR` / `Invalid cursor`, restart the query without `cursor`.
|
|
9987
9960
|
*/
|
|
9988
9961
|
search: async (query, opts) => {
|
|
9989
9962
|
try {
|
|
@@ -9996,6 +9969,32 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
9996
9969
|
throw toWarmHubError(error);
|
|
9997
9970
|
}
|
|
9998
9971
|
},
|
|
9972
|
+
/**
|
|
9973
|
+
* Iterate global component search hits. Cursors resume the same query and
|
|
9974
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
9975
|
+
* without `cursor`.
|
|
9976
|
+
*/
|
|
9977
|
+
searchIter: (query, opts) => {
|
|
9978
|
+
return paginate(
|
|
9979
|
+
(cursor) => this.component.search(query, { ...opts, cursor }),
|
|
9980
|
+
(page) => page.items,
|
|
9981
|
+
opts?.cursor
|
|
9982
|
+
);
|
|
9983
|
+
},
|
|
9984
|
+
/**
|
|
9985
|
+
* Materialize global component search hits. Cursors resume the same query
|
|
9986
|
+
* and result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the
|
|
9987
|
+
* query without `cursor`.
|
|
9988
|
+
*/
|
|
9989
|
+
searchAll: async (query, opts) => {
|
|
9990
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
9991
|
+
return await collectPaginatedPages(
|
|
9992
|
+
(cursor) => this.component.search(query, { ...pageOpts, cursor }),
|
|
9993
|
+
(page) => page.items,
|
|
9994
|
+
max,
|
|
9995
|
+
pageOpts.cursor
|
|
9996
|
+
);
|
|
9997
|
+
},
|
|
9999
9998
|
/**
|
|
10000
9999
|
* Fetch one installed component by its `Org/Name` ref.
|
|
10001
10000
|
*/
|
|
@@ -10604,10 +10603,39 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
10604
10603
|
throw toWarmHubError(error);
|
|
10605
10604
|
}
|
|
10606
10605
|
},
|
|
10606
|
+
/**
|
|
10607
|
+
* Iterate organization repositories. Cursors resume the same query and
|
|
10608
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10609
|
+
* without `cursor`.
|
|
10610
|
+
*/
|
|
10611
|
+
listIter: (orgName, opts) => {
|
|
10612
|
+
return paginate(
|
|
10613
|
+
(cursor) => this.repo.list(orgName, { ...opts, cursor }),
|
|
10614
|
+
(page) => page.items,
|
|
10615
|
+
opts?.cursor
|
|
10616
|
+
);
|
|
10617
|
+
},
|
|
10618
|
+
/**
|
|
10619
|
+
* Materialize organization repositories. Cursors resume the same query and
|
|
10620
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10621
|
+
* without `cursor`.
|
|
10622
|
+
*/
|
|
10623
|
+
listAll: async (orgName, opts) => {
|
|
10624
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
10625
|
+
return await collectPaginatedPages(
|
|
10626
|
+
(cursor) => this.repo.list(orgName, { ...pageOpts, cursor }),
|
|
10627
|
+
(page) => page.items,
|
|
10628
|
+
max,
|
|
10629
|
+
pageOpts.cursor
|
|
10630
|
+
);
|
|
10631
|
+
},
|
|
10607
10632
|
/**
|
|
10608
10633
|
* Search repos visible to the caller across all orgs (GH-4383): public
|
|
10609
10634
|
* repos plus private repos the caller can read. BM25 over
|
|
10610
10635
|
* name/description/shape vocabulary/README.
|
|
10636
|
+
*
|
|
10637
|
+
* Cursor contract: cursors resume the same query and result scope; on
|
|
10638
|
+
* `VALIDATION_ERROR` / `Invalid cursor`, restart the query without `cursor`.
|
|
10611
10639
|
*/
|
|
10612
10640
|
search: async (query, opts) => {
|
|
10613
10641
|
try {
|
|
@@ -10620,6 +10648,32 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
10620
10648
|
throw toWarmHubError(error);
|
|
10621
10649
|
}
|
|
10622
10650
|
},
|
|
10651
|
+
/**
|
|
10652
|
+
* Iterate global repository search hits. Cursors resume the same query and
|
|
10653
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10654
|
+
* without `cursor`.
|
|
10655
|
+
*/
|
|
10656
|
+
searchIter: (query, opts) => {
|
|
10657
|
+
return paginate(
|
|
10658
|
+
(cursor) => this.repo.search(query, { ...opts, cursor }),
|
|
10659
|
+
(page) => page.items,
|
|
10660
|
+
opts?.cursor
|
|
10661
|
+
);
|
|
10662
|
+
},
|
|
10663
|
+
/**
|
|
10664
|
+
* Materialize global repository search hits. Cursors resume the same query
|
|
10665
|
+
* and result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the
|
|
10666
|
+
* query without `cursor`.
|
|
10667
|
+
*/
|
|
10668
|
+
searchAll: async (query, opts) => {
|
|
10669
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
10670
|
+
return await collectPaginatedPages(
|
|
10671
|
+
(cursor) => this.repo.search(query, { ...pageOpts, cursor }),
|
|
10672
|
+
(page) => page.items,
|
|
10673
|
+
max,
|
|
10674
|
+
pageOpts.cursor
|
|
10675
|
+
);
|
|
10676
|
+
},
|
|
10623
10677
|
/**
|
|
10624
10678
|
* Create a repository inside an organization.
|
|
10625
10679
|
*
|
|
@@ -10784,6 +10838,32 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
10784
10838
|
throw toWarmHubError(error);
|
|
10785
10839
|
}
|
|
10786
10840
|
},
|
|
10841
|
+
/**
|
|
10842
|
+
* Iterate repository rows with stats. Cursors resume the same query and
|
|
10843
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10844
|
+
* without `cursor`.
|
|
10845
|
+
*/
|
|
10846
|
+
listPageIter: (orgName, opts) => {
|
|
10847
|
+
return paginate(
|
|
10848
|
+
(cursor) => this.repo.listPage(orgName, { ...opts, cursor }),
|
|
10849
|
+
(page) => page.items,
|
|
10850
|
+
opts?.cursor
|
|
10851
|
+
);
|
|
10852
|
+
},
|
|
10853
|
+
/**
|
|
10854
|
+
* Materialize repository rows with stats. Cursors resume the same query and
|
|
10855
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10856
|
+
* without `cursor`.
|
|
10857
|
+
*/
|
|
10858
|
+
listPageAll: async (orgName, opts) => {
|
|
10859
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
10860
|
+
return await collectPaginatedPages(
|
|
10861
|
+
(cursor) => this.repo.listPage(orgName, { ...pageOpts, cursor }),
|
|
10862
|
+
(page) => page.items,
|
|
10863
|
+
max,
|
|
10864
|
+
pageOpts.cursor
|
|
10865
|
+
);
|
|
10866
|
+
},
|
|
10787
10867
|
/**
|
|
10788
10868
|
* List the caller's repositories across every org they belong to, ordered
|
|
10789
10869
|
* for recency by default (most recently written first), capped at `limit`.
|
|
@@ -10845,6 +10925,36 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
10845
10925
|
throw toWarmHubError(error);
|
|
10846
10926
|
}
|
|
10847
10927
|
},
|
|
10928
|
+
/**
|
|
10929
|
+
* Iterate public Explore browse results. Cursors resume the same query and
|
|
10930
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
10931
|
+
* without `cursor`. Exact `slugs` lookup is not pageable.
|
|
10932
|
+
*/
|
|
10933
|
+
exploreIter: (opts) => {
|
|
10934
|
+
assertRepoExploreBrowseMode(opts);
|
|
10935
|
+
return paginate(
|
|
10936
|
+
(cursor) => this.repo.explore({ ...opts, cursor }),
|
|
10937
|
+
(page) => page.items,
|
|
10938
|
+
opts?.cursor
|
|
10939
|
+
);
|
|
10940
|
+
},
|
|
10941
|
+
/**
|
|
10942
|
+
* Materialize public Explore browse results. Cursors resume the same query
|
|
10943
|
+
* and result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the
|
|
10944
|
+
* query without `cursor`. Exact `slugs` lookup is not pageable. `max`
|
|
10945
|
+
* remains optional as part of the uniform `*All` contract; callers should
|
|
10946
|
+
* provide a finite cap for this offset-paginated endpoint.
|
|
10947
|
+
*/
|
|
10948
|
+
exploreAll: async (opts) => {
|
|
10949
|
+
assertRepoExploreBrowseMode(opts);
|
|
10950
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
10951
|
+
return await collectPaginatedPages(
|
|
10952
|
+
(cursor) => this.repo.explore({ ...pageOpts, cursor }),
|
|
10953
|
+
(page) => page.items,
|
|
10954
|
+
max,
|
|
10955
|
+
pageOpts.cursor
|
|
10956
|
+
);
|
|
10957
|
+
},
|
|
10848
10958
|
/**
|
|
10849
10959
|
* Fetch a repository's `Content/Readme` markdown record.
|
|
10850
10960
|
*
|
|
@@ -11142,6 +11252,32 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11142
11252
|
} catch (error) {
|
|
11143
11253
|
throw toWarmHubError(error);
|
|
11144
11254
|
}
|
|
11255
|
+
},
|
|
11256
|
+
/**
|
|
11257
|
+
* Iterate shape versions. Cursors resume the same query and result scope;
|
|
11258
|
+
* on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11259
|
+
* `cursor`.
|
|
11260
|
+
*/
|
|
11261
|
+
historyIter: (orgName, repoName, name, opts = {}) => {
|
|
11262
|
+
return paginate(
|
|
11263
|
+
(cursor) => this.shape.history(orgName, repoName, name, { ...opts, cursor }),
|
|
11264
|
+
(page) => page.versions,
|
|
11265
|
+
opts.cursor
|
|
11266
|
+
);
|
|
11267
|
+
},
|
|
11268
|
+
/**
|
|
11269
|
+
* Materialize shape versions. Cursors resume the same query and result
|
|
11270
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11271
|
+
* `cursor`.
|
|
11272
|
+
*/
|
|
11273
|
+
historyAll: async (orgName, repoName, name, opts) => {
|
|
11274
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
11275
|
+
return await collectPaginatedPages(
|
|
11276
|
+
(cursor) => this.shape.history(orgName, repoName, name, { ...pageOpts, cursor }),
|
|
11277
|
+
(page) => page.versions,
|
|
11278
|
+
max,
|
|
11279
|
+
pageOpts.cursor
|
|
11280
|
+
);
|
|
11145
11281
|
}
|
|
11146
11282
|
};
|
|
11147
11283
|
/**
|
|
@@ -11423,6 +11559,38 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11423
11559
|
throw toWarmHubError(error);
|
|
11424
11560
|
}
|
|
11425
11561
|
},
|
|
11562
|
+
/**
|
|
11563
|
+
* Iterate delivery-feed entries. Cursors resume the same query and result
|
|
11564
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11565
|
+
* `cursor`.
|
|
11566
|
+
*/
|
|
11567
|
+
liveFeedIter: (orgName, repoName, subscriptionName, opts) => {
|
|
11568
|
+
return paginate(
|
|
11569
|
+
(cursor) => this.action.liveFeed(orgName, repoName, subscriptionName, {
|
|
11570
|
+
...opts,
|
|
11571
|
+
cursor
|
|
11572
|
+
}),
|
|
11573
|
+
(page) => page.items,
|
|
11574
|
+
opts?.cursor
|
|
11575
|
+
);
|
|
11576
|
+
},
|
|
11577
|
+
/**
|
|
11578
|
+
* Materialize delivery-feed entries. Cursors resume the same query and
|
|
11579
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
11580
|
+
* without `cursor`.
|
|
11581
|
+
*/
|
|
11582
|
+
liveFeedAll: async (orgName, repoName, subscriptionName, opts) => {
|
|
11583
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
11584
|
+
return await collectPaginatedPages(
|
|
11585
|
+
(cursor) => this.action.liveFeed(orgName, repoName, subscriptionName, {
|
|
11586
|
+
...pageOpts,
|
|
11587
|
+
cursor
|
|
11588
|
+
}),
|
|
11589
|
+
(page) => page.items,
|
|
11590
|
+
max,
|
|
11591
|
+
pageOpts.cursor
|
|
11592
|
+
);
|
|
11593
|
+
},
|
|
11426
11594
|
/**
|
|
11427
11595
|
* List subscription action runs as a `Page<ActionRunInfo>` (`items` +
|
|
11428
11596
|
* optional `nextCursor`), newest-first, capped at 200 runs per page.
|
|
@@ -11430,8 +11598,9 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11430
11598
|
* `status` and `outcome` are mutually exclusive.
|
|
11431
11599
|
* `since` and `cursor` are mutually exclusive; pass `cursor` alone on later
|
|
11432
11600
|
* pages — the `since` window rides in the cursor.
|
|
11433
|
-
* Cursors are opaque, short-lived resume tokens
|
|
11434
|
-
*
|
|
11601
|
+
* Cursors are opaque, short-lived resume tokens for the same query and
|
|
11602
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
11603
|
+
* without `cursor`.
|
|
11435
11604
|
* See docs/dev/warmhub-actions-api.md for the full contract.
|
|
11436
11605
|
*/
|
|
11437
11606
|
listRuns: async (orgName, repoName, opts) => {
|
|
@@ -11439,6 +11608,7 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11439
11608
|
return await this.trpc.action.listRuns.query({
|
|
11440
11609
|
orgName,
|
|
11441
11610
|
repoName,
|
|
11611
|
+
runId: opts?.runId,
|
|
11442
11612
|
subscriptionName: opts?.subscriptionName,
|
|
11443
11613
|
status: opts?.status,
|
|
11444
11614
|
outcome: opts?.outcome,
|
|
@@ -11450,6 +11620,40 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11450
11620
|
throw toWarmHubError(error);
|
|
11451
11621
|
}
|
|
11452
11622
|
},
|
|
11623
|
+
/**
|
|
11624
|
+
* Iterate action runs. Cursors resume the same query and result scope; on
|
|
11625
|
+
* `VALIDATION_ERROR` / `Invalid cursor`, restart the query without `cursor`.
|
|
11626
|
+
* `since` is sent only on the initial request.
|
|
11627
|
+
*/
|
|
11628
|
+
listRunsIter: (orgName, repoName, opts) => {
|
|
11629
|
+
return paginate(
|
|
11630
|
+
(cursor) => this.action.listRuns(orgName, repoName, {
|
|
11631
|
+
...opts,
|
|
11632
|
+
since: cursor === void 0 ? opts?.since : void 0,
|
|
11633
|
+
cursor
|
|
11634
|
+
}),
|
|
11635
|
+
(page) => page.items,
|
|
11636
|
+
opts?.cursor
|
|
11637
|
+
);
|
|
11638
|
+
},
|
|
11639
|
+
/**
|
|
11640
|
+
* Materialize action runs. Cursors resume the same query and result scope;
|
|
11641
|
+
* on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11642
|
+
* `cursor`. `since` is sent only on the initial request.
|
|
11643
|
+
*/
|
|
11644
|
+
listRunsAll: async (orgName, repoName, opts) => {
|
|
11645
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
11646
|
+
return await collectPaginatedPages(
|
|
11647
|
+
(cursor) => this.action.listRuns(orgName, repoName, {
|
|
11648
|
+
...pageOpts,
|
|
11649
|
+
since: cursor === void 0 ? pageOpts.since : void 0,
|
|
11650
|
+
cursor
|
|
11651
|
+
}),
|
|
11652
|
+
(page) => page.items,
|
|
11653
|
+
max,
|
|
11654
|
+
pageOpts.cursor
|
|
11655
|
+
);
|
|
11656
|
+
},
|
|
11453
11657
|
/**
|
|
11454
11658
|
* Return the newest visible action run for each subscription in a repo.
|
|
11455
11659
|
*
|
|
@@ -11541,6 +11745,11 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11541
11745
|
throw toWarmHubError(error);
|
|
11542
11746
|
}
|
|
11543
11747
|
},
|
|
11748
|
+
/**
|
|
11749
|
+
* Read one collection-membership page. Cursors resume the same query and
|
|
11750
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
11751
|
+
* without `cursor`.
|
|
11752
|
+
*/
|
|
11544
11753
|
members: async (orgName, repoName, wref, opts) => {
|
|
11545
11754
|
try {
|
|
11546
11755
|
return await this.trpc.collection.members.query({
|
|
@@ -11555,6 +11764,11 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11555
11764
|
throw toWarmHubError(error);
|
|
11556
11765
|
}
|
|
11557
11766
|
},
|
|
11767
|
+
/**
|
|
11768
|
+
* Iterate collection members. Cursors resume the same query and result
|
|
11769
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11770
|
+
* `cursor`.
|
|
11771
|
+
*/
|
|
11558
11772
|
membersIter: (orgName, repoName, wref, opts) => {
|
|
11559
11773
|
let snapshotVersion = opts?.version;
|
|
11560
11774
|
return paginate(
|
|
@@ -11571,6 +11785,11 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11571
11785
|
opts?.cursor
|
|
11572
11786
|
);
|
|
11573
11787
|
},
|
|
11788
|
+
/**
|
|
11789
|
+
* Materialize collection members. Cursors resume the same query and result
|
|
11790
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
11791
|
+
* `cursor`.
|
|
11792
|
+
*/
|
|
11574
11793
|
membersAll: async (orgName, repoName, wref, opts) => {
|
|
11575
11794
|
const { max, ...pageOpts } = opts ?? {};
|
|
11576
11795
|
let snapshotVersion = pageOpts.version;
|
|
@@ -11694,12 +11913,11 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11694
11913
|
*/
|
|
11695
11914
|
head: async (orgName, repoName, opts) => {
|
|
11696
11915
|
try {
|
|
11697
|
-
const kind = opts?.kind === "shape" || opts?.kind === "thing" || opts?.kind === "assertion" || opts?.kind === "collection" ? opts.kind : void 0;
|
|
11698
11916
|
return await this.trpc.thing.head.query({
|
|
11699
11917
|
orgName,
|
|
11700
11918
|
repoName,
|
|
11701
11919
|
shape: opts?.shape,
|
|
11702
|
-
kind,
|
|
11920
|
+
kind: narrowKind(opts?.kind),
|
|
11703
11921
|
match: opts?.match,
|
|
11704
11922
|
dataMode: opts?.dataMode,
|
|
11705
11923
|
includeRetracted: opts?.includeRetracted,
|
|
@@ -11708,7 +11926,8 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11708
11926
|
componentRef: opts?.componentRef,
|
|
11709
11927
|
excludeComponents: opts?.excludeComponents,
|
|
11710
11928
|
excludeInfraShapes: opts?.excludeInfraShapes,
|
|
11711
|
-
where: opts?.where
|
|
11929
|
+
where: opts?.where,
|
|
11930
|
+
sinceRepoSeq: opts?.sinceRepoSeq
|
|
11712
11931
|
});
|
|
11713
11932
|
} catch (error) {
|
|
11714
11933
|
throw toWarmHubError(error);
|
|
@@ -11752,6 +11971,26 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11752
11971
|
pageOpts.cursor
|
|
11753
11972
|
);
|
|
11754
11973
|
},
|
|
11974
|
+
/**
|
|
11975
|
+
* Materialize identity-owned changes after a repository sequence and return
|
|
11976
|
+
* the exact checkpoint reached by the completed scan.
|
|
11977
|
+
*
|
|
11978
|
+
* Key a local cache by `item.metadata.durableId`: an identity rename
|
|
11979
|
+
* carries its checkpoint wref, and a retraction carries `active: false`.
|
|
11980
|
+
* This helper forces retracted rows on and returns only after draining the
|
|
11981
|
+
* terminal page. It does not fan out changes caused by another identity
|
|
11982
|
+
* and therefore is not, by itself, a complete local-result-mirror protocol.
|
|
11983
|
+
*/
|
|
11984
|
+
headChanges: async (orgName, repoName, opts) => {
|
|
11985
|
+
assertIncrementalLowerBound(opts?.sinceRepoSeq);
|
|
11986
|
+
return await collectIncrementalPages(
|
|
11987
|
+
(cursor) => this.thing.head(orgName, repoName, {
|
|
11988
|
+
...opts,
|
|
11989
|
+
includeRetracted: true,
|
|
11990
|
+
cursor
|
|
11991
|
+
})
|
|
11992
|
+
);
|
|
11993
|
+
},
|
|
11755
11994
|
/**
|
|
11756
11995
|
* Get one thing, assertion, shape, or collection by wref.
|
|
11757
11996
|
*
|
|
@@ -11985,6 +12224,32 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
11985
12224
|
throw toWarmHubError(error);
|
|
11986
12225
|
}
|
|
11987
12226
|
},
|
|
12227
|
+
/**
|
|
12228
|
+
* Iterate thing history versions. Cursors resume the same query and result
|
|
12229
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
12230
|
+
* `cursor`.
|
|
12231
|
+
*/
|
|
12232
|
+
historyIter: (orgName, repoName, opts) => {
|
|
12233
|
+
return paginate(
|
|
12234
|
+
(cursor) => this.thing.history(orgName, repoName, { ...opts, cursor }),
|
|
12235
|
+
(page) => page.versions,
|
|
12236
|
+
opts.cursor
|
|
12237
|
+
);
|
|
12238
|
+
},
|
|
12239
|
+
/**
|
|
12240
|
+
* Materialize thing history versions. Cursors resume the same query and
|
|
12241
|
+
* result scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query
|
|
12242
|
+
* without `cursor`.
|
|
12243
|
+
*/
|
|
12244
|
+
historyAll: async (orgName, repoName, opts) => {
|
|
12245
|
+
const { max, ...pageOpts } = opts;
|
|
12246
|
+
return await collectPaginatedPages(
|
|
12247
|
+
(cursor) => this.thing.history(orgName, repoName, { ...pageOpts, cursor }),
|
|
12248
|
+
(page) => page.versions,
|
|
12249
|
+
max,
|
|
12250
|
+
pageOpts.cursor
|
|
12251
|
+
);
|
|
12252
|
+
},
|
|
11988
12253
|
/**
|
|
11989
12254
|
* Rename a thing within its shape namespace.
|
|
11990
12255
|
*
|
|
@@ -12111,13 +12376,12 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
12111
12376
|
*/
|
|
12112
12377
|
query: async (orgName, repoName, opts) => {
|
|
12113
12378
|
try {
|
|
12114
|
-
const kind = opts?.kind === "shape" || opts?.kind === "thing" || opts?.kind === "assertion" || opts?.kind === "collection" ? opts.kind : void 0;
|
|
12115
12379
|
return await this.trpc.thing.query.query({
|
|
12116
12380
|
orgName,
|
|
12117
12381
|
repoName,
|
|
12118
12382
|
shape: opts?.shape,
|
|
12119
12383
|
about: opts?.about,
|
|
12120
|
-
kind,
|
|
12384
|
+
kind: narrowKind(opts?.kind),
|
|
12121
12385
|
match: opts?.match,
|
|
12122
12386
|
includeRetracted: opts?.includeRetracted,
|
|
12123
12387
|
resolveCollections: opts?.resolveCollections,
|
|
@@ -12127,7 +12391,8 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
12127
12391
|
componentRef: opts?.componentRef,
|
|
12128
12392
|
excludeComponents: opts?.excludeComponents,
|
|
12129
12393
|
excludeInfraShapes: opts?.excludeInfraShapes,
|
|
12130
|
-
where: opts?.where
|
|
12394
|
+
where: opts?.where,
|
|
12395
|
+
sinceRepoSeq: opts?.sinceRepoSeq
|
|
12131
12396
|
});
|
|
12132
12397
|
} catch (error) {
|
|
12133
12398
|
throw toWarmHubError(error);
|
|
@@ -12171,6 +12436,26 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
12171
12436
|
pageOpts.cursor
|
|
12172
12437
|
);
|
|
12173
12438
|
},
|
|
12439
|
+
/**
|
|
12440
|
+
* Materialize filtered identity-owned changes after a repository sequence
|
|
12441
|
+
* and return the exact checkpoint reached by the completed scan.
|
|
12442
|
+
*
|
|
12443
|
+
* Key a local cache by `item.metadata.durableId`: an identity rename
|
|
12444
|
+
* carries its checkpoint wref, and a retraction carries `active: false`.
|
|
12445
|
+
* This helper forces retracted rows on and returns only after draining the
|
|
12446
|
+
* terminal page. It does not fan out changes caused by another identity
|
|
12447
|
+
* and therefore is not, by itself, a complete local-result-mirror protocol.
|
|
12448
|
+
*/
|
|
12449
|
+
queryChanges: async (orgName, repoName, opts) => {
|
|
12450
|
+
assertIncrementalLowerBound(opts?.sinceRepoSeq);
|
|
12451
|
+
return await collectIncrementalPages(
|
|
12452
|
+
(cursor) => this.thing.query(orgName, repoName, {
|
|
12453
|
+
...opts,
|
|
12454
|
+
includeRetracted: true,
|
|
12455
|
+
cursor
|
|
12456
|
+
})
|
|
12457
|
+
);
|
|
12458
|
+
},
|
|
12174
12459
|
/**
|
|
12175
12460
|
* Search repository records with text, vector, or hybrid mode.
|
|
12176
12461
|
*
|
|
@@ -12184,14 +12469,13 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
12184
12469
|
*/
|
|
12185
12470
|
search: async (orgName, repoName, query, opts) => {
|
|
12186
12471
|
try {
|
|
12187
|
-
const kind = opts?.kind === "shape" || opts?.kind === "thing" || opts?.kind === "assertion" || opts?.kind === "collection" ? opts.kind : void 0;
|
|
12188
12472
|
return await this.trpc.thing.search.query({
|
|
12189
12473
|
orgName,
|
|
12190
12474
|
repoName,
|
|
12191
12475
|
query,
|
|
12192
12476
|
shape: opts?.shape,
|
|
12193
12477
|
about: opts?.about,
|
|
12194
|
-
kind,
|
|
12478
|
+
kind: narrowKind(opts?.kind),
|
|
12195
12479
|
match: opts?.match,
|
|
12196
12480
|
includeRetracted: opts?.includeRetracted,
|
|
12197
12481
|
resolveCollections: opts?.resolveCollections,
|
|
@@ -12207,25 +12491,54 @@ var WarmHubClient = class _WarmHubClient {
|
|
|
12207
12491
|
throw toWarmHubError(error);
|
|
12208
12492
|
}
|
|
12209
12493
|
},
|
|
12494
|
+
/**
|
|
12495
|
+
* Iterate ranked search hits. Cursors resume the same query and result
|
|
12496
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
12497
|
+
* `cursor`.
|
|
12498
|
+
*/
|
|
12499
|
+
searchIter: (orgName, repoName, query, opts) => {
|
|
12500
|
+
return paginate(
|
|
12501
|
+
(cursor) => this.thing.search(orgName, repoName, query, { ...opts, cursor }),
|
|
12502
|
+
(page) => page.items,
|
|
12503
|
+
opts?.cursor
|
|
12504
|
+
);
|
|
12505
|
+
},
|
|
12506
|
+
/**
|
|
12507
|
+
* Materialize ranked search hits. Cursors resume the same query and result
|
|
12508
|
+
* scope; on `VALIDATION_ERROR` / `Invalid cursor`, restart the query without
|
|
12509
|
+
* `cursor`.
|
|
12510
|
+
*/
|
|
12511
|
+
searchAll: async (orgName, repoName, query, opts) => {
|
|
12512
|
+
const { max, ...pageOpts } = opts ?? {};
|
|
12513
|
+
return await collectPaginatedPages(
|
|
12514
|
+
(cursor) => this.thing.search(orgName, repoName, query, {
|
|
12515
|
+
...pageOpts,
|
|
12516
|
+
cursor
|
|
12517
|
+
}),
|
|
12518
|
+
(page) => page.items,
|
|
12519
|
+
max,
|
|
12520
|
+
pageOpts.cursor
|
|
12521
|
+
);
|
|
12522
|
+
},
|
|
12210
12523
|
/**
|
|
12211
12524
|
* Count matching repository records without returning record data.
|
|
12212
12525
|
*/
|
|
12213
12526
|
count: async (orgName, repoName, opts) => {
|
|
12214
12527
|
try {
|
|
12215
|
-
const kind = opts?.kind === "shape" || opts?.kind === "thing" || opts?.kind === "assertion" || opts?.kind === "collection" ? opts.kind : void 0;
|
|
12216
12528
|
return await this.trpc.thing.count.query({
|
|
12217
12529
|
orgName,
|
|
12218
12530
|
repoName,
|
|
12219
12531
|
shape: opts?.shape,
|
|
12220
12532
|
about: opts?.about,
|
|
12221
|
-
kind,
|
|
12533
|
+
kind: narrowKind(opts?.kind),
|
|
12222
12534
|
match: opts?.match,
|
|
12223
12535
|
includeRetracted: opts?.includeRetracted,
|
|
12224
12536
|
resolveCollections: opts?.resolveCollections,
|
|
12225
12537
|
componentRef: opts?.componentRef,
|
|
12226
12538
|
excludeComponents: opts?.excludeComponents,
|
|
12227
12539
|
excludeInfraShapes: opts?.excludeInfraShapes,
|
|
12228
|
-
where: opts?.where
|
|
12540
|
+
where: opts?.where,
|
|
12541
|
+
sinceRepoSeq: opts?.sinceRepoSeq
|
|
12229
12542
|
});
|
|
12230
12543
|
} catch (error) {
|
|
12231
12544
|
throw toWarmHubError(error);
|
|
@@ -12987,5 +13300,5 @@ re2js/build/index.js:
|
|
|
12987
13300
|
*/
|
|
12988
13301
|
|
|
12989
13302
|
export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT2 as MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
|
|
12990
|
-
//# sourceMappingURL=chunk-
|
|
12991
|
-
//# sourceMappingURL=chunk-
|
|
13303
|
+
//# sourceMappingURL=chunk-CLDVXOJD.js.map
|
|
13304
|
+
//# sourceMappingURL=chunk-CLDVXOJD.js.map
|