@theholocron/cli 5.0.0-alpha.187 → 5.0.0-alpha.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, EnsureWebhookResult, EnsuredResource, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, NotificationsChannelLayout, NotificationsLayout, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, ServerInspection, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti } from "./plugin/capabilities.mjs";
1
+ import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, EnsureWebhookResult, EnsuredResource, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsChannelLayout, NotificationsLayout, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, ServerInspection, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti } from "./plugin/capabilities.mjs";
2
2
  import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
3
3
  import { PackageJson } from "@theholocron/pkg-utils";
4
4
  import { ConfigFileError } from "@theholocron/datapad";
@@ -789,4 +789,4 @@ declare function missingCapabilities(capabilities: readonly string[]): string[];
789
789
  */
790
790
  declare function readWorkspacePackageJsons(repoRoot: string, workspacePackages: readonly WorkspacePackage[]): Promise<PackageJsonLike[]>;
791
791
  //#endregion
792
- export { Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, EnsureResult, EnsureWebhookResult, EnsuredResource, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, type FeatureResolverConfig, type HolocronConfig, type HolocronProfile, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, type LoadedConfig, type LogConfig, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsChannelLayout, NotificationsLayout, type PackageJsonLike, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, type ProviderOptions, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, RepoSettings, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, ServerInspection, type SingleEntry, Source, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, type WorkflowWithConfig, compose, createFeatureResolver, createResolveToken, createRestClient, defineConfig, deleteToken, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, getToken, isMulti, listStoredProviders, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
792
+ export { Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, EnsureResult, EnsureWebhookResult, EnsuredResource, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, type FeatureResolverConfig, type HolocronConfig, type HolocronProfile, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, type LoadedConfig, type LogConfig, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsChannelLayout, NotificationsLayout, type PackageJsonLike, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, type ProviderOptions, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, RepoSettings, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, ServerInspection, type SingleEntry, Source, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, type WorkflowWithConfig, compose, createFeatureResolver, createResolveToken, createRestClient, defineConfig, deleteToken, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, getToken, isMulti, listStoredProviders, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
@@ -740,6 +740,8 @@ interface Tooling extends ProviderIdentity {
740
740
  interface EnsuredResource {
741
741
  id: string;
742
742
  created: boolean;
743
+ /** For something that already existed: the settings that disagreed with the layout and were changed. */
744
+ updated?: string[];
743
745
  }
744
746
  /** A webhook (or equivalent inbound URL) for a channel. */
745
747
  interface EnsureWebhookResult {
@@ -751,10 +753,23 @@ interface EnsureWebhookResult {
751
753
  */
752
754
  url?: string;
753
755
  }
756
+ /**
757
+ * Who may see a channel and post in it. Roles are named as in the layout's `roles`.
758
+ * A channel inherits its category's access; stating `view` or `post` on the channel
759
+ * replaces that field only.
760
+ */
761
+ interface NotificationsAccess {
762
+ /** `"everyone"` (the default), or the roles that can see it: everyone else cannot. */
763
+ view?: "everyone" | string[];
764
+ /** `"everyone"` (the default), or the roles that can post; `[]` means only bots and webhooks. */
765
+ post?: "everyone" | string[];
766
+ }
754
767
  /** One channel in a {@link NotificationsLayout}. */
755
768
  interface NotificationsChannelLayout {
756
769
  name: string;
757
770
  topic?: string;
771
+ /** Who may see and post. Overrides the category's, field by field. */
772
+ access?: NotificationsAccess;
758
773
  /**
759
774
  * Create an inbound webhook for the channel and store its URL in a secret.
760
775
  * `true` uses the defaults; the object form overrides the webhook's display
@@ -769,11 +784,21 @@ interface NotificationsChannelLayout {
769
784
  interface NotificationsLayout {
770
785
  categories?: Array<{
771
786
  name: string;
787
+ access?: NotificationsAccess;
772
788
  channels?: NotificationsChannelLayout[];
773
789
  }>;
774
790
  roles?: Array<{
775
791
  name: string;
776
792
  mentionable?: boolean;
793
+ /** `#rrggbb`. Omit to leave the colour alone. */
794
+ color?: string;
795
+ /** Show the role's members as their own group in the member list. */
796
+ hoist?: boolean;
797
+ /**
798
+ * The permissions the role holds, by the provider's own names (for Discord, `ViewChannel`,
799
+ * `SendMessages`, …). The list is exact: a permission not named is not granted.
800
+ */
801
+ permissions?: string[];
777
802
  /**
778
803
  * Store the role's id in this secret, so a workflow can ping the role
779
804
  * without anyone copying the id by hand. The id is not sensitive; a secret
@@ -785,11 +810,16 @@ interface NotificationsLayout {
785
810
  }
786
811
  /**
787
812
  * What a provider found on the server, limited to what a {@link NotificationsLayout}
788
- * asks about. Read-only: this is what `holocron notifications verify` compares the
813
+ * asks about. Read-only: this is what `holocron doctor notifications` compares the
789
814
  * layout against.
790
815
  */
791
816
  interface ServerInspection {
792
817
  categories: string[];
818
+ /**
819
+ * Who can see and post in each category. `"custom"` means its overwrites are not an access the layout
820
+ * can state (a role-specific deny, a member overwrite, only some of the posting permissions).
821
+ */
822
+ categoryAccess?: Record<string, Required<NotificationsAccess> | "custom">;
793
823
  channels: Array<{
794
824
  name: string;
795
825
  /** The category it sits under, if any. */
@@ -799,11 +829,17 @@ interface ServerInspection {
799
829
  webhooks: string[];
800
830
  /** Set when listing this channel's webhooks failed; `webhooks` is then empty and means nothing. */
801
831
  webhooksError?: string;
832
+ /** Who can see and post; `"custom"` as for `categoryAccess`. */
833
+ access?: Required<NotificationsAccess> | "custom";
802
834
  }>;
803
835
  roles: Array<{
804
836
  name: string;
805
837
  id: string;
806
838
  mentionable: boolean;
839
+ /** `#rrggbb`, or absent for the default colour. */
840
+ color?: string;
841
+ hoist?: boolean;
842
+ permissions?: string[];
807
843
  }>;
808
844
  /** Set when reading the roles failed; `roles` is then empty and means nothing. Not read at all when the layout declares none. */
809
845
  rolesError?: string;
@@ -825,11 +861,14 @@ interface Notifications extends ProviderIdentity {
825
861
  * what is missing), and all need provider credentials beyond the posting
826
862
  * URL — so a provider that only posts simply omits them.
827
863
  */
828
- ensureCategory?(name: string): Promise<EnsuredResource>;
864
+ ensureCategory?(name: string, opts?: {
865
+ access?: NotificationsAccess;
866
+ }): Promise<EnsuredResource>;
829
867
  ensureChannel?(input: {
830
868
  name: string;
831
869
  category?: string;
832
870
  topic?: string;
871
+ access?: NotificationsAccess;
833
872
  }): Promise<EnsuredResource>;
834
873
  ensureWebhook?(input: {
835
874
  channel: string;
@@ -839,7 +878,16 @@ interface Notifications extends ProviderIdentity {
839
878
  ensureRole?(input: {
840
879
  name: string;
841
880
  mentionable?: boolean;
881
+ color?: string;
882
+ hoist?: boolean;
883
+ permissions?: string[];
842
884
  }): Promise<EnsuredResource>;
885
+ /**
886
+ * Check the provider-specific parts of the layout (colours, permission names, …) without
887
+ * touching the server, so `setup` can refuse a bad layout before it creates anything.
888
+ * Returns the first problem, or `undefined` when the layout is fine.
889
+ */
890
+ validateLayout?(layout: NotificationsLayout): string | undefined;
843
891
  /**
844
892
  * Smoke check for `holocron doctor`: prove the provisioning credentials work
845
893
  * and name what they reach. Returns `null` when there is nothing to check (a
@@ -852,7 +900,7 @@ interface Notifications extends ProviderIdentity {
852
900
  } | null>;
853
901
  /**
854
902
  * Read what exists on the server, for the parts the layout cares about, without
855
- * changing anything. Backs `holocron notifications verify`.
903
+ * changing anything. Backs `holocron doctor notifications`.
856
904
  */
857
905
  inspect?(layout: NotificationsLayout): Promise<ServerInspection>;
858
906
  }
@@ -1027,4 +1075,4 @@ declare class WebhookVerificationError extends Error {
1027
1075
  }
1028
1076
  declare function isMulti<K extends CapabilityKey>(key: K): CardinalityFor<K> extends "many" ? true : false;
1029
1077
  //#endregion
1030
- export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, EnsureWebhookResult, EnsuredResource, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, NotificationsChannelLayout, NotificationsLayout, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, ServerInspection, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti };
1078
+ export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, EnsureWebhookResult, EnsuredResource, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, Monitoring, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsChannelLayout, NotificationsLayout, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, ServerInspection, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "5.0.0-alpha.187",
3
+ "version": "5.0.0-alpha.189",
4
4
  "description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
5
5
  "keywords": [
6
6
  "cli",
@@ -63,8 +63,8 @@
63
63
  "pino-pretty": "^13.1.3",
64
64
  "posthog-node": "^5.51.6",
65
65
  "yargs": "^18.1.0",
66
- "@theholocron/astromech": "5.0.0-alpha.187",
67
- "@theholocron/datapad": "5.0.0-alpha.187"
66
+ "@theholocron/astromech": "5.0.0-alpha.189",
67
+ "@theholocron/datapad": "5.0.0-alpha.189"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@theholocron/eslint-config": "^8.8.2",