@camunda8/orchestration-cluster-api 10.0.0-alpha.30 → 10.0.0-alpha.31
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/CHANGELOG.md +14 -0
- package/README.md +82 -68
- package/dist/{index-CIGXnFfe.d.ts → CamundaClient-D95Qr9pC.d.ts} +2101 -2221
- package/dist/{index-Cv5fK0gZ.d.cts → CamundaClient-esvUSLtB.d.cts} +2101 -2221
- package/dist/{chunk-SHE5T54L.js → chunk-M5UHGQJ3.js} +9 -139
- package/dist/chunk-M5UHGQJ3.js.map +1 -0
- package/dist/{fp → effect}/index.cjs +138 -119
- package/dist/effect/index.cjs.map +1 -0
- package/dist/effect/index.d.cts +119 -0
- package/dist/effect/index.d.ts +119 -0
- package/dist/effect/index.js +155 -0
- package/dist/effect/index.js.map +1 -0
- package/dist/index.cjs +7 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -20
- package/dist/index.d.ts +85 -20
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunk-SHE5T54L.js.map +0 -1
- package/dist/fp/index.cjs.map +0 -1
- package/dist/fp/index.d.cts +0 -3
- package/dist/fp/index.d.ts +0 -3
- package/dist/fp/index.js +0 -23
- package/dist/fp/index.js.map +0 -1
|
@@ -9219,19 +9219,24 @@ default, with local set to \`false\`, scope '1' will be { "foo": 5 } and scope '
|
|
|
9219
9219
|
}
|
|
9220
9220
|
});
|
|
9221
9221
|
|
|
9222
|
-
// src/
|
|
9223
|
-
var
|
|
9224
|
-
__export(
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9222
|
+
// src/effect/index.ts
|
|
9223
|
+
var effect_exports = {};
|
|
9224
|
+
__export(effect_exports, {
|
|
9225
|
+
CamundaEffect: () => CamundaEffect,
|
|
9226
|
+
CamundaGenericError: () => CamundaGenericError,
|
|
9227
|
+
CamundaValidationError: () => CamundaValidationError2,
|
|
9228
|
+
EventualConsistencyTimeout: () => EventualConsistencyTimeout,
|
|
9229
|
+
HttpError: () => HttpError,
|
|
9230
|
+
createCamundaEffectClient: () => createCamundaEffectClient,
|
|
9231
|
+
eventually: () => eventually,
|
|
9232
|
+
layer: () => layer,
|
|
9233
|
+
retryWithBackoff: () => retryWithBackoff,
|
|
9234
|
+
withTimeout: () => withTimeout
|
|
9233
9235
|
});
|
|
9234
|
-
module.exports = __toCommonJS(
|
|
9236
|
+
module.exports = __toCommonJS(effect_exports);
|
|
9237
|
+
|
|
9238
|
+
// src/effect.ts
|
|
9239
|
+
var import_effect = require("effect");
|
|
9235
9240
|
|
|
9236
9241
|
// src/gen/core/serverSentEvents.gen.ts
|
|
9237
9242
|
var __STANDARD_REQUEST_INIT_KEYS = [
|
|
@@ -13783,7 +13788,7 @@ function createLogger(opts = {}) {
|
|
|
13783
13788
|
}
|
|
13784
13789
|
|
|
13785
13790
|
// src/runtime/version.ts
|
|
13786
|
-
var packageVersion = "10.0.0-alpha.
|
|
13791
|
+
var packageVersion = "10.0.0-alpha.31";
|
|
13787
13792
|
|
|
13788
13793
|
// src/runtime/supportLogger.ts
|
|
13789
13794
|
var NoopSupportLogger = class {
|
|
@@ -14239,18 +14244,18 @@ function unwrapForInspection(s) {
|
|
|
14239
14244
|
continue;
|
|
14240
14245
|
}
|
|
14241
14246
|
if (t === "ZodIntersection") {
|
|
14242
|
-
const
|
|
14243
|
-
const
|
|
14244
|
-
if (
|
|
14247
|
+
const left = cur._def.left;
|
|
14248
|
+
const right = cur._def.right;
|
|
14249
|
+
if (left?._def?.typeName === "ZodObject" && right?._def?.typeName === "ZodObject") {
|
|
14245
14250
|
try {
|
|
14246
|
-
const leftShapeFn =
|
|
14247
|
-
const rightShapeFn =
|
|
14251
|
+
const leftShapeFn = left._def.shape;
|
|
14252
|
+
const rightShapeFn = right._def.shape;
|
|
14248
14253
|
const merged = { ...leftShapeFn(), ...rightShapeFn() };
|
|
14249
14254
|
return import_zod.ZodObject.create(merged);
|
|
14250
14255
|
} catch {
|
|
14251
14256
|
}
|
|
14252
14257
|
}
|
|
14253
|
-
cur =
|
|
14258
|
+
cur = left;
|
|
14254
14259
|
continue;
|
|
14255
14260
|
}
|
|
14256
14261
|
break;
|
|
@@ -29957,54 +29962,73 @@ var CamundaClient = class {
|
|
|
29957
29962
|
}
|
|
29958
29963
|
};
|
|
29959
29964
|
|
|
29960
|
-
// src/
|
|
29961
|
-
var
|
|
29962
|
-
|
|
29963
|
-
var
|
|
29964
|
-
|
|
29965
|
+
// src/effect.ts
|
|
29966
|
+
var CamundaValidationError2 = class extends import_effect.Data.TaggedError("CamundaValidationError") {
|
|
29967
|
+
};
|
|
29968
|
+
var EventualConsistencyTimeout = class extends import_effect.Data.TaggedError("EventualConsistencyTimeout") {
|
|
29969
|
+
};
|
|
29970
|
+
var HttpError = class extends import_effect.Data.TaggedError("HttpError") {
|
|
29971
|
+
};
|
|
29972
|
+
var CamundaGenericError = class extends import_effect.Data.TaggedError("CamundaGenericError") {
|
|
29973
|
+
};
|
|
29965
29974
|
function toDomainError(err) {
|
|
29966
|
-
if (err instanceof CamundaValidationError)
|
|
29967
|
-
|
|
29968
|
-
|
|
29969
|
-
|
|
29970
|
-
|
|
29971
|
-
|
|
29972
|
-
|
|
29973
|
-
|
|
29974
|
-
|
|
29975
|
-
|
|
29976
|
-
|
|
29977
|
-
|
|
29978
|
-
|
|
29979
|
-
|
|
29980
|
-
|
|
29981
|
-
|
|
29982
|
-
|
|
29983
|
-
|
|
29984
|
-
|
|
29985
|
-
|
|
29986
|
-
|
|
29987
|
-
|
|
29988
|
-
|
|
29989
|
-
|
|
29990
|
-
|
|
29975
|
+
if (err instanceof CamundaValidationError) {
|
|
29976
|
+
return new CamundaValidationError2({
|
|
29977
|
+
side: err.side,
|
|
29978
|
+
operationId: err.operationId,
|
|
29979
|
+
summary: err.summary,
|
|
29980
|
+
issues: err.issues,
|
|
29981
|
+
message: err.message,
|
|
29982
|
+
cause: err
|
|
29983
|
+
});
|
|
29984
|
+
}
|
|
29985
|
+
if (err instanceof EventualConsistencyTimeoutError) {
|
|
29986
|
+
return new EventualConsistencyTimeout({
|
|
29987
|
+
attempts: err.attempts,
|
|
29988
|
+
elapsedMs: err.elapsedMs,
|
|
29989
|
+
message: err.message,
|
|
29990
|
+
cause: err
|
|
29991
|
+
});
|
|
29992
|
+
}
|
|
29993
|
+
const anyErr = err;
|
|
29994
|
+
if (anyErr && typeof anyErr === "object" && typeof anyErr.status === "number") {
|
|
29995
|
+
return new HttpError({
|
|
29996
|
+
status: anyErr.status,
|
|
29997
|
+
body: anyErr.body,
|
|
29998
|
+
message: typeof anyErr.message === "string" ? anyErr.message : `HTTP ${anyErr.status}`,
|
|
29999
|
+
cause: err
|
|
30000
|
+
});
|
|
30001
|
+
}
|
|
30002
|
+
if (err instanceof Error) {
|
|
30003
|
+
return new CamundaGenericError({ message: err.message, cause: err });
|
|
30004
|
+
}
|
|
30005
|
+
return new CamundaGenericError({ message: String(err), cause: err });
|
|
29991
30006
|
}
|
|
29992
30007
|
function isPromiseLike(v) {
|
|
29993
|
-
return v && typeof v.then === "function";
|
|
30008
|
+
return !!v && typeof v.then === "function";
|
|
29994
30009
|
}
|
|
29995
|
-
function
|
|
30010
|
+
function createCamundaEffectClient(options) {
|
|
29996
30011
|
const base = createCamundaClient(options);
|
|
29997
30012
|
const cache = /* @__PURE__ */ new Map();
|
|
29998
30013
|
function wrap(fn) {
|
|
29999
|
-
return (...args) =>
|
|
30014
|
+
return (...args) => import_effect.Effect.suspend(() => {
|
|
30015
|
+
let r;
|
|
30000
30016
|
try {
|
|
30001
|
-
|
|
30002
|
-
const val = isPromiseLike(r) ? await r : r;
|
|
30003
|
-
return right(val);
|
|
30017
|
+
r = fn.apply(base, args);
|
|
30004
30018
|
} catch (e) {
|
|
30005
|
-
return
|
|
30006
|
-
}
|
|
30007
|
-
|
|
30019
|
+
return import_effect.Effect.fail(toDomainError(e));
|
|
30020
|
+
}
|
|
30021
|
+
if (!isPromiseLike(r)) return import_effect.Effect.succeed(r);
|
|
30022
|
+
const promise = r;
|
|
30023
|
+
return import_effect.Effect.callback((resume) => {
|
|
30024
|
+
promise.then(
|
|
30025
|
+
(a) => resume(import_effect.Effect.succeed(a)),
|
|
30026
|
+
(e) => resume(import_effect.Effect.fail(toDomainError(e)))
|
|
30027
|
+
);
|
|
30028
|
+
const cancel = r.cancel;
|
|
30029
|
+
return typeof cancel === "function" ? import_effect.Effect.sync(() => cancel.call(r)) : void 0;
|
|
30030
|
+
});
|
|
30031
|
+
});
|
|
30008
30032
|
}
|
|
30009
30033
|
const handler = {
|
|
30010
30034
|
get(_t, prop) {
|
|
@@ -30022,71 +30046,66 @@ function createCamundaFpClient(options) {
|
|
|
30022
30046
|
};
|
|
30023
30047
|
return new Proxy({}, handler);
|
|
30024
30048
|
}
|
|
30025
|
-
function
|
|
30026
|
-
|
|
30027
|
-
|
|
30028
|
-
|
|
30029
|
-
|
|
30030
|
-
|
|
30031
|
-
const res = await task();
|
|
30032
|
-
if (isRight(res)) return res;
|
|
30033
|
-
lastLeft = res;
|
|
30034
|
-
attempt++;
|
|
30035
|
-
const retry = attempt < max && (shouldRetry ? await shouldRetry(res.left, attempt) : true);
|
|
30036
|
-
if (!retry) return res;
|
|
30037
|
-
const delay = Math.min(2e3, baseDelayMs * 2 ** (attempt - 1));
|
|
30038
|
-
await new Promise((r) => setTimeout(r, delay));
|
|
30039
|
-
}
|
|
30040
|
-
return lastLeft;
|
|
30041
|
-
};
|
|
30049
|
+
function formatDuration(d) {
|
|
30050
|
+
try {
|
|
30051
|
+
return import_effect.Duration.format(import_effect.Duration.fromInputUnsafe(d));
|
|
30052
|
+
} catch {
|
|
30053
|
+
return String(d);
|
|
30054
|
+
}
|
|
30042
30055
|
}
|
|
30043
|
-
function
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
const timeout = new Promise(
|
|
30051
|
-
(res) => setTimeout(() => {
|
|
30052
|
-
if (!settled)
|
|
30053
|
-
res(left(onTimeout ? onTimeout() : new Error(`Timeout after ${ms}ms`)));
|
|
30054
|
-
}, ms)
|
|
30055
|
-
);
|
|
30056
|
-
return Promise.race([t, timeout]);
|
|
30057
|
-
};
|
|
30056
|
+
function retryWithBackoff(effect, opts) {
|
|
30057
|
+
const backoff = import_effect.Schedule.exponential(opts.baseDelay ?? "100 millis").pipe(import_effect.Schedule.jittered);
|
|
30058
|
+
return import_effect.Effect.retry(effect, {
|
|
30059
|
+
schedule: backoff,
|
|
30060
|
+
times: Math.max(0, opts.max - 1),
|
|
30061
|
+
while: opts.while
|
|
30062
|
+
});
|
|
30058
30063
|
}
|
|
30059
|
-
function
|
|
30060
|
-
|
|
30061
|
-
|
|
30062
|
-
|
|
30063
|
-
|
|
30064
|
-
|
|
30065
|
-
|
|
30066
|
-
|
|
30067
|
-
|
|
30068
|
-
|
|
30069
|
-
|
|
30070
|
-
|
|
30071
|
-
|
|
30072
|
-
|
|
30073
|
-
|
|
30074
|
-
|
|
30075
|
-
|
|
30076
|
-
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30064
|
+
function withTimeout(effect, duration, onTimeout) {
|
|
30065
|
+
return import_effect.Effect.timeoutOrElse(effect, {
|
|
30066
|
+
duration,
|
|
30067
|
+
orElse: () => import_effect.Effect.fail(
|
|
30068
|
+
onTimeout ? onTimeout() : new EventualConsistencyTimeout({
|
|
30069
|
+
message: `Timed out after ${formatDuration(duration)}`
|
|
30070
|
+
})
|
|
30071
|
+
)
|
|
30072
|
+
});
|
|
30073
|
+
}
|
|
30074
|
+
function eventually(effect, predicate, opts) {
|
|
30075
|
+
const interval = opts.interval ?? "500 millis";
|
|
30076
|
+
const poll = import_effect.Effect.suspend(
|
|
30077
|
+
() => effect.pipe(
|
|
30078
|
+
import_effect.Effect.flatMap(
|
|
30079
|
+
(a) => predicate(a) ? import_effect.Effect.succeed(a) : import_effect.Effect.sleep(interval).pipe(import_effect.Effect.andThen(poll))
|
|
30080
|
+
)
|
|
30081
|
+
)
|
|
30082
|
+
);
|
|
30083
|
+
return withTimeout(
|
|
30084
|
+
poll,
|
|
30085
|
+
opts.waitUpTo,
|
|
30086
|
+
() => new EventualConsistencyTimeout({
|
|
30087
|
+
message: `Eventual consistency timeout after ${formatDuration(opts.waitUpTo)}`
|
|
30088
|
+
})
|
|
30089
|
+
);
|
|
30090
|
+
}
|
|
30091
|
+
var CamundaEffect = class extends import_effect.Context.Service()(
|
|
30092
|
+
"CamundaEffect"
|
|
30093
|
+
) {
|
|
30094
|
+
};
|
|
30095
|
+
function layer(options) {
|
|
30096
|
+
return import_effect.Layer.sync(CamundaEffect, () => createCamundaEffectClient(options));
|
|
30080
30097
|
}
|
|
30081
30098
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30082
30099
|
0 && (module.exports = {
|
|
30083
|
-
|
|
30084
|
-
|
|
30085
|
-
|
|
30086
|
-
|
|
30087
|
-
|
|
30088
|
-
|
|
30089
|
-
|
|
30090
|
-
|
|
30100
|
+
CamundaEffect,
|
|
30101
|
+
CamundaGenericError,
|
|
30102
|
+
CamundaValidationError,
|
|
30103
|
+
EventualConsistencyTimeout,
|
|
30104
|
+
HttpError,
|
|
30105
|
+
createCamundaEffectClient,
|
|
30106
|
+
eventually,
|
|
30107
|
+
layer,
|
|
30108
|
+
retryWithBackoff,
|
|
30109
|
+
withTimeout
|
|
30091
30110
|
});
|
|
30092
30111
|
//# sourceMappingURL=index.cjs.map
|