@impz/client 4.2.4 → 5.0.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/index.d.ts +70 -21
- package/dist/index.js +20 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12958,17 +12958,27 @@ declare const impContract: {
|
|
|
12958
12958
|
}>, ProcedureMeta & Record<never, never>>;
|
|
12959
12959
|
};
|
|
12960
12960
|
secrets: {
|
|
12961
|
-
add: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodObject<{
|
|
12961
|
+
add: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
12962
|
+
kind: import("zod").ZodLiteral<"static">;
|
|
12963
|
+
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
12964
|
+
host: import("zod").ZodString;
|
|
12965
|
+
header: import("zod").ZodString;
|
|
12966
|
+
scheme: import("zod").ZodEnum<{
|
|
12967
|
+
basic: "basic";
|
|
12968
|
+
bearer: "bearer";
|
|
12969
|
+
raw: "raw";
|
|
12970
|
+
}>;
|
|
12971
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12972
|
+
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
12973
|
+
}, import("zod/v4/core").$strip>>>;
|
|
12974
|
+
env: import("zod").ZodOptional<import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>>;
|
|
12962
12975
|
name: import("zod").ZodString;
|
|
12963
|
-
kind: import("zod").ZodEnum<{
|
|
12964
|
-
anthropic: "anthropic";
|
|
12965
|
-
custom: "custom";
|
|
12966
|
-
github: "github";
|
|
12967
|
-
npm: "npm";
|
|
12968
|
-
oauth: "oauth";
|
|
12969
|
-
}>;
|
|
12970
12976
|
value: import("zod").ZodString;
|
|
12971
|
-
|
|
12977
|
+
replace: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
12978
|
+
rebind: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
12979
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
12980
|
+
kind: import("zod").ZodLiteral<"oauth">;
|
|
12981
|
+
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
12972
12982
|
host: import("zod").ZodString;
|
|
12973
12983
|
header: import("zod").ZodString;
|
|
12974
12984
|
scheme: import("zod").ZodEnum<{
|
|
@@ -12979,24 +12989,62 @@ declare const impContract: {
|
|
|
12979
12989
|
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12980
12990
|
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
12981
12991
|
}, import("zod/v4/core").$strip>>>;
|
|
12982
|
-
|
|
12992
|
+
env: import("zod").ZodOptional<import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>>;
|
|
12993
|
+
oauth: import("zod").ZodObject<{
|
|
12983
12994
|
tokenUrl: import("zod").ZodURL;
|
|
12984
12995
|
clientId: import("zod").ZodString;
|
|
12985
12996
|
tokenFormat: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
12986
12997
|
form: "form";
|
|
12987
12998
|
json: "json";
|
|
12988
12999
|
}>>;
|
|
12989
|
-
}, import("zod/v4/core").$strip
|
|
13000
|
+
}, import("zod/v4/core").$strip>;
|
|
13001
|
+
name: import("zod").ZodString;
|
|
13002
|
+
value: import("zod").ZodString;
|
|
12990
13003
|
replace: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
12991
13004
|
rebind: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
12992
|
-
}, import("zod/v4/core").$
|
|
13005
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
13006
|
+
kind: import("zod").ZodOptional<import("zod").ZodUndefined>;
|
|
13007
|
+
preset: import("zod").ZodEnum<{
|
|
13008
|
+
anthropic: "anthropic";
|
|
13009
|
+
github: "github";
|
|
13010
|
+
npm: "npm";
|
|
13011
|
+
}>;
|
|
12993
13012
|
name: import("zod").ZodString;
|
|
13013
|
+
value: import("zod").ZodString;
|
|
13014
|
+
replace: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13015
|
+
rebind: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13016
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
12994
13017
|
kind: import("zod").ZodEnum<{
|
|
12995
13018
|
anthropic: "anthropic";
|
|
12996
|
-
custom: "custom";
|
|
12997
13019
|
github: "github";
|
|
12998
13020
|
npm: "npm";
|
|
13021
|
+
}>;
|
|
13022
|
+
name: import("zod").ZodString;
|
|
13023
|
+
value: import("zod").ZodString;
|
|
13024
|
+
replace: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13025
|
+
rebind: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13026
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
13027
|
+
kind: import("zod").ZodLiteral<"custom">;
|
|
13028
|
+
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
13029
|
+
host: import("zod").ZodString;
|
|
13030
|
+
header: import("zod").ZodString;
|
|
13031
|
+
scheme: import("zod").ZodEnum<{
|
|
13032
|
+
basic: "basic";
|
|
13033
|
+
bearer: "bearer";
|
|
13034
|
+
raw: "raw";
|
|
13035
|
+
}>;
|
|
13036
|
+
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13037
|
+
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
13038
|
+
}, import("zod/v4/core").$strip>>>;
|
|
13039
|
+
name: import("zod").ZodString;
|
|
13040
|
+
value: import("zod").ZodString;
|
|
13041
|
+
replace: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13042
|
+
rebind: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13043
|
+
}, import("zod/v4/core").$strict>], "kind">, import("zod").ZodObject<{
|
|
13044
|
+
name: import("zod").ZodString;
|
|
13045
|
+
kind: import("zod").ZodEnum<{
|
|
12999
13046
|
oauth: "oauth";
|
|
13047
|
+
static: "static";
|
|
13000
13048
|
}>;
|
|
13001
13049
|
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
13002
13050
|
host: import("zod").ZodString;
|
|
@@ -13009,6 +13057,7 @@ declare const impContract: {
|
|
|
13009
13057
|
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13010
13058
|
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
13011
13059
|
}, import("zod/v4/core").$strip>>>;
|
|
13060
|
+
env: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13012
13061
|
imps: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13013
13062
|
createdAt: import("zod").ZodDate;
|
|
13014
13063
|
oauth: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -13206,11 +13255,8 @@ declare const impContract: {
|
|
|
13206
13255
|
list: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, import("zod").ZodArray<import("zod").ZodObject<{
|
|
13207
13256
|
name: import("zod").ZodString;
|
|
13208
13257
|
kind: import("zod").ZodEnum<{
|
|
13209
|
-
anthropic: "anthropic";
|
|
13210
|
-
custom: "custom";
|
|
13211
|
-
github: "github";
|
|
13212
|
-
npm: "npm";
|
|
13213
13258
|
oauth: "oauth";
|
|
13259
|
+
static: "static";
|
|
13214
13260
|
}>;
|
|
13215
13261
|
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
13216
13262
|
host: import("zod").ZodString;
|
|
@@ -13223,6 +13269,7 @@ declare const impContract: {
|
|
|
13223
13269
|
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13224
13270
|
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
13225
13271
|
}, import("zod/v4/core").$strip>>>;
|
|
13272
|
+
env: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13226
13273
|
imps: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13227
13274
|
createdAt: import("zod").ZodDate;
|
|
13228
13275
|
oauth: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -13421,11 +13468,8 @@ declare const impContract: {
|
|
|
13421
13468
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
13422
13469
|
name: import("zod").ZodString;
|
|
13423
13470
|
kind: import("zod").ZodEnum<{
|
|
13424
|
-
anthropic: "anthropic";
|
|
13425
|
-
custom: "custom";
|
|
13426
|
-
github: "github";
|
|
13427
|
-
npm: "npm";
|
|
13428
13471
|
oauth: "oauth";
|
|
13472
|
+
static: "static";
|
|
13429
13473
|
}>;
|
|
13430
13474
|
rules: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodObject<{
|
|
13431
13475
|
host: import("zod").ZodString;
|
|
@@ -13438,6 +13482,7 @@ declare const impContract: {
|
|
|
13438
13482
|
user: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13439
13483
|
upstream: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>>;
|
|
13440
13484
|
}, import("zod/v4/core").$strip>>>;
|
|
13485
|
+
env: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13441
13486
|
imps: import("zod").ZodReadonly<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13442
13487
|
createdAt: import("zod").ZodDate;
|
|
13443
13488
|
oauth: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
@@ -17039,6 +17084,7 @@ declare const impContract: {
|
|
|
17039
17084
|
publicEgress: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17040
17085
|
oauthSecrets: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17041
17086
|
secretUpstream: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17087
|
+
secretPresets: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17042
17088
|
backupOptOut: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17043
17089
|
brokerRefusals: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17044
17090
|
grantFilters: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -17241,6 +17287,7 @@ declare const impContract: {
|
|
|
17241
17287
|
publicEgress: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17242
17288
|
oauthSecrets: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17243
17289
|
secretUpstream: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17290
|
+
secretPresets: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17244
17291
|
backupOptOut: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17245
17292
|
brokerRefusals: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
17246
17293
|
grantFilters: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -21542,6 +21589,7 @@ declare const SystemInfoSchema: z.ZodObject<{
|
|
|
21542
21589
|
publicEgress: z.ZodOptional<z.ZodBoolean>;
|
|
21543
21590
|
oauthSecrets: z.ZodOptional<z.ZodBoolean>;
|
|
21544
21591
|
secretUpstream: z.ZodOptional<z.ZodBoolean>;
|
|
21592
|
+
secretPresets: z.ZodOptional<z.ZodBoolean>;
|
|
21545
21593
|
backupOptOut: z.ZodOptional<z.ZodBoolean>;
|
|
21546
21594
|
brokerRefusals: z.ZodOptional<z.ZodBoolean>;
|
|
21547
21595
|
grantFilters: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -21572,6 +21620,7 @@ declare const SystemFeaturesInfoSchema: z.ZodObject<{
|
|
|
21572
21620
|
publicEgress: z.ZodOptional<z.ZodBoolean>;
|
|
21573
21621
|
oauthSecrets: z.ZodOptional<z.ZodBoolean>;
|
|
21574
21622
|
secretUpstream: z.ZodOptional<z.ZodBoolean>;
|
|
21623
|
+
secretPresets: z.ZodOptional<z.ZodBoolean>;
|
|
21575
21624
|
backupOptOut: z.ZodOptional<z.ZodBoolean>;
|
|
21576
21625
|
brokerRefusals: z.ZodOptional<z.ZodBoolean>;
|
|
21577
21626
|
grantFilters: z.ZodOptional<z.ZodBoolean>;
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { P, match } from "ts-pattern";
|
|
|
5
5
|
import pRetry, { AbortError } from "p-retry";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/check-server.ts
|
|
8
|
-
const CLIENT_VERSION = "
|
|
8
|
+
const CLIENT_VERSION = "5.0.0";
|
|
9
9
|
async function checkServer(rpc, options = {}) {
|
|
10
10
|
const signal = options.signal;
|
|
11
11
|
const callOptions = signal === void 0 ? {} : { signal };
|
|
@@ -426,18 +426,17 @@ const BrokerRuleSchema = z.object({
|
|
|
426
426
|
user: BasicUserSchema.optional(),
|
|
427
427
|
upstream: BrokerUpstreamSchema.optional()
|
|
428
428
|
});
|
|
429
|
-
|
|
429
|
+
z.enum([
|
|
430
430
|
"github",
|
|
431
431
|
"anthropic",
|
|
432
|
-
"npm"
|
|
433
|
-
"custom",
|
|
434
|
-
"oauth"
|
|
432
|
+
"npm"
|
|
435
433
|
]);
|
|
434
|
+
const SecretKindSchema = z.enum(["static", "oauth"]);
|
|
436
435
|
const OAuthStateSchema = z.object({
|
|
437
436
|
tokenUrl: z.url({ protocol: /^https$/u }).max(2048),
|
|
438
437
|
clientId: PrintableSchema.min(1).max(256),
|
|
439
438
|
tokenFormat: z.enum(["json", "form"]).default("form")
|
|
440
|
-
}).extend({
|
|
439
|
+
}, { error: (issue) => issue.input === void 0 ? "needs a token URL and a client id" : void 0 }).extend({
|
|
441
440
|
status: z.enum([
|
|
442
441
|
"pending",
|
|
443
442
|
"ready",
|
|
@@ -448,10 +447,24 @@ const OAuthStateSchema = z.object({
|
|
|
448
447
|
error: z.string().nullable(),
|
|
449
448
|
idClaims: z.record(z.string(), z.unknown()).readonly().nullable()
|
|
450
449
|
});
|
|
450
|
+
const BROKER_ENV_NAMES = [
|
|
451
|
+
"HTTPS_PROXY",
|
|
452
|
+
"https_proxy",
|
|
453
|
+
"NO_PROXY",
|
|
454
|
+
"no_proxy",
|
|
455
|
+
"NODE_USE_ENV_PROXY",
|
|
456
|
+
"SSL_CERT_FILE",
|
|
457
|
+
"NODE_EXTRA_CA_CERTS",
|
|
458
|
+
"GIT_SSL_CAINFO",
|
|
459
|
+
"REQUESTS_CA_BUNDLE",
|
|
460
|
+
"CURL_CA_BUNDLE"
|
|
461
|
+
];
|
|
462
|
+
const SecretEnvSchema = z.array(z.string().regex(/^[A-Z_][A-Z0-9_]{0,63}$/u, "must be an upper-case variable name").refine((name) => !BROKER_ENV_NAMES.includes(name), "must not be a variable the broker sets")).max(16).readonly();
|
|
451
463
|
z.object({
|
|
452
464
|
name: SecretNameSchema,
|
|
453
465
|
kind: SecretKindSchema,
|
|
454
466
|
rules: z.array(BrokerRuleSchema).readonly(),
|
|
467
|
+
env: SecretEnvSchema,
|
|
455
468
|
imps: z.array(NameSchema).readonly(),
|
|
456
469
|
createdAt: z.date(),
|
|
457
470
|
oauth: OAuthStateSchema.optional()
|
|
@@ -857,6 +870,7 @@ const FEATURE_GAPS = {
|
|
|
857
870
|
publicEgress: "is older than 0.35.0",
|
|
858
871
|
oauthSecrets: "has no oauth secrets",
|
|
859
872
|
secretUpstream: "has no secret upstreams",
|
|
873
|
+
secretPresets: "has no static secrets or presets",
|
|
860
874
|
backupOptOut: "has no backup opt-out",
|
|
861
875
|
brokerRefusals: "has no audit of refused broker requests",
|
|
862
876
|
grantFilters: "has no grant filters",
|