@stack-spot/portal-network 0.99.5 → 0.101.0

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.
@@ -24,7 +24,7 @@ export type FoundationResponse = {
24
24
  stackSpotAccountId: string;
25
25
  foundationId: string;
26
26
  details: FoundationDetails;
27
- status: "READY" | "PENDING" | "ERROR";
27
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
28
28
  createdAt: string;
29
29
  updatedAt: string;
30
30
  deletedAt?: string;
@@ -40,6 +40,35 @@ export type CreateFoundationRequest = {
40
40
  cloudProvider: string;
41
41
  region: string;
42
42
  };
43
+ export type TunnelStatus = {
44
+ tunnel1?: string;
45
+ tunnel2?: string;
46
+ };
47
+ export type VpnDetails = {
48
+ peerCustomerGatewayIp: string;
49
+ destinationCidrBlock: string;
50
+ tunnelStatus: TunnelStatus;
51
+ };
52
+ export type VpnResponse = {
53
+ stackSpotAccountId: string;
54
+ foundationId: string;
55
+ vpnId: string;
56
+ details: VpnDetails;
57
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
58
+ createdAt: string;
59
+ updatedAt: string;
60
+ deletedAt?: string;
61
+ };
62
+ export type ListVpnResponse = {
63
+ stackSpotAccountId: string;
64
+ foundationId: string;
65
+ pendingResources: boolean;
66
+ content: VpnResponse[];
67
+ };
68
+ export type CreateVpnRequest = {
69
+ peerCustomerGatewayIp: string;
70
+ destinationCidrBlock: string;
71
+ };
43
72
  export type ProjectDetails = {
44
73
  name: string;
45
74
  folderName: string;
@@ -50,7 +79,7 @@ export type ProjectResponse = {
50
79
  parentFolderId: string;
51
80
  projectId: string;
52
81
  details: ProjectDetails;
53
- status: "READY" | "PENDING" | "ERROR";
82
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
54
83
  createdAt: string;
55
84
  updatedAt: string;
56
85
  deletedAt?: string;
@@ -78,7 +107,7 @@ export type NetworkResponse = {
78
107
  projectId: string;
79
108
  networkId: string;
80
109
  details: NetworkDetails;
81
- status: "READY" | "PENDING" | "ERROR";
110
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
82
111
  createdAt: string;
83
112
  updatedAt: string;
84
113
  deletedAt?: string;
@@ -110,7 +139,7 @@ export type NetworkConnectionResponse = {
110
139
  requesterProjectId: string;
111
140
  networkConnectionId: string;
112
141
  details: NetworkConnectionDetails;
113
- status: "READY" | "PENDING" | "ERROR";
142
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
114
143
  createdAt: string;
115
144
  updatedAt: string;
116
145
  deletedAt?: string;
@@ -138,7 +167,7 @@ export type InboundResponse = {
138
167
  projectId: string;
139
168
  inboundId: string;
140
169
  details: InboundDetails;
141
- status: "READY" | "PENDING" | "ERROR";
170
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
142
171
  createdAt: string;
143
172
  updatedAt: string;
144
173
  deletedAt?: string;
@@ -159,7 +188,7 @@ export type FolderContent = {
159
188
  "type": "FOLDER" | "PROJECT";
160
189
  id: string;
161
190
  name: string;
162
- status: "READY" | "PENDING" | "ERROR";
191
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
163
192
  };
164
193
  export type FolderDetails = {
165
194
  name: string;
@@ -172,7 +201,7 @@ export type FolderResponse = {
172
201
  parentFolderId: string;
173
202
  folderId: string;
174
203
  details: FolderDetails;
175
- status: "READY" | "PENDING" | "ERROR";
204
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
176
205
  createdAt: string;
177
206
  updatedAt: string;
178
207
  deletedAt?: string;
@@ -190,7 +219,7 @@ export type DnsZoneResponse = {
190
219
  foundationId: string;
191
220
  dnsZoneId: string;
192
221
  details: DnsZoneDetails;
193
- status: "READY" | "PENDING" | "ERROR";
222
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
194
223
  createdAt: string;
195
224
  updatedAt: string;
196
225
  deletedAt?: string;
@@ -219,7 +248,7 @@ export type DnsRecordResponse = {
219
248
  dnsZoneId: string;
220
249
  dnsRecordId: string;
221
250
  details: DnsRecordDetails;
222
- status: "READY" | "PENDING" | "ERROR";
251
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
223
252
  createdAt: string;
224
253
  updatedAt: string;
225
254
  deletedAt?: string;
@@ -254,7 +283,7 @@ export type CidrResponse = {
254
283
  foundationId: string;
255
284
  cidrId: string;
256
285
  details: CidrDetails;
257
- status: "READY" | "PENDING" | "ERROR";
286
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
258
287
  createdAt: string;
259
288
  updatedAt: string;
260
289
  deletedAt?: string;
@@ -291,7 +320,7 @@ export type CertificateResponse = {
291
320
  foundationId: string;
292
321
  certificateId: string;
293
322
  details: CertificateDetails;
294
- status: "READY" | "PENDING" | "ERROR";
323
+ status: "READY" | "PENDING" | "PENDING_APPROVAL" | "ERROR";
295
324
  createdAt: string;
296
325
  updatedAt: string;
297
326
  deletedAt?: string;
@@ -325,6 +354,15 @@ export type ImportCertificateRequest = {
325
354
  certificatePrivateKey?: string;
326
355
  certificateChain?: string;
327
356
  };
357
+ export type Configuration = {
358
+ ikev1: string;
359
+ ikev2: string;
360
+ };
361
+ export type VpnConfigurationResponse = {
362
+ vpnId: string;
363
+ foundationId: string;
364
+ configuration: Configuration;
365
+ };
328
366
  export function listFoundations({ authorization }: {
329
367
  authorization: string;
330
368
  }, opts?: Oazapfts.RequestOpts) {
@@ -354,6 +392,37 @@ export function createFoundation({ authorization, createFoundationRequest }: {
354
392
  })
355
393
  })));
356
394
  }
395
+ export function listVpns({ authorization, foundationId }: {
396
+ authorization: string;
397
+ foundationId: string;
398
+ }, opts?: Oazapfts.RequestOpts) {
399
+ return oazapfts.ok(oazapfts.fetchJson<{
400
+ status: 200;
401
+ data: ListVpnResponse;
402
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/vpns`, {
403
+ ...opts,
404
+ headers: oazapfts.mergeHeaders(opts?.headers, {
405
+ Authorization: authorization
406
+ })
407
+ }));
408
+ }
409
+ export function createVpn({ authorization, foundationId, createVpnRequest }: {
410
+ authorization: string;
411
+ foundationId: string;
412
+ createVpnRequest: CreateVpnRequest;
413
+ }, opts?: Oazapfts.RequestOpts) {
414
+ return oazapfts.ok(oazapfts.fetchJson<{
415
+ status: 200;
416
+ data: VpnResponse;
417
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/vpns`, oazapfts.json({
418
+ ...opts,
419
+ method: "POST",
420
+ body: createVpnRequest,
421
+ headers: oazapfts.mergeHeaders(opts?.headers, {
422
+ Authorization: authorization
423
+ })
424
+ })));
425
+ }
357
426
  export function listProject({ authorization, foundationId, parentFolderId }: {
358
427
  authorization: string;
359
428
  foundationId: string;
@@ -694,6 +763,36 @@ export function getFoundation({ authorization, foundationId }: {
694
763
  })
695
764
  }));
696
765
  }
766
+ export function getVpn({ authorization, foundationId, vpnId }: {
767
+ authorization: string;
768
+ foundationId: string;
769
+ vpnId: string;
770
+ }, opts?: Oazapfts.RequestOpts) {
771
+ return oazapfts.ok(oazapfts.fetchJson<{
772
+ status: 200;
773
+ data: VpnResponse;
774
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/vpns/${encodeURIComponent(vpnId)}`, {
775
+ ...opts,
776
+ headers: oazapfts.mergeHeaders(opts?.headers, {
777
+ Authorization: authorization
778
+ })
779
+ }));
780
+ }
781
+ export function getVpnConfiguration({ authorization, foundationId, vpnId }: {
782
+ authorization: string;
783
+ foundationId: string;
784
+ vpnId: string;
785
+ }, opts?: Oazapfts.RequestOpts) {
786
+ return oazapfts.ok(oazapfts.fetchJson<{
787
+ status: 200;
788
+ data: VpnConfigurationResponse;
789
+ }>(`/v1/foundations/${encodeURIComponent(foundationId)}/vpns/${encodeURIComponent(vpnId)}/configuration`, {
790
+ ...opts,
791
+ headers: oazapfts.mergeHeaders(opts?.headers, {
792
+ Authorization: authorization
793
+ })
794
+ }));
795
+ }
697
796
  export function getProject({ authorization, foundationId, projectId }: {
698
797
  authorization: string;
699
798
  foundationId: string;
@@ -13,6 +13,7 @@ import {
13
13
  createPersonalAccessToken,
14
14
  createSecret,
15
15
  createServiceCredential1,
16
+ createTrialAccount,
16
17
  createUser,
17
18
  deactivateFidoCredentials,
18
19
  defaults,
@@ -28,6 +29,7 @@ import {
28
29
  disableSecret,
29
30
  disassociateGroupToServiceCredential, enableFidoCredentials,
30
31
  enableSecret,
32
+ enterpriseContact,
31
33
  findSecrets1,
32
34
  getAccess,
33
35
  getAccountMembers,
@@ -51,6 +53,8 @@ import {
51
53
  getMembers,
52
54
  getMembers1,
53
55
  getPartnerAccount, getPartnersSharingAllowed,
56
+ getPersonalAccountDetails,
57
+ getPersonalAccountExpirationData,
54
58
  getPersonalClientCredentials,
55
59
  getResources1,
56
60
  getResources2,
@@ -80,6 +84,7 @@ import {
80
84
  listMemberFavoritesByResource,
81
85
  listScmCredentials,
82
86
  listScmCredentials1, partialUpdateSso, personalAccessTokenAuthorization,
87
+ personalContact,
83
88
  removeRoleFromMember,
84
89
  resetOtp,
85
90
  resetPassword, revokeServiceCredential1, save,
@@ -92,6 +97,7 @@ import {
92
97
  updateMemberPreferences,
93
98
  updatePartnerAccountAdminData,
94
99
  updatePartnerAccountData,
100
+ updatePersonalAccountDetails,
95
101
  updateRateLimit,
96
102
  updateResourceActions,
97
103
  updateRoleWithNewActions,
@@ -726,6 +732,32 @@ class AccountClient extends ReactQueryNetworkClient {
726
732
  * Disable secret
727
733
  */
728
734
  disableSecret = this.mutation(disableSecret)
735
+
736
+ // TRIAL
737
+ /**
738
+ * Create trial account
739
+ */
740
+ createTrialAccount = this.mutation(createTrialAccount)
741
+ /**
742
+ * Update trial account info
743
+ */
744
+ updateTrialAccount = this.mutation(updatePersonalAccountDetails)
745
+ /**
746
+ * Creates a personal contact lead
747
+ */
748
+ personalContact = this.mutation(personalContact)
749
+ /**
750
+ * Creates an enterprise contact lead
751
+ */
752
+ enterpriseContact = this.mutation(enterpriseContact)
753
+ /**
754
+ * Get trial expiration info
755
+ */
756
+ trialExpiration = this.query(getPersonalAccountExpirationData)
757
+ /**
758
+ * Get trial expiration info
759
+ */
760
+ trialAccountDetails = this.query(getPersonalAccountDetails)
729
761
  /**
730
762
  * Get account rate limit
731
763
  */
@@ -12,11 +12,13 @@ import
12
12
  createNetwork,
13
13
  createNetworkConnection,
14
14
  createProject,
15
+ createVpn,
15
16
  defaults,
16
17
  getCertificate,
17
18
  getFolder,
18
19
  getFoundation,
19
20
  getProject,
21
+ getVpnConfiguration,
20
22
  listCertificates,
21
23
  listCidr,
22
24
  listDnsRecord,
@@ -25,6 +27,7 @@ import
25
27
  listInbound,
26
28
  listNetwork,
27
29
  listNetworkConnection,
30
+ listVpns,
28
31
  providers,
29
32
  } from '../api/cloudPlatform'
30
33
  import apis from '../apis.json'
@@ -138,6 +141,18 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
138
141
  * Accept a network connection
139
142
  */
140
143
  acceptNetworkConnection = this.mutation(removeAuthorizationParam(acceptNetworkConnection))
144
+ /**
145
+ * Get a list of vpn's
146
+ */
147
+ listVpns = this.query(removeAuthorizationParam(listVpns))
148
+ /**
149
+ * Get vpn configuration
150
+ */
151
+ getVpnConfiguration = this.query(removeAuthorizationParam(getVpnConfiguration))
152
+ /**
153
+ * Create a vpn
154
+ */
155
+ createVpn = this.mutation(removeAuthorizationParam(createVpn))
141
156
  }
142
157
 
143
158
  export const cloudPlatformClient = new CloudPlatformClient()