@distilled.cloud/doppler 1.0.0-rc.12 → 1.0.0-rc.13
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/README.md +34 -0
- package/lib/credentials.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +4 -2
- package/lib/credentials.js.map +1 -1
- package/lib/protocol.d.ts +7 -4
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +16 -1
- package/lib/protocol.js.map +1 -1
- package/lib/response-validation.test.d.ts +4 -0
- package/lib/response-validation.test.d.ts.map +1 -0
- package/lib/response-validation.test.js +48 -0
- package/lib/response-validation.test.js.map +1 -0
- package/lib/services/doppler.d.ts +87 -15
- package/lib/services/doppler.d.ts.map +1 -1
- package/lib/services/doppler.js +97 -14
- package/lib/services/doppler.js.map +1 -1
- package/package.json +4 -4
- package/src/credentials.ts +5 -3
- package/src/protocol.ts +25 -4
- package/src/response-validation.test.ts +59 -0
- package/src/services/doppler.ts +230 -28
package/lib/services/doppler.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as Redacted from "effect/Redacted";
|
|
|
4
4
|
import * as API from "@distilled.cloud/core/api";
|
|
5
5
|
import * as C from "@distilled.cloud/core/category";
|
|
6
6
|
import * as T from "../traits.js";
|
|
7
|
-
import { DopplerProtocol, } from "../protocol.js";
|
|
7
|
+
import { DopplerProtocol, DopplerPublicProtocol, } from "../protocol.js";
|
|
8
8
|
import { UnknownDopplerError } from "../errors.js";
|
|
9
9
|
import * as Retry from "../retry.js";
|
|
10
10
|
export class BadRequest extends /*@__PURE__*/ /*@__PURE__*/ T.applyErrorMatchers(
|
|
@@ -158,11 +158,23 @@ export const AuthOidcRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
158
158
|
identifier: "AuthOidcRequest",
|
|
159
159
|
});
|
|
160
160
|
export const AuthOidcResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
161
|
-
token: S.
|
|
162
|
-
expires_at: S.
|
|
161
|
+
token: S.String.pipe(T.SensitiveValue({})),
|
|
162
|
+
expires_at: S.String,
|
|
163
163
|
})).annotate({
|
|
164
164
|
identifier: "AuthOidcResponse",
|
|
165
165
|
});
|
|
166
|
+
export const AuthorizeCliAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
167
|
+
code: S.String.pipe(T.SensitiveValue({})),
|
|
168
|
+
}).pipe(T.Http({ method: "POST", uri: "/v3/auth/cli/authorize", code: 200 }))).annotate({
|
|
169
|
+
identifier: "AuthorizeCliAuthRequest",
|
|
170
|
+
});
|
|
171
|
+
export const AuthorizeCliAuthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
172
|
+
token: S.String.pipe(T.SensitiveValue({})),
|
|
173
|
+
name: S.String,
|
|
174
|
+
dashboard_url: S.String,
|
|
175
|
+
})).annotate({
|
|
176
|
+
identifier: "AuthorizeCliAuthResponse",
|
|
177
|
+
});
|
|
166
178
|
export const CloneConfigRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
167
179
|
project: S.String,
|
|
168
180
|
config: S.String,
|
|
@@ -564,10 +576,28 @@ export const CreateIntegrationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
564
576
|
}).pipe(T.Http({ method: "POST", uri: "/v3/integrations", code: 200 }))).annotate({
|
|
565
577
|
identifier: "CreateIntegrationRequest",
|
|
566
578
|
});
|
|
579
|
+
export const CreateIntegrationResponseIntegrationFederationCase0 =
|
|
580
|
+
/*@__PURE__*/ S.suspend(() => S.Struct({
|
|
581
|
+
kind: S.String,
|
|
582
|
+
principal: S.String,
|
|
583
|
+
})).annotate({
|
|
584
|
+
identifier: "CreateIntegrationResponseIntegrationFederationCase0",
|
|
585
|
+
});
|
|
586
|
+
export const CreateIntegrationResponseIntegrationFederationCase1 =
|
|
587
|
+
/*@__PURE__*/ S.suspend(() => S.Struct({
|
|
588
|
+
kind: S.String,
|
|
589
|
+
issuer: S.String,
|
|
590
|
+
subject: S.String,
|
|
591
|
+
audience: S.String,
|
|
592
|
+
})).annotate({
|
|
593
|
+
identifier: "CreateIntegrationResponseIntegrationFederationCase1",
|
|
594
|
+
});
|
|
595
|
+
export const CreateIntegrationResponseIntegrationFederation = S.Unknown;
|
|
567
596
|
export const CreateIntegrationResponseIntegration = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
568
597
|
slug: S.optional(S.String),
|
|
569
598
|
name: S.optional(S.String),
|
|
570
599
|
type: S.optional(S.String),
|
|
600
|
+
federation: S.optional(S.NullOr(CreateIntegrationResponseIntegrationFederation)),
|
|
571
601
|
})).annotate({
|
|
572
602
|
identifier: "CreateIntegrationResponseIntegration",
|
|
573
603
|
});
|
|
@@ -828,8 +858,8 @@ export const DisableWebhookResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pi
|
|
|
828
858
|
export const DownloadSecretRequestFormat = S.String;
|
|
829
859
|
export const DownloadSecretRequestNameTransformer = S.String;
|
|
830
860
|
export const DownloadSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
831
|
-
project: S.String.pipe(T.Query()),
|
|
832
|
-
config: S.String.pipe(T.Query()),
|
|
861
|
+
project: S.optional(S.String.pipe(T.Query())),
|
|
862
|
+
config: S.optional(S.String.pipe(T.Query())),
|
|
833
863
|
format: S.optional(DownloadSecretRequestFormat.pipe(T.Query())),
|
|
834
864
|
name_transformer: S.optional(DownloadSecretRequestNameTransformer.pipe(T.Query())),
|
|
835
865
|
include_dynamic_secrets: S.optional(S.Boolean.pipe(T.Query())),
|
|
@@ -842,12 +872,8 @@ export const DownloadSecretRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
842
872
|
}))).annotate({
|
|
843
873
|
identifier: "DownloadSecretRequest",
|
|
844
874
|
});
|
|
845
|
-
export const
|
|
846
|
-
|
|
847
|
-
ALGOLIA: S.optional(S.String),
|
|
848
|
-
DATABASE: S.optional(S.String),
|
|
849
|
-
USER: S.optional(S.String),
|
|
850
|
-
})).annotate({
|
|
875
|
+
export const DownloadSecretResponseBodyMap = /*@__PURE__*/ S.Record(S.String, S.String);
|
|
876
|
+
export const DownloadSecretResponse = /*@__PURE__*/ S.suspend(() => DownloadSecretResponseBodyMap.pipe(T.RawResponseRoot())).annotate({
|
|
851
877
|
identifier: "DownloadSecretResponse",
|
|
852
878
|
});
|
|
853
879
|
export const DynamicSecretsIssueLeaseRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
@@ -900,6 +926,21 @@ export const EnableWebhookRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
900
926
|
export const EnableWebhookResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({
|
|
901
927
|
identifier: "EnableWebhookResponse",
|
|
902
928
|
});
|
|
929
|
+
export const GenerateCliAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
930
|
+
hostname: S.String.pipe(T.Query()),
|
|
931
|
+
version: S.String.pipe(T.Query()),
|
|
932
|
+
os: S.String.pipe(T.Query()),
|
|
933
|
+
arch: S.String.pipe(T.Query()),
|
|
934
|
+
}).pipe(T.Http({ method: "GET", uri: "/v3/auth/cli/generate/2", code: 200 }))).annotate({
|
|
935
|
+
identifier: "GenerateCliAuthRequest",
|
|
936
|
+
});
|
|
937
|
+
export const GenerateCliAuthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
938
|
+
code: S.String,
|
|
939
|
+
polling_code: S.String.pipe(T.SensitiveValue({})),
|
|
940
|
+
auth_url: S.String,
|
|
941
|
+
})).annotate({
|
|
942
|
+
identifier: "GenerateCliAuthResponse",
|
|
943
|
+
});
|
|
903
944
|
export const GetChangeRequestPolicyRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
904
945
|
slug: S.String.pipe(T.Label()),
|
|
905
946
|
}).pipe(T.Http({
|
|
@@ -986,9 +1027,19 @@ export const GetIntegrationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
986
1027
|
}).pipe(T.Http({ method: "GET", uri: "/v3/integrations/integration", code: 200 }))).annotate({
|
|
987
1028
|
identifier: "GetIntegrationRequest",
|
|
988
1029
|
});
|
|
989
|
-
export const
|
|
1030
|
+
export const GetIntegrationResponseIntegrationFederationCase0 = CreateIntegrationResponseIntegrationFederationCase0;
|
|
1031
|
+
export const GetIntegrationResponseIntegrationFederationCase1 = CreateIntegrationResponseIntegrationFederationCase1;
|
|
1032
|
+
export const GetIntegrationResponseIntegrationFederation = S.Unknown;
|
|
1033
|
+
export const GetIntegrationResponseIntegration = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
1034
|
+
slug: S.optional(S.String),
|
|
1035
|
+
name: S.optional(S.String),
|
|
1036
|
+
type: S.optional(S.String),
|
|
1037
|
+
federation: S.optional(S.NullOr(GetIntegrationResponseIntegrationFederation)),
|
|
1038
|
+
})).annotate({
|
|
1039
|
+
identifier: "GetIntegrationResponseIntegration",
|
|
1040
|
+
});
|
|
990
1041
|
export const GetIntegrationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
991
|
-
integration: S.optional(
|
|
1042
|
+
integration: S.optional(GetIntegrationResponseIntegration),
|
|
992
1043
|
})).annotate({
|
|
993
1044
|
identifier: "GetIntegrationResponse",
|
|
994
1045
|
});
|
|
@@ -2477,6 +2528,14 @@ export const RevokeAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
|
2477
2528
|
export const RevokeAuthResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
2478
2529
|
identifier: "RevokeAuthResponse",
|
|
2479
2530
|
});
|
|
2531
|
+
export const RevokeCliAuthRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
2532
|
+
token: S.String.pipe(T.SensitiveValue({})),
|
|
2533
|
+
}).pipe(T.Http({ method: "POST", uri: "/v3/auth/cli/revoke", code: 200 }))).annotate({
|
|
2534
|
+
identifier: "RevokeCliAuthRequest",
|
|
2535
|
+
});
|
|
2536
|
+
export const RevokeCliAuthResponse = /*@__PURE__*/ S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({
|
|
2537
|
+
identifier: "RevokeCliAuthResponse",
|
|
2538
|
+
});
|
|
2480
2539
|
export const SecretsNamesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
2481
2540
|
project: S.String.pipe(T.Query()),
|
|
2482
2541
|
config: S.String.pipe(T.Query()),
|
|
@@ -3311,7 +3370,15 @@ export const authOidc = /*@__PURE__*/ API.make(() => ({
|
|
|
3311
3370
|
input: AuthOidcRequest,
|
|
3312
3371
|
output: AuthOidcResponse,
|
|
3313
3372
|
errors: [UnknownDopplerError],
|
|
3314
|
-
protocol:
|
|
3373
|
+
protocol: DopplerPublicProtocol,
|
|
3374
|
+
retry: Retry.Retry,
|
|
3375
|
+
}));
|
|
3376
|
+
/** Doppler CLI browser authentication. Public endpoint; no bearer token required. Wire contract from DopplerHQ/cli pkg/http/api.go. */
|
|
3377
|
+
export const authorizeCliAuth = /*@__PURE__*/ API.make(() => ({
|
|
3378
|
+
input: AuthorizeCliAuthRequest,
|
|
3379
|
+
output: AuthorizeCliAuthResponse,
|
|
3380
|
+
errors: [Conflict, UnknownDopplerError],
|
|
3381
|
+
protocol: DopplerPublicProtocol,
|
|
3315
3382
|
retry: Retry.Retry,
|
|
3316
3383
|
}));
|
|
3317
3384
|
/** Clone Create a new branch config by cloning another. This duplicates a branch config and all its secrets. */
|
|
@@ -3584,6 +3651,14 @@ export const enableWebhook = /*@__PURE__*/ API.make(() => ({
|
|
|
3584
3651
|
protocol: DopplerProtocol,
|
|
3585
3652
|
retry: Retry.Retry,
|
|
3586
3653
|
}));
|
|
3654
|
+
/** Doppler CLI browser authentication. Public endpoint; no bearer token required. Wire contract from DopplerHQ/cli pkg/http/api.go. */
|
|
3655
|
+
export const generateCliAuth = /*@__PURE__*/ API.make(() => ({
|
|
3656
|
+
input: GenerateCliAuthRequest,
|
|
3657
|
+
output: GenerateCliAuthResponse,
|
|
3658
|
+
errors: [UnknownDopplerError],
|
|
3659
|
+
protocol: DopplerPublicProtocol,
|
|
3660
|
+
retry: Retry.Retry,
|
|
3661
|
+
}));
|
|
3587
3662
|
/** Retrieve Fetch an existing change request policy */
|
|
3588
3663
|
export const getChangeRequestPolicy = /*@__PURE__*/ API.make(() => ({
|
|
3589
3664
|
input: GetChangeRequestPolicyRequest,
|
|
@@ -4010,6 +4085,14 @@ export const revokeAuth = /*@__PURE__*/ API.make(() => ({
|
|
|
4010
4085
|
protocol: DopplerProtocol,
|
|
4011
4086
|
retry: Retry.Retry,
|
|
4012
4087
|
}));
|
|
4088
|
+
/** Doppler CLI browser authentication. Public endpoint; no bearer token required. Wire contract from DopplerHQ/cli pkg/http/api.go. */
|
|
4089
|
+
export const revokeCliAuth = /*@__PURE__*/ API.make(() => ({
|
|
4090
|
+
input: RevokeCliAuthRequest,
|
|
4091
|
+
output: RevokeCliAuthResponse,
|
|
4092
|
+
errors: [UnknownDopplerError],
|
|
4093
|
+
protocol: DopplerPublicProtocol,
|
|
4094
|
+
retry: Retry.Retry,
|
|
4095
|
+
}));
|
|
4013
4096
|
/** List Names Secret Names */
|
|
4014
4097
|
export const secretsNames = /*@__PURE__*/ API.make(() => ({
|
|
4015
4098
|
input: SecretsNamesRequest,
|