@walkeros/cli 4.3.1 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @walkeros/cli
2
2
 
3
+ ## 4.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a32ac49: The Observe session lifecycle is now available programmatically:
8
+ `startObserveSession`, `getObserveSession`, and the new `endObserveSession`
9
+ are exported from `@walkeros/cli`, so tools built on the CLI can open an
10
+ Observe session on a flow, read its status and record count, and end it.
11
+ Starting one also accepts `origins` to bind its web activation grant.
12
+ - @walkeros/collector@4.3.2
13
+ - @walkeros/core@4.3.2
14
+ - @walkeros/server-core@4.3.2
15
+ - @walkeros/server-destination-api@4.3.2
16
+ - @walkeros/transformer-validate@4.3.2
17
+
3
18
  ## 4.3.1
4
19
 
5
20
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -5858,7 +5858,7 @@ var init_contract = __esm({
5858
5858
  "src/core/contract.ts"() {
5859
5859
  "use strict";
5860
5860
  init_config_file();
5861
- bakedContractVersion = true ? "4.0.0" : PLACEHOLDER;
5861
+ bakedContractVersion = true ? "4.1.0" : PLACEHOLDER;
5862
5862
  }
5863
5863
  });
5864
5864
 
@@ -6353,6 +6353,7 @@ var init_output2 = __esm({
6353
6353
  // src/commands/observe/index.ts
6354
6354
  var observe_exports = {};
6355
6355
  __export(observe_exports, {
6356
+ endObserveSession: () => endObserveSession,
6356
6357
  formatObserveSession: () => formatObserveSession,
6357
6358
  getObserveSession: () => getObserveSession,
6358
6359
  heartbeatObserveSession: () => heartbeatObserveSession,
@@ -6368,7 +6369,10 @@ async function startObserveSession(options) {
6368
6369
  const body = {
6369
6370
  settingsName: options.settingsName,
6370
6371
  ...options.replace ? { replace: true } : {},
6371
- ...options.level !== void 0 ? { level: options.level } : {}
6372
+ ...options.level !== void 0 ? { level: options.level } : {},
6373
+ // An empty list carries no origin the grant could bind to, so it is
6374
+ // omitted rather than sent as a bare [] the app would have to interpret.
6375
+ ...options.origins?.length ? { origins: options.origins } : {}
6372
6376
  };
6373
6377
  const response = await apiFetch(
6374
6378
  `/api/projects/${pid}/flows/${options.flowId}/observe-sessions`,
@@ -6399,6 +6403,17 @@ async function getObserveSession(options) {
6399
6403
  }
6400
6404
  return response.json();
6401
6405
  }
6406
+ async function endObserveSession(options) {
6407
+ const pid = options.projectId ?? requireProjectId();
6408
+ const response = await apiFetch(
6409
+ `/api/projects/${pid}/flows/${options.flowId}/observe-sessions/${options.sessionId}`,
6410
+ { method: "DELETE" }
6411
+ );
6412
+ if (!response.ok) {
6413
+ const errorBody = await response.json().catch(() => ({}));
6414
+ throwApiResponseError(response, errorBody, "Failed to end observe session");
6415
+ }
6416
+ }
6402
6417
  async function heartbeatObserveSession(options) {
6403
6418
  const pid = options.projectId ?? requireProjectId();
6404
6419
  try {
@@ -7738,7 +7753,7 @@ function Nt2(e4, t4, n5) {
7738
7753
  if (!o4 || !r6) throw new Error("Event name is invalid");
7739
7754
  const { timestamp: s4 = Date.now(), name: a4 = `${o4} ${r6}`, data: i5 = {}, context: c2 = {}, globals: u2 = e4.globals, custom: d2 = {}, user: l3 = e4.user, nested: f3 = [], consent: p3 = e4.consent, id: g3 = Ne(), trigger: m3 = "", entity: h2 = o4, action: v3 = r6, timing: y3 = 0, source: w3 = { type: "collector", schema: "4" } } = t4, b3 = w3.count ?? (e4.count += 1), k3 = w3.trace ?? n5?._meta.trace ?? e4.trace, I3 = { ...w3, count: b3 };
7740
7755
  void 0 !== k3 && (I3.trace = k3);
7741
- const C3 = e4.name ?? w3.platform ?? "default", E2 = e4.release ?? "4.3.1";
7756
+ const C3 = e4.name ?? w3.platform ?? "default", E2 = e4.release ?? "4.3.2";
7742
7757
  return I3.release = { ...w3.release, [C3]: E2 }, { name: a4, data: i5, context: c2, globals: u2, custom: d2, user: l3, nested: f3, consent: p3, id: g3, trigger: m3, entity: h2, action: v3, timestamp: s4, timing: y3, source: I3 };
7743
7758
  }
7744
7759
  function Yt(e4, t4, n5) {
@@ -13793,7 +13808,7 @@ function validateMapping(input) {
13793
13808
  // src/commands/validate/validators/entry.ts
13794
13809
  init_dist();
13795
13810
  import Ajv from "ajv";
13796
- var CLIENT_HEADER = "walkeros-cli/4.3.1";
13811
+ var CLIENT_HEADER = "walkeros-cli/4.3.2";
13797
13812
  var SECTIONS = ["destinations", "sources", "transformers"];
13798
13813
  function resolveEntry(path19, flowConfig) {
13799
13814
  const flows = flowConfig.flows;
package/dist/index.d.ts CHANGED
@@ -9884,6 +9884,7 @@ interface components {
9884
9884
  /** Format: date-time */
9885
9885
  sessionExpiresAt: string;
9886
9886
  sessionGrant?: string;
9887
+ sessionId?: string;
9887
9888
  };
9888
9889
  ObserveSessionResponse: {
9889
9890
  /** @example ses_abc123xyz456 */
@@ -9915,6 +9916,9 @@ interface components {
9915
9916
  previewEnabled: boolean;
9916
9917
  /** Format: uri */
9917
9918
  bundleUrl: string;
9919
+ /** Format: uri */
9920
+ url?: string;
9921
+ binding?: string;
9918
9922
  } | null;
9919
9923
  ObserveSessionServer: {
9920
9924
  /** Format: uri */
@@ -11757,6 +11761,47 @@ interface ListJourneysOptions {
11757
11761
  */
11758
11762
  declare function listJourneys(options: ListJourneysOptions): Promise<any>;
11759
11763
 
11764
+ type ObserveSessionResponse = components['schemas']['ObserveSessionResponse'];
11765
+ type ObserveLevel = components['schemas']['ObserveLevel'];
11766
+ interface StartObserveSessionOptions {
11767
+ projectId?: string;
11768
+ flowId: string;
11769
+ /** Flow settings name; the mint contract requires it. */
11770
+ settingsName: string;
11771
+ /** Replace an existing active session for the flow (`--replace`). */
11772
+ replace?: boolean;
11773
+ /** Observation detail level for the session. */
11774
+ level?: ObserveLevel;
11775
+ /** Origins the session's web activation grant may activate on. */
11776
+ origins?: string[];
11777
+ }
11778
+ /**
11779
+ * Mint an observe session via the app's authenticated boundary. Thin client:
11780
+ * the app validates topology, inserts the row, and provisions detached; the
11781
+ * mint response comes back immediately (usually `arming`, with the web and
11782
+ * server parts still null - GET assembles them once the session settles).
11783
+ */
11784
+ declare function startObserveSession(options: StartObserveSessionOptions): Promise<ObserveSessionResponse>;
11785
+ interface GetObserveSessionOptions {
11786
+ projectId?: string;
11787
+ flowId: string;
11788
+ sessionId: string;
11789
+ }
11790
+ declare function getObserveSession(options: GetObserveSessionOptions): Promise<ObserveSessionResponse>;
11791
+ interface EndObserveSessionOptions {
11792
+ projectId?: string;
11793
+ flowId: string;
11794
+ sessionId: string;
11795
+ }
11796
+ /**
11797
+ * End a session through the app's authenticated boundary: the app tears down
11798
+ * the container, revokes credentials, deletes the web preview, and drops the
11799
+ * row. Ends the WHOLE session including every attached arm. Idempotent
11800
+ * app-side, and the 204 carries no body, so this resolves with nothing; a
11801
+ * session scoped to another flow or project is a 404, never a cross-tenant end.
11802
+ */
11803
+ declare function endObserveSession(options: EndObserveSessionOptions): Promise<void>;
11804
+
11760
11805
  interface ListSecretsOptions {
11761
11806
  projectId?: string;
11762
11807
  flowId: string;
@@ -12102,4 +12147,4 @@ declare module '@walkeros/core' {
12102
12147
  }
12103
12148
  }
12104
12149
 
12105
- export { ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientType, type CompareContractInput, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentSummaryForFlow, type DeviceCodeOptions, type DeviceCodeResult, type ExampleLookupResult, type FeedbackOptions, type GetPreviewOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListJourneysOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListSecretsOptions, type MinifyOptions, type PollOptions, type PollResult, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type UpdateSecretOptions, VERSION, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, annotateErrorWithDrift, apiFetch, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clientContextHeaders, compareContract, compareOutput, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, fetchHealth, findExample, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getPreview, getProject, getProjectCommand, getToken, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listJourneys, listPreviews, listProjects, listProjectsCommand, listSecrets, loadConfig, loadJsonConfig, loginCommand, logoutCommand, mergeAuthHeaders, parseSSEEvents, pollForToken, publicFetch, push, pushCommand, readConfig, regrantPreview, requestDeviceCode, requireProjectId, resetClientContext, resolveAppUrl, resolveToken, run, runCommand, setClientContext, setDefaultProject, setFeedbackPreference, simulateCollector, simulateDestination, simulateSource, simulateTransformer, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, validateFlowStructure, whoami, whoamiCommand, wrapSkeleton, writeConfig };
12150
+ export { ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type ClientContext, type ClientType, type CompareContractInput, type ContractComparison, type ContractVerdict, type CreatePreviewOptions, type CreateSecretOptions, type DeletePreviewOptions, type DeleteSecretOptions, type DeployOptions, DeploymentAmbiguityError, type DeploymentSummaryForFlow, type DeviceCodeOptions, type DeviceCodeResult, type EndObserveSessionOptions, type ExampleLookupResult, type FeedbackOptions, type GetObserveSessionOptions, type GetPreviewOptions, type GlobalOptions, type HealthResult, type ListDeploymentsOptions, type ListFlowsOptions, type ListJourneysOptions, type ListPreviewsOptions, type ListProjectsOptions, type ListSecretsOptions, type MinifyOptions, type PollOptions, type PollResult, type PrepareInput, type PreparedFlow, type ProjectFlows, type PushResult, type RegrantPreviewOptions, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulateCollectorOptions, type SimulateDataOptions, type SimulateDestinationOptions, type SimulateSourceOptions, type SimulateTransformerOptions, type StartObserveSessionOptions, type UpdateSecretOptions, VERSION, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, type WrapSkeletonOptions, annotateErrorWithDrift, apiFetch, bakedContractHash, bakedContractVersion, buildDataPayload, bundle, bundleCommand, canonicalContractHash, classifyStepProperties, clientContextHeaders, compareContract, compareOutput, containsCodeMarkers, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createPreview, createProject, createProjectCommand, createSecret, deleteConfig, deleteDeployment, deleteDeploymentByFlowId, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deletePreview, deleteProject, deleteProjectCommand, deleteSecret, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, endObserveSession, feedback, feedbackCommand, fetchHealth, findExample, getAuthHeaders, getClientContext, getDefaultProject, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFeedbackPreference, getFlow, getFlowCommand, getObserveSession, getPreview, getProject, getProjectCommand, getToken, listAllFlows, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listJourneys, listPreviews, listProjects, listProjectsCommand, listSecrets, loadConfig, loadJsonConfig, loginCommand, logoutCommand, mergeAuthHeaders, parseSSEEvents, pollForToken, publicFetch, push, pushCommand, readConfig, regrantPreview, requestDeviceCode, requireProjectId, resetClientContext, resolveAppUrl, resolveToken, run, runCommand, setClientContext, setDefaultProject, setFeedbackPreference, simulateCollector, simulateDestination, simulateSource, simulateTransformer, startObserveSession, index as telemetry, telemetryDisableCommand, telemetryEnableCommand, telemetryStatusCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, updateSecret, validate, validateCommand, validateFlowStructure, whoami, whoamiCommand, wrapSkeleton, writeConfig };
package/dist/index.js CHANGED
@@ -8249,7 +8249,7 @@ function validateMapping(input) {
8249
8249
  // src/commands/validate/validators/entry.ts
8250
8250
  import Ajv from "ajv";
8251
8251
  import { fetchPackageSchema } from "@walkeros/core";
8252
- var CLIENT_HEADER = "walkeros-cli/4.3.1";
8252
+ var CLIENT_HEADER = "walkeros-cli/4.3.2";
8253
8253
  var SECTIONS = ["destinations", "sources", "transformers"];
8254
8254
  function resolveEntry(path20, flowConfig) {
8255
8255
  const flows = flowConfig.flows;
@@ -8814,8 +8814,8 @@ import createClient from "openapi-fetch";
8814
8814
  init_config_file();
8815
8815
  import { createHash } from "crypto";
8816
8816
  import semver4 from "semver";
8817
- var bakedContractVersion = true ? "4.0.0" : PLACEHOLDER;
8818
- var bakedContractHash = true ? "79c9e2d3bd2a72f1a95ba52742c4acdfe446c3835d5d169654f94e95da0e545e" : "";
8817
+ var bakedContractVersion = true ? "4.1.0" : PLACEHOLDER;
8818
+ var bakedContractHash = true ? "4a8fe14e34844d44db2257c97807761bd6bb812b5e28cb0595ece294728123aa" : "";
8819
8819
  function isRecord3(value) {
8820
8820
  return value !== null && typeof value === "object" && !Array.isArray(value);
8821
8821
  }
@@ -10344,6 +10344,62 @@ async function listJourneys(options) {
10344
10344
  return response.json();
10345
10345
  }
10346
10346
 
10347
+ // src/commands/observe/index.ts
10348
+ init_auth();
10349
+ init_http();
10350
+ init_output();
10351
+ init_config_file();
10352
+ async function startObserveSession(options) {
10353
+ const pid = options.projectId ?? requireProjectId();
10354
+ const body = {
10355
+ settingsName: options.settingsName,
10356
+ ...options.replace ? { replace: true } : {},
10357
+ ...options.level !== void 0 ? { level: options.level } : {},
10358
+ // An empty list carries no origin the grant could bind to, so it is
10359
+ // omitted rather than sent as a bare [] the app would have to interpret.
10360
+ ...options.origins?.length ? { origins: options.origins } : {}
10361
+ };
10362
+ const response = await apiFetch(
10363
+ `/api/projects/${pid}/flows/${options.flowId}/observe-sessions`,
10364
+ {
10365
+ method: "POST",
10366
+ headers: { "Content-Type": "application/json" },
10367
+ body: JSON.stringify(body)
10368
+ }
10369
+ );
10370
+ if (!response.ok) {
10371
+ const errorBody = await response.json().catch(() => ({}));
10372
+ throwApiResponseError(
10373
+ response,
10374
+ errorBody,
10375
+ "Failed to start observe session"
10376
+ );
10377
+ }
10378
+ return response.json();
10379
+ }
10380
+ async function getObserveSession(options) {
10381
+ const pid = options.projectId ?? requireProjectId();
10382
+ const response = await apiFetch(
10383
+ `/api/projects/${pid}/flows/${options.flowId}/observe-sessions/${options.sessionId}`
10384
+ );
10385
+ if (!response.ok) {
10386
+ const errorBody = await response.json().catch(() => ({}));
10387
+ throwApiResponseError(response, errorBody, "Failed to get observe session");
10388
+ }
10389
+ return response.json();
10390
+ }
10391
+ async function endObserveSession(options) {
10392
+ const pid = options.projectId ?? requireProjectId();
10393
+ const response = await apiFetch(
10394
+ `/api/projects/${pid}/flows/${options.flowId}/observe-sessions/${options.sessionId}`,
10395
+ { method: "DELETE" }
10396
+ );
10397
+ if (!response.ok) {
10398
+ const errorBody = await response.json().catch(() => ({}));
10399
+ throwApiResponseError(response, errorBody, "Failed to end observe session");
10400
+ }
10401
+ }
10402
+
10347
10403
  // src/commands/secrets/index.ts
10348
10404
  init_auth();
10349
10405
  init_http();
@@ -10753,6 +10809,7 @@ export {
10753
10809
  deployFetch,
10754
10810
  duplicateFlow,
10755
10811
  duplicateFlowCommand,
10812
+ endObserveSession,
10756
10813
  feedback,
10757
10814
  feedbackCommand,
10758
10815
  fetchHealth,
@@ -10767,6 +10824,7 @@ export {
10767
10824
  getFeedbackPreference,
10768
10825
  getFlow,
10769
10826
  getFlowCommand,
10827
+ getObserveSession,
10770
10828
  getPreview,
10771
10829
  getProject,
10772
10830
  getProjectCommand,
@@ -10807,6 +10865,7 @@ export {
10807
10865
  simulateDestination,
10808
10866
  simulateSource,
10809
10867
  simulateTransformer,
10868
+ startObserveSession,
10810
10869
  telemetry_exports as telemetry,
10811
10870
  telemetryDisableCommand,
10812
10871
  telemetryEnableCommand,