@nosana/api 0.1.9 → 0.1.11

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 (26) hide show
  1. package/dist/client/deployment-manager-schema.d.ts +2100 -0
  2. package/dist/client/deployment-manager-schema.js +6 -0
  3. package/dist/client/deployment-manager-schema.js.map +1 -0
  4. package/dist/client/index.js +4 -1
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/client/schema.d.ts +226 -36
  7. package/dist/routes/deployments/deployment/actions/deploymentCreateNewRevision.js +0 -1
  8. package/dist/routes/deployments/deployment/actions/deploymentCreateNewRevision.js.map +1 -1
  9. package/dist/routes/deployments/deployment/actions/deploymentGetEvents.d.ts +13 -0
  10. package/dist/routes/deployments/deployment/actions/deploymentGetEvents.js +19 -0
  11. package/dist/routes/deployments/deployment/actions/deploymentGetEvents.js.map +1 -0
  12. package/dist/routes/deployments/deployment/actions/deploymentGetJobs.d.ts +13 -0
  13. package/dist/routes/deployments/deployment/actions/deploymentGetJobs.js +19 -0
  14. package/dist/routes/deployments/deployment/actions/deploymentGetJobs.js.map +1 -0
  15. package/dist/routes/deployments/deployment/actions/deploymentGetRevisions.d.ts +13 -0
  16. package/dist/routes/deployments/deployment/actions/deploymentGetRevisions.js +19 -0
  17. package/dist/routes/deployments/deployment/actions/deploymentGetRevisions.js.map +1 -0
  18. package/dist/routes/deployments/deployment/actions/index.d.ts +3 -0
  19. package/dist/routes/deployments/deployment/actions/index.js +3 -0
  20. package/dist/routes/deployments/deployment/actions/index.js.map +1 -1
  21. package/dist/routes/deployments/deployment/createDeployment.d.ts +3 -1
  22. package/dist/routes/deployments/deployment/createDeployment.js +37 -1
  23. package/dist/routes/deployments/deployment/createDeployment.js.map +1 -1
  24. package/dist/routes/deployments/index.js.map +1 -1
  25. package/dist/routes/deployments/types.d.ts +8 -2
  26. package/package.json +2 -2
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=deployment-manager-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployment-manager-schema.js","sourceRoot":"","sources":["../../src/client/deployment-manager-schema.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -16,7 +16,10 @@ export function createNosanaClient(environment, authParams, options) {
16
16
  }
17
17
  }
18
18
  };
19
- const client = createClient({ baseUrl: backend_url });
19
+ const client = createClient({
20
+ baseUrl: backend_url,
21
+ credentials: 'include',
22
+ });
20
23
  client.use(authMiddleware);
21
24
  return client;
22
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAiC,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAcrD,MAAM,UAAU,kBAAkB,CAChC,WAA0B,EAC1B,UAA+C,EAC/C,OAA2C;IAE3C,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC;IAEnF,MAAM,cAAc,GAAe;QACjC,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE;YACzB,IAAI,UAAU,EAAE,CAAC;gBACjB,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;oBACnC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,UAAU,EAAE,CAAC,CAAC;gBAC/D,CAAC;qBAAM,CAAC;oBACN,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;oBACxE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;oBACxD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;gBACjD,CAAC;YACH,CAAC;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,CAAC"}
@@ -593,6 +593,225 @@ export interface paths {
593
593
  patch?: never;
594
594
  trace?: never;
595
595
  };
596
+ "/api/deployments/{deployment}/jobs": {
597
+ parameters: {
598
+ query?: never;
599
+ header?: never;
600
+ path?: never;
601
+ cookie?: never;
602
+ };
603
+ /** @description Get jobs for a specific deployment. */
604
+ get: {
605
+ parameters: {
606
+ query?: never;
607
+ header: {
608
+ /** @description Required when using Wallet Authentication. The public key used to sign authentication header. */
609
+ "x-user-id"?: string;
610
+ /**
611
+ * @description Authentication token, either an API key or a wallet-signed message.
612
+ * @example Bearer <ApiKey> or WalletSignedMessage
613
+ */
614
+ authorization: string;
615
+ };
616
+ path: {
617
+ deployment: components["schemas"]["PublicKey"];
618
+ };
619
+ cookie?: never;
620
+ };
621
+ requestBody?: never;
622
+ responses: {
623
+ /** @description List of jobs for the deployment. */
624
+ 200: {
625
+ headers: {
626
+ [name: string]: unknown;
627
+ };
628
+ content: {
629
+ "application/json": components["schemas"]["Job"][];
630
+ };
631
+ };
632
+ /** @description Unauthorized. Invalid or missing authentication. */
633
+ 401: {
634
+ headers: {
635
+ [name: string]: unknown;
636
+ };
637
+ content: {
638
+ "application/json": "Unauthorized";
639
+ };
640
+ };
641
+ /** @description Deployment not found. */
642
+ 404: {
643
+ headers: {
644
+ [name: string]: unknown;
645
+ };
646
+ content: {
647
+ "application/json": components["schemas"]["Error"];
648
+ };
649
+ };
650
+ /** @description Internal Server Error. */
651
+ 500: {
652
+ headers: {
653
+ [name: string]: unknown;
654
+ };
655
+ content: {
656
+ "application/json": components["schemas"]["Error"];
657
+ };
658
+ };
659
+ };
660
+ };
661
+ put?: never;
662
+ post?: never;
663
+ delete?: never;
664
+ options?: never;
665
+ head?: never;
666
+ patch?: never;
667
+ trace?: never;
668
+ };
669
+ "/api/deployments/{deployment}/revisions": {
670
+ parameters: {
671
+ query?: never;
672
+ header?: never;
673
+ path?: never;
674
+ cookie?: never;
675
+ };
676
+ /** @description Get revisions for a specific deployment. */
677
+ get: {
678
+ parameters: {
679
+ query?: never;
680
+ header: {
681
+ /** @description Required when using Wallet Authentication. The public key used to sign authentication header. */
682
+ "x-user-id"?: string;
683
+ /**
684
+ * @description Authentication token, either an API key or a wallet-signed message.
685
+ * @example Bearer <ApiKey> or WalletSignedMessage
686
+ */
687
+ authorization: string;
688
+ };
689
+ path: {
690
+ deployment: components["schemas"]["PublicKey"];
691
+ };
692
+ cookie?: never;
693
+ };
694
+ requestBody?: never;
695
+ responses: {
696
+ /** @description List of revisions for the deployment. */
697
+ 200: {
698
+ headers: {
699
+ [name: string]: unknown;
700
+ };
701
+ content: {
702
+ "application/json": components["schemas"]["Revision"][];
703
+ };
704
+ };
705
+ /** @description Unauthorized. Invalid or missing authentication. */
706
+ 401: {
707
+ headers: {
708
+ [name: string]: unknown;
709
+ };
710
+ content: {
711
+ "application/json": "Unauthorized";
712
+ };
713
+ };
714
+ /** @description Deployment not found. */
715
+ 404: {
716
+ headers: {
717
+ [name: string]: unknown;
718
+ };
719
+ content: {
720
+ "application/json": components["schemas"]["Error"];
721
+ };
722
+ };
723
+ /** @description Internal Server Error. */
724
+ 500: {
725
+ headers: {
726
+ [name: string]: unknown;
727
+ };
728
+ content: {
729
+ "application/json": components["schemas"]["Error"];
730
+ };
731
+ };
732
+ };
733
+ };
734
+ put?: never;
735
+ post?: never;
736
+ delete?: never;
737
+ options?: never;
738
+ head?: never;
739
+ patch?: never;
740
+ trace?: never;
741
+ };
742
+ "/api/deployments/{deployment}/events": {
743
+ parameters: {
744
+ query?: never;
745
+ header?: never;
746
+ path?: never;
747
+ cookie?: never;
748
+ };
749
+ /** @description Get events for a specific deployment. */
750
+ get: {
751
+ parameters: {
752
+ query?: never;
753
+ header: {
754
+ /** @description Required when using Wallet Authentication. The public key used to sign authentication header. */
755
+ "x-user-id"?: string;
756
+ /**
757
+ * @description Authentication token, either an API key or a wallet-signed message.
758
+ * @example Bearer <ApiKey> or WalletSignedMessage
759
+ */
760
+ authorization: string;
761
+ };
762
+ path: {
763
+ deployment: components["schemas"]["PublicKey"];
764
+ };
765
+ cookie?: never;
766
+ };
767
+ requestBody?: never;
768
+ responses: {
769
+ /** @description List of events for the deployment. */
770
+ 200: {
771
+ headers: {
772
+ [name: string]: unknown;
773
+ };
774
+ content: {
775
+ "application/json": components["schemas"]["Event"][];
776
+ };
777
+ };
778
+ /** @description Unauthorized. Invalid or missing authentication. */
779
+ 401: {
780
+ headers: {
781
+ [name: string]: unknown;
782
+ };
783
+ content: {
784
+ "application/json": "Unauthorized";
785
+ };
786
+ };
787
+ /** @description Deployment not found. */
788
+ 404: {
789
+ headers: {
790
+ [name: string]: unknown;
791
+ };
792
+ content: {
793
+ "application/json": components["schemas"]["Error"];
794
+ };
795
+ };
796
+ /** @description Internal Server Error. */
797
+ 500: {
798
+ headers: {
799
+ [name: string]: unknown;
800
+ };
801
+ content: {
802
+ "application/json": components["schemas"]["Error"];
803
+ };
804
+ };
805
+ };
806
+ };
807
+ put?: never;
808
+ post?: never;
809
+ delete?: never;
810
+ options?: never;
811
+ head?: never;
812
+ patch?: never;
813
+ trace?: never;
814
+ };
596
815
  "/api/deployments/create": {
597
816
  parameters: {
598
817
  query?: never;
@@ -1701,38 +1920,8 @@ export interface components {
1701
1920
  market: string;
1702
1921
  owner: string;
1703
1922
  status: "DRAFT" | "ERROR" | "STARTING" | "RUNNING" | "STOPPING" | "STOPPED" | "INSUFFICIENT_FUNDS" | "ARCHIVED";
1704
- revisions: {
1705
- revision: number;
1706
- deployment: string;
1707
- ipfs_definition_hash: string;
1708
- job_definition: components["schemas"]["JobDefinition"];
1709
- /** Format: date-time */
1710
- created_at: string;
1711
- }[];
1712
1923
  replicas: number;
1713
1924
  timeout: number;
1714
- jobs: {
1715
- tx: string;
1716
- job: string;
1717
- deployment: string;
1718
- market: string;
1719
- revision: number;
1720
- state: "QUEUED" | "RUNNING" | "COMPLETED" | "STOPPED";
1721
- time_start: number;
1722
- /** Format: date-time */
1723
- created_at: string;
1724
- /** Format: date-time */
1725
- updated_at: string;
1726
- }[];
1727
- events: {
1728
- category: "Deployment" | "Event";
1729
- deploymentId: string;
1730
- type: string;
1731
- message: string;
1732
- tx?: string;
1733
- /** Format: date-time */
1734
- created_at: string;
1735
- }[];
1736
1925
  endpoints: {
1737
1926
  opId: string;
1738
1927
  port: number | string;
@@ -1740,6 +1929,7 @@ export interface components {
1740
1929
  }[];
1741
1930
  confidential: boolean;
1742
1931
  active_revision: number;
1932
+ active_jobs: number;
1743
1933
  /** Format: date-time */
1744
1934
  created_at: string;
1745
1935
  /** Format: date-time */
@@ -1798,8 +1988,8 @@ export interface components {
1798
1988
  Error: {
1799
1989
  error: string;
1800
1990
  };
1801
- /** Events */
1802
- Events: {
1991
+ /** Event */
1992
+ Event: {
1803
1993
  category: "Deployment" | "Event";
1804
1994
  deploymentId: string;
1805
1995
  type: string;
@@ -1808,8 +1998,8 @@ export interface components {
1808
1998
  /** Format: date-time */
1809
1999
  created_at: string;
1810
2000
  };
1811
- /** Jobs */
1812
- Jobs: {
2001
+ /** Job */
2002
+ Job: {
1813
2003
  tx: string;
1814
2004
  job: string;
1815
2005
  deployment: string;
@@ -1991,7 +2181,7 @@ export interface components {
1991
2181
  /** @enum {string} */
1992
2182
  policy: "on-failure";
1993
2183
  restart_tries?: number;
1994
- } | ("no" | "always" | "unless-stopped" | "on-failure");
2184
+ } | ("on-failure" | "no" | "always" | "unless-stopped");
1995
2185
  private?: boolean;
1996
2186
  resources?: ({
1997
2187
  __spread__: string;
@@ -2130,7 +2320,7 @@ export interface components {
2130
2320
  End: string;
2131
2321
  ExitCode: number;
2132
2322
  Output: string;
2133
- }[];
2323
+ }[] | null;
2134
2324
  };
2135
2325
  RestartCount: number;
2136
2326
  };
@@ -11,7 +11,6 @@ export async function deploymentCreateNewRevision(jobDefinition, client, state)
11
11
  active_revision: data.active_revision,
12
12
  endpoints: data.endpoints,
13
13
  updated_at: new Date(data.updated_at),
14
- revisions: [...state.revisions, data.revisions],
15
14
  });
16
15
  }
17
16
  //# sourceMappingURL=deploymentCreateNewRevision.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploymentCreateNewRevision.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/deploymentCreateNewRevision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAMrE,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,aAA4B,EAAE,MAAmB,EAAE,KAAsB;IACzH,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,+CAA+C,EAAE;QACzF,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;QAC1C,IAAI,EAAE,aAAuD;KAC9D,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;QACnB,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;QACrC,SAAS,EAAE,CAAC,GAAG,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC;KAChD,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"deploymentCreateNewRevision.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/deploymentCreateNewRevision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAMrE,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,aAA4B,EAAE,MAAmB,EAAE,KAAsB;IACzH,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,+CAA+C,EAAE;QACzF,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;QAC1C,IAAI,EAAE,aAAuD;KAC9D,CAAC,CAAC;IAEH,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;QACnB,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;KACtC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { QueryClient } from '../../../../client/index.js';
2
+ import type { paths } from '@nosana/types';
3
+ import type { DeploymentState } from '../../types.js';
4
+ export type DeploymentEvents = paths['/api/deployments/{deployment}/events']['get']['responses']['200']['content']['application/json'];
5
+ /**
6
+ * @returns Promise<DeploymentEvents>
7
+ * @throws Error if there is an error fetching the events
8
+ * @throws Error if the deployment is not found
9
+ * @description Fetches the events for the deployment.
10
+ * This will return all events associated with the deployment.
11
+ * It is useful for monitoring deployment activity and debugging.
12
+ */
13
+ export declare function deploymentGetEvents(client: QueryClient, state: DeploymentState): Promise<DeploymentEvents>;
@@ -0,0 +1,19 @@
1
+ import { errorFormatter } from '../../../../utils/errorFormatter.js';
2
+ /**
3
+ * @returns Promise<DeploymentEvents>
4
+ * @throws Error if there is an error fetching the events
5
+ * @throws Error if the deployment is not found
6
+ * @description Fetches the events for the deployment.
7
+ * This will return all events associated with the deployment.
8
+ * It is useful for monitoring deployment activity and debugging.
9
+ */
10
+ export async function deploymentGetEvents(client, state) {
11
+ const { data, error } = await client.GET('/api/deployments/{deployment}/events', {
12
+ params: { path: { deployment: state.id } },
13
+ });
14
+ if (error || !data) {
15
+ throw errorFormatter('Error getting deployment events', error);
16
+ }
17
+ return data;
18
+ }
19
+ //# sourceMappingURL=deploymentGetEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentGetEvents.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/deploymentGetEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAQrE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAmB,EACnB,KAAsB;IAEtB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,sCAAsC,EACtC;QACE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;KAC3C,CACF,CAAC;IAEF,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { QueryClient } from '../../../../client/index.js';
2
+ import type { paths } from '@nosana/types';
3
+ import type { DeploymentState } from '../../types.js';
4
+ export type DeploymentJobs = paths['/api/deployments/{deployment}/jobs']['get']['responses']['200']['content']['application/json'];
5
+ /**
6
+ * @returns Promise<DeploymentJobs>
7
+ * @throws Error if there is an error fetching the jobs
8
+ * @throws Error if the deployment is not found
9
+ * @description Fetches the jobs for the deployment.
10
+ * This will return the current jobs associated with the deployment.
11
+ * It is useful for monitoring the deployment's job status.
12
+ */
13
+ export declare function deploymentGetJobs(client: QueryClient, state: DeploymentState): Promise<DeploymentJobs>;
@@ -0,0 +1,19 @@
1
+ import { errorFormatter } from '../../../../utils/errorFormatter.js';
2
+ /**
3
+ * @returns Promise<DeploymentJobs>
4
+ * @throws Error if there is an error fetching the jobs
5
+ * @throws Error if the deployment is not found
6
+ * @description Fetches the jobs for the deployment.
7
+ * This will return the current jobs associated with the deployment.
8
+ * It is useful for monitoring the deployment's job status.
9
+ */
10
+ export async function deploymentGetJobs(client, state) {
11
+ const { data, error } = await client.GET('/api/deployments/{deployment}/jobs', {
12
+ params: { path: { deployment: state.id } },
13
+ });
14
+ if (error || !data) {
15
+ throw errorFormatter('Error getting deployment jobs', error);
16
+ }
17
+ return data;
18
+ }
19
+ //# sourceMappingURL=deploymentGetJobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentGetJobs.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/deploymentGetJobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAQrE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAmB,EACnB,KAAsB;IAEtB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,oCAAoC,EACpC;QACE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;KAC3C,CACF,CAAC;IAEF,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { QueryClient } from '../../../../client/index.js';
2
+ import type { paths } from '@nosana/types';
3
+ import type { DeploymentState } from '../../types.js';
4
+ export type DeploymentRevisions = paths['/api/deployments/{deployment}/revisions']['get']['responses']['200']['content']['application/json'];
5
+ /**
6
+ * @returns Promise<DeploymentRevisions>
7
+ * @throws Error if there is an error fetching the revisions
8
+ * @throws Error if the deployment is not found
9
+ * @description Fetches the revisions for the deployment.
10
+ * This will return all revisions associated with the deployment.
11
+ * It is useful for viewing the deployment history.
12
+ */
13
+ export declare function deploymentGetRevisions(client: QueryClient, state: DeploymentState): Promise<DeploymentRevisions>;
@@ -0,0 +1,19 @@
1
+ import { errorFormatter } from '../../../../utils/errorFormatter.js';
2
+ /**
3
+ * @returns Promise<DeploymentRevisions>
4
+ * @throws Error if there is an error fetching the revisions
5
+ * @throws Error if the deployment is not found
6
+ * @description Fetches the revisions for the deployment.
7
+ * This will return all revisions associated with the deployment.
8
+ * It is useful for viewing the deployment history.
9
+ */
10
+ export async function deploymentGetRevisions(client, state) {
11
+ const { data, error } = await client.GET('/api/deployments/{deployment}/revisions', {
12
+ params: { path: { deployment: state.id } },
13
+ });
14
+ if (error || !data) {
15
+ throw errorFormatter('Error getting deployment revisions', error);
16
+ }
17
+ return data;
18
+ }
19
+ //# sourceMappingURL=deploymentGetRevisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentGetRevisions.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/deploymentGetRevisions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAQrE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAmB,EACnB,KAAsB;IAEtB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CACtC,yCAAyC,EACzC;QACE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE;KAC3C,CACF,CAAC;IAEF,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,MAAM,cAAc,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,7 +1,10 @@
1
1
  export * from './deploymentArchive.js';
2
2
  export * from './deploymentCreateNewRevision.js';
3
3
  export * from './deploymentDelete.js';
4
+ export * from './deploymentGetEvents.js';
4
5
  export * from './deploymentGetJob.js';
6
+ export * from './deploymentGetJobs.js';
7
+ export * from './deploymentGetRevisions.js';
5
8
  export * from './deploymentGetTasks.js';
6
9
  export * from './deploymentStart.js';
7
10
  export * from './deploymentStop.js';
@@ -1,7 +1,10 @@
1
1
  export * from './deploymentArchive.js';
2
2
  export * from './deploymentCreateNewRevision.js';
3
3
  export * from './deploymentDelete.js';
4
+ export * from './deploymentGetEvents.js';
4
5
  export * from './deploymentGetJob.js';
6
+ export * from './deploymentGetJobs.js';
7
+ export * from './deploymentGetRevisions.js';
5
8
  export * from './deploymentGetTasks.js';
6
9
  export * from './deploymentStart.js';
7
10
  export * from './deploymentStop.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/routes/deployments/deployment/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
@@ -1,5 +1,7 @@
1
- import type { Deployment as DeploymentSchema } from '@nosana/types';
2
1
  import type { Deployment, ApiDeployment } from '../types.js';
3
2
  import type { RouteOptions, RouteOptionsWithSigner } from '../../../types.js';
3
+ import type { components } from '@nosana/types';
4
+ type DeploymentSchema = components['schemas']['Deployment'];
4
5
  export declare function createDeployment(deployment: DeploymentSchema, options: RouteOptions, hasApiKey: true): ApiDeployment;
5
6
  export declare function createDeployment(deployment: DeploymentSchema, options: RouteOptionsWithSigner, hasApiKey: false): Deployment;
7
+ export {};
@@ -1,4 +1,4 @@
1
- import { deploymentStop, deploymentStart, deploymentGetJob, deploymentArchive, deploymentUpdateReplicaCount, deploymentGetTasks, deploymentUpdateTimeout, deploymentCreateNewRevision, deploymentUpdateActiveRevision, deploymentUpdateSchedule, deploymentGenerateAuthHeader, deploymentDelete } from './actions/index.js';
1
+ import { deploymentStop, deploymentStart, deploymentGetEvents, deploymentGetJob, deploymentGetJobs, deploymentGetRevisions, deploymentArchive, deploymentUpdateReplicaCount, deploymentGetTasks, deploymentUpdateTimeout, deploymentCreateNewRevision, deploymentUpdateActiveRevision, deploymentUpdateSchedule, deploymentGenerateAuthHeader, deploymentDelete } from './actions/index.js';
2
2
  import { createVault } from './createVault.js';
3
3
  export function createDeployment(deployment, options, hasApiKey) {
4
4
  let state = {
@@ -113,6 +113,39 @@ export function createDeployment(deployment, options, hasApiKey) {
113
113
  const getJob = async (job) => {
114
114
  return await deploymentGetJob(options.client, state.id, job);
115
115
  };
116
+ /**
117
+ * @returns Promise<DeploymentJobs>
118
+ * @throws Error if there is an error fetching the jobs
119
+ * @throws Error if the deployment is not found
120
+ * @description Fetches all jobs for the deployment.
121
+ * This will return the current jobs associated with the deployment.
122
+ * It is useful for monitoring the deployment's job status.
123
+ */
124
+ const getJobs = async () => {
125
+ return await deploymentGetJobs(options.client, state);
126
+ };
127
+ /**
128
+ * @returns Promise<DeploymentRevisions>
129
+ * @throws Error if there is an error fetching the revisions
130
+ * @throws Error if the deployment is not found
131
+ * @description Fetches all revisions for the deployment.
132
+ * This will return all revisions associated with the deployment.
133
+ * It is useful for viewing the deployment history.
134
+ */
135
+ const getRevisions = async () => {
136
+ return await deploymentGetRevisions(options.client, state);
137
+ };
138
+ /**
139
+ * @returns Promise<DeploymentEvents>
140
+ * @throws Error if there is an error fetching the events
141
+ * @throws Error if the deployment is not found
142
+ * @description Fetches all events for the deployment.
143
+ * This will return all events associated with the deployment.
144
+ * It is useful for monitoring deployment activity and debugging.
145
+ */
146
+ const getEvents = async () => {
147
+ return await deploymentGetEvents(options.client, state);
148
+ };
116
149
  /**
117
150
  * @throws Error if the deployment is not stopped
118
151
  * @throws Error if there is an error deleting the deployment
@@ -139,6 +172,9 @@ export function createDeployment(deployment, options, hasApiKey) {
139
172
  delete: deleteDeployment,
140
173
  getTasks,
141
174
  getJob,
175
+ getJobs,
176
+ getRevisions,
177
+ getEvents,
142
178
  generateAuthHeader,
143
179
  createRevision,
144
180
  updateReplicaCount,
@@ -1 +1 @@
1
- {"version":3,"file":"createDeployment.js","sourceRoot":"","sources":["../../../../src/routes/deployments/deployment/createDeployment.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAc/C,MAAM,UAAU,gBAAgB,CA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C,CAAC,CAAC,EAAE,CAAC;QACP,KAAK;QACL,IAAI;QACJ,OAAO;QACP,MAAM,EAAE,gBAAgB;QACxB,QAAQ;QACR,MAAM;QACN,kBAAkB;QAClB,cAAc;QACd,kBAAkB;QAClB,oBAAoB;QACpB,aAAa;QACb,cAAc;KACf,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"createDeployment.js","sourceRoot":"","sources":["../../../../src/routes/deployments/deployment/createDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoB/C,MAAM,UAAU,gBAAgB,CAC9B,UAA4B,EAC5B,OAA8C,EAC9C,SAAuB;IAEvB,IAAI,KAAK,GAAoB;QAC3B,GAAG,UAAU;QACb,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAC3C,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;KAC5C,CAAC;IAEF;;;;;OAKG;IACH,MAAM,KAAK,GAAG,KAAK,IAAmB,EAAE;QACtC,MAAM,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF;;;;;;;OAOG;IACH,MAAM,IAAI,GAAG,KAAK,IAAmB,EAAE;QACrC,MAAM,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEF;;;;;;;OAOG;IACH,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;QACzB,MAAM,iBAAiB,CA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AAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;QAExF,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,MAAM,cAAc,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,aAAa,CAClB,IAAI,CAAC,KAAK,EACV,OAAO,EACP,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAC1B,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;QAC5B,IAAI,SAAS,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,cAAc,CAAC,iDAAiD,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;QAEhF,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,MAAM,cAAc,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,aAAa,CACtD,KAAK,EACL,OAAO,EACP,IAAI,IAAI,CAAC,UAAU,CAAC,CACrB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,GAAG;QACH,IAAI;QACJ,IAAI;QACJ,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YACf,MAAM,EAAE;gBACN,MAAM,EAAE,WAAW;gBACnB,IAAI,EAAE,UAAU;aACjB;SACF,CAAC,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { JobDefinition, Task, Deployment as DeploymentSchema, components, paths } from '@nosana/types';
1
+ import type { JobDefinition, Task, components, paths } from '@nosana/types';
2
2
  export type { JobDefinition, Task } from '@nosana/types';
3
- export type DeploymentState = Omit<DeploymentSchema, "updated_at" | "created_at"> & {
3
+ export type DeploymentState = Omit<components['schemas']['Deployment'], "updated_at" | "created_at"> & {
4
4
  updated_at: Date;
5
5
  created_at: Date;
6
6
  };
@@ -8,6 +8,9 @@ export type DeploymentCreateBody = components['schemas']['DeploymentCreateBody']
8
8
  export type CreateDeployment = Omit<DeploymentCreateBody, 'job_definition'> & {
9
9
  job_definition: JobDefinition;
10
10
  };
11
+ export type DeploymentJobs = paths['/api/deployments/{deployment}/jobs']['get']['responses']['200']['content']['application/json'];
12
+ export type DeploymentRevisions = paths['/api/deployments/{deployment}/revisions']['get']['responses']['200']['content']['application/json'];
13
+ export type DeploymentEvents = paths['/api/deployments/{deployment}/events']['get']['responses']['200']['content']['application/json'];
11
14
  export interface TopupVaultOptions {
12
15
  SOL?: number;
13
16
  NOS?: number;
@@ -35,6 +38,9 @@ export type ApiDeployment = DeploymentState & {
35
38
  delete: () => Promise<void>;
36
39
  getTasks: () => Promise<Task[]>;
37
40
  getJob: (job: string) => Promise<DeploymentJob>;
41
+ getJobs: () => Promise<DeploymentJobs>;
42
+ getRevisions: () => Promise<DeploymentRevisions>;
43
+ getEvents: () => Promise<DeploymentEvents>;
38
44
  generateAuthHeader: () => Promise<string>;
39
45
  createRevision: (jobDefinition: JobDefinition) => Promise<void>;
40
46
  updateActiveRevision: (revision: number) => Promise<void>;