freestyle-sandboxes 0.0.53 → 0.0.55

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/src/index.ts CHANGED
@@ -798,13 +798,14 @@ export class FreestyleSandboxes {
798
798
  * not store the url in your database!
799
799
  */
800
800
  async requestDevServer({
801
- repo,
802
801
  repoUrl,
803
802
  repoId,
804
803
  }: {
805
- repoUrl?: string;
806
- repoId?: string;
807
- repo?: string;
804
+ /**
805
+ * @deprecated
806
+ */
807
+ repoUrl?: string,
808
+ repoId?: string, repo?: string
808
809
  }) {
809
810
  function formatHook(serverUrl: string, repoUrl: string) {
810
811
  const hook =
@@ -818,7 +819,7 @@ export class FreestyleSandboxes {
818
819
  client: this.client,
819
820
  body: {
820
821
  // @ts-ignore
821
- repo: repo || repoUrl,
822
+ repo: repoUrl,
822
823
  repoId: repoId,
823
824
  },
824
825
  });
@@ -829,11 +830,8 @@ export class FreestyleSandboxes {
829
830
  await this.createGitTrigger({
830
831
  repoId: rId,
831
832
  action: {
832
- endpoint: formatHook(
833
- response.data?.url!,
834
- repoUrl || repo || `https://git.freestyle.sh/${rId}`
835
- ),
836
- action: "webhook",
833
+ endpoint: formatHook(response.data?.url!, repoUrl || `https://git.freestyle.sh/${rId}`),
834
+ action: "webhook"
837
835
  },
838
836
  trigger: {
839
837
  event: "push",
@@ -39,11 +39,11 @@ export function DefaultLoadingComponent({
39
39
  }
40
40
 
41
41
  export function FreestyleDevServer({
42
- repoUrl,
43
42
  loadingComponent,
44
43
  actions,
44
+ repoId,
45
45
  }: {
46
- repoUrl: string;
46
+ repoId: string;
47
47
  loadingComponent?: (props: {
48
48
  devCommandRunning: boolean;
49
49
  installCommandRunning: boolean;
@@ -55,7 +55,7 @@ export function FreestyleDevServer({
55
55
  <QueryClientProvider client={queryClient}>
56
56
  <FreestyleDevServerInner
57
57
  loadingComponent={loadingComponent ?? DefaultLoadingComponent}
58
- repoUrl={repoUrl}
58
+ repoId={repoId}
59
59
  actions={actions}
60
60
  />
61
61
  </QueryClientProvider>
@@ -63,11 +63,11 @@ export function FreestyleDevServer({
63
63
  }
64
64
 
65
65
  function FreestyleDevServerInner({
66
- repoUrl,
66
+ repoId,
67
67
  loadingComponent,
68
68
  actions: { requestDevServer },
69
69
  }: {
70
- repoUrl: string;
70
+ repoId: string;
71
71
  loadingComponent: (props: {
72
72
  devCommandRunning: boolean;
73
73
  installCommandRunning: boolean;
@@ -76,8 +76,8 @@ function FreestyleDevServerInner({
76
76
  actions: RequestDevServerActions;
77
77
  }) {
78
78
  const { data, isLoading } = useQuery({
79
- queryKey: ["dev-server", repoUrl],
80
- queryFn: async () => await requestDevServer({ repoUrl: repoUrl }),
79
+ queryKey: ["dev-server", repoId],
80
+ queryFn: async () => await requestDevServer({ repoId: repoId }),
81
81
  refetchInterval: 1000,
82
82
  });
83
83
 
@@ -1,5 +1,5 @@
1
1
  export type RequestDevServerActions = {
2
2
  requestDevServer: (args: {
3
- repoUrl: string;
3
+ repoId: string;
4
4
  }) => Promise<{ ephemeralUrl: string; devCommandRunning: boolean; installCommandRunning: boolean; }>;
5
5
  };