| 36 | } |
| 37 | |
| 38 | export async function createDeployment( |
| 39 | org: string, |
| 40 | projectName: string, |
| 41 | authToken: string, |
| 42 | ipfsCID: string, |
| 43 | queryImageVersion: string, |
| 44 | type: DeploymentType, |
| 45 | query: QueryAdvancedOpts, |
| 46 | chains: V3DeploymentIndexerType[], |
| 47 | url: string |
| 48 | ): Promise<DeploymentDataType> { |
| 49 | try { |
| 50 | const res = await getAxiosInstance(url, authToken).post( |
| 51 | `v3/subqueries/${buildProjectKey(org, projectName)}/deployments`, |
| 52 | { |
| 53 | cid: ipfsCID, |
| 54 | type: type, |
| 55 | queryImageVersion: queryImageVersion, |
| 56 | queryAdvancedSettings: {query}, |
| 57 | chains, |
| 58 | } satisfies V3DeploymentInput |
| 59 | ); |
| 60 | return res.data.deployment; |
| 61 | } catch (e) { |
| 62 | throw errorHandle(e, 'Error deploying to hosted service:'); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | export async function promoteDeployment( |
| 67 | org: string, |