@stack-spot/portal-network 0.49.0 → 0.50.1

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.
@@ -2,7 +2,7 @@ import apis from '../apis.json';
2
2
  import { DefaultAPIError } from '../error/DefaultAPIError.js';
3
3
  import { cntDictionary } from '../error/dictionary/cnt.js';
4
4
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
5
- import { createApplication, createDeployment, defaults, getApplication, getApplicationHistory, getDeployment, getDeploymentHealth, getDeploymentLogs, getDeploymentStatus, getRepositoryImages, listApplications, listDeployments, listRepositories, listRuntimes, } from '../api/cloudPlatform.js';
5
+ import { createApplication, createCidr, createDeployment, createDnsZone, createFolder, createFoundation, defaults, getApplication, getApplicationHistory, getDeployment, getDeploymentHealth, getDeploymentLogs, getDeploymentStatus, getFolder, getFoundation, getRepositoryImages, listApplications, listCidr, listDeployments, listDnsZone, listFoundations, listRepositories, listRuntimes, providers, } from '../api/cloudPlatform.js';
6
6
  import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
7
7
  class CloudPlatformClient extends ReactQueryNetworkClient {
8
8
  constructor() {
@@ -124,6 +124,96 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
124
124
  writable: true,
125
125
  value: this.mutation(removeAuthorizationParam(createApplication))
126
126
  });
127
+ /**
128
+ * List foundations
129
+ */
130
+ Object.defineProperty(this, "listFoundations", {
131
+ enumerable: true,
132
+ configurable: true,
133
+ writable: true,
134
+ value: this.query(removeAuthorizationParam(listFoundations))
135
+ });
136
+ /**
137
+ * Get a foundation by id
138
+ */
139
+ Object.defineProperty(this, "foundation", {
140
+ enumerable: true,
141
+ configurable: true,
142
+ writable: true,
143
+ value: this.query(removeAuthorizationParam(getFoundation))
144
+ });
145
+ /**
146
+ * Get list of foundations folders or folder by id
147
+ */
148
+ Object.defineProperty(this, "listFolders", {
149
+ enumerable: true,
150
+ configurable: true,
151
+ writable: true,
152
+ value: this.query(removeAuthorizationParam(getFolder))
153
+ });
154
+ /**
155
+ * Get list of providers for a foundation
156
+ */
157
+ Object.defineProperty(this, "listProviders", {
158
+ enumerable: true,
159
+ configurable: true,
160
+ writable: true,
161
+ value: this.query(removeAuthorizationParam(providers))
162
+ });
163
+ /**
164
+ * Create a foundation
165
+ */
166
+ Object.defineProperty(this, "createFoundation", {
167
+ enumerable: true,
168
+ configurable: true,
169
+ writable: true,
170
+ value: this.mutation(removeAuthorizationParam(createFoundation))
171
+ });
172
+ /**
173
+ * Create a foundation folder
174
+ */
175
+ Object.defineProperty(this, "createFolder", {
176
+ enumerable: true,
177
+ configurable: true,
178
+ writable: true,
179
+ value: this.mutation(removeAuthorizationParam(createFolder))
180
+ });
181
+ /**
182
+ * Get a list of dns zones
183
+ */
184
+ Object.defineProperty(this, "listDnsZones", {
185
+ enumerable: true,
186
+ configurable: true,
187
+ writable: true,
188
+ value: this.query(removeAuthorizationParam(listDnsZone))
189
+ });
190
+ /**
191
+ * Create a dns zone
192
+ */
193
+ Object.defineProperty(this, "createDnsZone", {
194
+ enumerable: true,
195
+ configurable: true,
196
+ writable: true,
197
+ value: this.mutation(removeAuthorizationParam(createDnsZone))
198
+ });
199
+ /**
200
+ * Get a list of cidrs
201
+ */
202
+ Object.defineProperty(this, "listCidrs", {
203
+ enumerable: true,
204
+ configurable: true,
205
+ writable: true,
206
+ value: this.query(removeAuthorizationParam(listCidr))
207
+ });
208
+ /**
209
+ * Create a cidr
210
+ */
211
+ Object.defineProperty(this, "createCidr", {
212
+ enumerable: true,
213
+ configurable: true,
214
+ writable: true,
215
+ value: this.mutation(removeAuthorizationParam(createCidr))
216
+ });
127
217
  }
128
218
  buildStackSpotError(error) {
129
219
  return new DefaultAPIError(error.data, error.status, cntDictionary, error.headers);
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-platform.js","sourceRoot":"","sources":["../../src/client/cloud-platform.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAA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AAwB,CAAC,UAAU,CAAC,CAAC;WAAA;IAhGhE,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACpF,CAAC;CA6FF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAA"}
@@ -67,6 +67,7 @@ declare class WorkflowClient extends ReactQueryNetworkClient {
67
67
  executionId: string;
68
68
  jobId: string;
69
69
  authorization: string;
70
+ stackspotCustomerIp?: string | undefined;
70
71
  }, "authorization" | "jwtToken"> & {}, import("../api/workflows.js").GetWorkflowExecutionJobGraphResponse>;
71
72
  /**
72
73
  * Refuses a workflow step that is suspended so the execution can be canceled.
@@ -75,6 +76,7 @@ declare class WorkflowClient extends ReactQueryNetworkClient {
75
76
  executionId: string;
76
77
  jobId: string;
77
78
  authorization: string;
79
+ stackspotCustomerIp?: string | undefined;
78
80
  }, "authorization" | "jwtToken"> & {}, import("../api/workflows.js").GetWorkflowExecutionJobGraphResponse>;
79
81
  }
80
82
  export declare const workflowClient: WorkflowClient;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/client/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAG5E,cAAM,cAAe,SAAQ,uBAAuB;;IAKlD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,SAAS;;;;;wFAA0F;IAEnG;;OAEG;IACH,SAAS;;;;;oDAAgE;IAEzE;;OAEG;IACH,eAAe;;;yFAAwG;IAEvH;;OAEG;IACH,qBAAqB;;;gDAAyG;IAE9H;;OAEG;IACH,oBAAoB;;;;;wFAA8F;IAElH;;OAEG;IACH,KAAK;;;4GAAwG;IAE7G;;OAEG;IACH,QAAQ;;;;iGAAkH;IAE1H;;OAEG;IACH,kBAAkB;;;;4GAEjB;IAED;;OAEG;IACH,kBAAkB;;;;4GAEjB;CACF;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAA"}
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/client/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAG5E,cAAM,cAAe,SAAQ,uBAAuB;;IAKlD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,SAAS;;;;;wFAA0F;IAEnG;;OAEG;IACH,SAAS;;;;;oDAAgE;IAEzE;;OAEG;IACH,eAAe;;;yFAAwG;IAEvH;;OAEG;IACH,qBAAqB;;;gDAAyG;IAE9H;;OAEG;IACH,oBAAoB;;;;;wFAA8F;IAElH;;OAEG;IACH,KAAK;;;4GAAwG;IAE7G;;OAEG;IACH,QAAQ;;;;iGAAkH;IAE1H;;OAEG;IACH,kBAAkB;;;;;4GAEjB;IAED;;OAEG;IACH,kBAAkB;;;;;4GAEjB;CACF;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.49.0",
3
+ "version": "0.50.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,54 +8,32 @@ import * as Oazapfts from "@oazapfts/runtime";
8
8
  import * as QS from "@oazapfts/runtime/query";
9
9
  export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
10
  headers: {},
11
- baseUrl: "https://cloud-cloud-platform-api.prd.stackspot.com",
11
+ baseUrl: "https://cloud-cloud-platform-api.stg.stackspot.com",
12
12
  };
13
13
  const oazapfts = Oazapfts.runtime(defaults);
14
14
  export const servers = {
15
- generatedServerUrl: "https://cloud-cloud-platform-api.prd.stackspot.com"
15
+ generatedServerUrl: "https://cloud-cloud-platform-api.stg.stackspot.com"
16
16
  };
17
- export type EnvVar = {
18
- key: string;
19
- value: string;
20
- };
21
- export type ReplicasConfigRequest = {
22
- /** Minimum number of replicas */
23
- min?: number;
24
- /** Maximum number of replicas */
25
- max?: number;
26
- cpu?: number;
27
- };
28
- export type CreateDeploymentRequest = {
29
- applicationId?: string;
30
- applicationName: string;
31
- action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
32
- containerPort?: string;
33
- healthCheckPath?: string;
34
- envVars?: EnvVar[];
35
- imageUrl?: string;
36
- tag?: string;
37
- runtimeId?: string;
38
- mem?: number;
39
- cpu?: number;
40
- replicaNum?: ReplicasConfigRequest;
17
+ export type Foundation = {
18
+ /** Unique identifier of the foundation */
19
+ id: string;
20
+ /** Human-readable name of the foundation */
21
+ name: string;
22
+ /**
23
+ Provision status. All resources are provisioned in an asynchronous manner. They should be available
24
+ for further actions when the status is READY. */
25
+ status: "READY" | "NOT_READY";
26
+ description?: string;
27
+ /** Cloud provider */
28
+ cloudProvider: "AWS" | "ORACLE";
29
+ /** The region where the foundation is provisioned */
30
+ region: string;
31
+ createdAt: string;
32
+ updatedAt: string;
41
33
  };
42
- export type CreateDeploymentResponse = {
43
- deploymentId?: string;
44
- applicationURL?: string;
45
- action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
46
- containerPort?: string;
47
- healthCheckPath?: string;
48
- envVars?: EnvVar[];
49
- imageUrl?: string;
50
- versionTag?: string;
51
- health?: "HEALTH" | "UNHEALTH";
52
- deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
53
- runtimeId?: string;
54
- mem?: number;
55
- cpu?: number;
56
- replicaNum?: ReplicasConfigRequest;
57
- awsAccount?: string;
58
- idAwsAccount?: string;
34
+ export type OffsetPageFoundation = {
35
+ data: Foundation[];
36
+ total: number;
59
37
  };
60
38
  export type ErrorResponse = {
61
39
  message: string;
@@ -102,6 +80,127 @@ export type ErrorResponse = {
102
80
  localizedMessage?: string;
103
81
  };
104
82
  };
83
+ export type CreateFoundationRequest = {
84
+ /** Human-readable name for the foundation */
85
+ name: string;
86
+ /** A short description for the foundation */
87
+ description?: string;
88
+ /** Cloud provider */
89
+ cloudProvider: "AWS" | "ORACLE";
90
+ /** The region where the foundation will be provisioned */
91
+ region: string;
92
+ };
93
+ export type FolderContentResponse = {
94
+ id: string;
95
+ name: string;
96
+ "type": "FOLDER" | "PROJECT";
97
+ status: "NOT_READY" | "READY";
98
+ };
99
+ export type FolderResponse = {
100
+ stackSpotAccountId: string;
101
+ foundationId: string;
102
+ parentFolderId?: string;
103
+ folderId: string;
104
+ folderName: string;
105
+ status: "NOT_READY" | "READY";
106
+ createdAt: string;
107
+ updatedAt: string;
108
+ deletedAt?: string;
109
+ content: FolderContentResponse[];
110
+ };
111
+ export type CreateFolderRequest = {
112
+ name: string;
113
+ };
114
+ export type DnsZoneResponse = {
115
+ stackSpotAccountId: string;
116
+ foundationId: string;
117
+ dnsZoneId: string;
118
+ domain: string;
119
+ dnsZoneType: "PUBLIC";
120
+ status: "NOT_READY" | "READY";
121
+ createdAt: string;
122
+ updatedAt: string;
123
+ deletedAt?: string;
124
+ };
125
+ export type ListDnsZoneResponse = {
126
+ stackSpotAccountId: string;
127
+ foundationId: string;
128
+ status: "NOT_READY" | "READY";
129
+ content: DnsZoneResponse[];
130
+ };
131
+ export type CreateDnsZoneRequest = {
132
+ domain: string;
133
+ "type": "PUBLIC";
134
+ };
135
+ export type CidrResponse = {
136
+ stackSpotAccountId: string;
137
+ foundationId: string;
138
+ cidrId: string;
139
+ cidrNotation: string;
140
+ networkAddress: string;
141
+ netmask: string;
142
+ broadcastAddress: string;
143
+ lowAddress: string;
144
+ highAddress: string;
145
+ addressCount: number;
146
+ status: "NOT_READY" | "READY";
147
+ createdAt: string;
148
+ updatedAt: string;
149
+ deletedAt?: string;
150
+ };
151
+ export type ListCidrResponse = {
152
+ stackSpotAccountId: string;
153
+ foundationId: string;
154
+ status: "NOT_READY" | "READY";
155
+ content: CidrResponse[];
156
+ };
157
+ export type CreateCidrRequest = {
158
+ address: string;
159
+ prefix: number;
160
+ };
161
+ export type EnvVar = {
162
+ key: string;
163
+ value: string;
164
+ };
165
+ export type ReplicasConfigRequest = {
166
+ /** Minimum number of replicas */
167
+ min?: number;
168
+ /** Maximum number of replicas */
169
+ max?: number;
170
+ cpu?: number;
171
+ };
172
+ export type CreateDeploymentRequest = {
173
+ applicationId?: string;
174
+ applicationName: string;
175
+ action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
176
+ containerPort?: string;
177
+ healthCheckPath?: string;
178
+ envVars?: EnvVar[];
179
+ imageUrl?: string;
180
+ tag?: string;
181
+ runtimeId?: string;
182
+ mem?: number;
183
+ cpu?: number;
184
+ replicaNum?: ReplicasConfigRequest;
185
+ };
186
+ export type CreateDeploymentResponse = {
187
+ deploymentId?: string;
188
+ applicationURL?: string;
189
+ action: "DEPLOY" | "STOP" | "START" | "RESTART" | "REDEPLOY";
190
+ containerPort?: string;
191
+ healthCheckPath?: string;
192
+ envVars?: EnvVar[];
193
+ imageUrl?: string;
194
+ versionTag?: string;
195
+ health?: "HEALTH" | "UNHEALTH";
196
+ deploymentStatus?: "UP" | "STOPPED" | "DEPLOYING";
197
+ runtimeId?: string;
198
+ mem?: number;
199
+ cpu?: number;
200
+ replicaNum?: ReplicasConfigRequest;
201
+ awsAccount?: string;
202
+ idAwsAccount?: string;
203
+ };
105
204
  export type CreateApplicationRequest = {
106
205
  /** The name of the application in kebab-case format. */
107
206
  name: string;
@@ -174,6 +273,14 @@ export type ImageResponse = {
174
273
  imageUri: string;
175
274
  tags: string[];
176
275
  };
276
+ export type GetProvisionAvailabilityResponse = {
277
+ available: boolean;
278
+ };
279
+ export type CloudProvider = {
280
+ /** Cloud provider */
281
+ "type": "AWS" | "ORACLE";
282
+ regions: string[];
283
+ };
177
284
  export type DeploymentStatusResponse = {
178
285
  status: "UP" | "STOPPED" | "DEPLOYING";
179
286
  };
@@ -233,6 +340,178 @@ export type ListApplicationsResponse = {
233
340
  limit: number;
234
341
  offset: number;
235
342
  };
343
+ /**
344
+ * List foundations
345
+ */
346
+ export function listFoundations({ limit, offset }: {
347
+ limit?: number;
348
+ offset?: number;
349
+ }, opts?: Oazapfts.RequestOpts) {
350
+ return oazapfts.ok(oazapfts.fetchJson<{
351
+ status: 200;
352
+ data: OffsetPageFoundation;
353
+ } | {
354
+ status: 500;
355
+ data: ErrorResponse;
356
+ } | {
357
+ status: 503;
358
+ data: ErrorResponse;
359
+ }>(`/v1/foundations${QS.query(QS.explode({
360
+ limit,
361
+ offset
362
+ }))}`, {
363
+ ...opts
364
+ }));
365
+ }
366
+ export function createFoundation({ createFoundationRequest }: {
367
+ createFoundationRequest: CreateFoundationRequest;
368
+ }, opts?: Oazapfts.RequestOpts) {
369
+ return oazapfts.ok(oazapfts.fetchJson<{
370
+ status: 200;
371
+ data: Foundation;
372
+ } | {
373
+ status: 500;
374
+ data: ErrorResponse;
375
+ } | {
376
+ status: 503;
377
+ data: ErrorResponse;
378
+ }>("/v1/foundations", oazapfts.json({
379
+ ...opts,
380
+ method: "POST",
381
+ body: createFoundationRequest
382
+ })));
383
+ }
384
+ export function getFolder({ foundationId, authorization, folderId }: {
385
+ foundationId: string;
386
+ authorization: string;
387
+ folderId: string;
388
+ }, opts?: Oazapfts.RequestOpts) {
389
+ return oazapfts.ok(oazapfts.fetchJson<{
390
+ status: 200;
391
+ data: FolderResponse;
392
+ } | {
393
+ status: 500;
394
+ data: ErrorResponse;
395
+ } | {
396
+ status: 503;
397
+ data: ErrorResponse;
398
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/folders/${encodeURIComponent(folderId)}`, {
399
+ ...opts,
400
+ headers: oazapfts.mergeHeaders(opts?.headers, {
401
+ Authorization: authorization
402
+ })
403
+ }));
404
+ }
405
+ export function createFolder({ authorization, foundationId, folderId, createFolderRequest }: {
406
+ authorization: string;
407
+ foundationId: string;
408
+ folderId: string;
409
+ createFolderRequest: CreateFolderRequest;
410
+ }, opts?: Oazapfts.RequestOpts) {
411
+ return oazapfts.ok(oazapfts.fetchJson<{
412
+ status: 200;
413
+ data: FolderResponse;
414
+ } | {
415
+ status: 500;
416
+ data: ErrorResponse;
417
+ } | {
418
+ status: 503;
419
+ data: ErrorResponse;
420
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/folders/${encodeURIComponent(folderId)}`, oazapfts.json({
421
+ ...opts,
422
+ method: "POST",
423
+ body: createFolderRequest,
424
+ headers: oazapfts.mergeHeaders(opts?.headers, {
425
+ Authorization: authorization
426
+ })
427
+ })));
428
+ }
429
+ export function listDnsZone({ authorization, foundationId }: {
430
+ authorization: string;
431
+ foundationId: string;
432
+ }, opts?: Oazapfts.RequestOpts) {
433
+ return oazapfts.ok(oazapfts.fetchJson<{
434
+ status: 200;
435
+ data: ListDnsZoneResponse;
436
+ } | {
437
+ status: 500;
438
+ data: ErrorResponse;
439
+ } | {
440
+ status: 503;
441
+ data: ErrorResponse;
442
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones`, {
443
+ ...opts,
444
+ headers: oazapfts.mergeHeaders(opts?.headers, {
445
+ Authorization: authorization
446
+ })
447
+ }));
448
+ }
449
+ export function createDnsZone({ authorization, foundationId, createDnsZoneRequest }: {
450
+ authorization: string;
451
+ foundationId: string;
452
+ createDnsZoneRequest: CreateDnsZoneRequest;
453
+ }, opts?: Oazapfts.RequestOpts) {
454
+ return oazapfts.ok(oazapfts.fetchJson<{
455
+ status: 200;
456
+ data: DnsZoneResponse;
457
+ } | {
458
+ status: 500;
459
+ data: ErrorResponse;
460
+ } | {
461
+ status: 503;
462
+ data: ErrorResponse;
463
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones`, oazapfts.json({
464
+ ...opts,
465
+ method: "POST",
466
+ body: createDnsZoneRequest,
467
+ headers: oazapfts.mergeHeaders(opts?.headers, {
468
+ Authorization: authorization
469
+ })
470
+ })));
471
+ }
472
+ export function listCidr({ foundationId, authorization }: {
473
+ foundationId: string;
474
+ authorization: string;
475
+ }, opts?: Oazapfts.RequestOpts) {
476
+ return oazapfts.ok(oazapfts.fetchJson<{
477
+ status: 200;
478
+ data: ListCidrResponse;
479
+ } | {
480
+ status: 500;
481
+ data: ErrorResponse;
482
+ } | {
483
+ status: 503;
484
+ data: ErrorResponse;
485
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr`, {
486
+ ...opts,
487
+ headers: oazapfts.mergeHeaders(opts?.headers, {
488
+ Authorization: authorization
489
+ })
490
+ }));
491
+ }
492
+ export function createCidr({ authorization, foundationId, createCidrRequest }: {
493
+ authorization: string;
494
+ foundationId: string;
495
+ createCidrRequest: CreateCidrRequest;
496
+ }, opts?: Oazapfts.RequestOpts) {
497
+ return oazapfts.ok(oazapfts.fetchJson<{
498
+ status: 200;
499
+ data: CidrResponse;
500
+ } | {
501
+ status: 500;
502
+ data: ErrorResponse;
503
+ } | {
504
+ status: 503;
505
+ data: ErrorResponse;
506
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr`, oazapfts.json({
507
+ ...opts,
508
+ method: "POST",
509
+ body: createCidrRequest,
510
+ headers: oazapfts.mergeHeaders(opts?.headers, {
511
+ Authorization: authorization
512
+ })
513
+ })));
514
+ }
236
515
  export function createDeployment({ authorization, createDeploymentRequest }: {
237
516
  authorization: string;
238
517
  createDeploymentRequest: CreateDeploymentRequest;
@@ -434,6 +713,96 @@ export function getRepositoryImages({ authorization, repositoryId }: {
434
713
  })
435
714
  }));
436
715
  }
716
+ export function getFoundation({ foundationId }: {
717
+ foundationId: string;
718
+ }, opts?: Oazapfts.RequestOpts) {
719
+ return oazapfts.ok(oazapfts.fetchJson<{
720
+ status: 200;
721
+ data: Foundation;
722
+ } | {
723
+ status: 500;
724
+ data: ErrorResponse;
725
+ } | {
726
+ status: 503;
727
+ data: ErrorResponse;
728
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}`, {
729
+ ...opts
730
+ }));
731
+ }
732
+ export function getDnsZone({ foundationId, authorization, dnsZoneId }: {
733
+ foundationId: string;
734
+ authorization: string;
735
+ dnsZoneId: string;
736
+ }, opts?: Oazapfts.RequestOpts) {
737
+ return oazapfts.ok(oazapfts.fetchJson<{
738
+ status: 200;
739
+ data: DnsZoneResponse;
740
+ } | {
741
+ status: 500;
742
+ data: ErrorResponse;
743
+ } | {
744
+ status: 503;
745
+ data: ErrorResponse;
746
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/dns-zones/${encodeURIComponent(dnsZoneId)}`, {
747
+ ...opts,
748
+ headers: oazapfts.mergeHeaders(opts?.headers, {
749
+ Authorization: authorization
750
+ })
751
+ }));
752
+ }
753
+ export function getCidr({ foundationId, authorization, cidrId }: {
754
+ foundationId: string;
755
+ authorization: string;
756
+ cidrId: string;
757
+ }, opts?: Oazapfts.RequestOpts) {
758
+ return oazapfts.ok(oazapfts.fetchJson<{
759
+ status: 200;
760
+ data: CidrResponse;
761
+ } | {
762
+ status: 500;
763
+ data: ErrorResponse;
764
+ } | {
765
+ status: 503;
766
+ data: ErrorResponse;
767
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/cidr/${encodeURIComponent(cidrId)}`, {
768
+ ...opts,
769
+ headers: oazapfts.mergeHeaders(opts?.headers, {
770
+ Authorization: authorization
771
+ })
772
+ }));
773
+ }
774
+ export function getProvisionAvailability({ cloudProvider }: {
775
+ cloudProvider: "AWS" | "ORACLE";
776
+ }, opts?: Oazapfts.RequestOpts) {
777
+ return oazapfts.ok(oazapfts.fetchJson<{
778
+ status: 200;
779
+ data: GetProvisionAvailabilityResponse;
780
+ } | {
781
+ status: 500;
782
+ data: ErrorResponse;
783
+ } | {
784
+ status: 503;
785
+ data: ErrorResponse;
786
+ }>(`/v1/foundations/provision-availability${QS.query(QS.explode({
787
+ cloudProvider
788
+ }))}`, {
789
+ ...opts
790
+ }));
791
+ }
792
+ export function providers(opts?: Oazapfts.RequestOpts) {
793
+ return oazapfts.ok(oazapfts.fetchJson<{
794
+ status: 200;
795
+ data: CloudProvider[];
796
+ } | {
797
+ status: 500;
798
+ data: ErrorResponse;
799
+ } | {
800
+ status: 503;
801
+ data: ErrorResponse;
802
+ }>("/v1/foundations/providers", {
803
+ ...opts
804
+ }));
805
+ }
437
806
  export function getDeploymentStatus({ authorization, deploymentId }: {
438
807
  authorization: string;
439
808
  deploymentId: string;