@smoothbricks/cli 0.11.19 → 0.11.21
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 +68 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +28 -4
- package/dist/lib/json.d.ts +22 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/json.js +15 -3
- package/dist/monorepo/cargo-policy.d.ts +17 -0
- package/dist/monorepo/cargo-policy.d.ts.map +1 -1
- package/dist/monorepo/cargo-policy.js +73 -1
- package/dist/monorepo/index.d.ts.map +1 -1
- package/dist/monorepo/index.js +4 -2
- package/dist/monorepo/packs/index.d.ts.map +1 -1
- package/dist/monorepo/packs/index.js +6 -2
- package/dist/nx/index.d.ts +6 -1
- package/dist/nx/index.d.ts.map +1 -1
- package/dist/nx/index.js +14 -1
- package/dist/secrets/commands.d.ts +9 -5
- package/dist/secrets/commands.d.ts.map +1 -1
- package/dist/secrets/commands.js +122 -49
- package/dist/secrets/index.d.ts +42 -56
- package/dist/secrets/index.d.ts.map +1 -1
- package/dist/secrets/index.js +52 -79
- package/dist/secrets/resolver.d.ts +59 -0
- package/dist/secrets/resolver.d.ts.map +1 -0
- package/dist/secrets/resolver.js +100 -0
- package/dist/secrets/run.d.ts +23 -0
- package/dist/secrets/run.d.ts.map +1 -0
- package/dist/secrets/run.js +130 -0
- package/dist/secrets/status.d.ts +177 -0
- package/dist/secrets/status.d.ts.map +1 -0
- package/dist/secrets/status.js +724 -0
- package/dist/wrangler/deploy-stage.d.ts +1 -1
- package/dist/wrangler/deploy-stage.d.ts.map +1 -1
- package/dist/wrangler/deploy-stage.js +22 -20
- package/dist/wrangler/deployed-version.d.ts.map +1 -1
- package/dist/wrangler/deployed-version.js +7 -12
- package/dist/wrangler/flat-config.d.ts +1 -4
- package/dist/wrangler/flat-config.d.ts.map +1 -1
- package/dist/wrangler/flat-config.js +98 -44
- package/dist/wrangler/prepare-env.d.ts +4 -3
- package/dist/wrangler/prepare-env.d.ts.map +1 -1
- package/dist/wrangler/prepare-env.js +7 -5
- package/dist/wrangler/source-config.d.ts +24 -0
- package/dist/wrangler/source-config.d.ts.map +1 -0
- package/dist/wrangler/source-config.js +110 -0
- package/dist/wrangler/stage.d.ts +55 -23
- package/dist/wrangler/stage.d.ts.map +1 -1
- package/dist/wrangler/stage.js +81 -162
- package/managed/raw/tooling/direnv/devenv.smoo.nix +19 -3
- package/managed/raw/tooling/direnv/secret-references.ts +280 -76
- package/managed/raw/tooling/direnv/setup-environment.ts +58 -2
- package/managed/raw/tsconfig.lib.json +28 -0
- package/package.json +7 -2
- package/src/cli.ts +34 -5
- package/src/lib/json.ts +23 -1
- package/src/monorepo/cargo-policy.test.ts +91 -1
- package/src/monorepo/cargo-policy.ts +87 -1
- package/src/monorepo/index.ts +8 -2
- package/src/monorepo/package-policy.test.ts +50 -19
- package/src/monorepo/packs/index.ts +10 -2
- package/src/monorepo/secret-references.test.ts +412 -6
- package/src/monorepo/setup-environment.test.ts +181 -0
- package/src/nx/index.test.ts +8 -2
- package/src/nx/index.ts +20 -2
- package/src/secrets/commands.test.ts +186 -4
- package/src/secrets/commands.ts +142 -51
- package/src/secrets/index.test.ts +4 -10
- package/src/secrets/index.ts +54 -115
- package/src/secrets/resolver.ts +130 -0
- package/src/secrets/run.test.ts +359 -0
- package/src/secrets/run.ts +148 -0
- package/src/secrets/status.test.ts +164 -0
- package/src/secrets/status.ts +297 -0
- package/src/wrangler/deploy-stage.test.ts +95 -2
- package/src/wrangler/deploy-stage.ts +26 -23
- package/src/wrangler/deployed-version.ts +7 -11
- package/src/wrangler/flat-config.test.ts +9 -4
- package/src/wrangler/flat-config.ts +1 -20
- package/src/wrangler/format-parity.test.ts +433 -0
- package/src/wrangler/prepare-env.ts +7 -5
- package/src/wrangler/source-config.test.ts +102 -0
- package/src/wrangler/source-config.ts +110 -0
- package/src/wrangler/stage.test.ts +61 -32
- package/src/wrangler/stage.ts +124 -173
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import * as _assertGuard_1 from "typia/lib/internal/_assertGuard";
|
|
2
|
+
import * as _jsonStringifyNumber_1 from "typia/lib/internal/_jsonStringifyNumber";
|
|
3
|
+
import * as _jsonStringifyArray_1 from "typia/lib/internal/_jsonStringifyArray";
|
|
4
|
+
import * as _jsonStringifyString_1 from "typia/lib/internal/_jsonStringifyString";
|
|
5
|
+
import * as _throwTypeGuardError_1 from "typia/lib/internal/_throwTypeGuardError";
|
|
6
|
+
import * as _validateReport_1 from "typia/lib/internal/_validateReport";
|
|
7
|
+
/**
|
|
8
|
+
* The value model behind `smoo secrets`: one row per secret name, reconciled
|
|
9
|
+
* from every source that has an opinion about it, plus the machine-readable
|
|
10
|
+
* document `smoo secrets status --json` emits.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is pure and depends on nothing but typia, which is what lets
|
|
13
|
+
* `@smoothbricks/cli/secrets` be imported for the types alone — a consumer
|
|
14
|
+
* driving a UI or a repository's own operations CLI gets the document type and
|
|
15
|
+
* a validator without pulling in `gh`, the filesystem readers, or commander.
|
|
16
|
+
* The readers that produce these facts live in ./index.ts; the operator
|
|
17
|
+
* commands that print them live in ./commands.ts.
|
|
18
|
+
*/
|
|
19
|
+
import typia from 'typia';
|
|
20
|
+
/**
|
|
21
|
+
* One row per name known to any source, sorted, so a reader sees the whole
|
|
22
|
+
* picture rather than one source's view of it.
|
|
23
|
+
*/
|
|
24
|
+
export function reconcileSecrets(sources) {
|
|
25
|
+
const declaredByAnyWorker = Object.values(sources.workerSecrets).flatMap((names) => [...names]);
|
|
26
|
+
const localSecrets = new Map(sources.localSecrets.map((secret) => [secret.name, secret]));
|
|
27
|
+
const names = new Set([...declaredByAnyWorker, ...sources.workflowSecrets, ...localSecrets.keys()]);
|
|
28
|
+
// A repository secret that already carries a known env name is that name's
|
|
29
|
+
// row, not a row of its own: listing ACME_GITHUB_CLIENT_SECRET beside
|
|
30
|
+
// GITHUB_CLIENT_SECRET would report one value as two secrets, one of them
|
|
31
|
+
// permanently "declared by nothing".
|
|
32
|
+
const carriesKnownEnvName = new Set(names.size > 0 ? [...names].map((name) => sources.secretNames[name] ?? name) : []);
|
|
33
|
+
// A value only an environment holds is still a value: leaving it out of the
|
|
34
|
+
// rows is how an operator ends up hunting for a secret that is already set.
|
|
35
|
+
const addUndeclared = (secret) => {
|
|
36
|
+
if (!carriesKnownEnvName.has(secret))
|
|
37
|
+
names.add(secret);
|
|
38
|
+
};
|
|
39
|
+
for (const secret of sources.repositorySecrets)
|
|
40
|
+
addUndeclared(secret);
|
|
41
|
+
for (const held of Object.values(sources.environmentSecrets ?? {})) {
|
|
42
|
+
for (const secret of held)
|
|
43
|
+
addUndeclared(secret);
|
|
44
|
+
}
|
|
45
|
+
return [...names]
|
|
46
|
+
.sort((left, right) => left.localeCompare(right))
|
|
47
|
+
.map((name) => {
|
|
48
|
+
const local = localSecrets.get(name);
|
|
49
|
+
return {
|
|
50
|
+
name,
|
|
51
|
+
repositorySecret: sources.secretNames[name] ?? name,
|
|
52
|
+
declaredByWorkers: Object.entries(sources.workerSecrets)
|
|
53
|
+
.filter(([, declared]) => declared.includes(name))
|
|
54
|
+
.map(([label]) => label)
|
|
55
|
+
.sort((left, right) => left.localeCompare(right)),
|
|
56
|
+
suppliedByWorkflow: sources.workflowSecrets.includes(name),
|
|
57
|
+
fetchableLocally: local !== undefined,
|
|
58
|
+
...(local === undefined ? {} : { localGroup: { resolves: local.group, derived: local.derivedGroup } }),
|
|
59
|
+
onRepository: sources.repositorySecrets.includes(sources.secretNames[name] ?? name),
|
|
60
|
+
heldByEnvironment: Object.entries(sources.environmentSecrets ?? {})
|
|
61
|
+
.filter(([, held]) => held.includes(sources.secretNames[name] ?? name))
|
|
62
|
+
.map(([environment]) => environment)
|
|
63
|
+
.sort((left, right) => left.localeCompare(right)),
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The rows a CI deploy cannot satisfy: a Worker declares the name, a workflow
|
|
69
|
+
* promises to pass it, and the repository has no value to pass. Reported
|
|
70
|
+
* separately from "declared but not wired into any workflow", because the
|
|
71
|
+
* remedies differ — set a secret, versus declare it in `smoo.github`.
|
|
72
|
+
*/
|
|
73
|
+
export function unsatisfiedSecrets(rows, boundEnvironments = []) {
|
|
74
|
+
return rows.filter((row) => {
|
|
75
|
+
if (!row.suppliedByWorkflow)
|
|
76
|
+
return false;
|
|
77
|
+
if (row.onRepository)
|
|
78
|
+
return false;
|
|
79
|
+
// With no environment bound, the repository is the only scope a job reads.
|
|
80
|
+
// With environments bound, each one can carry the value instead - so the
|
|
81
|
+
// name is satisfied only when every bound environment holds it.
|
|
82
|
+
if (boundEnvironments.length === 0)
|
|
83
|
+
return true;
|
|
84
|
+
return !boundEnvironments.every((environment) => row.heldByEnvironment.includes(environment));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/** Bound environments that lack their own value and cannot fall back to the repository. */
|
|
88
|
+
export function environmentsMissing(row, boundEnvironments) {
|
|
89
|
+
if (row.onRepository)
|
|
90
|
+
return [];
|
|
91
|
+
return boundEnvironments.filter((environment) => !row.heldByEnvironment.includes(environment));
|
|
92
|
+
}
|
|
93
|
+
/** Worker-declared names no managed workflow passes: a CI deploy will run without them. */
|
|
94
|
+
export function unwiredSecrets(rows) {
|
|
95
|
+
return rows.filter((row) => row.declaredByWorkers.length > 0 && !row.suppliedByWorkflow);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Every stage a scope can name, in the order the document lists them. A
|
|
99
|
+
* declared secret absent from `smoo.wrangler.secretStages` belongs to all of
|
|
100
|
+
* them, which is the rule this constant spells out exactly once.
|
|
101
|
+
*/
|
|
102
|
+
const EVERY_STAGE = ['preview', 'production', 'staging'];
|
|
103
|
+
/**
|
|
104
|
+
* The stages that require a value for one name: the union over every worker
|
|
105
|
+
* declaring it, since a name two projects share must exist wherever either of
|
|
106
|
+
* them deploys.
|
|
107
|
+
*/
|
|
108
|
+
function requiredByStages(name, workers, stageScopes) {
|
|
109
|
+
const required = new Set();
|
|
110
|
+
for (const worker of workers) {
|
|
111
|
+
const scoped = stageScopes[worker]?.[name];
|
|
112
|
+
// No scope declared for a name the worker declares is "every stage": the
|
|
113
|
+
// map is an exception list, not a registry.
|
|
114
|
+
for (const stage of scoped ?? EVERY_STAGE)
|
|
115
|
+
required.add(stage);
|
|
116
|
+
}
|
|
117
|
+
return EVERY_STAGE.filter((stage) => required.has(stage));
|
|
118
|
+
}
|
|
119
|
+
/** The document, from facts. Pure: every read happened before this was called. */
|
|
120
|
+
export function projectSecretsStatus(facts) {
|
|
121
|
+
const secrets = facts.rows.map((row) => ({
|
|
122
|
+
...row,
|
|
123
|
+
requiredByStages: requiredByStages(row.name, row.declaredByWorkers, facts.stageScopes),
|
|
124
|
+
}));
|
|
125
|
+
// Only an environment a workflow binds *and* `gh` could list is a scope a job
|
|
126
|
+
// is known to read: an unreadable one is unknown, not empty.
|
|
127
|
+
const bound = facts.environments
|
|
128
|
+
.filter((environment) => environment.bound && environment.readable)
|
|
129
|
+
.map((environment) => environment.name);
|
|
130
|
+
return {
|
|
131
|
+
version: 1,
|
|
132
|
+
repository: facts.repository,
|
|
133
|
+
environments: [...facts.environments],
|
|
134
|
+
secrets,
|
|
135
|
+
unsatisfied: unsatisfiedSecrets(secrets, bound).map((row) => ({
|
|
136
|
+
name: row.name,
|
|
137
|
+
repositorySecret: row.repositorySecret,
|
|
138
|
+
missingIn: environmentsMissing(row, bound),
|
|
139
|
+
})),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The consumer's boundary: text off a `smoo secrets status --json` run into a
|
|
144
|
+
* validated document, or typia's own account of every field that disagreed.
|
|
145
|
+
*/
|
|
146
|
+
export const parseSecretsStatusDocument = (() => {
|
|
147
|
+
const _ip0 = input => "number" === typeof input["secretCount"];
|
|
148
|
+
const _ip1 = input => "string" === typeof input["name"];
|
|
149
|
+
const _ip2 = input => "boolean" === typeof input["bound"];
|
|
150
|
+
const _ip3 = input => "string" === typeof input["repositorySecret"];
|
|
151
|
+
const _ve0 = "({ name: string; bound: boolean; readable: false; reason: string; } | { name: string; bound: boolean; readable: true; secretCount: number; })";
|
|
152
|
+
const _vp0 = (input, _path, _exceptionable = true) => "number" === typeof input["secretCount"] || _report(_exceptionable, {
|
|
153
|
+
path: _path + ".secretCount",
|
|
154
|
+
expected: "number",
|
|
155
|
+
value: input["secretCount"]
|
|
156
|
+
});
|
|
157
|
+
const _vp1 = (input, _path, _exceptionable = true) => "string" === typeof input["name"] || _report(_exceptionable, {
|
|
158
|
+
path: _path + ".name",
|
|
159
|
+
expected: "string",
|
|
160
|
+
value: input["name"]
|
|
161
|
+
});
|
|
162
|
+
const _vp2 = (input, _path, _exceptionable = true) => "boolean" === typeof input["bound"] || _report(_exceptionable, {
|
|
163
|
+
path: _path + ".bound",
|
|
164
|
+
expected: "boolean",
|
|
165
|
+
value: input["bound"]
|
|
166
|
+
});
|
|
167
|
+
const _vp3 = (input, _path, _exceptionable = true) => "string" === typeof input["repositorySecret"] || _report(_exceptionable, {
|
|
168
|
+
path: _path + ".repositorySecret",
|
|
169
|
+
expected: "string",
|
|
170
|
+
value: input["repositorySecret"]
|
|
171
|
+
});
|
|
172
|
+
const _ve1 = "({ name: string; bound: boolean; readable: true; secretCount: number; } | { name: string; bound: boolean; readable: false; reason: string; })";
|
|
173
|
+
const _io0 = input => 1 === input.version && ("object" === typeof input.repository && null !== input.repository && _io1(input.repository)) && (Array.isArray(input.environments) && input.environments.every(elem => "object" === typeof elem && null !== elem && _iu0(elem))) && (Array.isArray(input.secrets) && input.secrets.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && (Array.isArray(input.unsatisfied) && input.unsatisfied.every(elem => "object" === typeof elem && null !== elem && _io6(elem)));
|
|
174
|
+
const _io1 = input => "string" === typeof input.repo && "string" === typeof input.source && _ip0(input);
|
|
175
|
+
const _io2 = input => _ip1(input) && _ip2(input) && true === input.readable && _ip0(input);
|
|
176
|
+
const _io3 = input => _ip1(input) && _ip2(input) && false === input.readable && "string" === typeof input.reason;
|
|
177
|
+
const _io4 = input => _ip1(input) && _ip3(input) && (Array.isArray(input.declaredByWorkers) && input.declaredByWorkers.every(elem => "string" === typeof elem)) && "boolean" === typeof input.suppliedByWorkflow && "boolean" === typeof input.fetchableLocally && (undefined === input.localGroup || "object" === typeof input.localGroup && null !== input.localGroup && _io5(input.localGroup)) && "boolean" === typeof input.onRepository && (Array.isArray(input.heldByEnvironment) && input.heldByEnvironment.every(elem => "string" === typeof elem)) && (Array.isArray(input.requiredByStages) && input.requiredByStages.every(elem => "preview" === elem || "production" === elem || "staging" === elem));
|
|
178
|
+
const _io5 = input => "string" === typeof input.resolves && "string" === typeof input.derived;
|
|
179
|
+
const _io6 = input => _ip1(input) && _ip3(input) && (Array.isArray(input.missingIn) && input.missingIn.every(elem => "string" === typeof elem));
|
|
180
|
+
const _iu0 = input => (() => {
|
|
181
|
+
if (true === input.readable)
|
|
182
|
+
return _io2(input);
|
|
183
|
+
else if (false === input.readable)
|
|
184
|
+
return _io3(input);
|
|
185
|
+
else
|
|
186
|
+
return false;
|
|
187
|
+
})();
|
|
188
|
+
const _vo0 = (input, _path, _exceptionable = true) => [1 === input.version || _report(_exceptionable, {
|
|
189
|
+
path: _path + ".version",
|
|
190
|
+
expected: "1",
|
|
191
|
+
value: input.version
|
|
192
|
+
}), ("object" === typeof input.repository && null !== input.repository || _report(_exceptionable, {
|
|
193
|
+
path: _path + ".repository",
|
|
194
|
+
expected: "SecretsStatusRepository",
|
|
195
|
+
value: input.repository
|
|
196
|
+
})) && _vo1(input.repository, _path + ".repository", true && _exceptionable) || _report(_exceptionable, {
|
|
197
|
+
path: _path + ".repository",
|
|
198
|
+
expected: "SecretsStatusRepository",
|
|
199
|
+
value: input.repository
|
|
200
|
+
}), (Array.isArray(input.environments) || _report(_exceptionable, {
|
|
201
|
+
path: _path + ".environments",
|
|
202
|
+
expected: "Array<SecretsStatusEnvironment>",
|
|
203
|
+
value: input.environments
|
|
204
|
+
})) && input.environments.map((elem, _index8) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
205
|
+
path: _path + ".environments[" + _index8 + "]",
|
|
206
|
+
expected: _ve0,
|
|
207
|
+
value: elem
|
|
208
|
+
})) && _vu0(elem, _path + ".environments[" + _index8 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
209
|
+
path: _path + ".environments[" + _index8 + "]",
|
|
210
|
+
expected: _ve0,
|
|
211
|
+
value: elem
|
|
212
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
213
|
+
path: _path + ".environments",
|
|
214
|
+
expected: "Array<SecretsStatusEnvironment>",
|
|
215
|
+
value: input.environments
|
|
216
|
+
}), (Array.isArray(input.secrets) || _report(_exceptionable, {
|
|
217
|
+
path: _path + ".secrets",
|
|
218
|
+
expected: "Array<SecretsStatusRow>",
|
|
219
|
+
value: input.secrets
|
|
220
|
+
})) && input.secrets.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
221
|
+
path: _path + ".secrets[" + _index9 + "]",
|
|
222
|
+
expected: "SecretsStatusRow",
|
|
223
|
+
value: elem
|
|
224
|
+
})) && _vo4(elem, _path + ".secrets[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
225
|
+
path: _path + ".secrets[" + _index9 + "]",
|
|
226
|
+
expected: "SecretsStatusRow",
|
|
227
|
+
value: elem
|
|
228
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
229
|
+
path: _path + ".secrets",
|
|
230
|
+
expected: "Array<SecretsStatusRow>",
|
|
231
|
+
value: input.secrets
|
|
232
|
+
}), (Array.isArray(input.unsatisfied) || _report(_exceptionable, {
|
|
233
|
+
path: _path + ".unsatisfied",
|
|
234
|
+
expected: "Array<UnsatisfiedSecret>",
|
|
235
|
+
value: input.unsatisfied
|
|
236
|
+
})) && input.unsatisfied.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
237
|
+
path: _path + ".unsatisfied[" + _index10 + "]",
|
|
238
|
+
expected: "UnsatisfiedSecret",
|
|
239
|
+
value: elem
|
|
240
|
+
})) && _vo6(elem, _path + ".unsatisfied[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
241
|
+
path: _path + ".unsatisfied[" + _index10 + "]",
|
|
242
|
+
expected: "UnsatisfiedSecret",
|
|
243
|
+
value: elem
|
|
244
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
245
|
+
path: _path + ".unsatisfied",
|
|
246
|
+
expected: "Array<UnsatisfiedSecret>",
|
|
247
|
+
value: input.unsatisfied
|
|
248
|
+
})].every(flag => flag);
|
|
249
|
+
const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.repo || _report(_exceptionable, {
|
|
250
|
+
path: _path + ".repo",
|
|
251
|
+
expected: "string",
|
|
252
|
+
value: input.repo
|
|
253
|
+
}), "string" === typeof input.source || _report(_exceptionable, {
|
|
254
|
+
path: _path + ".source",
|
|
255
|
+
expected: "string",
|
|
256
|
+
value: input.source
|
|
257
|
+
}), _vp0(input, _path, true && _exceptionable)].every(flag => flag);
|
|
258
|
+
const _vo2 = (input, _path, _exceptionable = true) => [_vp1(input, _path, true && _exceptionable), _vp2(input, _path, true && _exceptionable), true === input.readable || _report(_exceptionable, {
|
|
259
|
+
path: _path + ".readable",
|
|
260
|
+
expected: "true",
|
|
261
|
+
value: input.readable
|
|
262
|
+
}), _vp0(input, _path, true && _exceptionable)].every(flag => flag);
|
|
263
|
+
const _vo3 = (input, _path, _exceptionable = true) => [_vp1(input, _path, true && _exceptionable), _vp2(input, _path, true && _exceptionable), false === input.readable || _report(_exceptionable, {
|
|
264
|
+
path: _path + ".readable",
|
|
265
|
+
expected: "false",
|
|
266
|
+
value: input.readable
|
|
267
|
+
}), "string" === typeof input.reason || _report(_exceptionable, {
|
|
268
|
+
path: _path + ".reason",
|
|
269
|
+
expected: "string",
|
|
270
|
+
value: input.reason
|
|
271
|
+
})].every(flag => flag);
|
|
272
|
+
const _vo4 = (input, _path, _exceptionable = true) => [_vp1(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), (Array.isArray(input.declaredByWorkers) || _report(_exceptionable, {
|
|
273
|
+
path: _path + ".declaredByWorkers",
|
|
274
|
+
expected: "Array<string>",
|
|
275
|
+
value: input.declaredByWorkers
|
|
276
|
+
})) && input.declaredByWorkers.map((elem, _index11) => "string" === typeof elem || _report(_exceptionable, {
|
|
277
|
+
path: _path + ".declaredByWorkers[" + _index11 + "]",
|
|
278
|
+
expected: "string",
|
|
279
|
+
value: elem
|
|
280
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
281
|
+
path: _path + ".declaredByWorkers",
|
|
282
|
+
expected: "Array<string>",
|
|
283
|
+
value: input.declaredByWorkers
|
|
284
|
+
}), "boolean" === typeof input.suppliedByWorkflow || _report(_exceptionable, {
|
|
285
|
+
path: _path + ".suppliedByWorkflow",
|
|
286
|
+
expected: "boolean",
|
|
287
|
+
value: input.suppliedByWorkflow
|
|
288
|
+
}), "boolean" === typeof input.fetchableLocally || _report(_exceptionable, {
|
|
289
|
+
path: _path + ".fetchableLocally",
|
|
290
|
+
expected: "boolean",
|
|
291
|
+
value: input.fetchableLocally
|
|
292
|
+
}), undefined === input.localGroup || ("object" === typeof input.localGroup && null !== input.localGroup || _report(_exceptionable, {
|
|
293
|
+
path: _path + ".localGroup",
|
|
294
|
+
expected: "(undefined | { resolves: string; derived: string; })",
|
|
295
|
+
value: input.localGroup
|
|
296
|
+
})) && _vo5(input.localGroup, _path + ".localGroup", true && _exceptionable) || _report(_exceptionable, {
|
|
297
|
+
path: _path + ".localGroup",
|
|
298
|
+
expected: "(undefined | { resolves: string; derived: string; })",
|
|
299
|
+
value: input.localGroup
|
|
300
|
+
}), "boolean" === typeof input.onRepository || _report(_exceptionable, {
|
|
301
|
+
path: _path + ".onRepository",
|
|
302
|
+
expected: "boolean",
|
|
303
|
+
value: input.onRepository
|
|
304
|
+
}), (Array.isArray(input.heldByEnvironment) || _report(_exceptionable, {
|
|
305
|
+
path: _path + ".heldByEnvironment",
|
|
306
|
+
expected: "Array<string>",
|
|
307
|
+
value: input.heldByEnvironment
|
|
308
|
+
})) && input.heldByEnvironment.map((elem, _index12) => "string" === typeof elem || _report(_exceptionable, {
|
|
309
|
+
path: _path + ".heldByEnvironment[" + _index12 + "]",
|
|
310
|
+
expected: "string",
|
|
311
|
+
value: elem
|
|
312
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
313
|
+
path: _path + ".heldByEnvironment",
|
|
314
|
+
expected: "Array<string>",
|
|
315
|
+
value: input.heldByEnvironment
|
|
316
|
+
}), (Array.isArray(input.requiredByStages) || _report(_exceptionable, {
|
|
317
|
+
path: _path + ".requiredByStages",
|
|
318
|
+
expected: "Array<SecretStageScope>",
|
|
319
|
+
value: input.requiredByStages
|
|
320
|
+
})) && input.requiredByStages.map((elem, _index13) => "preview" === elem || "production" === elem || "staging" === elem || _report(_exceptionable, {
|
|
321
|
+
path: _path + ".requiredByStages[" + _index13 + "]",
|
|
322
|
+
expected: "(\"preview\" | \"production\" | \"staging\")",
|
|
323
|
+
value: elem
|
|
324
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
325
|
+
path: _path + ".requiredByStages",
|
|
326
|
+
expected: "Array<SecretStageScope>",
|
|
327
|
+
value: input.requiredByStages
|
|
328
|
+
})].every(flag => flag);
|
|
329
|
+
const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.resolves || _report(_exceptionable, {
|
|
330
|
+
path: _path + ".resolves",
|
|
331
|
+
expected: "string",
|
|
332
|
+
value: input.resolves
|
|
333
|
+
}), "string" === typeof input.derived || _report(_exceptionable, {
|
|
334
|
+
path: _path + ".derived",
|
|
335
|
+
expected: "string",
|
|
336
|
+
value: input.derived
|
|
337
|
+
})].every(flag => flag);
|
|
338
|
+
const _vo6 = (input, _path, _exceptionable = true) => [_vp1(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), (Array.isArray(input.missingIn) || _report(_exceptionable, {
|
|
339
|
+
path: _path + ".missingIn",
|
|
340
|
+
expected: "Array<string>",
|
|
341
|
+
value: input.missingIn
|
|
342
|
+
})) && input.missingIn.map((elem, _index14) => "string" === typeof elem || _report(_exceptionable, {
|
|
343
|
+
path: _path + ".missingIn[" + _index14 + "]",
|
|
344
|
+
expected: "string",
|
|
345
|
+
value: elem
|
|
346
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
347
|
+
path: _path + ".missingIn",
|
|
348
|
+
expected: "Array<string>",
|
|
349
|
+
value: input.missingIn
|
|
350
|
+
})].every(flag => flag);
|
|
351
|
+
const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
352
|
+
if (true === input.readable)
|
|
353
|
+
return _vo2(input, _path, true && _exceptionable);
|
|
354
|
+
else if (false === input.readable)
|
|
355
|
+
return _vo3(input, _path, true && _exceptionable);
|
|
356
|
+
else
|
|
357
|
+
return _report(_exceptionable, {
|
|
358
|
+
path: _path,
|
|
359
|
+
expected: _ve1,
|
|
360
|
+
value: input
|
|
361
|
+
});
|
|
362
|
+
})();
|
|
363
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
364
|
+
let errors;
|
|
365
|
+
let _report;
|
|
366
|
+
const __validate = input => {
|
|
367
|
+
if (false === __is(input)) {
|
|
368
|
+
errors = [];
|
|
369
|
+
_report = _validateReport_1._validateReport(errors);
|
|
370
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
371
|
+
path: _path + "",
|
|
372
|
+
expected: "SecretsStatusDocument",
|
|
373
|
+
value: input
|
|
374
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
375
|
+
path: _path + "",
|
|
376
|
+
expected: "SecretsStatusDocument",
|
|
377
|
+
value: input
|
|
378
|
+
}))(input, "$input", true);
|
|
379
|
+
const success = 0 === errors.length;
|
|
380
|
+
return success ? {
|
|
381
|
+
success,
|
|
382
|
+
data: input
|
|
383
|
+
} : {
|
|
384
|
+
success,
|
|
385
|
+
errors,
|
|
386
|
+
data: input
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
success: true,
|
|
391
|
+
data: input
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
return input => __validate(JSON.parse(input));
|
|
395
|
+
})();
|
|
396
|
+
/**
|
|
397
|
+
* The emitter's boundary: the projection is checked against its declared type
|
|
398
|
+
* before it becomes text. A shape bug then fails here, naming the field, rather
|
|
399
|
+
* than reaching a consumer as a document its validator rejects with no idea who
|
|
400
|
+
* produced it.
|
|
401
|
+
*/
|
|
402
|
+
export const stringifySecretsStatusDocument = (() => {
|
|
403
|
+
const _ip0 = input => "number" === typeof input["secretCount"] && Number.isFinite(input["secretCount"]);
|
|
404
|
+
const _ip1 = input => "string" === typeof input["name"];
|
|
405
|
+
const _ip2 = input => "boolean" === typeof input["bound"];
|
|
406
|
+
const _ip3 = input => "string" === typeof input["repositorySecret"];
|
|
407
|
+
const _ae0 = "({ name: string; bound: boolean; readable: false; reason: string; } | { name: string; bound: boolean; readable: true; secretCount: number; })";
|
|
408
|
+
const _ap0 = (input, _path, _exceptionable = true) => "number" === typeof input["secretCount"] && Number.isFinite(input["secretCount"]) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
409
|
+
method: "typia.json.createAssertStringify",
|
|
410
|
+
path: _path + ".secretCount",
|
|
411
|
+
expected: "number",
|
|
412
|
+
value: input["secretCount"]
|
|
413
|
+
}, _errorFactory);
|
|
414
|
+
const _ap1 = (input, _path, _exceptionable = true) => "string" === typeof input["name"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
415
|
+
method: "typia.json.createAssertStringify",
|
|
416
|
+
path: _path + ".name",
|
|
417
|
+
expected: "string",
|
|
418
|
+
value: input["name"]
|
|
419
|
+
}, _errorFactory);
|
|
420
|
+
const _ap2 = (input, _path, _exceptionable = true) => "boolean" === typeof input["bound"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
421
|
+
method: "typia.json.createAssertStringify",
|
|
422
|
+
path: _path + ".bound",
|
|
423
|
+
expected: "boolean",
|
|
424
|
+
value: input["bound"]
|
|
425
|
+
}, _errorFactory);
|
|
426
|
+
const _ap3 = (input, _path, _exceptionable = true) => "string" === typeof input["repositorySecret"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
427
|
+
method: "typia.json.createAssertStringify",
|
|
428
|
+
path: _path + ".repositorySecret",
|
|
429
|
+
expected: "string",
|
|
430
|
+
value: input["repositorySecret"]
|
|
431
|
+
}, _errorFactory);
|
|
432
|
+
const _ae1 = "({ name: string; bound: boolean; readable: true; secretCount: number; } | { name: string; bound: boolean; readable: false; reason: string; })";
|
|
433
|
+
const _sip0 = input => "number" === typeof input["secretCount"];
|
|
434
|
+
const _sip1 = input => "string" === typeof input["name"];
|
|
435
|
+
const _sip2 = input => "boolean" === typeof input["bound"];
|
|
436
|
+
const _sip3 = input => "string" === typeof input["repositorySecret"];
|
|
437
|
+
const _ao0 = (input, _path, _exceptionable = true) => (1 === input.version || _assertGuard_1._assertGuard(_exceptionable, {
|
|
438
|
+
method: "typia.json.createAssertStringify",
|
|
439
|
+
path: _path + ".version",
|
|
440
|
+
expected: "1",
|
|
441
|
+
value: input.version
|
|
442
|
+
}, _errorFactory)) && (("object" === typeof input.repository && null !== input.repository || _assertGuard_1._assertGuard(_exceptionable, {
|
|
443
|
+
method: "typia.json.createAssertStringify",
|
|
444
|
+
path: _path + ".repository",
|
|
445
|
+
expected: "SecretsStatusRepository",
|
|
446
|
+
value: input.repository
|
|
447
|
+
}, _errorFactory)) && _ao1(input.repository, _path + ".repository", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
448
|
+
method: "typia.json.createAssertStringify",
|
|
449
|
+
path: _path + ".repository",
|
|
450
|
+
expected: "SecretsStatusRepository",
|
|
451
|
+
value: input.repository
|
|
452
|
+
}, _errorFactory)) && ((Array.isArray(input.environments) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
453
|
+
method: "typia.json.createAssertStringify",
|
|
454
|
+
path: _path + ".environments",
|
|
455
|
+
expected: "Array<SecretsStatusEnvironment>",
|
|
456
|
+
value: input.environments
|
|
457
|
+
}, _errorFactory)) && input.environments.every((elem, _index8) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
458
|
+
method: "typia.json.createAssertStringify",
|
|
459
|
+
path: _path + ".environments[" + _index8 + "]",
|
|
460
|
+
expected: _ae0,
|
|
461
|
+
value: elem
|
|
462
|
+
}, _errorFactory)) && _au0(elem, _path + ".environments[" + _index8 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
463
|
+
method: "typia.json.createAssertStringify",
|
|
464
|
+
path: _path + ".environments[" + _index8 + "]",
|
|
465
|
+
expected: _ae0,
|
|
466
|
+
value: elem
|
|
467
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
468
|
+
method: "typia.json.createAssertStringify",
|
|
469
|
+
path: _path + ".environments",
|
|
470
|
+
expected: "Array<SecretsStatusEnvironment>",
|
|
471
|
+
value: input.environments
|
|
472
|
+
}, _errorFactory)) && ((Array.isArray(input.secrets) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
473
|
+
method: "typia.json.createAssertStringify",
|
|
474
|
+
path: _path + ".secrets",
|
|
475
|
+
expected: "Array<SecretsStatusRow>",
|
|
476
|
+
value: input.secrets
|
|
477
|
+
}, _errorFactory)) && input.secrets.every((elem, _index9) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
478
|
+
method: "typia.json.createAssertStringify",
|
|
479
|
+
path: _path + ".secrets[" + _index9 + "]",
|
|
480
|
+
expected: "SecretsStatusRow",
|
|
481
|
+
value: elem
|
|
482
|
+
}, _errorFactory)) && _ao4(elem, _path + ".secrets[" + _index9 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
483
|
+
method: "typia.json.createAssertStringify",
|
|
484
|
+
path: _path + ".secrets[" + _index9 + "]",
|
|
485
|
+
expected: "SecretsStatusRow",
|
|
486
|
+
value: elem
|
|
487
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
488
|
+
method: "typia.json.createAssertStringify",
|
|
489
|
+
path: _path + ".secrets",
|
|
490
|
+
expected: "Array<SecretsStatusRow>",
|
|
491
|
+
value: input.secrets
|
|
492
|
+
}, _errorFactory)) && ((Array.isArray(input.unsatisfied) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
493
|
+
method: "typia.json.createAssertStringify",
|
|
494
|
+
path: _path + ".unsatisfied",
|
|
495
|
+
expected: "Array<UnsatisfiedSecret>",
|
|
496
|
+
value: input.unsatisfied
|
|
497
|
+
}, _errorFactory)) && input.unsatisfied.every((elem, _index10) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
498
|
+
method: "typia.json.createAssertStringify",
|
|
499
|
+
path: _path + ".unsatisfied[" + _index10 + "]",
|
|
500
|
+
expected: "UnsatisfiedSecret",
|
|
501
|
+
value: elem
|
|
502
|
+
}, _errorFactory)) && _ao6(elem, _path + ".unsatisfied[" + _index10 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
503
|
+
method: "typia.json.createAssertStringify",
|
|
504
|
+
path: _path + ".unsatisfied[" + _index10 + "]",
|
|
505
|
+
expected: "UnsatisfiedSecret",
|
|
506
|
+
value: elem
|
|
507
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
508
|
+
method: "typia.json.createAssertStringify",
|
|
509
|
+
path: _path + ".unsatisfied",
|
|
510
|
+
expected: "Array<UnsatisfiedSecret>",
|
|
511
|
+
value: input.unsatisfied
|
|
512
|
+
}, _errorFactory));
|
|
513
|
+
const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.repo || _assertGuard_1._assertGuard(_exceptionable, {
|
|
514
|
+
method: "typia.json.createAssertStringify",
|
|
515
|
+
path: _path + ".repo",
|
|
516
|
+
expected: "string",
|
|
517
|
+
value: input.repo
|
|
518
|
+
}, _errorFactory)) && ("string" === typeof input.source || _assertGuard_1._assertGuard(_exceptionable, {
|
|
519
|
+
method: "typia.json.createAssertStringify",
|
|
520
|
+
path: _path + ".source",
|
|
521
|
+
expected: "string",
|
|
522
|
+
value: input.source
|
|
523
|
+
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable);
|
|
524
|
+
const _ao2 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable) && (true === input.readable || _assertGuard_1._assertGuard(_exceptionable, {
|
|
525
|
+
method: "typia.json.createAssertStringify",
|
|
526
|
+
path: _path + ".readable",
|
|
527
|
+
expected: "true",
|
|
528
|
+
value: input.readable
|
|
529
|
+
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable);
|
|
530
|
+
const _ao3 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && _ap2(input, _path, true && _exceptionable) && (false === input.readable || _assertGuard_1._assertGuard(_exceptionable, {
|
|
531
|
+
method: "typia.json.createAssertStringify",
|
|
532
|
+
path: _path + ".readable",
|
|
533
|
+
expected: "false",
|
|
534
|
+
value: input.readable
|
|
535
|
+
}, _errorFactory)) && ("string" === typeof input.reason || _assertGuard_1._assertGuard(_exceptionable, {
|
|
536
|
+
method: "typia.json.createAssertStringify",
|
|
537
|
+
path: _path + ".reason",
|
|
538
|
+
expected: "string",
|
|
539
|
+
value: input.reason
|
|
540
|
+
}, _errorFactory));
|
|
541
|
+
const _ao4 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ((Array.isArray(input.declaredByWorkers) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
542
|
+
method: "typia.json.createAssertStringify",
|
|
543
|
+
path: _path + ".declaredByWorkers",
|
|
544
|
+
expected: "Array<string>",
|
|
545
|
+
value: input.declaredByWorkers
|
|
546
|
+
}, _errorFactory)) && input.declaredByWorkers.every((elem, _index11) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
547
|
+
method: "typia.json.createAssertStringify",
|
|
548
|
+
path: _path + ".declaredByWorkers[" + _index11 + "]",
|
|
549
|
+
expected: "string",
|
|
550
|
+
value: elem
|
|
551
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
552
|
+
method: "typia.json.createAssertStringify",
|
|
553
|
+
path: _path + ".declaredByWorkers",
|
|
554
|
+
expected: "Array<string>",
|
|
555
|
+
value: input.declaredByWorkers
|
|
556
|
+
}, _errorFactory)) && ("boolean" === typeof input.suppliedByWorkflow || _assertGuard_1._assertGuard(_exceptionable, {
|
|
557
|
+
method: "typia.json.createAssertStringify",
|
|
558
|
+
path: _path + ".suppliedByWorkflow",
|
|
559
|
+
expected: "boolean",
|
|
560
|
+
value: input.suppliedByWorkflow
|
|
561
|
+
}, _errorFactory)) && ("boolean" === typeof input.fetchableLocally || _assertGuard_1._assertGuard(_exceptionable, {
|
|
562
|
+
method: "typia.json.createAssertStringify",
|
|
563
|
+
path: _path + ".fetchableLocally",
|
|
564
|
+
expected: "boolean",
|
|
565
|
+
value: input.fetchableLocally
|
|
566
|
+
}, _errorFactory)) && (undefined === input.localGroup || ("object" === typeof input.localGroup && null !== input.localGroup || _assertGuard_1._assertGuard(_exceptionable, {
|
|
567
|
+
method: "typia.json.createAssertStringify",
|
|
568
|
+
path: _path + ".localGroup",
|
|
569
|
+
expected: "(undefined | { resolves: string; derived: string; })",
|
|
570
|
+
value: input.localGroup
|
|
571
|
+
}, _errorFactory)) && _ao5(input.localGroup, _path + ".localGroup", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
572
|
+
method: "typia.json.createAssertStringify",
|
|
573
|
+
path: _path + ".localGroup",
|
|
574
|
+
expected: "(undefined | { resolves: string; derived: string; })",
|
|
575
|
+
value: input.localGroup
|
|
576
|
+
}, _errorFactory)) && ("boolean" === typeof input.onRepository || _assertGuard_1._assertGuard(_exceptionable, {
|
|
577
|
+
method: "typia.json.createAssertStringify",
|
|
578
|
+
path: _path + ".onRepository",
|
|
579
|
+
expected: "boolean",
|
|
580
|
+
value: input.onRepository
|
|
581
|
+
}, _errorFactory)) && ((Array.isArray(input.heldByEnvironment) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
582
|
+
method: "typia.json.createAssertStringify",
|
|
583
|
+
path: _path + ".heldByEnvironment",
|
|
584
|
+
expected: "Array<string>",
|
|
585
|
+
value: input.heldByEnvironment
|
|
586
|
+
}, _errorFactory)) && input.heldByEnvironment.every((elem, _index12) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
587
|
+
method: "typia.json.createAssertStringify",
|
|
588
|
+
path: _path + ".heldByEnvironment[" + _index12 + "]",
|
|
589
|
+
expected: "string",
|
|
590
|
+
value: elem
|
|
591
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
592
|
+
method: "typia.json.createAssertStringify",
|
|
593
|
+
path: _path + ".heldByEnvironment",
|
|
594
|
+
expected: "Array<string>",
|
|
595
|
+
value: input.heldByEnvironment
|
|
596
|
+
}, _errorFactory)) && ((Array.isArray(input.requiredByStages) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
597
|
+
method: "typia.json.createAssertStringify",
|
|
598
|
+
path: _path + ".requiredByStages",
|
|
599
|
+
expected: "Array<SecretStageScope>",
|
|
600
|
+
value: input.requiredByStages
|
|
601
|
+
}, _errorFactory)) && input.requiredByStages.every((elem, _index13) => "preview" === elem || "production" === elem || "staging" === elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
602
|
+
method: "typia.json.createAssertStringify",
|
|
603
|
+
path: _path + ".requiredByStages[" + _index13 + "]",
|
|
604
|
+
expected: "(\"preview\" | \"production\" | \"staging\")",
|
|
605
|
+
value: elem
|
|
606
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
607
|
+
method: "typia.json.createAssertStringify",
|
|
608
|
+
path: _path + ".requiredByStages",
|
|
609
|
+
expected: "Array<SecretStageScope>",
|
|
610
|
+
value: input.requiredByStages
|
|
611
|
+
}, _errorFactory));
|
|
612
|
+
const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.resolves || _assertGuard_1._assertGuard(_exceptionable, {
|
|
613
|
+
method: "typia.json.createAssertStringify",
|
|
614
|
+
path: _path + ".resolves",
|
|
615
|
+
expected: "string",
|
|
616
|
+
value: input.resolves
|
|
617
|
+
}, _errorFactory)) && ("string" === typeof input.derived || _assertGuard_1._assertGuard(_exceptionable, {
|
|
618
|
+
method: "typia.json.createAssertStringify",
|
|
619
|
+
path: _path + ".derived",
|
|
620
|
+
expected: "string",
|
|
621
|
+
value: input.derived
|
|
622
|
+
}, _errorFactory));
|
|
623
|
+
const _ao6 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && _ap3(input, _path, true && _exceptionable) && ((Array.isArray(input.missingIn) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
624
|
+
method: "typia.json.createAssertStringify",
|
|
625
|
+
path: _path + ".missingIn",
|
|
626
|
+
expected: "Array<string>",
|
|
627
|
+
value: input.missingIn
|
|
628
|
+
}, _errorFactory)) && input.missingIn.every((elem, _index14) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
629
|
+
method: "typia.json.createAssertStringify",
|
|
630
|
+
path: _path + ".missingIn[" + _index14 + "]",
|
|
631
|
+
expected: "string",
|
|
632
|
+
value: elem
|
|
633
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
634
|
+
method: "typia.json.createAssertStringify",
|
|
635
|
+
path: _path + ".missingIn",
|
|
636
|
+
expected: "Array<string>",
|
|
637
|
+
value: input.missingIn
|
|
638
|
+
}, _errorFactory));
|
|
639
|
+
const _au0 = (input, _path, _exceptionable = true) => (() => {
|
|
640
|
+
if (true === input.readable)
|
|
641
|
+
return _ao2(input, _path, true && _exceptionable);
|
|
642
|
+
else if (false === input.readable)
|
|
643
|
+
return _ao3(input, _path, true && _exceptionable);
|
|
644
|
+
else
|
|
645
|
+
return _assertGuard_1._assertGuard(_exceptionable, {
|
|
646
|
+
method: "typia.json.createAssertStringify",
|
|
647
|
+
path: _path,
|
|
648
|
+
expected: _ae1,
|
|
649
|
+
value: input
|
|
650
|
+
}, _errorFactory);
|
|
651
|
+
})();
|
|
652
|
+
const _io0 = input => 1 === input.version && ("object" === typeof input.repository && null !== input.repository && _io1(input.repository)) && (Array.isArray(input.environments) && input.environments.every(elem => "object" === typeof elem && null !== elem && _iu0(elem))) && (Array.isArray(input.secrets) && input.secrets.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && (Array.isArray(input.unsatisfied) && input.unsatisfied.every(elem => "object" === typeof elem && null !== elem && _io6(elem)));
|
|
653
|
+
const _io1 = input => "string" === typeof input.repo && "string" === typeof input.source && _ip0(input);
|
|
654
|
+
const _io2 = input => _ip1(input) && _ip2(input) && true === input.readable && _ip0(input);
|
|
655
|
+
const _io3 = input => _ip1(input) && _ip2(input) && false === input.readable && "string" === typeof input.reason;
|
|
656
|
+
const _io4 = input => _ip1(input) && _ip3(input) && (Array.isArray(input.declaredByWorkers) && input.declaredByWorkers.every(elem => "string" === typeof elem)) && "boolean" === typeof input.suppliedByWorkflow && "boolean" === typeof input.fetchableLocally && (undefined === input.localGroup || "object" === typeof input.localGroup && null !== input.localGroup && _io5(input.localGroup)) && "boolean" === typeof input.onRepository && (Array.isArray(input.heldByEnvironment) && input.heldByEnvironment.every(elem => "string" === typeof elem)) && (Array.isArray(input.requiredByStages) && input.requiredByStages.every(elem => "preview" === elem || "production" === elem || "staging" === elem));
|
|
657
|
+
const _io5 = input => "string" === typeof input.resolves && "string" === typeof input.derived;
|
|
658
|
+
const _io6 = input => _ip1(input) && _ip3(input) && (Array.isArray(input.missingIn) && input.missingIn.every(elem => "string" === typeof elem));
|
|
659
|
+
const _iu0 = input => (() => {
|
|
660
|
+
if (true === input.readable)
|
|
661
|
+
return _io2(input);
|
|
662
|
+
else if (false === input.readable)
|
|
663
|
+
return _io3(input);
|
|
664
|
+
else
|
|
665
|
+
return false;
|
|
666
|
+
})();
|
|
667
|
+
const _so0 = input => `{"version":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.version))},"repository":${_so1(input.repository)},"environments":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.environments, elem => _su0(elem))}]`},"secrets":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.secrets, elem => _so4(elem))}]`},"unsatisfied":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.unsatisfied, elem => _so6(elem))}]`}}`;
|
|
668
|
+
const _so1 = input => `{"repo":${_jsonStringifyString_1._jsonStringifyString(input.repo)},"source":${_jsonStringifyString_1._jsonStringifyString(input.source)},"secretCount":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.secretCount))}}`;
|
|
669
|
+
const _so2 = input => `{"name":${_jsonStringifyString_1._jsonStringifyString(input.name)},"bound":${String(input.bound)},"readable":${String(input.readable)},"secretCount":${String(_jsonStringifyNumber_1._jsonStringifyNumber(input.secretCount))}}`;
|
|
670
|
+
const _so3 = input => `{"name":${_jsonStringifyString_1._jsonStringifyString(input.name)},"bound":${String(input.bound)},"readable":${String(input.readable)},"reason":${_jsonStringifyString_1._jsonStringifyString(input.reason)}}`;
|
|
671
|
+
const _so4 = input => `{"name":${_jsonStringifyString_1._jsonStringifyString(input.name)},"repositorySecret":${_jsonStringifyString_1._jsonStringifyString(input.repositorySecret)},"declaredByWorkers":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.declaredByWorkers, elem => _jsonStringifyString_1._jsonStringifyString(elem))}]`},"suppliedByWorkflow":${String(input.suppliedByWorkflow)},"fetchableLocally":${String(input.fetchableLocally)},${undefined === input.localGroup ? "" : `"localGroup":${undefined !== input.localGroup ? _so5(input.localGroup) : undefined},`}"onRepository":${String(input.onRepository)},"heldByEnvironment":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.heldByEnvironment, elem => _jsonStringifyString_1._jsonStringifyString(elem))}]`},"requiredByStages":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.requiredByStages, elem => "\"" + elem + "\"")}]`}}`;
|
|
672
|
+
const _so5 = input => `{"resolves":${_jsonStringifyString_1._jsonStringifyString(input.resolves)},"derived":${_jsonStringifyString_1._jsonStringifyString(input.derived)}}`;
|
|
673
|
+
const _so6 = input => `{"name":${_jsonStringifyString_1._jsonStringifyString(input.name)},"repositorySecret":${_jsonStringifyString_1._jsonStringifyString(input.repositorySecret)},"missingIn":${`[${_jsonStringifyArray_1._jsonStringifyArray(input.missingIn, elem => _jsonStringifyString_1._jsonStringifyString(elem))}]`}}`;
|
|
674
|
+
const _su0 = input => (() => {
|
|
675
|
+
if (true === input.readable)
|
|
676
|
+
return _so2(input);
|
|
677
|
+
else if (false === input.readable)
|
|
678
|
+
return _so3(input);
|
|
679
|
+
else
|
|
680
|
+
_throwTypeGuardError_1._throwTypeGuardError({
|
|
681
|
+
method: "typia.json.createAssertStringify",
|
|
682
|
+
expected: "({ name: string; bound: boolean; readable: true; secretCount: number; } | { name: string; bound: boolean; readable: false; reason: string; })",
|
|
683
|
+
value: input
|
|
684
|
+
});
|
|
685
|
+
})();
|
|
686
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
687
|
+
let _errorFactory;
|
|
688
|
+
const _sio1 = input => "string" === typeof input.repo && "string" === typeof input.source && _sip0(input);
|
|
689
|
+
const _sio2 = input => _sip1(input) && _sip2(input) && true === input.readable && _sip0(input);
|
|
690
|
+
const _sio3 = input => _sip1(input) && _sip2(input) && false === input.readable && "string" === typeof input.reason;
|
|
691
|
+
const _sio4 = input => _sip1(input) && _sip3(input) && (Array.isArray(input.declaredByWorkers) && input.declaredByWorkers.every(elem => "string" === typeof elem)) && "boolean" === typeof input.suppliedByWorkflow && "boolean" === typeof input.fetchableLocally && (undefined === input.localGroup || "object" === typeof input.localGroup && null !== input.localGroup && _sio5(input.localGroup)) && "boolean" === typeof input.onRepository && (Array.isArray(input.heldByEnvironment) && input.heldByEnvironment.every(elem => "string" === typeof elem)) && (Array.isArray(input.requiredByStages) && input.requiredByStages.every(elem => "preview" === elem || "production" === elem || "staging" === elem));
|
|
692
|
+
const _sio5 = input => "string" === typeof input.resolves && "string" === typeof input.derived;
|
|
693
|
+
const _sio6 = input => _sip1(input) && _sip3(input) && (Array.isArray(input.missingIn) && input.missingIn.every(elem => "string" === typeof elem));
|
|
694
|
+
const _siu0 = input => (() => {
|
|
695
|
+
if (true === input.readable)
|
|
696
|
+
return _sio2(input);
|
|
697
|
+
else if (false === input.readable)
|
|
698
|
+
return _sio3(input);
|
|
699
|
+
else
|
|
700
|
+
return false;
|
|
701
|
+
})();
|
|
702
|
+
const __assert = (input, errorFactory) => {
|
|
703
|
+
if (false === __is(input)) {
|
|
704
|
+
_errorFactory = errorFactory;
|
|
705
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
|
|
706
|
+
method: "typia.json.createAssertStringify",
|
|
707
|
+
path: _path + "",
|
|
708
|
+
expected: "SecretsStatusDocument",
|
|
709
|
+
value: input
|
|
710
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
|
|
711
|
+
method: "typia.json.createAssertStringify",
|
|
712
|
+
path: _path + "",
|
|
713
|
+
expected: "SecretsStatusDocument",
|
|
714
|
+
value: input
|
|
715
|
+
}, _errorFactory))(input, "$input", true);
|
|
716
|
+
}
|
|
717
|
+
return input;
|
|
718
|
+
};
|
|
719
|
+
const __stringify = input => _so0(input);
|
|
720
|
+
return (input, errorFactory) => {
|
|
721
|
+
__assert(input, errorFactory);
|
|
722
|
+
return __stringify(input);
|
|
723
|
+
};
|
|
724
|
+
})();
|