@nixopus/api-client 0.0.9 → 0.0.10

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.mjs CHANGED
@@ -1162,6 +1162,7 @@ var pauseLiveDeployService = (options) => (options.client ?? client).post({
1162
1162
  ...options.headers
1163
1163
  }
1164
1164
  });
1165
+ var getMachineBillingStatus = (options) => (options?.client ?? client).get({ url: "/api/v1/machine/billing", ...options });
1165
1166
  var executeACommandOnTheHostMachine = (options) => (options.client ?? client).post({
1166
1167
  url: "/api/v1/machine/exec",
1167
1168
  ...options,
@@ -1170,7 +1171,20 @@ var executeACommandOnTheHostMachine = (options) => (options.client ?? client).po
1170
1171
  ...options.headers
1171
1172
  }
1172
1173
  });
1174
+ var pauseMachine = (options) => (options?.client ?? client).post({ url: "/api/v1/machine/pause", ...options });
1175
+ var selectAMachinePlan = (options) => (options.client ?? client).post({
1176
+ url: "/api/v1/machine/plan/select",
1177
+ ...options,
1178
+ headers: {
1179
+ "Content-Type": "*/*",
1180
+ ...options.headers
1181
+ }
1182
+ });
1183
+ var listAvailableMachinePlans = (options) => (options?.client ?? client).get({ url: "/api/v1/machine/plans", ...options });
1184
+ var restartMachine = (options) => (options?.client ?? client).post({ url: "/api/v1/machine/restart", ...options });
1185
+ var resumeMachine = (options) => (options?.client ?? client).post({ url: "/api/v1/machine/resume", ...options });
1173
1186
  var getMachineSystemStats = (options) => (options?.client ?? client).get({ url: "/api/v1/machine/stats", ...options });
1187
+ var getMachineLifecycleStatus = (options) => (options?.client ?? client).get({ url: "/api/v1/machine/status", ...options });
1174
1188
  var getNotificationPreferences = (options) => (options?.client ?? client).get({ url: "/api/v1/notification/preferences", ...options });
1175
1189
  var updateNotificationPreferences = (options) => (options.client ?? client).post({
1176
1190
  url: "/api/v1/notification/preferences",
@@ -2557,6 +2571,19 @@ var pauseLiveDeployServiceMutation = (options) => {
2557
2571
  };
2558
2572
  return mutationOptions;
2559
2573
  };
2574
+ var getMachineBillingStatusQueryKey = (options) => createQueryKey("getMachineBillingStatus", options);
2575
+ var getMachineBillingStatusOptions = (options) => queryOptions({
2576
+ queryFn: async ({ queryKey, signal }) => {
2577
+ const { data } = await getMachineBillingStatus({
2578
+ ...options,
2579
+ ...queryKey[0],
2580
+ signal,
2581
+ throwOnError: true
2582
+ });
2583
+ return data;
2584
+ },
2585
+ queryKey: getMachineBillingStatusQueryKey(options)
2586
+ });
2560
2587
  var executeACommandOnTheHostMachineMutation = (options) => {
2561
2588
  const mutationOptions = {
2562
2589
  mutationFn: async (fnOptions) => {
@@ -2570,6 +2597,71 @@ var executeACommandOnTheHostMachineMutation = (options) => {
2570
2597
  };
2571
2598
  return mutationOptions;
2572
2599
  };
2600
+ var pauseMachineMutation = (options) => {
2601
+ const mutationOptions = {
2602
+ mutationFn: async (fnOptions) => {
2603
+ const { data } = await pauseMachine({
2604
+ ...options,
2605
+ ...fnOptions,
2606
+ throwOnError: true
2607
+ });
2608
+ return data;
2609
+ }
2610
+ };
2611
+ return mutationOptions;
2612
+ };
2613
+ var selectAMachinePlanMutation = (options) => {
2614
+ const mutationOptions = {
2615
+ mutationFn: async (fnOptions) => {
2616
+ const { data } = await selectAMachinePlan({
2617
+ ...options,
2618
+ ...fnOptions,
2619
+ throwOnError: true
2620
+ });
2621
+ return data;
2622
+ }
2623
+ };
2624
+ return mutationOptions;
2625
+ };
2626
+ var listAvailableMachinePlansQueryKey = (options) => createQueryKey("listAvailableMachinePlans", options);
2627
+ var listAvailableMachinePlansOptions = (options) => queryOptions({
2628
+ queryFn: async ({ queryKey, signal }) => {
2629
+ const { data } = await listAvailableMachinePlans({
2630
+ ...options,
2631
+ ...queryKey[0],
2632
+ signal,
2633
+ throwOnError: true
2634
+ });
2635
+ return data;
2636
+ },
2637
+ queryKey: listAvailableMachinePlansQueryKey(options)
2638
+ });
2639
+ var restartMachineMutation = (options) => {
2640
+ const mutationOptions = {
2641
+ mutationFn: async (fnOptions) => {
2642
+ const { data } = await restartMachine({
2643
+ ...options,
2644
+ ...fnOptions,
2645
+ throwOnError: true
2646
+ });
2647
+ return data;
2648
+ }
2649
+ };
2650
+ return mutationOptions;
2651
+ };
2652
+ var resumeMachineMutation = (options) => {
2653
+ const mutationOptions = {
2654
+ mutationFn: async (fnOptions) => {
2655
+ const { data } = await resumeMachine({
2656
+ ...options,
2657
+ ...fnOptions,
2658
+ throwOnError: true
2659
+ });
2660
+ return data;
2661
+ }
2662
+ };
2663
+ return mutationOptions;
2664
+ };
2573
2665
  var getMachineSystemStatsQueryKey = (options) => createQueryKey("getMachineSystemStats", options);
2574
2666
  var getMachineSystemStatsOptions = (options) => queryOptions({
2575
2667
  queryFn: async ({ queryKey, signal }) => {
@@ -2583,6 +2675,19 @@ var getMachineSystemStatsOptions = (options) => queryOptions({
2583
2675
  },
2584
2676
  queryKey: getMachineSystemStatsQueryKey(options)
2585
2677
  });
2678
+ var getMachineLifecycleStatusQueryKey = (options) => createQueryKey("getMachineLifecycleStatus", options);
2679
+ var getMachineLifecycleStatusOptions = (options) => queryOptions({
2680
+ queryFn: async ({ queryKey, signal }) => {
2681
+ const { data } = await getMachineLifecycleStatus({
2682
+ ...options,
2683
+ ...queryKey[0],
2684
+ signal,
2685
+ throwOnError: true
2686
+ });
2687
+ return data;
2688
+ },
2689
+ queryKey: getMachineLifecycleStatusQueryKey(options)
2690
+ });
2586
2691
  var getNotificationPreferencesQueryKey = (options) => createQueryKey("getNotificationPreferences", options);
2587
2692
  var getNotificationPreferencesOptions = (options) => queryOptions({
2588
2693
  queryFn: async ({ queryKey, signal }) => {
@@ -3120,6 +3225,7 @@ var zCreateGithubConnectorRequest = z.object({
3120
3225
  app_id: z.string().uuid().optional(),
3121
3226
  client_id: z.string().uuid().optional(),
3122
3227
  client_secret: z.string().optional(),
3228
+ installation_id: z.string().uuid().optional(),
3123
3229
  pem: z.string().optional(),
3124
3230
  slug: z.string().optional(),
3125
3231
  webhook_secret: z.string().optional()
@@ -3964,6 +4070,19 @@ var zListLogsResponse = z.object({
3964
4070
  message: z.string().optional(),
3965
4071
  status: z.string().optional()
3966
4072
  });
4073
+ var zListPlansResponse = z.object({
4074
+ data: z.array(z.object({
4075
+ id: z.string().uuid().optional(),
4076
+ monthly_cost_cents: z.number().int().optional(),
4077
+ monthly_cost_usd: z.string().optional(),
4078
+ name: z.string().optional(),
4079
+ ram_mb: z.number().int().optional(),
4080
+ storage_mb: z.number().int().optional(),
4081
+ tier: z.string().optional(),
4082
+ vcpu: z.number().int().optional()
4083
+ })).optional(),
4084
+ status: z.string().optional()
4085
+ });
3967
4086
  var zListRepositoriesResponse = z.object({
3968
4087
  data: z.object({
3969
4088
  page: z.number().int().gte(1).optional().default(1),
@@ -4086,6 +4205,35 @@ var zListRepositoriesResponse = z.object({
4086
4205
  message: z.string().optional(),
4087
4206
  status: z.string().optional()
4088
4207
  });
4208
+ var zMachineActionResponse = z.object({
4209
+ message: z.string().optional(),
4210
+ status: z.string().optional()
4211
+ });
4212
+ var zMachineBillingResponse = z.object({
4213
+ data: z.object({
4214
+ billing_status: z.string().optional(),
4215
+ days_remaining: z.number().int().optional(),
4216
+ grace_deadline: z.string().optional(),
4217
+ has_machine: z.boolean().optional(),
4218
+ message: z.string().optional(),
4219
+ monthly_cost_cents: z.number().int().optional(),
4220
+ monthly_cost_usd: z.string().optional(),
4221
+ period_end: z.string().optional(),
4222
+ plan_name: z.string().optional(),
4223
+ plan_tier: z.string().optional()
4224
+ }).optional(),
4225
+ status: z.string().optional()
4226
+ });
4227
+ var zMachineStateResponse = z.object({
4228
+ data: z.object({
4229
+ active: z.boolean().optional(),
4230
+ pid: z.number().int().optional(),
4231
+ state: z.string().optional(),
4232
+ uptime_sec: z.coerce.bigint().min(BigInt("-9223372036854775808"), { message: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { message: "Invalid value: Expected int64 to be <= 9223372036854775807" }).optional()
4233
+ }).optional(),
4234
+ message: z.string().optional(),
4235
+ status: z.string().optional()
4236
+ });
4089
4237
  var zMarkOnboardingCompleteResponse = z.object({
4090
4238
  data: z.object({
4091
4239
  is_onboarded: z.boolean().optional()
@@ -4251,6 +4399,27 @@ var zSshConnectionStatusResponse = z.object({
4251
4399
  message: z.string().optional(),
4252
4400
  status: z.string().optional()
4253
4401
  });
4402
+ var zSelectPlanRequest = z.object({
4403
+ plan_tier: z.string()
4404
+ });
4405
+ var zSelectPlanResponse = z.object({
4406
+ balance_after_cents: z.number().int().optional(),
4407
+ charged_cents: z.number().int().optional(),
4408
+ error: z.string().optional(),
4409
+ message: z.string().optional(),
4410
+ period_end: z.string().optional(),
4411
+ plan: z.object({
4412
+ id: z.string().uuid().optional(),
4413
+ monthly_cost_cents: z.number().int().optional(),
4414
+ monthly_cost_usd: z.string().optional(),
4415
+ name: z.string().optional(),
4416
+ ram_mb: z.number().int().optional(),
4417
+ storage_mb: z.number().int().optional(),
4418
+ tier: z.string().optional(),
4419
+ vcpu: z.number().int().optional()
4420
+ }).optional(),
4421
+ status: z.string().optional()
4422
+ });
4254
4423
  var zSendNotificationRequest = z.object({
4255
4424
  channel: z.string(),
4256
4425
  message: z.string(),
@@ -4544,6 +4713,7 @@ var zListServersResponse = z.object({
4544
4713
  created_at: z.string().datetime().optional(),
4545
4714
  domain: z.string().optional(),
4546
4715
  error: z.string().optional(),
4716
+ guest_ip: z.string().optional(),
4547
4717
  id: z.string().uuid().optional(),
4548
4718
  lxd_container_name: z.string().optional(),
4549
4719
  organization: z.object({
@@ -4555,6 +4725,7 @@ var zListServersResponse = z.object({
4555
4725
  slug: z.string().optional()
4556
4726
  }).optional(),
4557
4727
  organization_id: z.string().uuid().optional(),
4728
+ server_id: z.string().uuid().optional(),
4558
4729
  ssh_key: z.object({
4559
4730
  auth_method: z.string().optional(),
4560
4731
  created_at: z.string().datetime().optional(),
@@ -5032,16 +5203,7 @@ var zApplicationDeployment = z.object({
5032
5203
  id: z.string().uuid().optional(),
5033
5204
  image_s3_key: z.string().optional(),
5034
5205
  image_size: z.coerce.bigint().min(BigInt("-9223372036854775808"), { message: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { message: "Invalid value: Expected int64 to be <= 9223372036854775807" }).optional(),
5035
- logs: z.array(z.object({
5036
- application: zApplication.optional(),
5037
- application_deployment: z.lazy(() => zApplicationDeployment).optional(),
5038
- application_deployment_id: z.string().uuid().optional(),
5039
- application_id: z.string().uuid().optional(),
5040
- created_at: z.string().datetime().optional(),
5041
- id: z.string().uuid().optional(),
5042
- log: z.string().optional(),
5043
- updated_at: z.string().datetime().optional()
5044
- })).optional(),
5206
+ logs: z.array(z.lazy(() => zApplicationLogs)).optional(),
5045
5207
  status: z.object({
5046
5208
  application_deployment: z.lazy(() => zApplicationDeployment).optional(),
5047
5209
  application_deployment_id: z.string().uuid().optional(),
@@ -5055,7 +5217,16 @@ var zApplicationDeployment = z.object({
5055
5217
  var zApplicationDomain = z.object({
5056
5218
  application: zApplication.optional(),
5057
5219
  application_id: z.string().uuid().optional(),
5058
- compose_service: z.lazy(() => zComposeService).optional(),
5220
+ compose_service: z.object({
5221
+ application: zApplication.optional(),
5222
+ application_id: z.string().uuid().optional(),
5223
+ created_at: z.string().datetime().optional(),
5224
+ domains: z.array(z.lazy(() => zApplicationDomain)).optional(),
5225
+ id: z.string().uuid().optional(),
5226
+ port: z.number().int().optional(),
5227
+ service_name: z.string().optional(),
5228
+ updated_at: z.string().datetime().optional()
5229
+ }).optional(),
5059
5230
  compose_service_id: z.string().uuid().optional(),
5060
5231
  created_at: z.string().datetime().optional(),
5061
5232
  domain: z.string().optional(),
@@ -7936,6 +8107,15 @@ var zPauseLiveDeployServiceData = z.object({
7936
8107
  }).optional()
7937
8108
  });
7938
8109
  var zPauseLiveDeployServiceResponse = zPauseResponse;
8110
+ var zGetMachineBillingStatusData = z.object({
8111
+ body: z.never().optional(),
8112
+ path: z.never().optional(),
8113
+ query: z.never().optional(),
8114
+ headers: z.object({
8115
+ Accept: z.string().optional()
8116
+ }).optional()
8117
+ });
8118
+ var zGetMachineBillingStatusResponse = zMachineBillingResponse;
7939
8119
  var zExecuteACommandOnTheHostMachineData = z.object({
7940
8120
  body: zHostExecRequest,
7941
8121
  path: z.never().optional(),
@@ -7945,6 +8125,51 @@ var zExecuteACommandOnTheHostMachineData = z.object({
7945
8125
  }).optional()
7946
8126
  });
7947
8127
  var zExecuteACommandOnTheHostMachineResponse = zHostExecResponse;
8128
+ var zPauseMachineData = z.object({
8129
+ body: z.never().optional(),
8130
+ path: z.never().optional(),
8131
+ query: z.never().optional(),
8132
+ headers: z.object({
8133
+ Accept: z.string().optional()
8134
+ }).optional()
8135
+ });
8136
+ var zPauseMachineResponse = zMachineActionResponse;
8137
+ var zSelectAMachinePlanData = z.object({
8138
+ body: zSelectPlanRequest,
8139
+ path: z.never().optional(),
8140
+ query: z.never().optional(),
8141
+ headers: z.object({
8142
+ Accept: z.string().optional()
8143
+ }).optional()
8144
+ });
8145
+ var zSelectAMachinePlanResponse = zSelectPlanResponse;
8146
+ var zListAvailableMachinePlansData = z.object({
8147
+ body: z.never().optional(),
8148
+ path: z.never().optional(),
8149
+ query: z.never().optional(),
8150
+ headers: z.object({
8151
+ Accept: z.string().optional()
8152
+ }).optional()
8153
+ });
8154
+ var zListAvailableMachinePlansResponse = zListPlansResponse;
8155
+ var zRestartMachineData = z.object({
8156
+ body: z.never().optional(),
8157
+ path: z.never().optional(),
8158
+ query: z.never().optional(),
8159
+ headers: z.object({
8160
+ Accept: z.string().optional()
8161
+ }).optional()
8162
+ });
8163
+ var zRestartMachineResponse = zMachineActionResponse;
8164
+ var zResumeMachineData = z.object({
8165
+ body: z.never().optional(),
8166
+ path: z.never().optional(),
8167
+ query: z.never().optional(),
8168
+ headers: z.object({
8169
+ Accept: z.string().optional()
8170
+ }).optional()
8171
+ });
8172
+ var zResumeMachineResponse = zMachineActionResponse;
7948
8173
  var zGetMachineSystemStatsData = z.object({
7949
8174
  body: z.never().optional(),
7950
8175
  path: z.never().optional(),
@@ -7954,6 +8179,15 @@ var zGetMachineSystemStatsData = z.object({
7954
8179
  }).optional()
7955
8180
  });
7956
8181
  var zGetMachineSystemStatsResponse = zSystemStatsResponse;
8182
+ var zGetMachineLifecycleStatusData = z.object({
8183
+ body: z.never().optional(),
8184
+ path: z.never().optional(),
8185
+ query: z.never().optional(),
8186
+ headers: z.object({
8187
+ Accept: z.string().optional()
8188
+ }).optional()
8189
+ });
8190
+ var zGetMachineLifecycleStatusResponse = zMachineStateResponse;
7957
8191
  var zGetNotificationPreferencesData = z.object({
7958
8192
  body: z.never().optional(),
7959
8193
  path: z.never().optional(),
@@ -8551,6 +8785,12 @@ export {
8551
8785
  getHealthChecks,
8552
8786
  getHealthChecksOptions,
8553
8787
  getHealthChecksQueryKey,
8788
+ getMachineBillingStatus,
8789
+ getMachineBillingStatusOptions,
8790
+ getMachineBillingStatusQueryKey,
8791
+ getMachineLifecycleStatus,
8792
+ getMachineLifecycleStatusOptions,
8793
+ getMachineLifecycleStatusQueryKey,
8554
8794
  getMachineSystemStats,
8555
8795
  getMachineSystemStatsOptions,
8556
8796
  getMachineSystemStatsQueryKey,
@@ -8599,6 +8839,9 @@ export {
8599
8839
  listAuditLogsInfiniteQueryKey,
8600
8840
  listAuditLogsOptions,
8601
8841
  listAuditLogsQueryKey,
8842
+ listAvailableMachinePlans,
8843
+ listAvailableMachinePlansOptions,
8844
+ listAvailableMachinePlansQueryKey,
8602
8845
  listComposeServices,
8603
8846
  listComposeServicesOptions,
8604
8847
  listComposeServicesQueryKey,
@@ -8658,6 +8901,8 @@ export {
8658
8901
  moveDirectoryMutation,
8659
8902
  pauseLiveDeployService,
8660
8903
  pauseLiveDeployServiceMutation,
8904
+ pauseMachine,
8905
+ pauseMachineMutation,
8661
8906
  performUpdate,
8662
8907
  performUpdateMutation,
8663
8908
  previewComposeServices,
@@ -8682,10 +8927,16 @@ export {
8682
8927
  restartContainerMutation,
8683
8928
  restartDeployment,
8684
8929
  restartDeploymentMutation,
8930
+ restartMachine,
8931
+ restartMachineMutation,
8932
+ resumeMachine,
8933
+ resumeMachineMutation,
8685
8934
  rollbackDeployment,
8686
8935
  rollbackDeploymentMutation,
8687
8936
  runExtension,
8688
8937
  runExtensionMutation,
8938
+ selectAMachinePlan,
8939
+ selectAMachinePlanMutation,
8689
8940
  sendNotification,
8690
8941
  sendNotificationMutation,
8691
8942
  startContainer,
@@ -8861,6 +9112,10 @@ export {
8861
9112
  zGetHealthCheckStatsResponse,
8862
9113
  zGetHealthChecksData,
8863
9114
  zGetHealthChecksResponse,
9115
+ zGetMachineBillingStatusData,
9116
+ zGetMachineBillingStatusResponse,
9117
+ zGetMachineLifecycleStatusData,
9118
+ zGetMachineLifecycleStatusResponse,
8864
9119
  zGetMachineSystemStatsData,
8865
9120
  zGetMachineSystemStatsResponse,
8866
9121
  zGetNotificationPreferencesData,
@@ -8904,6 +9159,8 @@ export {
8904
9159
  zListApplicationsResponse2,
8905
9160
  zListAuditLogsData,
8906
9161
  zListAuditLogsResponse,
9162
+ zListAvailableMachinePlansData,
9163
+ zListAvailableMachinePlansResponse,
8907
9164
  zListBranchesResponse,
8908
9165
  zListComposeServicesData,
8909
9166
  zListComposeServicesResponse,
@@ -8944,6 +9201,7 @@ export {
8944
9201
  zListImagesResponse,
8945
9202
  zListImagesResponse2,
8946
9203
  zListLogsResponse,
9204
+ zListPlansResponse,
8947
9205
  zListProjectsInFamilyData,
8948
9206
  zListProjectsInFamilyResponse,
8949
9207
  zListRepositoriesResponse,
@@ -8953,6 +9211,9 @@ export {
8953
9211
  zListServersResponse,
8954
9212
  zListServersResponse2,
8955
9213
  zLogsResponse,
9214
+ zMachineActionResponse,
9215
+ zMachineBillingResponse,
9216
+ zMachineStateResponse,
8956
9217
  zMarkOnboardingCompleteData,
8957
9218
  zMarkOnboardingCompleteResponse,
8958
9219
  zMarkOnboardingCompleteResponse2,
@@ -8962,6 +9223,8 @@ export {
8962
9223
  zMoveDirectoryResponse,
8963
9224
  zPauseLiveDeployServiceData,
8964
9225
  zPauseLiveDeployServiceResponse,
9226
+ zPauseMachineData,
9227
+ zPauseMachineResponse,
8965
9228
  zPauseRequest,
8966
9229
  zPauseResponse,
8967
9230
  zPerformUpdateData,
@@ -9004,12 +9267,20 @@ export {
9004
9267
  zRestartDeploymentData,
9005
9268
  zRestartDeploymentRequest,
9006
9269
  zRestartDeploymentResponse,
9270
+ zRestartMachineData,
9271
+ zRestartMachineResponse,
9272
+ zResumeMachineData,
9273
+ zResumeMachineResponse,
9007
9274
  zRollbackDeploymentData,
9008
9275
  zRollbackDeploymentRequest,
9009
9276
  zRollbackDeploymentResponse,
9010
9277
  zRunExtensionData,
9011
9278
  zRunExtensionRequest,
9012
9279
  zRunExtensionResponse,
9280
+ zSelectAMachinePlanData,
9281
+ zSelectAMachinePlanResponse,
9282
+ zSelectPlanRequest,
9283
+ zSelectPlanResponse,
9013
9284
  zSendNotificationData,
9014
9285
  zSendNotificationRequest,
9015
9286
  zSendNotificationResponse,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixopus/api-client",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "TypeScript API client for Nixopus, generated from OpenAPI spec",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",