@barekey/sdk 0.4.4 → 0.5.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.
Files changed (45) hide show
  1. package/dist/client.d.ts +4 -0
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +61 -15
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/internal/node-runtime.d.ts +11 -0
  7. package/dist/internal/node-runtime.d.ts.map +1 -1
  8. package/dist/internal/node-runtime.js +2 -1
  9. package/dist/internal/public-runtime.d.ts.map +1 -1
  10. package/dist/internal/public-runtime.js +38 -0
  11. package/dist/internal/runtime.d.ts +15 -2
  12. package/dist/internal/runtime.d.ts.map +1 -1
  13. package/dist/internal/runtime.js +71 -5
  14. package/dist/internal/singleton.d.ts.map +1 -1
  15. package/dist/internal/singleton.js +14 -0
  16. package/dist/internal/standalone.d.ts +10 -0
  17. package/dist/internal/standalone.d.ts.map +1 -0
  18. package/dist/internal/standalone.js +246 -0
  19. package/dist/internal/typegen.d.ts +6 -3
  20. package/dist/internal/typegen.d.ts.map +1 -1
  21. package/dist/internal/typegen.js +41 -9
  22. package/dist/public-client.d.ts +4 -0
  23. package/dist/public-client.d.ts.map +1 -1
  24. package/dist/public-types.d.ts +1 -1
  25. package/dist/public-types.d.ts.map +1 -1
  26. package/dist/public.d.ts +1 -1
  27. package/dist/public.d.ts.map +1 -1
  28. package/dist/server.d.ts +1 -1
  29. package/dist/server.d.ts.map +1 -1
  30. package/dist/types.d.ts +6 -0
  31. package/dist/types.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/client.ts +86 -15
  34. package/src/index.ts +2 -0
  35. package/src/internal/node-runtime.ts +4 -2
  36. package/src/internal/public-runtime.ts +58 -1
  37. package/src/internal/runtime.ts +121 -5
  38. package/src/internal/singleton.ts +37 -4
  39. package/src/internal/standalone.ts +309 -0
  40. package/src/internal/typegen.ts +63 -10
  41. package/src/public-client.ts +4 -0
  42. package/src/public-types.ts +1 -0
  43. package/src/public.ts +2 -0
  44. package/src/server.ts +2 -0
  45. package/src/types.ts +7 -0
package/dist/client.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare class BarekeyClient {
9
9
  private requirementsPromise;
10
10
  private typegenWatcherStarted;
11
11
  constructor();
12
+ constructor(options: {
13
+ requirements?: BarekeyClientOptions["requirements"];
14
+ typegen?: BarekeyClientOptions["typegen"];
15
+ });
12
16
  constructor(options: {
13
17
  organization: string;
14
18
  project: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAmBtE,OAAO,KAAK,EACV,oBAAoB,EAEpB,2BAA2B,EAC3B,6BAA6B,EAC7B,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EAErB,MAAM,YAAY,CAAC;AAqFpB,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgD;IAChF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA4C;IAC5E,OAAO,CAAC,qBAAqB,CAA+C;IAC5E,OAAO,CAAC,mBAAmB,CAA8B;IACzD,OAAO,CAAC,qBAAqB,CAAS;;gBAG1B,OAAO,EAAE;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;QACpD,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;KAC3C;gBACW,OAAO,EAAE;QACnB,IAAI,EAAE,iBAAiB,CAAC;QACxB,YAAY,CAAC,EAAE,oBAAoB,CAAC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YA4B3B,oBAAoB;YAkCpB,mBAAmB;YASnB,kBAAkB;YAQlB,mBAAmB;YAUnB,kBAAkB;YAgElB,mBAAmB;YAkCnB,oBAAoB;YAuCpB,qBAAqB;YAarB,sBAAsB;CAsBrC"}
package/dist/client.js CHANGED
@@ -5,6 +5,7 @@ import { getJson, postJson } from "./internal/http.js";
5
5
  import { validateRequirements } from "./internal/requirements.js";
6
6
  import { resolveRuntimeContext } from "./internal/runtime.js";
7
7
  import { createBarekeyClientSingletonKey } from "./internal/singleton.js";
8
+ import { buildStandaloneTypegenManifest, loadStandaloneDefinitions, } from "./internal/standalone.js";
8
9
  import { MemoryCache } from "./internal/cache.js";
9
10
  import { DEFAULT_TYPEGEN_TTL_MS, resolveTtlMilliseconds } from "./internal/ttl.js";
10
11
  import { hasFreshInstalledSdkTypegen, resolveInstalledSdkGeneratedTypesPath, writeInstalledSdkGeneratedTypes, } from "./internal/typegen.js";
@@ -55,6 +56,17 @@ function resolveEvaluatedResponse(evaluated) {
55
56
  selectedArm: inferSelectedArmFromDecision(evaluated.decision),
56
57
  };
57
58
  }
59
+ function createTypegenIdentity(context) {
60
+ return {
61
+ baseUrl: context.baseUrl,
62
+ orgSlug: context.organization,
63
+ projectSlug: context.project,
64
+ stageSlug: context.environment,
65
+ typegenMode: context.typegenMode,
66
+ runtimeMode: context.mode,
67
+ localEnvRoot: context.localEnvRoot,
68
+ };
69
+ }
58
70
  export class BarekeyClient {
59
71
  options;
60
72
  fetchFn;
@@ -87,13 +99,15 @@ export class BarekeyClient {
87
99
  message: "Barekey could not update generated SDK types because filesystem access is unavailable.",
88
100
  });
89
101
  }
90
- const manifest = await this.fetchTypegenManifest(context);
91
- return await writeInstalledSdkGeneratedTypes(manifest, {
92
- baseUrl: context.baseUrl,
93
- orgSlug: context.organization,
94
- projectSlug: context.project,
95
- stageSlug: context.environment,
96
- });
102
+ const manifest = context.mode === "standalone"
103
+ ? await buildStandaloneTypegenManifest({
104
+ rootDirectory: context.localEnvRoot,
105
+ organization: context.organization,
106
+ project: context.project,
107
+ environment: context.environment,
108
+ })
109
+ : await this.fetchTypegenManifest(context);
110
+ return await writeInstalledSdkGeneratedTypes(manifest, createTypegenIdentity(context));
97
111
  }
98
112
  async getRuntimeContext() {
99
113
  if (this.runtimeContextPromise === null) {
@@ -109,6 +123,14 @@ export class BarekeyClient {
109
123
  }
110
124
  async fetchTypegenManifest(context) {
111
125
  const resolvedContext = context ?? (await this.getRuntimeContext());
126
+ if (resolvedContext.mode !== "centralized") {
127
+ return await buildStandaloneTypegenManifest({
128
+ rootDirectory: resolvedContext.localEnvRoot,
129
+ organization: resolvedContext.organization,
130
+ project: resolvedContext.project,
131
+ environment: resolvedContext.environment,
132
+ });
133
+ }
112
134
  return await getJson({
113
135
  fetchFn: this.fetchFn,
114
136
  baseUrl: resolvedContext.baseUrl,
@@ -138,10 +160,13 @@ export class BarekeyClient {
138
160
  }
139
161
  const intervalMs = this.getTypegenIntervalMs();
140
162
  const watcherKey = [
141
- context.baseUrl,
163
+ context.baseUrl ?? "",
142
164
  context.organization,
143
165
  context.project,
144
166
  context.environment,
167
+ context.mode,
168
+ context.localEnvRoot ?? "",
169
+ context.typegenMode,
145
170
  generatedTypesPath,
146
171
  ].join("|");
147
172
  const runWatcher = async (watcher) => {
@@ -187,10 +212,7 @@ export class BarekeyClient {
187
212
  };
188
213
  sharedTypegenWatchers.set(watcherKey, watcher);
189
214
  if (!(await hasFreshInstalledSdkTypegen(intervalMs, {
190
- baseUrl: context.baseUrl,
191
- orgSlug: context.organization,
192
- projectSlug: context.project,
193
- stageSlug: context.environment,
215
+ ...createTypegenIdentity(context),
194
216
  }))) {
195
217
  void runWatcher(watcher);
196
218
  }
@@ -205,16 +227,25 @@ export class BarekeyClient {
205
227
  });
206
228
  }
207
229
  buildDefinitionCacheKey(context, name) {
208
- return [context.organization, context.project, context.environment, name].join("|");
230
+ return [
231
+ context.mode,
232
+ context.localEnvRoot ?? "",
233
+ context.organization,
234
+ context.project,
235
+ context.environment,
236
+ name,
237
+ ].join("|");
209
238
  }
210
239
  buildEvaluationCacheKey(context, name, options) {
211
240
  return [
241
+ context.mode,
242
+ context.localEnvRoot ?? "",
212
243
  context.organization,
213
244
  context.project,
214
245
  context.environment,
215
246
  name,
216
- options?.seed ?? "",
217
- options?.key ?? "",
247
+ context.mode === "standalone" ? "" : options?.seed ?? "",
248
+ context.mode === "standalone" ? "" : options?.key ?? "",
218
249
  ].join("|");
219
250
  }
220
251
  async fetchDefinitions(names) {
@@ -222,6 +253,16 @@ export class BarekeyClient {
222
253
  return [];
223
254
  }
224
255
  const context = await this.getRuntimeContext();
256
+ if (context.mode === "standalone") {
257
+ const definitions = await loadStandaloneDefinitions(context.localEnvRoot);
258
+ for (const definition of definitions) {
259
+ this.definitionCache.set(this.buildDefinitionCacheKey(context, definition.name), definition);
260
+ }
261
+ if (names === undefined) {
262
+ return definitions;
263
+ }
264
+ return mapValuesToRequestedOrder(names, definitions);
265
+ }
225
266
  const response = await postJson({
226
267
  fetchFn: this.fetchFn,
227
268
  baseUrl: context.baseUrl,
@@ -308,6 +349,11 @@ export class BarekeyClient {
308
349
  return await Promise.all(definitions.map(async (definition) => await evaluateDefinition(definition, options)));
309
350
  }
310
351
  async fetchDynamicValues(names, context, options) {
352
+ if (context.mode === "standalone") {
353
+ const definitions = await loadStandaloneDefinitions(context.localEnvRoot);
354
+ const resolvedDefinitions = mapValuesToRequestedOrder(names, definitions);
355
+ return await Promise.all(resolvedDefinitions.map(async (definition) => await evaluateDefinition(definition)));
356
+ }
311
357
  try {
312
358
  if (names.length === 1) {
313
359
  const evaluated = await postJson({
package/dist/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export { BarekeyClient } from "./client.js";
2
2
  export { PublicBarekeyClient } from "./public-client.js";
3
3
  export { BarekeyEnvBatchHandle, BarekeyEnvHandle } from "./handle.js";
4
4
  export { BarekeyError, BillingUnavailableError, CoerceFailedError, DeviceCodeExpiredError, DeviceCodeNotFoundError, EvaluationFailedError, FsNotAvailableError, InvalidConfigurationProvidedError, InvalidCredentialsProvidedError, InvalidDynamicOptionsError, InvalidJsonError, InvalidOrgScopeError, InvalidRefreshTokenError, InvalidRequestError, NetworkError, NoConfigurationProvidedError, NoCredentialsProvidedError, OrgScopeInvalidError, RequirementsValidationFailedError, SdkModuleNotFoundError, TemporalNotAvailableError, TypegenReadFailedError, TypegenUnsupportedSdkError, TypegenWriteFailedError, UnauthorizedError, UnknownError, UsageLimitExceededError, UserCodeInvalidError, VariableNotFoundError, createBarekeyErrorFromCode, docsUrlForErrorCode, formatBarekeyErrorMessage, isBarekeyErrorCode, normalizeErrorCode, } from "./errors.js";
5
- export type { AB, BarekeyClientOptions, BarekeyCoerceTarget, BarekeyDeclaredType, BarekeyErrorCode, BarekeyEnvDescriptor, BarekeyEvaluatedValue, BarekeyGeneratedTypeMap, BarekeyGeneratedValueForKey, BarekeyGeneratedValuesForKeys, BarekeyGetOptions, BarekeyJsonConfig, BarekeyKey, BarekeyLiteralString, BarekeyKnownKey, BarekeyResolvedRecord, BarekeyResolvedRecords, BarekeyResolvedKind, BarekeyRolloutMilestone, BarekeyStandardSchemaV1, BarekeyTemporalInstant, BarekeyTemporalInstantLike, BarekeyTtlInput, BarekeyTypegenResult, BarekeyValueForGeneratedMap, BarekeyValuesForGeneratedMap, Env, Linear, Secret, BarekeyVisibility, } from "./types.js";
5
+ export type { AB, BarekeyClientOptions, BarekeyCoerceTarget, BarekeyDeclaredType, BarekeyErrorCode, BarekeyEnvDescriptor, BarekeyEvaluatedValue, BarekeyGeneratedTypeMap, BarekeyGeneratedValueForKey, BarekeyGeneratedValuesForKeys, BarekeyGetOptions, BarekeyJsonConfig, BarekeyKey, BarekeyLiteralString, BarekeyMode, BarekeyKnownKey, BarekeyResolvedRecord, BarekeyResolvedRecords, BarekeyResolvedKind, BarekeyRolloutMilestone, BarekeyStandardSchemaV1, BarekeyTemporalInstant, BarekeyTemporalInstantLike, BarekeyTypegenMode, BarekeyTtlInput, BarekeyTypegenResult, BarekeyValueForGeneratedMap, BarekeyValuesForGeneratedMap, Env, Linear, Secret, BarekeyVisibility, } from "./types.js";
6
6
  export type { BarekeyPublicGeneratedTypeMap, BarekeyPublicKey, BarekeyPublicKnownKey, BarekeyPublicValueForKey, BarekeyPublicValuesForKeys, PublicBarekeyClientOptions, } from "./public-types.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,EAC1B,oBAAoB,EACpB,iCAAiC,EACjC,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,EAAE,EACF,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,eAAe,EACf,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,GAAG,EACH,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,4BAA4B,EAC5B,0BAA0B,EAC1B,oBAAoB,EACpB,iCAAiC,EACjC,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,EAAE,EACF,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,GAAG,EACH,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,6BAA6B,EAC7B,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC"}
@@ -1,6 +1,17 @@
1
+ export type NodeRuntimeModules = {
2
+ childProcess: typeof import("node:child_process");
3
+ fs: typeof import("node:fs/promises");
4
+ moduleApi: {
5
+ createRequire(path: string | URL): NodeRequire;
6
+ };
7
+ os: typeof import("node:os");
8
+ path: typeof import("node:path");
9
+ };
10
+ export declare function loadNodeRuntime(): Promise<NodeRuntimeModules | null>;
1
11
  export declare function isFilesystemAvailable(): Promise<boolean>;
2
12
  export declare function loadBarekeyJsonConfig(): Promise<{
3
13
  path: string;
14
+ directory: string;
4
15
  json: Record<string, unknown>;
5
16
  } | null>;
6
17
  export declare function loadCliSessionAuthResolver(fetchFn: typeof globalThis.fetch): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"node-runtime.d.ts","sourceRoot":"","sources":["../../src/internal/node-runtime.ts"],"names":[],"mappings":"AA4VA,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE9D;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,GAAG,IAAI,CAAC,CAwCR;AA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BAAqB,IAAI,OAAO,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,GAAG,IAAI,CAAC,CAyCR;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;IAC1F,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,GAAG,IAAI,CAAC,CAoER;AAOD,KAAK,yBAAyB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB,EAAE,MAAM,CAAC;IACjC,wBAAwB,EAAE,MAAM,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CA0DlG;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkB3E;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBxF"}
@@ -7,7 +7,7 @@ function isNodeRuntime() {
7
7
  process.versions !== null &&
8
8
  typeof process.versions.node === "string");
9
9
  }
10
- async function loadNodeRuntime() {
10
+ export async function loadNodeRuntime() {
11
11
  if (!isNodeRuntime()) {
12
12
  return null;
13
13
  }
@@ -241,6 +241,7 @@ export async function loadBarekeyJsonConfig() {
241
241
  try {
242
242
  return {
243
243
  path: candidate,
244
+ directory: current,
244
245
  json: JSON.parse(raw),
245
246
  };
246
247
  }
@@ -1 +1 @@
1
- {"version":3,"file":"public-runtime.d.ts","sourceRoot":"","sources":["../../src/internal/public-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAqB,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAM9E,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,GAAG;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAqGF,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAOtC"}
1
+ {"version":3,"file":"public-runtime.d.ts","sourceRoot":"","sources":["../../src/internal/public-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAGV,uBAAuB,EAExB,MAAM,aAAa,CAAC;AAMrB,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,GAAG;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAyJF,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAOtC"}
@@ -20,7 +20,45 @@ function normalizeScope(input) {
20
20
  environment,
21
21
  };
22
22
  }
23
+ function normalizeTypegenMode(value, source) {
24
+ if (value === undefined) {
25
+ return "semantic";
26
+ }
27
+ if (value === "semantic" || value === "minimal") {
28
+ return value;
29
+ }
30
+ throw new InvalidConfigurationProvidedError({
31
+ message: `${source} must provide config.typegen as "semantic" or "minimal" when set.`,
32
+ });
33
+ }
34
+ function normalizeMode(value, source) {
35
+ if (value === undefined) {
36
+ return "centralized";
37
+ }
38
+ if (value === "centralized" || value === "standalone") {
39
+ return value;
40
+ }
41
+ throw new InvalidConfigurationProvidedError({
42
+ message: `${source} must provide config.mode as "centralized" or "standalone" when set.`,
43
+ });
44
+ }
45
+ function createStandaloneUnsupportedError(source) {
46
+ return new InvalidConfigurationProvidedError({
47
+ message: [
48
+ `${source} sets config.mode to "standalone".`,
49
+ "PublicBarekeyClient does not support standalone local env mode because it relies on a server filesystem to read .env files.",
50
+ "Use BarekeyClient on the server instead, or switch barekey.json config.mode back to \"centralized\" for browser/public usage.",
51
+ ].join(" "),
52
+ });
53
+ }
23
54
  function normalizeJsonConfig(input, source) {
55
+ const config = "config" in input && typeof input.config === "object" && input.config !== null
56
+ ? input.config
57
+ : undefined;
58
+ normalizeTypegenMode(config?.typegen ?? ("typegen" in input ? input.typegen : undefined), source);
59
+ if (normalizeMode(config?.mode, source) === "standalone") {
60
+ throw createStandaloneUnsupportedError(source);
61
+ }
24
62
  return normalizeScope({
25
63
  organization: input.organization ?? input.org,
26
64
  project: input.project,
@@ -1,15 +1,28 @@
1
- import type { BarekeyClientOptions, BarekeyStandardSchemaV1 } from "../types.js";
1
+ import type { BarekeyClientOptions, BarekeyMode, BarekeyStandardSchemaV1, BarekeyTypegenMode } from "../types.js";
2
2
  import { type InternalAuthResolver } from "./http.js";
3
3
  type BarekeyResolvedScope = {
4
4
  organization: string;
5
5
  project: string;
6
6
  environment: string;
7
+ typegenMode: BarekeyTypegenMode;
8
+ mode: BarekeyMode;
9
+ localEnvRoot: string | null;
7
10
  };
8
- export type BarekeyRuntimeContext = BarekeyResolvedScope & {
11
+ type BarekeyCentralizedRuntimeContext = BarekeyResolvedScope & {
12
+ mode: "centralized";
13
+ localEnvRoot: null;
9
14
  baseUrl: string;
10
15
  auth: InternalAuthResolver;
11
16
  requirements?: BarekeyStandardSchemaV1;
12
17
  };
18
+ type BarekeyStandaloneRuntimeContext = BarekeyResolvedScope & {
19
+ mode: "standalone";
20
+ localEnvRoot: string;
21
+ baseUrl: null;
22
+ auth: null;
23
+ requirements?: BarekeyStandardSchemaV1;
24
+ };
25
+ export type BarekeyRuntimeContext = BarekeyCentralizedRuntimeContext | BarekeyStandaloneRuntimeContext;
13
26
  export declare function resolveRuntimeContext(options: BarekeyClientOptions, fetchFn: typeof globalThis.fetch): Promise<BarekeyRuntimeContext>;
14
27
  export {};
15
28
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/internal/runtime.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAqB,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,KAAK,oBAAoB,EAAoB,MAAM,WAAW,CAAC;AASxE,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AA8JF,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAQhC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/internal/runtime.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,oBAAoB,EAEpB,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,oBAAoB,EAAoB,MAAM,WAAW,CAAC;AASxE,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,kBAAkB,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,gCAAgC,GAAG,oBAAoB,GAAG;IAC7D,IAAI,EAAE,aAAa,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAEF,KAAK,+BAA+B,GAAG,oBAAoB,GAAG;IAC5D,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAC7B,gCAAgC,GAChC,+BAA+B,CAAC;AAuOpC,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CA4BhC"}
@@ -12,26 +12,71 @@ function readProcessEnv(key) {
12
12
  function readConfigString(value) {
13
13
  return typeof value === "string" ? value.trim() : undefined;
14
14
  }
15
+ function safeCurrentWorkingDirectory() {
16
+ if (typeof process === "undefined" || typeof process.cwd !== "function") {
17
+ return null;
18
+ }
19
+ return process.cwd();
20
+ }
21
+ function normalizeTypegenMode(value, source) {
22
+ if (value === undefined) {
23
+ return "semantic";
24
+ }
25
+ if (value === "semantic" || value === "minimal") {
26
+ return value;
27
+ }
28
+ throw new InvalidConfigurationProvidedError({
29
+ message: `${source} must provide config.typegen as "semantic" or "minimal" when set.`,
30
+ });
31
+ }
32
+ function normalizeMode(value, source) {
33
+ if (value === undefined) {
34
+ return "centralized";
35
+ }
36
+ if (value === "centralized" || value === "standalone") {
37
+ return value;
38
+ }
39
+ throw new InvalidConfigurationProvidedError({
40
+ message: `${source} must provide config.mode as "centralized" or "standalone" when set.`,
41
+ });
42
+ }
15
43
  function normalizeScope(input) {
44
+ const mode = input.mode ?? "centralized";
16
45
  const organization = readConfigString(input.organization) ?? "";
17
46
  const project = readConfigString(input.project) ?? "";
18
47
  const environment = readConfigString(input.environment) ?? "";
19
- if (organization.length === 0 || project.length === 0 || environment.length === 0) {
48
+ if (mode !== "standalone" &&
49
+ (organization.length === 0 || project.length === 0 || environment.length === 0)) {
20
50
  throw new InvalidConfigurationProvidedError({
21
51
  message: `${input.source} must provide organization, project, and environment.`,
22
52
  });
23
53
  }
54
+ const localEnvRoot = mode === "standalone" ? input.localEnvRoot ?? safeCurrentWorkingDirectory() : null;
55
+ if (mode === "standalone" && (!localEnvRoot || localEnvRoot.trim().length === 0)) {
56
+ throw new FsNotAvailableError({
57
+ message: "Barekey standalone mode requires filesystem access and a working directory.",
58
+ });
59
+ }
24
60
  return {
25
61
  organization,
26
62
  project,
27
63
  environment,
64
+ typegenMode: mode === "standalone" ? "minimal" : (input.typegenMode ?? "semantic"),
65
+ mode,
66
+ localEnvRoot: mode === "standalone" ? localEnvRoot : null,
28
67
  };
29
68
  }
30
- function normalizeJsonConfig(input, source) {
69
+ function normalizeJsonConfig(input, source, localEnvRoot) {
70
+ const config = "config" in input && typeof input.config === "object" && input.config !== null
71
+ ? input.config
72
+ : undefined;
31
73
  return normalizeScope({
32
74
  organization: input.organization ?? input.org,
33
75
  project: input.project,
34
76
  environment: input.environment ?? input.stage,
77
+ typegenMode: normalizeTypegenMode(config?.typegen ?? ("typegen" in input ? input.typegen : undefined), source),
78
+ mode: normalizeMode(config?.mode, source),
79
+ localEnvRoot,
35
80
  source,
36
81
  });
37
82
  }
@@ -54,13 +99,16 @@ async function resolveScope(options) {
54
99
  });
55
100
  }
56
101
  if (explicitJson !== undefined) {
57
- return normalizeJsonConfig(explicitJson, "The provided json configuration");
102
+ return normalizeJsonConfig(explicitJson, "The provided json configuration", safeCurrentWorkingDirectory());
58
103
  }
59
104
  if (explicitCount === 3) {
60
105
  return normalizeScope({
61
106
  organization: explicitOrganization,
62
107
  project: explicitProject,
63
108
  environment: explicitEnvironment,
109
+ typegenMode: "semantic",
110
+ mode: "centralized",
111
+ localEnvRoot: null,
64
112
  source: "The provided Barekey configuration",
65
113
  });
66
114
  }
@@ -73,7 +121,7 @@ async function resolveScope(options) {
73
121
  message: "No Barekey configuration was found and no barekey.json file could be loaded.",
74
122
  });
75
123
  }
76
- return normalizeJsonConfig(loadedConfig.json, `The barekey.json file at ${loadedConfig.path}`);
124
+ return normalizeJsonConfig(loadedConfig.json, `The barekey.json file at ${loadedConfig.path}`, loadedConfig.directory);
77
125
  }
78
126
  async function resolveAuth(fetchFn) {
79
127
  const envToken = readProcessEnv("BAREKEY_ACCESS_TOKEN");
@@ -125,9 +173,27 @@ async function resolveAuth(fetchFn) {
125
173
  };
126
174
  }
127
175
  export async function resolveRuntimeContext(options, fetchFn) {
128
- const [scope, auth] = await Promise.all([resolveScope(options), resolveAuth(fetchFn)]);
176
+ const scope = await resolveScope(options);
177
+ if (scope.mode === "standalone") {
178
+ if (!(await isFilesystemAvailable())) {
179
+ throw new FsNotAvailableError({
180
+ message: "Barekey standalone mode requires a local filesystem to read .env files.",
181
+ });
182
+ }
183
+ return {
184
+ ...scope,
185
+ mode: "standalone",
186
+ localEnvRoot: scope.localEnvRoot ?? safeCurrentWorkingDirectory() ?? "",
187
+ baseUrl: null,
188
+ auth: null,
189
+ requirements: options.requirements,
190
+ };
191
+ }
192
+ const auth = await resolveAuth(fetchFn);
129
193
  return {
130
194
  ...scope,
195
+ mode: "centralized",
196
+ localEnvRoot: null,
131
197
  baseUrl: auth.baseUrl,
132
198
  auth: auth.auth,
133
199
  requirements: options.requirements,
@@ -1 +1 @@
1
- {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/internal/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,aAAa,CAAC;AAyJrB,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAYrF;AAED,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,0BAA0B,GAClC,MAAM,CAOR"}
1
+ {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/internal/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,aAAa,CAAC;AA0LrB,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAYrF;AAED,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,0BAA0B,GAClC,MAAM,CAOR"}
@@ -28,10 +28,21 @@ function normalizeJsonScope(value) {
28
28
  if (value === undefined) {
29
29
  return null;
30
30
  }
31
+ const config = typeof value.config === "object" && value.config !== null
32
+ ? value.config
33
+ : undefined;
34
+ const runtimeMode = config?.mode === "standalone" ? "standalone" : "centralized";
31
35
  return {
32
36
  organization: readConfigString(value.organization ?? value.org),
33
37
  project: readConfigString(value.project),
34
38
  environment: readConfigString(value.environment ?? value.stage),
39
+ typegenMode: runtimeMode === "standalone"
40
+ ? "minimal"
41
+ : config?.typegen === "minimal"
42
+ ? "minimal"
43
+ : "semantic",
44
+ runtimeMode,
45
+ localEnvRoot: runtimeMode === "standalone" ? safeCurrentWorkingDirectory() : null,
35
46
  };
36
47
  }
37
48
  function normalizeScopeKey(options) {
@@ -47,6 +58,9 @@ function normalizeScopeKey(options) {
47
58
  organization,
48
59
  project,
49
60
  environment,
61
+ typegenMode: "semantic",
62
+ runtimeMode: "centralized",
63
+ localEnvRoot: null,
50
64
  };
51
65
  }
52
66
  return {
@@ -0,0 +1,10 @@
1
+ import type { BarekeyVariableDefinition } from "../types.js";
2
+ import type { TypegenManifest } from "./typegen.js";
3
+ export declare function loadStandaloneDefinitions(rootDirectory: string): Promise<Array<BarekeyVariableDefinition>>;
4
+ export declare function buildStandaloneTypegenManifest(input: {
5
+ rootDirectory: string;
6
+ organization: string;
7
+ project: string;
8
+ environment: string;
9
+ }): Promise<TypegenManifest>;
10
+ //# sourceMappingURL=standalone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../src/internal/standalone.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,cAAc,CAAC;AAyP7E,wBAAsB,yBAAyB,CAC7C,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAS3C;AAED,wBAAsB,8BAA8B,CAAC,KAAK,EAAE;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,eAAe,CAAC,CA4B3B"}