@stack-spot/portal-network 0.7.0 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.8.0...portal-network@v0.9.0) (2024-08-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * add embeded links requests ([6cb40d8](https://github.com/stack-spot/portal-commons/commit/6cb40d8f41371f4c00864848f878b251e8daac7a))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * connection interface methods ([1ede473](https://github.com/stack-spot/portal-commons/commit/1ede473d8ac16ebe52891463082e92056c08397b))
14
+
15
+ ## [0.8.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.7.0...portal-network@v0.8.0) (2024-08-07)
16
+
17
+
18
+ ### Features
19
+
20
+ * network - scm ([#240](https://github.com/stack-spot/portal-commons/issues/240)) ([55278fb](https://github.com/stack-spot/portal-commons/commit/55278fbc8f6ea76bf50ab8c95806594fd6db1084))
21
+
3
22
  ## [0.7.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.6.0...portal-network@v0.7.0) (2024-08-07)
4
23
 
5
24
 
@@ -1,6 +1,7 @@
1
1
  import { HttpError } from '@oazapfts/runtime';
2
2
  import { StackspotAPIError } from '../error/StackspotAPIError.js';
3
3
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
4
+ import { CreateSCMRequest, SCMStatus, UpdateSCMRequest } from './types.js';
4
5
  declare class AccountClient extends ReactQueryNetworkClient {
5
6
  constructor();
6
7
  protected buildStackSpotError(error: HttpError): StackspotAPIError;
@@ -477,6 +478,69 @@ declare class AccountClient extends ReactQueryNetworkClient {
477
478
  * Sends an email for downloading the CLI
478
479
  */
479
480
  sendDownloadCLIEmail: import("../network/types.js").MutationObject<void, unknown>;
481
+ /**
482
+ * Creates an SCM credential (account level).
483
+ */
484
+ createSCMCredential: import("../network/types.js").MutationObject<CreateSCMRequest, unknown>;
485
+ /**
486
+ * Updates an SCM credential (account level).
487
+ */
488
+ updateSCMCredential: import("../network/types.js").MutationObject<UpdateSCMRequest, unknown>;
489
+ /**
490
+ * Gets all SCM credentials (account level).
491
+ */
492
+ allSCMCredentials: import("../network/types.js").QueryObject<void, import("../api/account.js").AccountScmInfoResponse[]>;
493
+ /**
494
+ * Gets the status for the SCM credential.
495
+ *
496
+ * - If the SCM status is invalid because there's no configuration at the account level, it returns `{ status: 'missing-account' }`.
497
+ * - If the SCM status is invalid because, although the SCM integration is configured, the SCM access is not, it returns
498
+ * `{ status: 'missing-user' }`.
499
+ * - If the SCM status is valid, it returns `{ status: 'valid', mandate: boolean, hasUserConfiguration: boolean }`. `mandate` indicates
500
+ * if the SCM credential is mandatory at the account level for every user. `hasUserConfiguration` indicates if the user currently logged
501
+ * in has an SCM credential configured or not.
502
+ */
503
+ scmCredentialStatus: Omit<import("../network/types.js").QueryObject<void, SCMStatus>, "isAllowed" | "useAllowed" | "getPermissionKey">;
504
+ /**
505
+ * Enables Personal Access Token (PAT) generation.
506
+ */
507
+ enablePATGeneration: import("../network/types.js").MutationObject<void, unknown>;
508
+ /**
509
+ * Disables Personal Access Token (PAT) generation.
510
+ */
511
+ disablePATGeneration: import("../network/types.js").MutationObject<void, unknown>;
512
+ /**
513
+ * Verifies if Personal Access Token (PAT) generation is enabled.
514
+ */
515
+ patGenerationEnabled: Omit<import("../network/types.js").QueryObject<void, boolean>, "isAllowed" | "useAllowed" | "getPermissionKey">;
516
+ /**
517
+ * Verifies if the current user has an SCM credential configured.
518
+ */
519
+ userHasSCMCredential: Omit<import("../network/types.js").QueryObject<void, boolean>, "isAllowed" | "useAllowed" | "getPermissionKey">;
520
+ /**
521
+ * Creates an SCM credential for the user currently logged in.
522
+ */
523
+ createUserSCMCredential: import("../network/types.js").MutationObject<{
524
+ userScmInfoRequest: import("../api/account.js").UserScmInfoRequest;
525
+ }, unknown>;
526
+ /**
527
+ * Updates an SCM credential for the user currently logged in.
528
+ */
529
+ updateUserSCMCredential: import("../network/types.js").MutationObject<{
530
+ userScmInfoRequest: import("../api/account.js").UserScmInfoRequest;
531
+ }, unknown>;
532
+ /**
533
+ * Gets all SCM credentials for the user currently logged in.
534
+ */
535
+ allUserSCMCredentials: import("../network/types.js").QueryObject<void, import("../api/account.js").UserScmInfoResponse[]>;
536
+ /**
537
+ * Gets the SCM provider.
538
+ */
539
+ scmProvider: import("../network/types.js").QueryObject<void, import("../api/account.js").AccountScmProviderResponse>;
540
+ /**
541
+ * Deletes the SCM credentials for the user currently logged in.
542
+ */
543
+ deleteSCMCredentials: import("../network/types.js").MutationObject<void, unknown>;
480
544
  }
481
545
  export declare const accountClient: AccountClient;
482
546
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/client/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AA0C7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,aAAc,SAAQ,uBAAuB;;IAKjD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,iCAAiC,8GAA8C;IAC/E;;OAEG;IACH,iBAAiB;;gBAAwB;IACzC;;OAEG;IACH,WAAW;;;8DAAqC;IAChD;;OAEG;IACH,YAAY,gGAA0B;IACtC;;OAEG;IACH,QAAQ;;0DAAwC;IAChD;;OAEG;IACH,OAAO;;iDAAgC;IACvC;;OAEG;IACH,aAAa;;4CAA+B;IAC5C;;OAEG;IACH,aAAa;;;gBAA0C;IACvD;;OAEG;IACH,kBAAkB;;;gBAA+C;IACjE;;OAEG;IACH,iBAAiB;;gBAA+B;IAChD;;OAEG;IACH,sBAAsB;;gBAAwC;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;;;;;;;;;;;oDAA+B;IACvC;;OAEG;IACH,IAAI;YAEoC,MAAM;gGAK5C;IACF;;OAEG;IACH,WAAW;;;;;;;;;;;;0DAAqC;IAChD;;OAEG;IACH,UAAU;;4CAAmC;IAC7C;;OAEG;IACH,UAAU;;;gBAAmC;IAC7C;;OAEG;IACH,UAAU;;gBAAmC;IAC7C;;OAEG;IACH,gBAAgB;;;wDAAiC;IACjD;;OAEG;IACH,UAAU;;;;;;;;;;;;yDAAoC;IAC9C;;OAEG;IACH,eAAe;;;gBAAgC;IAC/C;;OAEG;IACH,eAAe;;;;;;;;;;;;uDAAuD;IACtE;;OAEG;IACH,qBAAqB;;;gBAA0C;IAC/D;;OAEG;IACH,YAAY;;;;;;;;;;;wDAAmC;IAC/C;;OAEG;IACH,gBAAgB;;;;;;;;;;;4DAAuC;IACvD;;OAEG;IACH,oBAAoB,2DAAmC;IACvD;;OAEG;IACH,mBAAmB,uEAA6G;IAChI;;OAEG;IACH,mBAAmB,uEAA+G;IAClI;;OAEG;IACH,iBAAiB,kGAAkC;IACnD;;;;;;;;;OASG;IACH,mBAAmB,iHAgBjB;IACF;;OAEG;IACH,mBAAmB,2DAA2C;IAC9D;;OAEG;IACH,oBAAoB,2DAAsD;IAC1E;;OAEG;IACH,oBAAoB,+GAWlB;IACF;;OAEG;IACH,oBAAoB,+GAUlB;IACF;;OAEG;IACH,uBAAuB;;gBAAmC;IAC1D;;OAEG;IACH,uBAAuB;;gBAAqC;IAC5D;;OAEG;IACH,qBAAqB,+FAAiC;IACtD;;OAEG;IACH,WAAW,oGAA6B;IACxC;;OAEG;IACH,oBAAoB,2DAA2B;CAChD;AAED,eAAO,MAAM,aAAa,eAAsB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { HttpError } from '@oazapfts/runtime';
2
- import { accountDataIsAvailable, addResourcesToGroup, addRoleToMember, bindGroupMembers, bindRoleGroups, bindRoles, bindToGroups, bindToRoles, create, createAccountRole, createPartner, createUser, deactivateFidoCredentials, defaults, deleteAccountRole, deleteMember, deletePartner, deleteResourceFromGroup, deleteRole, deleteV1GroupsByGroupId, enableFidoCredentials, getAccountMembers1, getAllMemberFidoCredentials, getFeatures, getGroupById, getGroupResources, getGroups, getMemberById, getMemberGroups, getMembers, getPartnerAccount, getPartnersSharingAllowed, getPersonalClientCredentials, getResources, getResources1, getResourcesAndActionsWithStatus, getResourceTypes, getRoleGroups, getRoleMembers, getRoles, getRoles1, getRoles2, removeRoleFromMember, resetPassword, save, sendDownloadEmail, update1, updateAccountRole, updatePartnerAccountAdminData, updatePartnerAccountData, updateRoleWithNewActions, updateUser, validateNewPartnerData, validatePartnerAssociationLimit, } from '../api/account.js';
2
+ import { accountDataIsAvailable, addResourcesToGroup, addRoleToMember, bindGroupMembers, bindRoleGroups, bindRoles, bindToGroups, bindToRoles, create, createAccountRole, createPartner, createPersonalAccessToken, createUser, deactivateFidoCredentials, defaults, deleteAccountRole, deleteMember, deletePartner, deleteResourceFromGroup, deleteRole, deleteV1GroupsByGroupId, disablePersonalAccessTokenGeneration, enableFidoCredentials, getAccountMembers1, getAllMemberFidoCredentials, getFeatures, getGroupById, getGroupResources, getGroups, getMemberById, getMemberGroups, getMembers, getPartnerAccount, getPartnersSharingAllowed, getPersonalClientCredentials, getResources, getResources1, getResourcesAndActionsWithStatus, getResourceTypes, getRoleGroups, getRoleMembers, getRoles, getRoles1, getRoles2, getScmProvider, isCreatedScmCredentials, isCreatedScmCredentials1, listScmCredentials, listScmCredentials1, personalAccessTokenAuthorization, removeRoleFromMember, resetPassword, save, scmCredentialSave, scmCredentialSave1, scmCredentialUpdate, scmCredentialUpdate1, scmDelete, sendDownloadEmail, update1, updateAccountRole, updatePartnerAccountAdminData, updatePartnerAccountData, updateRoleWithNewActions, updateUser, validateNewPartnerData, validatePartnerAssociationLimit, } from '../api/account.js';
3
3
  import apis from '../apis.json';
4
4
  import { DefaultAPIError } from '../error/DefaultAPIError.js';
5
5
  import { accountDictionary } from '../error/dictionary/account.js';
@@ -519,6 +519,173 @@ class AccountClient extends ReactQueryNetworkClient {
519
519
  writable: true,
520
520
  value: this.mutation(sendDownloadEmail)
521
521
  });
522
+ /**
523
+ * Creates an SCM credential (account level).
524
+ */
525
+ Object.defineProperty(this, "createSCMCredential", {
526
+ enumerable: true,
527
+ configurable: true,
528
+ writable: true,
529
+ value: this.mutation(scmCredentialSave1)
530
+ });
531
+ /**
532
+ * Updates an SCM credential (account level).
533
+ */
534
+ Object.defineProperty(this, "updateSCMCredential", {
535
+ enumerable: true,
536
+ configurable: true,
537
+ writable: true,
538
+ value: this.mutation(scmCredentialUpdate1)
539
+ });
540
+ /**
541
+ * Gets all SCM credentials (account level).
542
+ */
543
+ Object.defineProperty(this, "allSCMCredentials", {
544
+ enumerable: true,
545
+ configurable: true,
546
+ writable: true,
547
+ value: this.query(listScmCredentials1)
548
+ });
549
+ /**
550
+ * Gets the status for the SCM credential.
551
+ *
552
+ * - If the SCM status is invalid because there's no configuration at the account level, it returns `{ status: 'missing-account' }`.
553
+ * - If the SCM status is invalid because, although the SCM integration is configured, the SCM access is not, it returns
554
+ * `{ status: 'missing-user' }`.
555
+ * - If the SCM status is valid, it returns `{ status: 'valid', mandate: boolean, hasUserConfiguration: boolean }`. `mandate` indicates
556
+ * if the SCM credential is mandatory at the account level for every user. `hasUserConfiguration` indicates if the user currently logged
557
+ * in has an SCM credential configured or not.
558
+ */
559
+ Object.defineProperty(this, "scmCredentialStatus", {
560
+ enumerable: true,
561
+ configurable: true,
562
+ writable: true,
563
+ value: this.query({
564
+ name: 'account.scmStatus',
565
+ request: async (signal) => {
566
+ try {
567
+ const data = await isCreatedScmCredentials1({ signal });
568
+ return { status: 'valid', ...data };
569
+ }
570
+ catch (error) {
571
+ if (error instanceof HttpError) {
572
+ // 404 means that the scm integration was not configured
573
+ if (error.status === 404)
574
+ return { status: 'missing-account' };
575
+ // 422 means that the scm integration is configured, but the scm access is not
576
+ if (error.status === 422)
577
+ return { status: 'missing-user' };
578
+ }
579
+ throw error;
580
+ }
581
+ },
582
+ })
583
+ });
584
+ /**
585
+ * Enables Personal Access Token (PAT) generation.
586
+ */
587
+ Object.defineProperty(this, "enablePATGeneration", {
588
+ enumerable: true,
589
+ configurable: true,
590
+ writable: true,
591
+ value: this.mutation(createPersonalAccessToken)
592
+ });
593
+ /**
594
+ * Disables Personal Access Token (PAT) generation.
595
+ */
596
+ Object.defineProperty(this, "disablePATGeneration", {
597
+ enumerable: true,
598
+ configurable: true,
599
+ writable: true,
600
+ value: this.mutation(disablePersonalAccessTokenGeneration)
601
+ });
602
+ /**
603
+ * Verifies if Personal Access Token (PAT) generation is enabled.
604
+ */
605
+ Object.defineProperty(this, "patGenerationEnabled", {
606
+ enumerable: true,
607
+ configurable: true,
608
+ writable: true,
609
+ value: this.query({
610
+ name: 'account.patEnabled',
611
+ request: async (signal) => {
612
+ try {
613
+ await personalAccessTokenAuthorization({ signal });
614
+ return true;
615
+ }
616
+ catch (error) {
617
+ if (error instanceof HttpError && error.status === 404)
618
+ return false;
619
+ throw error;
620
+ }
621
+ },
622
+ })
623
+ });
624
+ /**
625
+ * Verifies if the current user has an SCM credential configured.
626
+ */
627
+ Object.defineProperty(this, "userHasSCMCredential", {
628
+ enumerable: true,
629
+ configurable: true,
630
+ writable: true,
631
+ value: this.query({
632
+ name: 'account.userHasSCMCredential',
633
+ request: async (signal) => {
634
+ try {
635
+ await isCreatedScmCredentials({ signal });
636
+ return true;
637
+ }
638
+ catch {
639
+ return false;
640
+ }
641
+ },
642
+ })
643
+ });
644
+ /**
645
+ * Creates an SCM credential for the user currently logged in.
646
+ */
647
+ Object.defineProperty(this, "createUserSCMCredential", {
648
+ enumerable: true,
649
+ configurable: true,
650
+ writable: true,
651
+ value: this.mutation(scmCredentialSave)
652
+ });
653
+ /**
654
+ * Updates an SCM credential for the user currently logged in.
655
+ */
656
+ Object.defineProperty(this, "updateUserSCMCredential", {
657
+ enumerable: true,
658
+ configurable: true,
659
+ writable: true,
660
+ value: this.mutation(scmCredentialUpdate)
661
+ });
662
+ /**
663
+ * Gets all SCM credentials for the user currently logged in.
664
+ */
665
+ Object.defineProperty(this, "allUserSCMCredentials", {
666
+ enumerable: true,
667
+ configurable: true,
668
+ writable: true,
669
+ value: this.query(listScmCredentials)
670
+ });
671
+ /**
672
+ * Gets the SCM provider.
673
+ */
674
+ Object.defineProperty(this, "scmProvider", {
675
+ enumerable: true,
676
+ configurable: true,
677
+ writable: true,
678
+ value: this.query(getScmProvider)
679
+ });
680
+ /**
681
+ * Deletes the SCM credentials for the user currently logged in.
682
+ */
683
+ Object.defineProperty(this, "deleteSCMCredentials", {
684
+ enumerable: true,
685
+ configurable: true,
686
+ writable: true,
687
+ value: this.mutation(scmDelete)
688
+ });
522
689
  }
523
690
  buildStackSpotError(error) {
524
691
  return new DefaultAPIError(error.data, error.status, accountDictionary, error.headers);
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/client/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,aAAa,EACnE,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,aAAa,EAAE,uBAAuB,EAAE,UAAU,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EACtH,2BAA2B,EAAE,WAAW,EACxC,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EAAE,yBAAyB,EAC5C,4BAA4B,EAC5B,YAAY,EACZ,aAAa,EACb,gCAAgC,EAChC,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,aAAa,EAAE,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oUpdateRequest, AccountScmStatusResponse } from '../api/account.js';
2
+ interface BaseSMCStatus {
3
+ /**
4
+ * Indicates the current status of the SCM credential.
5
+ * - 'valid': the SCM credential is valid.
6
+ * - 'missing-account': the SCM credential is not configured at the account level.
7
+ * - 'missing-user': the SCM credential is configured at the account level, but the SCM access is not configured for the user.
8
+ */
9
+ status: 'missing-account' | 'missing-user' | 'valid';
10
+ }
11
+ interface ValidSCMStatus extends BaseSMCStatus, AccountScmStatusResponse {
12
+ status: 'valid';
13
+ }
14
+ interface InvalidSCMStatus extends BaseSMCStatus {
15
+ status: 'missing-account' | 'missing-user';
16
+ }
17
+ export type SCMStatus = InvalidSCMStatus | ValidSCMStatus;
18
+ interface SCMAuthPATValue {
19
+ user: string;
20
+ pass: string;
21
+ }
22
+ interface SCMAuthGitValue {
23
+ appId: string;
24
+ installationId: string;
25
+ privateKey: string;
26
+ }
27
+ export interface CreateSCMRequest {
28
+ accountScmInfoSaveRequest: AccountScmInfoSaveRequest & {
29
+ value: SCMAuthGitValue | SCMAuthPATValue;
30
+ };
31
+ }
32
+ export interface UpdateSCMRequest {
33
+ accountScmInfoUpdateRequest: AccountScmInfoUpdateRequest & {
34
+ value?: SCMAuthGitValue | SCMAuthPATValue;
35
+ };
36
+ }
37
+ export {};
38
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAEjH,UAAU,aAAa;IACrB;;;;;OAKG;IACH,MAAM,EAAE,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC;CACtD;AAED,UAAU,cAAe,SAAQ,aAAa,EAAE,wBAAwB;IACtE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,UAAU,gBAAiB,SAAQ,aAAa;IAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC;CAC5C;AAED,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,cAAc,CAAA;AAEzD,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB,EAAE,yBAAyB,GAAG;QACrD,KAAK,EAAE,eAAe,GAAG,eAAe,CAAC;KAC1C,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B,EAAE,2BAA2B,GAAG;QACzD,KAAK,CAAC,EAAE,eAAe,GAAG,eAAe,CAAC;KAC3C,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":""}
@@ -4,6 +4,52 @@ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
4
4
  declare class WorkspaceClient extends ReactQueryNetworkClient {
5
5
  constructor();
6
6
  protected buildStackSpotError(error: HttpError): StackspotAPIError;
7
+ /**
8
+ * Gets all connection interfaces from a workspace
9
+ */
10
+ allConnectionInterfaces: import("../network/types.js").QueryObject<{
11
+ workspaceId: string;
12
+ typeId?: string | undefined;
13
+ }, import("../api/workspace.js").ConnectionInterfaceSummaryResponse[]>;
14
+ /**
15
+ * Gets a connection interface from a workspace
16
+ */
17
+ connectionInterface: import("../network/types.js").QueryObject<{
18
+ workspaceId: string;
19
+ connectionInterfaceId: string;
20
+ environmentId?: string | undefined;
21
+ }, import("../api/workspace.js").ConnectionInterfaceDetailsResponse>;
22
+ /**
23
+ * Updates the visibility of a connection interface
24
+ */
25
+ updateConnectionInterfaceVisibility: import("../network/types.js").MutationObject<{
26
+ workspaceId: string;
27
+ connectionInterfaceId: string;
28
+ updateConnectionInterfaceVisibilityRequest: any;
29
+ }, unknown>;
30
+ /**
31
+ * Removes a connection interface
32
+ */
33
+ deleteConnectionInterface: import("../network/types.js").MutationObject<{
34
+ workspaceId: string;
35
+ slug: string;
36
+ }, unknown>;
37
+ /**
38
+ * Removes connection interface attributes by environment
39
+ */
40
+ deleteConnectionInterfaceAttributesFromEnvironment: import("../network/types.js").MutationObject<{
41
+ workspaceId: string;
42
+ slug: string;
43
+ environmentId: string;
44
+ }, unknown>;
45
+ /**
46
+ * Updates the attributes of a connection interface
47
+ */
48
+ updateConnectionInterfaceAttributes: import("../network/types.js").MutationObject<{
49
+ workspaceId: string;
50
+ connectionInterfaceId: string;
51
+ updateConnectionInterfaceAttributesRequest: import("../api/workspace.js").UpdateConnectionInterfaceAttributesRequest;
52
+ }, unknown>;
7
53
  /**
8
54
  * Gets all environments
9
55
  */
@@ -29,6 +75,98 @@ declare class WorkspaceClient extends ReactQueryNetworkClient {
29
75
  id: string;
30
76
  environmentUpdateRequest: import("../api/workspace.js").EnvironmentUpdateRequest;
31
77
  }, import("../api/workspace.js").IdResponse>;
78
+ /**
79
+ * Gets embedded link by id
80
+ */
81
+ embeddedLinkInWorkspace: import("../network/types.js").QueryObject<{
82
+ workspaceId: string;
83
+ embeddedLinkId: string;
84
+ }, import("../api/workspace.js").WorkspaceEmbeddedLinkReadResponse>;
85
+ /**
86
+ * Gets all embedded links from a workspace
87
+ */
88
+ allEmbeddedLinksInWorkspace: import("../network/types.js").QueryObject<{
89
+ workspaceId: string;
90
+ name?: string | undefined;
91
+ }, import("../api/workspace.js").WorkspaceEmbeddedLinkReadResponse[]>;
92
+ /**
93
+ * Creates an embedded link in a workspace
94
+ */
95
+ createEmbeddedLinkInWorkspace: import("../network/types.js").MutationObject<{
96
+ workspaceId: string;
97
+ createWorkspaceEmbeddedLinkRequest: import("../api/workspace.js").CreateWorkspaceEmbeddedLinkRequest;
98
+ }, import("../api/workspace.js").IdResponse>;
99
+ /**
100
+ * Deletes an embedded link from a workspace
101
+ */
102
+ deleteEmbeddedLinkFromWorkspace: import("../network/types.js").MutationObject<{
103
+ workspaceId: string;
104
+ embeddedLinkId: string;
105
+ }, unknown>;
106
+ /**
107
+ * Updates an embedded link from a workspace
108
+ */
109
+ updateEmbeddedLinkInWorkspace: import("../network/types.js").MutationObject<{
110
+ workspaceId: string;
111
+ embeddedLinkId: string;
112
+ updateWorkspaceEmbeddedLinkRequest: import("../api/workspace.js").UpdateWorkspaceEmbeddedLinkRequest;
113
+ }, import("../api/workspace.js").IdResponse>;
114
+ /**
115
+ * Updates all embedded links from a workspace
116
+ */
117
+ updateAllEmbeddedLinksInWorkspace: import("../network/types.js").MutationObject<{
118
+ workspaceId: string;
119
+ body: import("../api/workspace.js").UpsertWorkspaceEmbeddedLinkRequest[];
120
+ }, unknown>;
121
+ /**
122
+ * Gets an embedded link from an application
123
+ */
124
+ embeddedLinkInApplication: import("../network/types.js").QueryObject<{
125
+ workspaceId: string;
126
+ applicationId: string;
127
+ embeddedLinkId: string;
128
+ }, import("../api/workspace.js").ApplicationEmbeddedLinkReadResponse>;
129
+ /**
130
+ * Gets all embedded links from an application
131
+ */
132
+ allEmbeddedLinksInApplication: import("../network/types.js").QueryObject<{
133
+ workspaceId: string;
134
+ applicationId: string;
135
+ name?: string | undefined;
136
+ }, import("../api/workspace.js").ApplicationEmbeddedLinkReadResponse[]>;
137
+ /**
138
+ * Creates an embedded link in an application
139
+ */
140
+ createEmbeddedLinkInApplication: import("../network/types.js").MutationObject<{
141
+ workspaceId: string;
142
+ applicationId: string;
143
+ createApplicationEmbeddedLinkRequest: import("../api/workspace.js").CreateApplicationEmbeddedLinkRequest;
144
+ }, import("../api/workspace.js").IdResponse>;
145
+ /**
146
+ * Deletes an embedded link from an application
147
+ */
148
+ deleteEmbeddedLinkFromApplication: import("../network/types.js").MutationObject<{
149
+ workspaceId: string;
150
+ applicationId: string;
151
+ embeddedLinkId: string;
152
+ }, unknown>;
153
+ /**
154
+ * Updates an embedded link in an application
155
+ */
156
+ updateEmbeddedLinkInApplication: import("../network/types.js").MutationObject<{
157
+ workspaceId: string;
158
+ applicationId: string;
159
+ embeddedLinkId: string;
160
+ updateApplicationEmbeddedLinkRequest: import("../api/workspace.js").UpdateApplicationEmbeddedLinkRequest;
161
+ }, import("../api/workspace.js").IdResponse>;
162
+ /**
163
+ * Updates all embedded links in an application
164
+ */
165
+ updateAllEmbeddedLinksInApplication: import("../network/types.js").MutationObject<{
166
+ workspaceId: string;
167
+ applicationId: string;
168
+ body: import("../api/workspace.js").UpsertApplicationEmbeddedLinkRequest[];
169
+ }, unknown>;
32
170
  }
33
171
  export declare const workspaceClient: WorkspaceClient;
34
172
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/client/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAQ7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,eAAgB,SAAQ,uBAAuB;;IAKnD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,YAAY;;6DAA8B;IAE1C;;OAEG;IACH,WAAW;;2DAA6B;IAExC;;OAEG;IACH,iBAAiB;;8CAAiC;IAElD;;OAEG;IACH,iBAAiB;;;8CAAmC;CAErD;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/client/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAwB7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,eAAgB,SAAQ,uBAAuB;;IAKnD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,uBAAuB;;;wEAAsC;IAE7D;;OAEG;IACH,mBAAmB;;;;sEAAqC;IAExD;;OAEG;IACH,mCAAmC;;;;gBAAqD;IAExF;;OAEG;IACH,yBAAyB;;;gBAA8D;IAEvF;;OAEG;IACH,kDAAkD;;;;gBAAoE;IAEtH;;OAEG;IACH,mCAAmC;;;;gBAAqD;IAExF;;OAEG;IACH,YAAY;;6DAA8B;IAE1C;;OAEG;IACH,WAAW;;2DAA6B;IAExC;;OAEG;IACH,iBAAiB;;8CAAiC;IAElD;;OAEG;IACH,iBAAiB;;;8CAAmC;IAEpD;;OAEG;IACH,uBAAuB;;;qEAA8B;IAErD;;OAEG;IACH,2BAA2B;;;uEAA+B;IAE1D;;OAEG;IACH,6BAA6B;;;8CAAoC;IAEjE;;OAEG;IACH,+BAA+B;;;gBAAoC;IAEnE;;OAEG;IACH,6BAA6B;;;;8CAAoC;IAEjE;;OAEG;IACH,iCAAiC;;;gBAAuC;IAExE;;OAEG;IACH,yBAAyB;;;;uEAA0C;IAEnE;;OAEG;IACH,6BAA6B;;;;yEAA6C;IAE1E;;OAEG;IACH,+BAA+B;;;;8CAA8C;IAE7E;;OAEG;IACH,iCAAiC;;;;gBAAgD;IAEjF;;OAEG;IACH,+BAA+B;;;;;8CAAgD;IAE/E;;OAEG;IACH,mCAAmC;;;;gBAAmD;CAEvF;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { defaults, getEnvironment, getEnvironments, save9 as saveEnvironment, update9 as updateEnvironment, } from '../api/workspace.js';
1
+ import { save5 as createEmbeddedLink, defaults, delete6 as deleteApplicationEmbeddedLinks, deleteConnectionInterfaceAttributesFromEnvironment, deleteConnectionInterfaceFromAllEnvironments, delete4 as deleteEmbeddedLink, getEmbeddedLinks1 as getAllApplicationEmbeddedLinks, getEmbeddedLink1 as getApplicationEmbeddedLinks, getConnectionInterface, getConnectionInterfaces, getEmbeddedLink, getEmbeddedLinks, getEnvironment, getEnvironments, save8 as saveApplicationEmbeddedLinks, save9 as saveEnvironment, upsertBatch2 as updateAllApplicationEmbeddedLinks, upsertBatch1 as updateAllEmbeddedLink, update8 as updateApplicationEmbeddedLinks, updateConnectionInterfaceAttributes, updateConnectionInterfaceVisibility, update5 as updateEmbeddedLink, update9 as updateEnvironment, } from '../api/workspace.js';
2
2
  import apis from '../apis.json';
3
3
  import { DefaultAPIError } from '../error/DefaultAPIError.js';
4
4
  import { workspaceDictionary } from '../error/dictionary/workspace.js';
@@ -6,6 +6,60 @@ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
6
6
  class WorkspaceClient extends ReactQueryNetworkClient {
7
7
  constructor() {
8
8
  super(apis.workspace.url, defaults);
9
+ /**
10
+ * Gets all connection interfaces from a workspace
11
+ */
12
+ Object.defineProperty(this, "allConnectionInterfaces", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: this.query(getConnectionInterfaces)
17
+ });
18
+ /**
19
+ * Gets a connection interface from a workspace
20
+ */
21
+ Object.defineProperty(this, "connectionInterface", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: this.query(getConnectionInterface)
26
+ });
27
+ /**
28
+ * Updates the visibility of a connection interface
29
+ */
30
+ Object.defineProperty(this, "updateConnectionInterfaceVisibility", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: this.mutation(updateConnectionInterfaceVisibility)
35
+ });
36
+ /**
37
+ * Removes a connection interface
38
+ */
39
+ Object.defineProperty(this, "deleteConnectionInterface", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: this.mutation(deleteConnectionInterfaceFromAllEnvironments)
44
+ });
45
+ /**
46
+ * Removes connection interface attributes by environment
47
+ */
48
+ Object.defineProperty(this, "deleteConnectionInterfaceAttributesFromEnvironment", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: this.mutation(deleteConnectionInterfaceAttributesFromEnvironment)
53
+ });
54
+ /**
55
+ * Updates the attributes of a connection interface
56
+ */
57
+ Object.defineProperty(this, "updateConnectionInterfaceAttributes", {
58
+ enumerable: true,
59
+ configurable: true,
60
+ writable: true,
61
+ value: this.mutation(updateConnectionInterfaceAttributes)
62
+ });
9
63
  /**
10
64
  * Gets all environments
11
65
  */
@@ -42,6 +96,114 @@ class WorkspaceClient extends ReactQueryNetworkClient {
42
96
  writable: true,
43
97
  value: this.mutation(updateEnvironment)
44
98
  });
99
+ /**
100
+ * Gets embedded link by id
101
+ */
102
+ Object.defineProperty(this, "embeddedLinkInWorkspace", {
103
+ enumerable: true,
104
+ configurable: true,
105
+ writable: true,
106
+ value: this.query(getEmbeddedLink)
107
+ });
108
+ /**
109
+ * Gets all embedded links from a workspace
110
+ */
111
+ Object.defineProperty(this, "allEmbeddedLinksInWorkspace", {
112
+ enumerable: true,
113
+ configurable: true,
114
+ writable: true,
115
+ value: this.query(getEmbeddedLinks)
116
+ });
117
+ /**
118
+ * Creates an embedded link in a workspace
119
+ */
120
+ Object.defineProperty(this, "createEmbeddedLinkInWorkspace", {
121
+ enumerable: true,
122
+ configurable: true,
123
+ writable: true,
124
+ value: this.mutation(createEmbeddedLink)
125
+ });
126
+ /**
127
+ * Deletes an embedded link from a workspace
128
+ */
129
+ Object.defineProperty(this, "deleteEmbeddedLinkFromWorkspace", {
130
+ enumerable: true,
131
+ configurable: true,
132
+ writable: true,
133
+ value: this.mutation(deleteEmbeddedLink)
134
+ });
135
+ /**
136
+ * Updates an embedded link from a workspace
137
+ */
138
+ Object.defineProperty(this, "updateEmbeddedLinkInWorkspace", {
139
+ enumerable: true,
140
+ configurable: true,
141
+ writable: true,
142
+ value: this.mutation(updateEmbeddedLink)
143
+ });
144
+ /**
145
+ * Updates all embedded links from a workspace
146
+ */
147
+ Object.defineProperty(this, "updateAllEmbeddedLinksInWorkspace", {
148
+ enumerable: true,
149
+ configurable: true,
150
+ writable: true,
151
+ value: this.mutation(updateAllEmbeddedLink)
152
+ });
153
+ /**
154
+ * Gets an embedded link from an application
155
+ */
156
+ Object.defineProperty(this, "embeddedLinkInApplication", {
157
+ enumerable: true,
158
+ configurable: true,
159
+ writable: true,
160
+ value: this.query(getApplicationEmbeddedLinks)
161
+ });
162
+ /**
163
+ * Gets all embedded links from an application
164
+ */
165
+ Object.defineProperty(this, "allEmbeddedLinksInApplication", {
166
+ enumerable: true,
167
+ configurable: true,
168
+ writable: true,
169
+ value: this.query(getAllApplicationEmbeddedLinks)
170
+ });
171
+ /**
172
+ * Creates an embedded link in an application
173
+ */
174
+ Object.defineProperty(this, "createEmbeddedLinkInApplication", {
175
+ enumerable: true,
176
+ configurable: true,
177
+ writable: true,
178
+ value: this.mutation(saveApplicationEmbeddedLinks)
179
+ });
180
+ /**
181
+ * Deletes an embedded link from an application
182
+ */
183
+ Object.defineProperty(this, "deleteEmbeddedLinkFromApplication", {
184
+ enumerable: true,
185
+ configurable: true,
186
+ writable: true,
187
+ value: this.mutation(deleteApplicationEmbeddedLinks)
188
+ });
189
+ /**
190
+ * Updates an embedded link in an application
191
+ */
192
+ Object.defineProperty(this, "updateEmbeddedLinkInApplication", {
193
+ enumerable: true,
194
+ configurable: true,
195
+ writable: true,
196
+ value: this.mutation(updateApplicationEmbeddedLinks)
197
+ });
198
+ /**
199
+ * Updates all embedded links in an application
200
+ */
201
+ Object.defineProperty(this, "updateAllEmbeddedLinksInApplication", {
202
+ enumerable: true,
203
+ configurable: true,
204
+ writable: true,
205
+ value: this.mutation(updateAllApplicationEmbeddedLinks)
206
+ });
45
207
  }
46
208
  buildStackSpotError(error) {
47
209
  return new DefaultAPIError(error.data, error.status, workspaceDictionary, error.headers);
@@ -1 +1 @@
1
- {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/client/workspace.ts"],"names":[],"m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CAAA;IAC1F,CAAC;CAgHF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { accountClient } from './client/account.js';
2
2
  export { secretsClient } from './client/secrets.js';
3
+ export * from './client/types.js';
3
4
  export { workspaceClient } from './client/workspace.js';
4
5
  export { DefaultAPIError } from './error/DefaultAPIError.js';
5
6
  export { StackspotAPIError } from './error/StackspotAPIError.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { accountClient } from './client/account.js';
2
2
  export { secretsClient } from './client/secrets.js';
3
+ export * from './client/types.js';
3
4
  export { workspaceClient } from './client/workspace.js';
4
5
  export { DefaultAPIError } from './error/DefaultAPIError.js';
5
6
  export { StackspotAPIError } from './error/StackspotAPIError.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import { HttpError } from '@oazapfts/runtime'
1
+ import { HttpError, RequestOpts } from '@oazapfts/runtime'
2
2
  import {
3
3
  accountDataIsAvailable,
4
4
  addResourcesToGroup,
@@ -7,12 +7,14 @@ import {
7
7
  bindRoleGroups,
8
8
  bindRoles,
9
9
  bindToGroups, bindToRoles, create, createAccountRole, createPartner,
10
+ createPersonalAccessToken,
10
11
  createUser,
11
12
  deactivateFidoCredentials,
12
13
  defaults,
13
14
  deleteAccountRole,
14
15
  deleteMember,
15
- deletePartner, deleteResourceFromGroup, deleteRole, deleteV1GroupsByGroupId, enableFidoCredentials, getAccountMembers1,
16
+ deletePartner, deleteResourceFromGroup, deleteRole, deleteV1GroupsByGroupId, disablePersonalAccessTokenGeneration, enableFidoCredentials,
17
+ getAccountMembers1,
16
18
  getAllMemberFidoCredentials, getFeatures,
17
19
  getGroupById,
18
20
  getGroupResources,
@@ -29,7 +31,13 @@ import {
29
31
  getRoleGroups,
30
32
  getRoleMembers,
31
33
  getRoles,
32
- getRoles1, getRoles2, removeRoleFromMember, resetPassword, save, sendDownloadEmail, update1, updateAccountRole,
34
+ getRoles1, getRoles2,
35
+ getScmProvider,
36
+ isCreatedScmCredentials,
37
+ isCreatedScmCredentials1, listScmCredentials, listScmCredentials1, personalAccessTokenAuthorization, removeRoleFromMember,
38
+ resetPassword, save,
39
+ scmCredentialSave, scmCredentialSave1, scmCredentialUpdate, scmCredentialUpdate1, scmDelete, sendDownloadEmail, update1,
40
+ updateAccountRole,
33
41
  updatePartnerAccountAdminData,
34
42
  updatePartnerAccountData,
35
43
  updateRoleWithNewActions,
@@ -42,6 +50,7 @@ import { DefaultAPIError } from '../error/DefaultAPIError'
42
50
  import { accountDictionary } from '../error/dictionary/account'
43
51
  import { StackspotAPIError } from '../error/StackspotAPIError'
44
52
  import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
53
+ import { CreateSCMRequest, SCMStatus, UpdateSCMRequest } from './types'
45
54
 
46
55
  class AccountClient extends ReactQueryNetworkClient {
47
56
  constructor() {
@@ -290,6 +299,102 @@ class AccountClient extends ReactQueryNetworkClient {
290
299
  * Sends an email for downloading the CLI
291
300
  */
292
301
  sendDownloadCLIEmail = this.mutation(sendDownloadEmail)
302
+ /**
303
+ * Creates an SCM credential (account level).
304
+ */
305
+ createSCMCredential = this.mutation(scmCredentialSave1 as (variables: CreateSCMRequest, opts?: RequestOpts) => Promise<unknown>)
306
+ /**
307
+ * Updates an SCM credential (account level).
308
+ */
309
+ updateSCMCredential = this.mutation(scmCredentialUpdate1 as (variables: UpdateSCMRequest, opts?: RequestOpts) => Promise<unknown>)
310
+ /**
311
+ * Gets all SCM credentials (account level).
312
+ */
313
+ allSCMCredentials = this.query(listScmCredentials1)
314
+ /**
315
+ * Gets the status for the SCM credential.
316
+ *
317
+ * - If the SCM status is invalid because there's no configuration at the account level, it returns `{ status: 'missing-account' }`.
318
+ * - If the SCM status is invalid because, although the SCM integration is configured, the SCM access is not, it returns
319
+ * `{ status: 'missing-user' }`.
320
+ * - If the SCM status is valid, it returns `{ status: 'valid', mandate: boolean, hasUserConfiguration: boolean }`. `mandate` indicates
321
+ * if the SCM credential is mandatory at the account level for every user. `hasUserConfiguration` indicates if the user currently logged
322
+ * in has an SCM credential configured or not.
323
+ */
324
+ scmCredentialStatus = this.query({
325
+ name: 'account.scmStatus',
326
+ request: async (signal): Promise<SCMStatus> => {
327
+ try {
328
+ const data = await isCreatedScmCredentials1({ signal })
329
+ return { status: 'valid', ...data }
330
+ } catch (error) {
331
+ if (error instanceof HttpError) {
332
+ // 404 means that the scm integration was not configured
333
+ if (error.status === 404) return { status: 'missing-account' }
334
+ // 422 means that the scm integration is configured, but the scm access is not
335
+ if (error.status === 422) return { status: 'missing-user' }
336
+ }
337
+ throw error
338
+ }
339
+ },
340
+ })
341
+ /**
342
+ * Enables Personal Access Token (PAT) generation.
343
+ */
344
+ enablePATGeneration = this.mutation(createPersonalAccessToken)
345
+ /**
346
+ * Disables Personal Access Token (PAT) generation.
347
+ */
348
+ disablePATGeneration = this.mutation(disablePersonalAccessTokenGeneration)
349
+ /**
350
+ * Verifies if Personal Access Token (PAT) generation is enabled.
351
+ */
352
+ patGenerationEnabled = this.query({
353
+ name: 'account.patEnabled',
354
+ request: async (signal) => {
355
+ try {
356
+ await personalAccessTokenAuthorization({ signal })
357
+ return true
358
+ } catch (error) {
359
+ if (error instanceof HttpError && error.status === 404) return false
360
+ throw error
361
+ }
362
+ },
363
+ })
364
+ /**
365
+ * Verifies if the current user has an SCM credential configured.
366
+ */
367
+ userHasSCMCredential = this.query({
368
+ name: 'account.userHasSCMCredential',
369
+ request: async (signal) => {
370
+ try {
371
+ await isCreatedScmCredentials({ signal })
372
+ return true
373
+ } catch {
374
+ return false
375
+ }
376
+ },
377
+ })
378
+ /**
379
+ * Creates an SCM credential for the user currently logged in.
380
+ */
381
+ createUserSCMCredential = this.mutation(scmCredentialSave)
382
+ /**
383
+ * Updates an SCM credential for the user currently logged in.
384
+ */
385
+ updateUserSCMCredential = this.mutation(scmCredentialUpdate)
386
+ /**
387
+ * Gets all SCM credentials for the user currently logged in.
388
+ */
389
+ allUserSCMCredentials = this.query(listScmCredentials)
390
+ /**
391
+ * Gets the SCM provider.
392
+ */
393
+ scmProvider = this.query(getScmProvider)
394
+ /**
395
+ * Deletes the SCM credentials for the user currently logged in.
396
+ */
397
+ deleteSCMCredentials = this.mutation(scmDelete)
293
398
  }
294
399
 
295
400
  export const accountClient = new AccountClient()
@@ -0,0 +1,44 @@
1
+ import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatusResponse } from '../api/account'
2
+
3
+ interface BaseSMCStatus {
4
+ /**
5
+ * Indicates the current status of the SCM credential.
6
+ * - 'valid': the SCM credential is valid.
7
+ * - 'missing-account': the SCM credential is not configured at the account level.
8
+ * - 'missing-user': the SCM credential is configured at the account level, but the SCM access is not configured for the user.
9
+ */
10
+ status: 'missing-account' | 'missing-user' | 'valid',
11
+ }
12
+
13
+ interface ValidSCMStatus extends BaseSMCStatus, AccountScmStatusResponse {
14
+ status: 'valid',
15
+ }
16
+
17
+ interface InvalidSCMStatus extends BaseSMCStatus {
18
+ status: 'missing-account' | 'missing-user',
19
+ }
20
+
21
+ export type SCMStatus = InvalidSCMStatus | ValidSCMStatus
22
+
23
+ interface SCMAuthPATValue {
24
+ user: string,
25
+ pass: string,
26
+ }
27
+
28
+ interface SCMAuthGitValue {
29
+ appId: string,
30
+ installationId: string,
31
+ privateKey: string,
32
+ }
33
+
34
+ export interface CreateSCMRequest {
35
+ accountScmInfoSaveRequest: AccountScmInfoSaveRequest & {
36
+ value: SCMAuthGitValue | SCMAuthPATValue,
37
+ },
38
+ }
39
+
40
+ export interface UpdateSCMRequest {
41
+ accountScmInfoUpdateRequest: AccountScmInfoUpdateRequest & {
42
+ value?: SCMAuthGitValue | SCMAuthPATValue,
43
+ },
44
+ }
@@ -1,6 +1,22 @@
1
1
  import { HttpError } from '@oazapfts/runtime'
2
2
  import {
3
- defaults, getEnvironment, getEnvironments, save9 as saveEnvironment,
3
+ save5 as createEmbeddedLink,
4
+ defaults,
5
+ delete6 as deleteApplicationEmbeddedLinks,
6
+ deleteConnectionInterfaceAttributesFromEnvironment, deleteConnectionInterfaceFromAllEnvironments,
7
+ delete4 as deleteEmbeddedLink,
8
+ getEmbeddedLinks1 as getAllApplicationEmbeddedLinks,
9
+ getEmbeddedLink1 as getApplicationEmbeddedLinks,
10
+ getConnectionInterface, getConnectionInterfaces,
11
+ getEmbeddedLink, getEmbeddedLinks, getEnvironment, getEnvironments,
12
+ save8 as saveApplicationEmbeddedLinks,
13
+ save9 as saveEnvironment,
14
+ upsertBatch2 as updateAllApplicationEmbeddedLinks,
15
+ upsertBatch1 as updateAllEmbeddedLink,
16
+ update8 as updateApplicationEmbeddedLinks,
17
+ updateConnectionInterfaceAttributes,
18
+ updateConnectionInterfaceVisibility,
19
+ update5 as updateEmbeddedLink,
4
20
  update9 as updateEnvironment,
5
21
  } from '../api/workspace'
6
22
  import apis from '../apis.json'
@@ -17,6 +33,36 @@ class WorkspaceClient extends ReactQueryNetworkClient {
17
33
  protected buildStackSpotError(error: HttpError): StackspotAPIError {
18
34
  return new DefaultAPIError(error.data, error.status, workspaceDictionary, error.headers)
19
35
  }
36
+
37
+ /**
38
+ * Gets all connection interfaces from a workspace
39
+ */
40
+ allConnectionInterfaces = this.query(getConnectionInterfaces)
41
+
42
+ /**
43
+ * Gets a connection interface from a workspace
44
+ */
45
+ connectionInterface = this.query(getConnectionInterface)
46
+
47
+ /**
48
+ * Updates the visibility of a connection interface
49
+ */
50
+ updateConnectionInterfaceVisibility = this.mutation(updateConnectionInterfaceVisibility)
51
+
52
+ /**
53
+ * Removes a connection interface
54
+ */
55
+ deleteConnectionInterface = this.mutation(deleteConnectionInterfaceFromAllEnvironments)
56
+
57
+ /**
58
+ * Removes connection interface attributes by environment
59
+ */
60
+ deleteConnectionInterfaceAttributesFromEnvironment = this.mutation(deleteConnectionInterfaceAttributesFromEnvironment)
61
+
62
+ /**
63
+ * Updates the attributes of a connection interface
64
+ */
65
+ updateConnectionInterfaceAttributes = this.mutation(updateConnectionInterfaceAttributes)
20
66
 
21
67
  /**
22
68
  * Gets all environments
@@ -38,6 +84,66 @@ class WorkspaceClient extends ReactQueryNetworkClient {
38
84
  */
39
85
  updateEnvironment = this.mutation(updateEnvironment)
40
86
 
87
+ /**
88
+ * Gets embedded link by id
89
+ */
90
+ embeddedLinkInWorkspace = this.query(getEmbeddedLink)
91
+
92
+ /**
93
+ * Gets all embedded links from a workspace
94
+ */
95
+ allEmbeddedLinksInWorkspace = this.query(getEmbeddedLinks)
96
+
97
+ /**
98
+ * Creates an embedded link in a workspace
99
+ */
100
+ createEmbeddedLinkInWorkspace = this.mutation(createEmbeddedLink)
101
+
102
+ /**
103
+ * Deletes an embedded link from a workspace
104
+ */
105
+ deleteEmbeddedLinkFromWorkspace = this.mutation(deleteEmbeddedLink)
106
+
107
+ /**
108
+ * Updates an embedded link from a workspace
109
+ */
110
+ updateEmbeddedLinkInWorkspace = this.mutation(updateEmbeddedLink)
111
+
112
+ /**
113
+ * Updates all embedded links from a workspace
114
+ */
115
+ updateAllEmbeddedLinksInWorkspace = this.mutation(updateAllEmbeddedLink)
116
+
117
+ /**
118
+ * Gets an embedded link from an application
119
+ */
120
+ embeddedLinkInApplication = this.query(getApplicationEmbeddedLinks)
121
+
122
+ /**
123
+ * Gets all embedded links from an application
124
+ */
125
+ allEmbeddedLinksInApplication = this.query(getAllApplicationEmbeddedLinks)
126
+
127
+ /**
128
+ * Creates an embedded link in an application
129
+ */
130
+ createEmbeddedLinkInApplication = this.mutation(saveApplicationEmbeddedLinks)
131
+
132
+ /**
133
+ * Deletes an embedded link from an application
134
+ */
135
+ deleteEmbeddedLinkFromApplication = this.mutation(deleteApplicationEmbeddedLinks)
136
+
137
+ /**
138
+ * Updates an embedded link in an application
139
+ */
140
+ updateEmbeddedLinkInApplication = this.mutation(updateApplicationEmbeddedLinks)
141
+
142
+ /**
143
+ * Updates all embedded links in an application
144
+ */
145
+ updateAllEmbeddedLinksInApplication = this.mutation(updateAllApplicationEmbeddedLinks)
146
+
41
147
  }
42
148
 
43
149
  export const workspaceClient = new WorkspaceClient()
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { accountClient } from './client/account'
2
2
  export { secretsClient } from './client/secrets'
3
+ export * from './client/types'
3
4
  export { workspaceClient } from './client/workspace'
4
5
  export { DefaultAPIError } from './error/DefaultAPIError'
5
6
  export { StackspotAPIError } from './error/StackspotAPIError'