shoal-web-sdk 0.0.45 → 0.0.47

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.
@@ -1,5 +1,5 @@
1
1
  import type { Client, Options as Options2, TDataShape } from './client';
2
- import type { AddEdgesData, AddEdgesErrors, AddEdgesResponses, AddNodesData, AddNodesErrors, AddNodesResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceBillingAgreementsData, GetSpaceBillingAgreementsErrors, GetSpaceBillingAgreementsResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, RemoveEdgesData, RemoveEdgesErrors, RemoveEdgesResponses, RemoveNodesData, RemoveNodesErrors, RemoveNodesResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses } from './types.gen';
2
+ import type { AddEdgesData, AddEdgesErrors, AddEdgesResponses, AddNodesData, AddNodesErrors, AddNodesResponses, CreateAccountIdentityData, CreateAccountIdentityErrors, CreateAccountIdentityResponses, CreateEnvironmentData, CreateEnvironmentErrors, CreateEnvironmentResponses, CreateProjectData, CreateProjectErrors, CreateProjectResponses, CreateSpaceData, CreateSpaceErrors, CreateSpaceResponses, FetchKindeOrganisationBillingAgreementsData, FetchKindeOrganisationBillingAgreementsErrors, FetchKindeOrganisationBillingAgreementsResponses, GetConnectedAppUrlData, GetConnectedAppUrlErrors, GetConnectedAppUrlResponses, GetEnvironmentOverviewData, GetEnvironmentOverviewErrors, GetEnvironmentOverviewResponses, GetGraphOverviewData, GetGraphOverviewErrors, GetGraphOverviewResponses, GetProjectOverviewData, GetProjectOverviewErrors, GetProjectOverviewResponses, GetServiceHealthData, GetServiceHealthResponses, GetSpaceOverviewData, GetSpaceOverviewErrors, GetSpaceOverviewResponses, GetUserIdentitiesData, GetUserIdentitiesErrors, GetUserIdentitiesResponses, GetUserProfileData, GetUserProfileErrors, GetUserProfileResponses, ListInstallationBranchesData, ListInstallationBranchesErrors, ListInstallationBranchesResponses, ListInstallationRepositoriesData, ListInstallationRepositoriesErrors, ListInstallationRepositoriesResponses, ListUserInstallationsData, ListUserInstallationsErrors, ListUserInstallationsResponses, RemoveEdgesData, RemoveEdgesErrors, RemoveEdgesResponses, RemoveNodesData, RemoveNodesErrors, RemoveNodesResponses, RequestAccountPasswordResetData, RequestAccountPasswordResetErrors, RequestAccountPasswordResetResponses, UpdateUserInstallationsData, UpdateUserInstallationsErrors, UpdateUserInstallationsResponses } from './types.gen';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -29,6 +29,30 @@ export declare const getUserProfile: <ThrowOnError extends boolean = false>(opti
29
29
  * Fetch the users identities.
30
30
  */
31
31
  export declare const getUserIdentities: <ThrowOnError extends boolean = false>(options?: Options<GetUserIdentitiesData, ThrowOnError>) => import("./client").RequestResult<GetUserIdentitiesResponses, GetUserIdentitiesErrors, ThrowOnError, "fields">;
32
+ /**
33
+ * Create an identity for the authenticated user.
34
+ */
35
+ export declare const createAccountIdentity: <ThrowOnError extends boolean = false>(options: Options<CreateAccountIdentityData, ThrowOnError>) => import("./client").RequestResult<CreateAccountIdentityResponses, CreateAccountIdentityErrors, ThrowOnError, "fields">;
36
+ /**
37
+ * Fetch a connected app authorization URL for the authenticated user.
38
+ */
39
+ export declare const getConnectedAppUrl: <ThrowOnError extends boolean = false>(options: Options<GetConnectedAppUrlData, ThrowOnError>) => import("./client").RequestResult<GetConnectedAppUrlResponses, GetConnectedAppUrlErrors, ThrowOnError, "fields">;
40
+ /**
41
+ * List repositories accessible to a GitHub App installation.
42
+ */
43
+ export declare const listInstallationRepositories: <ThrowOnError extends boolean = false>(options: Options<ListInstallationRepositoriesData, ThrowOnError>) => import("./client").RequestResult<ListInstallationRepositoriesResponses, ListInstallationRepositoriesErrors, ThrowOnError, "fields">;
44
+ /**
45
+ * List branches for a repository accessible to a GitHub App installation.
46
+ */
47
+ export declare const listInstallationBranches: <ThrowOnError extends boolean = false>(options: Options<ListInstallationBranchesData, ThrowOnError>) => import("./client").RequestResult<ListInstallationBranchesResponses, ListInstallationBranchesErrors, ThrowOnError, "fields">;
48
+ /**
49
+ * List GitHub App installations stored for the authenticated user.
50
+ */
51
+ export declare const listUserInstallations: <ThrowOnError extends boolean = false>(options?: Options<ListUserInstallationsData, ThrowOnError>) => import("./client").RequestResult<ListUserInstallationsResponses, ListUserInstallationsErrors, ThrowOnError, "fields">;
52
+ /**
53
+ * Add a GitHub App installation to the authenticated user's stored installation list.
54
+ */
55
+ export declare const updateUserInstallations: <ThrowOnError extends boolean = false>(options: Options<UpdateUserInstallationsData, ThrowOnError>) => import("./client").RequestResult<UpdateUserInstallationsResponses, UpdateUserInstallationsErrors, ThrowOnError, "fields">;
32
56
  /**
33
57
  * Create a space.
34
58
  */
@@ -40,7 +64,7 @@ export declare const getSpaceOverview: <ThrowOnError extends boolean = false>(op
40
64
  /**
41
65
  * The space billing agreements.
42
66
  */
43
- export declare const getSpaceBillingAgreements: <ThrowOnError extends boolean = false>(options: Options<GetSpaceBillingAgreementsData, ThrowOnError>) => import("./client").RequestResult<GetSpaceBillingAgreementsResponses, GetSpaceBillingAgreementsErrors, ThrowOnError, "fields">;
67
+ export declare const fetchKindeOrganisationBillingAgreements: <ThrowOnError extends boolean = false>(options: Options<FetchKindeOrganisationBillingAgreementsData, ThrowOnError>) => import("./client").RequestResult<FetchKindeOrganisationBillingAgreementsResponses, FetchKindeOrganisationBillingAgreementsErrors, ThrowOnError, "fields">;
44
68
  /**
45
69
  * Create a project inside a space.
46
70
  */
@@ -60,6 +60,100 @@ export const getUserIdentities = (options) => {
60
60
  ...options
61
61
  });
62
62
  };
63
+ /**
64
+ * Create an identity for the authenticated user.
65
+ */
66
+ export const createAccountIdentity = (options) => {
67
+ return (options.client ?? client).post({
68
+ security: [
69
+ {
70
+ scheme: 'bearer',
71
+ type: 'http'
72
+ }
73
+ ],
74
+ url: '/auth/account/identities',
75
+ ...options,
76
+ headers: {
77
+ 'Content-Type': 'application/json',
78
+ ...options.headers
79
+ }
80
+ });
81
+ };
82
+ /**
83
+ * Fetch a connected app authorization URL for the authenticated user.
84
+ */
85
+ export const getConnectedAppUrl = (options) => {
86
+ return (options.client ?? client).get({
87
+ security: [
88
+ {
89
+ scheme: 'bearer',
90
+ type: 'http'
91
+ }
92
+ ],
93
+ url: '/auth/account/connected-app-url',
94
+ ...options
95
+ });
96
+ };
97
+ /**
98
+ * List repositories accessible to a GitHub App installation.
99
+ */
100
+ export const listInstallationRepositories = (options) => {
101
+ return (options.client ?? client).get({
102
+ security: [
103
+ {
104
+ scheme: 'bearer',
105
+ type: 'http'
106
+ }
107
+ ],
108
+ url: '/auth/installations/{installationID}/repositories',
109
+ ...options
110
+ });
111
+ };
112
+ /**
113
+ * List branches for a repository accessible to a GitHub App installation.
114
+ */
115
+ export const listInstallationBranches = (options) => {
116
+ return (options.client ?? client).get({
117
+ security: [
118
+ {
119
+ scheme: 'bearer',
120
+ type: 'http'
121
+ }
122
+ ],
123
+ url: '/auth/installations/{installationID}/branches',
124
+ ...options
125
+ });
126
+ };
127
+ /**
128
+ * List GitHub App installations stored for the authenticated user.
129
+ */
130
+ export const listUserInstallations = (options) => {
131
+ return (options?.client ?? client).get({
132
+ security: [
133
+ {
134
+ scheme: 'bearer',
135
+ type: 'http'
136
+ }
137
+ ],
138
+ url: '/auth/installations',
139
+ ...options
140
+ });
141
+ };
142
+ /**
143
+ * Add a GitHub App installation to the authenticated user's stored installation list.
144
+ */
145
+ export const updateUserInstallations = (options) => {
146
+ return (options.client ?? client).patch({
147
+ security: [
148
+ {
149
+ scheme: 'bearer',
150
+ type: 'http'
151
+ }
152
+ ],
153
+ url: '/auth/installations/{installationID}',
154
+ ...options
155
+ });
156
+ };
63
157
  /**
64
158
  * Create a space.
65
159
  */
@@ -97,7 +191,7 @@ export const getSpaceOverview = (options) => {
97
191
  /**
98
192
  * The space billing agreements.
99
193
  */
100
- export const getSpaceBillingAgreements = (options) => {
194
+ export const fetchKindeOrganisationBillingAgreements = (options) => {
101
195
  return (options.client ?? client).get({
102
196
  security: [
103
197
  {
@@ -65,6 +65,92 @@ export type AccountIdentity = {
65
65
  export type AccountIdentities = {
66
66
  identities: Array<AccountIdentity>;
67
67
  };
68
+ export type CreateAccountIdentityRequest = {
69
+ type: 'github';
70
+ /**
71
+ * External provider user id (e.g., GitHub user id).
72
+ */
73
+ identity?: string;
74
+ };
75
+ export type CreateAccountIdentityResponse = {
76
+ status: string;
77
+ };
78
+ export type ConnectedAppUrlResponse = {
79
+ url: string;
80
+ session_id: string;
81
+ };
82
+ export type GitHubRepoOwner = {
83
+ login: string;
84
+ type: string;
85
+ avatar: string;
86
+ id: number;
87
+ };
88
+ export type GitHubRepositorySummary = {
89
+ id: number;
90
+ name: string;
91
+ full_name: string;
92
+ visibility: string;
93
+ owner: GitHubRepoOwner;
94
+ };
95
+ export type GitHubRepositoriesResponse = {
96
+ repositories: Array<GitHubRepositorySummary>;
97
+ total_count: number;
98
+ page: number;
99
+ limit: number;
100
+ next_page?: number;
101
+ };
102
+ export type GitHubBranch = {
103
+ name?: string;
104
+ protected?: boolean;
105
+ commit?: {
106
+ sha: string;
107
+ url: string;
108
+ };
109
+ [key: string]: unknown | string | boolean | {
110
+ sha: string;
111
+ url: string;
112
+ } | undefined;
113
+ };
114
+ export type GitHubBranchesResponse = {
115
+ branches: Array<GitHubBranch>;
116
+ page: number;
117
+ limit: number;
118
+ next_page?: number;
119
+ };
120
+ export type GitHubBranchesAllResponse = {
121
+ branches: Array<GitHubBranch>;
122
+ total_count: number;
123
+ };
124
+ export type GitHubInstallationAccount = {
125
+ login: string;
126
+ id: number;
127
+ type: string;
128
+ };
129
+ export type GitHubInstallation = {
130
+ id: number;
131
+ app_id: number;
132
+ account: GitHubInstallationAccount;
133
+ repository_selection?: string;
134
+ access_tokens_url?: string;
135
+ repositories_url?: string;
136
+ html_url?: string;
137
+ target_type?: string;
138
+ [key: string]: unknown | number | GitHubInstallationAccount | string | undefined;
139
+ };
140
+ export type GitHubUserInstallationsResponse = {
141
+ installations: Array<GitHubInstallation>;
142
+ page: number;
143
+ limit: number;
144
+ next_page?: number;
145
+ };
146
+ export type UserGithubInstallation = {
147
+ installation_id: number;
148
+ account_name: string;
149
+ account_type: string;
150
+ };
151
+ export type UserGithubInstallations = {
152
+ installations: Array<UserGithubInstallation>;
153
+ };
68
154
  export type AccountProfile = {
69
155
  preferredEmail: string;
70
156
  phone: string;
@@ -78,7 +164,7 @@ export type AccountProfile = {
78
164
  lastSignedIn: string;
79
165
  createdOn: string;
80
166
  };
81
- export type BillingAgreement = {
167
+ export type KindeOrganisationBillingAgreement = {
82
168
  /**
83
169
  * The friendly id of an agreement
84
170
  */
@@ -246,6 +332,38 @@ export type ProjectHandle = string;
246
332
  * The space handle. This must be globally unique.
247
333
  */
248
334
  export type SpaceHandle = string;
335
+ /**
336
+ * GitHub App installation ID.
337
+ */
338
+ export type InstallationId = number;
339
+ /**
340
+ * Repository owner (user or organization login).
341
+ */
342
+ export type RepoOwner = string;
343
+ /**
344
+ * Repository name.
345
+ */
346
+ export type RepoName = string;
347
+ /**
348
+ * Page number (1-based).
349
+ */
350
+ export type Page = number;
351
+ /**
352
+ * Page size (max 100).
353
+ */
354
+ export type Limit = number;
355
+ /**
356
+ * When true, fetch all pages and return the full list (branches only).
357
+ */
358
+ export type All = boolean;
359
+ /**
360
+ * Connected app key code reference from Kinde.
361
+ */
362
+ export type KeyCodeRef = string;
363
+ /**
364
+ * GitHub OAuth access token for the authenticated Kinde user.
365
+ */
366
+ export type GitHubTokenHeader = string;
249
367
  export type GetServiceHealthData = {
250
368
  body?: never;
251
369
  path?: never;
@@ -342,6 +460,255 @@ export type GetUserIdentitiesResponses = {
342
460
  200: AccountIdentities;
343
461
  };
344
462
  export type GetUserIdentitiesResponse = GetUserIdentitiesResponses[keyof GetUserIdentitiesResponses];
463
+ export type CreateAccountIdentityData = {
464
+ body: CreateAccountIdentityRequest;
465
+ path?: never;
466
+ query?: never;
467
+ url: '/auth/account/identities';
468
+ };
469
+ export type CreateAccountIdentityErrors = {
470
+ /**
471
+ * Invalid request body.
472
+ */
473
+ 400: ErrorResponse;
474
+ /**
475
+ * Unauthorised user.
476
+ */
477
+ 401: ErrorResponse;
478
+ /**
479
+ * Invalid credentials.
480
+ */
481
+ 403: ErrorResponse;
482
+ /**
483
+ * Unexpected error.
484
+ */
485
+ 500: ErrorResponse;
486
+ };
487
+ export type CreateAccountIdentityError = CreateAccountIdentityErrors[keyof CreateAccountIdentityErrors];
488
+ export type CreateAccountIdentityResponses = {
489
+ /**
490
+ * Identity created successfully.
491
+ */
492
+ 201: CreateAccountIdentityResponse;
493
+ };
494
+ export type CreateAccountIdentityResponse2 = CreateAccountIdentityResponses[keyof CreateAccountIdentityResponses];
495
+ export type GetConnectedAppUrlData = {
496
+ body?: never;
497
+ path?: never;
498
+ query: {
499
+ /**
500
+ * Connected app key code reference from Kinde.
501
+ */
502
+ key_code_ref: string;
503
+ };
504
+ url: '/auth/account/connected-app-url';
505
+ };
506
+ export type GetConnectedAppUrlErrors = {
507
+ /**
508
+ * Invalid request parameters.
509
+ */
510
+ 400: ErrorResponse;
511
+ /**
512
+ * Unauthorised user.
513
+ */
514
+ 401: ErrorResponse;
515
+ /**
516
+ * Invalid credentials.
517
+ */
518
+ 403: ErrorResponse;
519
+ /**
520
+ * Related content not found.
521
+ */
522
+ 404: ErrorResponse;
523
+ /**
524
+ * Unexpected error.
525
+ */
526
+ 500: ErrorResponse;
527
+ };
528
+ export type GetConnectedAppUrlError = GetConnectedAppUrlErrors[keyof GetConnectedAppUrlErrors];
529
+ export type GetConnectedAppUrlResponses = {
530
+ /**
531
+ * Connected app URL and session id.
532
+ */
533
+ 200: ConnectedAppUrlResponse;
534
+ };
535
+ export type GetConnectedAppUrlResponse = GetConnectedAppUrlResponses[keyof GetConnectedAppUrlResponses];
536
+ export type ListInstallationRepositoriesData = {
537
+ body?: never;
538
+ path: {
539
+ /**
540
+ * GitHub App installation ID.
541
+ */
542
+ installationID: number;
543
+ };
544
+ query?: {
545
+ /**
546
+ * Page number (1-based).
547
+ */
548
+ page?: number;
549
+ /**
550
+ * Page size (max 100).
551
+ */
552
+ limit?: number;
553
+ };
554
+ url: '/auth/installations/{installationID}/repositories';
555
+ };
556
+ export type ListInstallationRepositoriesErrors = {
557
+ /**
558
+ * Invalid request parameters.
559
+ */
560
+ 400: ErrorResponse;
561
+ /**
562
+ * Unauthorised user.
563
+ */
564
+ 401: ErrorResponse;
565
+ /**
566
+ * Invalid credentials.
567
+ */
568
+ 403: ErrorResponse;
569
+ /**
570
+ * Unexpected error.
571
+ */
572
+ 500: ErrorResponse;
573
+ };
574
+ export type ListInstallationRepositoriesError = ListInstallationRepositoriesErrors[keyof ListInstallationRepositoriesErrors];
575
+ export type ListInstallationRepositoriesResponses = {
576
+ /**
577
+ * Repositories for the installation.
578
+ */
579
+ 200: GitHubRepositoriesResponse;
580
+ };
581
+ export type ListInstallationRepositoriesResponse = ListInstallationRepositoriesResponses[keyof ListInstallationRepositoriesResponses];
582
+ export type ListInstallationBranchesData = {
583
+ body?: never;
584
+ path: {
585
+ /**
586
+ * GitHub App installation ID.
587
+ */
588
+ installationID: number;
589
+ };
590
+ query: {
591
+ /**
592
+ * Repository owner (user or organization login).
593
+ */
594
+ owner: string;
595
+ /**
596
+ * Repository name.
597
+ */
598
+ repo: string;
599
+ /**
600
+ * Page number (1-based).
601
+ */
602
+ page?: number;
603
+ /**
604
+ * Page size (max 100).
605
+ */
606
+ limit?: number;
607
+ /**
608
+ * When true, fetch all pages and return the full list (branches only).
609
+ */
610
+ all?: boolean;
611
+ };
612
+ url: '/auth/installations/{installationID}/branches';
613
+ };
614
+ export type ListInstallationBranchesErrors = {
615
+ /**
616
+ * Invalid request parameters.
617
+ */
618
+ 400: ErrorResponse;
619
+ /**
620
+ * Unauthorised user.
621
+ */
622
+ 401: ErrorResponse;
623
+ /**
624
+ * Invalid credentials.
625
+ */
626
+ 403: ErrorResponse;
627
+ /**
628
+ * Unexpected error.
629
+ */
630
+ 500: ErrorResponse;
631
+ };
632
+ export type ListInstallationBranchesError = ListInstallationBranchesErrors[keyof ListInstallationBranchesErrors];
633
+ export type ListInstallationBranchesResponses = {
634
+ /**
635
+ * Branches for the repository.
636
+ */
637
+ 200: GitHubBranchesResponse | GitHubBranchesAllResponse;
638
+ };
639
+ export type ListInstallationBranchesResponse = ListInstallationBranchesResponses[keyof ListInstallationBranchesResponses];
640
+ export type ListUserInstallationsData = {
641
+ body?: never;
642
+ path?: never;
643
+ query?: never;
644
+ url: '/auth/installations';
645
+ };
646
+ export type ListUserInstallationsErrors = {
647
+ /**
648
+ * Invalid request parameters.
649
+ */
650
+ 400: ErrorResponse;
651
+ /**
652
+ * Unauthorised user.
653
+ */
654
+ 401: ErrorResponse;
655
+ /**
656
+ * Invalid credentials.
657
+ */
658
+ 403: ErrorResponse;
659
+ /**
660
+ * Unexpected error.
661
+ */
662
+ 500: ErrorResponse;
663
+ };
664
+ export type ListUserInstallationsError = ListUserInstallationsErrors[keyof ListUserInstallationsErrors];
665
+ export type ListUserInstallationsResponses = {
666
+ /**
667
+ * Installations for the authenticated user.
668
+ */
669
+ 200: UserGithubInstallations;
670
+ };
671
+ export type ListUserInstallationsResponse = ListUserInstallationsResponses[keyof ListUserInstallationsResponses];
672
+ export type UpdateUserInstallationsData = {
673
+ body?: never;
674
+ path: {
675
+ /**
676
+ * GitHub App installation ID.
677
+ */
678
+ installationID: number;
679
+ };
680
+ query?: never;
681
+ url: '/auth/installations/{installationID}';
682
+ };
683
+ export type UpdateUserInstallationsErrors = {
684
+ /**
685
+ * Invalid request parameters.
686
+ */
687
+ 400: ErrorResponse;
688
+ /**
689
+ * Unauthorised user.
690
+ */
691
+ 401: ErrorResponse;
692
+ /**
693
+ * Invalid credentials.
694
+ */
695
+ 403: ErrorResponse;
696
+ /**
697
+ * Unexpected error.
698
+ */
699
+ 500: ErrorResponse;
700
+ };
701
+ export type UpdateUserInstallationsError = UpdateUserInstallationsErrors[keyof UpdateUserInstallationsErrors];
702
+ export type UpdateUserInstallationsResponses = {
703
+ /**
704
+ * Installation list updated.
705
+ */
706
+ 200: {
707
+ status: string;
708
+ installations: Array<UserGithubInstallation>;
709
+ };
710
+ };
711
+ export type UpdateUserInstallationsResponse = UpdateUserInstallationsResponses[keyof UpdateUserInstallationsResponses];
345
712
  export type CreateSpaceData = {
346
713
  body: CreateSpace;
347
714
  path?: never;
@@ -411,7 +778,7 @@ export type GetSpaceOverviewResponses = {
411
778
  200: SpaceOverview;
412
779
  };
413
780
  export type GetSpaceOverviewResponse = GetSpaceOverviewResponses[keyof GetSpaceOverviewResponses];
414
- export type GetSpaceBillingAgreementsData = {
781
+ export type FetchKindeOrganisationBillingAgreementsData = {
415
782
  body?: never;
416
783
  path: {
417
784
  /**
@@ -422,7 +789,7 @@ export type GetSpaceBillingAgreementsData = {
422
789
  query?: never;
423
790
  url: '/auth/{spaceHandle}/billing-agreements';
424
791
  };
425
- export type GetSpaceBillingAgreementsErrors = {
792
+ export type FetchKindeOrganisationBillingAgreementsErrors = {
426
793
  /**
427
794
  * Unauthorised user.
428
795
  */
@@ -440,14 +807,14 @@ export type GetSpaceBillingAgreementsErrors = {
440
807
  */
441
808
  500: ErrorResponse;
442
809
  };
443
- export type GetSpaceBillingAgreementsError = GetSpaceBillingAgreementsErrors[keyof GetSpaceBillingAgreementsErrors];
444
- export type GetSpaceBillingAgreementsResponses = {
810
+ export type FetchKindeOrganisationBillingAgreementsError = FetchKindeOrganisationBillingAgreementsErrors[keyof FetchKindeOrganisationBillingAgreementsErrors];
811
+ export type FetchKindeOrganisationBillingAgreementsResponses = {
445
812
  /**
446
813
  * A list of the space's billing agreements.
447
814
  */
448
- 200: Array<BillingAgreement>;
815
+ 200: Array<KindeOrganisationBillingAgreement>;
449
816
  };
450
- export type GetSpaceBillingAgreementsResponse = GetSpaceBillingAgreementsResponses[keyof GetSpaceBillingAgreementsResponses];
817
+ export type FetchKindeOrganisationBillingAgreementsResponse = FetchKindeOrganisationBillingAgreementsResponses[keyof FetchKindeOrganisationBillingAgreementsResponses];
451
818
  export type CreateProjectData = {
452
819
  body: CreateProject;
453
820
  path: {
@@ -1,6 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { GetSuccessResponse } from "../util";
3
- import { GetServiceHealthData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, GetSpaceBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, RemoveNodesData, RemoveNodesResponses, AddNodesData, AddNodesResponses, RemoveEdgesData, RemoveEdgesResponses, AddEdgesData, AddEdgesResponses } from "../../sdk/types.gen";
3
+ import { GetServiceHealthData, RequestAccountPasswordResetData, RequestAccountPasswordResetResponses, GetUserProfileData, GetUserIdentitiesData, CreateAccountIdentityData, CreateAccountIdentityResponses, GetConnectedAppUrlData, ListInstallationRepositoriesData, ListInstallationBranchesData, ListUserInstallationsData, UpdateUserInstallationsData, UpdateUserInstallationsResponses, CreateSpaceData, CreateSpaceResponses, GetSpaceOverviewData, FetchKindeOrganisationBillingAgreementsData, CreateProjectData, CreateProjectResponses, GetProjectOverviewData, CreateEnvironmentData, CreateEnvironmentResponses, GetEnvironmentOverviewData, GetGraphOverviewData, RemoveNodesData, RemoveNodesResponses, AddNodesData, AddNodesResponses, RemoveEdgesData, RemoveEdgesResponses, AddEdgesData, AddEdgesResponses } from "../../sdk/types.gen";
4
4
  export declare const useGetServiceHealth: (options?: Omit<GetServiceHealthData, "url"> & {
5
5
  enabled?: boolean;
6
6
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").HealthResponse | undefined, Error>;
@@ -15,6 +15,31 @@ export declare const useGetUserProfile: (options?: Omit<GetUserProfileData, "url
15
15
  export declare const useGetUserIdentities: (options?: Omit<GetUserIdentitiesData, "url"> & {
16
16
  enabled?: boolean;
17
17
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").AccountIdentities | undefined, Error>;
18
+ export declare const useCreateAccountIdentity: (config?: {
19
+ onSuccess?: (data: GetSuccessResponse<CreateAccountIdentityResponses>) => void;
20
+ onError?: Parameters<typeof useMutation>["0"]["onError"];
21
+ retry?: boolean;
22
+ }) => import("@tanstack/react-query").UseMutationResult<import("../../sdk/types.gen").CreateAccountIdentityResponse | undefined, unknown, Omit<CreateAccountIdentityData, "url">, unknown>;
23
+ export declare const useGetConnectedAppUrl: (options: Omit<GetConnectedAppUrlData, "url"> & {
24
+ enabled?: boolean;
25
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").ConnectedAppUrlResponse | undefined, Error>;
26
+ export declare const useListInstallationRepositories: (options: Omit<ListInstallationRepositoriesData, "url"> & {
27
+ enabled?: boolean;
28
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubRepositoriesResponse | undefined, Error>;
29
+ export declare const useListInstallationBranches: (options: Omit<ListInstallationBranchesData, "url"> & {
30
+ enabled?: boolean;
31
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").GitHubBranchesResponse | import("../../sdk/types.gen").GitHubBranchesAllResponse | undefined, Error>;
32
+ export declare const useListUserInstallations: (options?: Omit<ListUserInstallationsData, "url"> & {
33
+ enabled?: boolean;
34
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").UserGithubInstallations | undefined, Error>;
35
+ export declare const useUpdateUserInstallations: (config?: {
36
+ onSuccess?: (data: GetSuccessResponse<UpdateUserInstallationsResponses>) => void;
37
+ onError?: Parameters<typeof useMutation>["0"]["onError"];
38
+ retry?: boolean;
39
+ }) => import("@tanstack/react-query").UseMutationResult<{
40
+ status: string;
41
+ installations: Array<import("../../sdk/types.gen").UserGithubInstallation>;
42
+ } | undefined, unknown, Omit<UpdateUserInstallationsData, "url">, unknown>;
18
43
  export declare const useCreateSpace: (config?: {
19
44
  onSuccess?: (data: GetSuccessResponse<CreateSpaceResponses>) => void;
20
45
  onError?: Parameters<typeof useMutation>["0"]["onError"];
@@ -23,9 +48,9 @@ export declare const useCreateSpace: (config?: {
23
48
  export declare const useGetSpaceOverview: (options: Omit<GetSpaceOverviewData, "url"> & {
24
49
  enabled?: boolean;
25
50
  }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").SpaceOverview | undefined, Error>;
26
- export declare const useGetSpaceBillingAgreements: (options: Omit<GetSpaceBillingAgreementsData, "url"> & {
51
+ export declare const useFetchKindeOrganisationBillingAgreements: (options: Omit<FetchKindeOrganisationBillingAgreementsData, "url"> & {
27
52
  enabled?: boolean;
28
- }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").BillingAgreement[] | undefined, Error>;
53
+ }) => import("@tanstack/react-query").UseQueryResult<import("../../sdk/types.gen").KindeOrganisationBillingAgreement[] | undefined, Error>;
29
54
  export declare const useCreateProject: (config?: {
30
55
  onSuccess?: (data: GetSuccessResponse<CreateProjectResponses>) => void;
31
56
  onError?: Parameters<typeof useMutation>["0"]["onError"];
@@ -2,7 +2,7 @@
2
2
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
3
3
  import { isPromise } from "../util";
4
4
  import { useToken } from "../../provider/token-provider";
5
- import { getServiceHealth, requestAccountPasswordReset, getUserProfile, getUserIdentities, createSpace, getSpaceOverview, getSpaceBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, removeNodes, addNodes, removeEdges, addEdges } from "../../sdk/sdk.gen";
5
+ import { getServiceHealth, requestAccountPasswordReset, getUserProfile, getUserIdentities, createAccountIdentity, getConnectedAppUrl, listInstallationRepositories, listInstallationBranches, listUserInstallations, updateUserInstallations, createSpace, getSpaceOverview, fetchKindeOrganisationBillingAgreements, createProject, getProjectOverview, createEnvironment, getEnvironmentOverview, getGraphOverview, removeNodes, addNodes, removeEdges, addEdges } from "../../sdk/sdk.gen";
6
6
  export const useGetServiceHealth = (options) => {
7
7
  const token = useToken();
8
8
  let { enabled, ...rest } = options || { enabled: true };
@@ -85,6 +85,128 @@ export const useGetUserIdentities = (options) => {
85
85
  staleTime: 600000
86
86
  });
87
87
  };
88
+ export const useCreateAccountIdentity = (config) => {
89
+ const token = useToken();
90
+ const queryClient = useQueryClient();
91
+ const opts = { throwOnError: true, url: "/auth/account/identities" };
92
+ const funcer = async (options) => {
93
+ const auth = isPromise(token) ? (await token) || "" : token || "";
94
+ const res = await createAccountIdentity({ ...opts, ...options, auth });
95
+ return res?.data;
96
+ };
97
+ return useMutation({
98
+ mutationFn: funcer,
99
+ onSuccess: (res, options, c, ctx) => {
100
+ queryClient.invalidateQueries({ queryKey: ["account", "identities"] });
101
+ config?.onSuccess && config.onSuccess(res);
102
+ },
103
+ onError: config?.onError,
104
+ retry: config?.retry
105
+ });
106
+ };
107
+ export const useGetConnectedAppUrl = (options) => {
108
+ const token = useToken();
109
+ let { enabled, ...rest } = options || { enabled: true };
110
+ const opts = { throwOnError: true, url: "/auth/account/connected-app-url" };
111
+ const funcer = async () => {
112
+ const auth = isPromise(token) ? (await token) || "" : token || "";
113
+ if (isPromise(token) && !token)
114
+ return;
115
+ const res = await getConnectedAppUrl({ ...opts, ...rest, auth });
116
+ return res.data;
117
+ };
118
+ if (!token)
119
+ enabled = false;
120
+ return useQuery({
121
+ queryKey: ["account", "connected-app-url", options.query ?? {}],
122
+ queryFn: funcer,
123
+ enabled,
124
+ retry: false,
125
+ staleTime: 600000
126
+ });
127
+ };
128
+ export const useListInstallationRepositories = (options) => {
129
+ const token = useToken();
130
+ let { enabled, ...rest } = options || { enabled: true };
131
+ const opts = { throwOnError: true, url: "/auth/installations/{installationID}/repositories" };
132
+ const funcer = async () => {
133
+ const auth = isPromise(token) ? (await token) || "" : token || "";
134
+ if (isPromise(token) && !token)
135
+ return;
136
+ const res = await listInstallationRepositories({ ...opts, ...rest, auth });
137
+ return res.data;
138
+ };
139
+ if (!token)
140
+ enabled = false;
141
+ return useQuery({
142
+ queryKey: ["installations", options?.path?.installationID, "repositories", options.query ?? {}],
143
+ queryFn: funcer,
144
+ enabled,
145
+ retry: false,
146
+ staleTime: 600000
147
+ });
148
+ };
149
+ export const useListInstallationBranches = (options) => {
150
+ const token = useToken();
151
+ let { enabled, ...rest } = options || { enabled: true };
152
+ const opts = { throwOnError: true, url: "/auth/installations/{installationID}/branches" };
153
+ const funcer = async () => {
154
+ const auth = isPromise(token) ? (await token) || "" : token || "";
155
+ if (isPromise(token) && !token)
156
+ return;
157
+ const res = await listInstallationBranches({ ...opts, ...rest, auth });
158
+ return res.data;
159
+ };
160
+ if (!token)
161
+ enabled = false;
162
+ return useQuery({
163
+ queryKey: ["installations", options?.path?.installationID, "branches", options.query ?? {}],
164
+ queryFn: funcer,
165
+ enabled,
166
+ retry: false,
167
+ staleTime: 600000
168
+ });
169
+ };
170
+ export const useListUserInstallations = (options) => {
171
+ const token = useToken();
172
+ let { enabled, ...rest } = options || { enabled: true };
173
+ const opts = { throwOnError: true, url: "/auth/installations" };
174
+ const funcer = async () => {
175
+ const auth = isPromise(token) ? (await token) || "" : token || "";
176
+ if (isPromise(token) && !token)
177
+ return;
178
+ const res = await listUserInstallations({ ...opts, ...rest, auth });
179
+ return res.data;
180
+ };
181
+ if (!token)
182
+ enabled = false;
183
+ return useQuery({
184
+ queryKey: ["installations", options?.query ?? {}],
185
+ queryFn: funcer,
186
+ enabled,
187
+ retry: false,
188
+ staleTime: 600000
189
+ });
190
+ };
191
+ export const useUpdateUserInstallations = (config) => {
192
+ const token = useToken();
193
+ const queryClient = useQueryClient();
194
+ const opts = { throwOnError: true, url: "/auth/installations/{installationID}" };
195
+ const funcer = async (options) => {
196
+ const auth = isPromise(token) ? (await token) || "" : token || "";
197
+ const res = await updateUserInstallations({ ...opts, ...options, auth });
198
+ return res?.data;
199
+ };
200
+ return useMutation({
201
+ mutationFn: funcer,
202
+ onSuccess: (res, options, c, ctx) => {
203
+ queryClient.invalidateQueries({ queryKey: ["installations", options?.path?.installationID] });
204
+ config?.onSuccess && config.onSuccess(res);
205
+ },
206
+ onError: config?.onError,
207
+ retry: config?.retry
208
+ });
209
+ };
88
210
  export const useCreateSpace = (config) => {
89
211
  const token = useToken();
90
212
  const queryClient = useQueryClient();
@@ -125,7 +247,7 @@ export const useGetSpaceOverview = (options) => {
125
247
  staleTime: 600000
126
248
  });
127
249
  };
128
- export const useGetSpaceBillingAgreements = (options) => {
250
+ export const useFetchKindeOrganisationBillingAgreements = (options) => {
129
251
  const token = useToken();
130
252
  let { enabled, ...rest } = options || { enabled: true };
131
253
  const opts = { throwOnError: true, url: "/auth/{spaceHandle}/billing-agreements" };
@@ -133,7 +255,7 @@ export const useGetSpaceBillingAgreements = (options) => {
133
255
  const auth = isPromise(token) ? (await token) || "" : token || "";
134
256
  if (isPromise(token) && !token)
135
257
  return;
136
- const res = await getSpaceBillingAgreements({ ...opts, ...rest, auth });
258
+ const res = await fetchKindeOrganisationBillingAgreements({ ...opts, ...rest, auth });
137
259
  return res.data;
138
260
  };
139
261
  if (!token)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",