@go-labs-sg/event-tech 0.3.0 → 0.4.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 (2) hide show
  1. package/dist/index.js +21 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14750,6 +14750,22 @@ var assertBunRuntime = (runtime = globalThis.Bun) => {
14750
14750
  };
14751
14751
 
14752
14752
  // ../../cli-auth/src/client/credential-store.ts
14753
+ class CliCredentialStoreUnavailableError extends Error {
14754
+ code = "CLI_CREDENTIAL_STORE_UNAVAILABLE";
14755
+ constructor(product, options) {
14756
+ super(`Secure credential storage is unavailable for the ${product} CLI. Bun.secrets requires the operating system credential store, including Secret Service on Linux. Browser authentication cannot continue without a supported secure store.`, options);
14757
+ this.name = "CliCredentialStoreUnavailableError";
14758
+ }
14759
+ }
14760
+ var useSecrets = async (product, operation) => {
14761
+ try {
14762
+ return await operation();
14763
+ } catch (cause) {
14764
+ if (cause instanceof CliCredentialStoreUnavailableError)
14765
+ throw cause;
14766
+ throw new CliCredentialStoreUnavailableError(product, { cause });
14767
+ }
14768
+ };
14753
14769
  var defaultSecrets = () => {
14754
14770
  assertBunRuntime();
14755
14771
  return Bun.secrets;
@@ -14762,10 +14778,10 @@ var createBunCredentialStore = ({
14762
14778
  const service = `go-labs-cli:${product}`;
14763
14779
  return {
14764
14780
  delete: async () => {
14765
- await secrets.delete({ name: account, service });
14781
+ await useSecrets(product, () => secrets.delete({ name: account, service }));
14766
14782
  },
14767
14783
  get: async () => {
14768
- const value = await secrets.get({ name: account, service });
14784
+ const value = await useSecrets(product, () => secrets.get({ name: account, service }));
14769
14785
  if (value === null)
14770
14786
  return null;
14771
14787
  try {
@@ -14776,11 +14792,11 @@ var createBunCredentialStore = ({
14776
14792
  },
14777
14793
  set: async (credentials) => {
14778
14794
  const parsed = storedCliCredentialsSchema.parse(credentials);
14779
- await secrets.set({
14795
+ await useSecrets(product, () => secrets.set({
14780
14796
  name: account,
14781
14797
  service,
14782
14798
  value: JSON.stringify(parsed)
14783
- });
14799
+ }));
14784
14800
  }
14785
14801
  };
14786
14802
  };
@@ -14956,7 +14972,7 @@ import {
14956
14972
  import SuperJSON from "superjson";
14957
14973
 
14958
14974
  // src/config.ts
14959
- var DEFAULT_EVENT_TECH_API_BASE_URL = "https://shared-events.getout.events";
14975
+ var DEFAULT_EVENT_TECH_API_BASE_URL = "https://app.getout.events";
14960
14976
 
14961
14977
  class CliConfigurationError extends Error {
14962
14978
  code = "CONFIGURATION";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-labs-sg/event-tech",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Event Tech CLI for managing Event Tech resources through the Go Labs API.",
5
5
  "type": "module",
6
6
  "bin": {