@goodfellow-cms/gitlab 0.1.0 → 0.2.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/README.md CHANGED
@@ -8,9 +8,9 @@ import { gitlab } from "@goodfellow-cms/gitlab";
8
8
  export default defineConfig({ blocks, backend: gitlab({ project: "your-name/your-site" }) });
9
9
  ```
10
10
 
11
- [Goodfellow](https://github.com/chartung17/goodfellow-cms) is a website builder for people who aren't developers, with no server or database: pages are files in your own GitHub or GitLab repository, edited in a visual editor built on [Puck](https://puckeditor.com). To start a new site, run `npm create goodfellow@latest my-site`. See the [documentation](https://chartung17.github.io/goodfellow-cms/) for everything else.
11
+ [Goodfellow](https://github.com/goodfellow-cms/goodfellow-cms) is a website builder for people who aren't developers, with no server or database: pages are files in your own GitHub or GitLab repository, edited in a visual editor built on [Puck](https://puckeditor.com). To start a new site, run `npm create goodfellow@latest my-site`. See the [documentation](https://goodfellow-cms.github.io/goodfellow-cms/) for everything else.
12
12
 
13
- More in the docs: [Hosts and business sites](https://chartung17.github.io/goodfellow-cms/docs/hosts).
13
+ More in the docs: [Hosts and business sites](https://goodfellow-cms.github.io/goodfellow-cms/docs/hosts).
14
14
 
15
15
  ## License
16
16
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { DeployStatus, FileChange, GitBackend, GitHost, GitUser, StorageLike, WriteOptions } from "@goodfellow-cms/core";
1
+ import { ConnectDomainOptions, DeployStatus, DnsRecord, FileChange, FileVersion, GitBackend, GitHost, GitUser, HistoryOptions, PagesDomains, SetupHost, SiteEditors, SiteUpdates, StorageLike, WriteOptions } from "@goodfellow-cms/core";
2
2
  //#region src/api.d.ts
3
3
  interface ApiOptions {
4
4
  /** The API root, such as `https://gitlab.com/api/v4`. */
@@ -27,6 +27,9 @@ interface GitLabBackendOptions {
27
27
  */
28
28
  export declare class GitLabBackend implements GitBackend {
29
29
  readonly user: GitUser;
30
+ readonly pages: PagesDomains;
31
+ readonly editors: SiteEditors;
32
+ readonly updates: SiteUpdates;
30
33
  private readonly api;
31
34
  private readonly project;
32
35
  private readonly branch;
@@ -49,12 +52,16 @@ export declare class GitLabBackend implements GitBackend {
49
52
  write(changes: FileChange[], { message, expectedRevision }: WriteOptions): Promise<{
50
53
  revision: string;
51
54
  }>;
55
+ history(path: string, { page, perPage }?: HistoryOptions): Promise<FileVersion[]>;
56
+ readAt(path: string, revision: string): Promise<string | undefined>;
52
57
  changedPaths(from: string, to: string): Promise<string[]>;
53
58
  /**
54
59
  * Reads the commit's pipeline and external statuses (GitLab Pages jobs, or
55
60
  * Vercel). Before any exist, the site counts as building if it has pipelines.
56
61
  */
57
62
  deployStatus(revision: string): Promise<DeployStatus>;
63
+ /** Why a commit's pipeline failed: the failed job's reason, and its log for which command failed and why. */
64
+ private jobProblem;
58
65
  signOut(): void;
59
66
  }
60
67
  //#endregion
@@ -62,6 +69,37 @@ export declare class GitLabBackend implements GitBackend {
62
69
  /** The admin panel's address, with a trailing slash so it always matches the redirect URI registered with GitLab. */
63
70
  export declare function redirectUri(href: string): string;
64
71
  //#endregion
72
+ //#region src/pages.d.ts
73
+ /**
74
+ * The records GitLab Pages needs: its address for an apex domain, or an alias
75
+ * of the namespace's gitlab.io otherwise, and a TXT record per domain that
76
+ * proves it's the owner's, with the codes GitLab gave.
77
+ */
78
+ export declare function gitlabPagesRecords(project: string, domain: string, options: ConnectDomainOptions, codes: Record<string, string>): DnsRecord[];
79
+ //#endregion
80
+ //#region src/setup.d.ts
81
+ interface GitLabSetupOptions {
82
+ /** For self-managed GitLab. Defaults to `https://gitlab.com`. */
83
+ url?: string;
84
+ /**
85
+ * The Application ID of an OAuth application for the setup page (not
86
+ * confidential, scope `api`, redirect URI the page's address). Enables
87
+ * "Sign in with GitLab". Without it, people sign in with a token.
88
+ */
89
+ clientId?: string;
90
+ /** For tests. */
91
+ fetch?: typeof fetch;
92
+ /** For tests. */
93
+ storage?: {
94
+ local?: StorageLike;
95
+ session?: StorageLike;
96
+ };
97
+ /** For tests. */
98
+ location?: BrowserLocation;
99
+ }
100
+ /** Signing in to GitLab to create a site's project, with GitLab Pages if wanted. */
101
+ export declare function gitlabSetup(options?: GitLabSetupOptions): SetupHost;
102
+ //#endregion
65
103
  //#region src/index.d.ts
66
104
  /** The page's address and how to change it. Replaceable in tests. */
67
105
  export interface BrowserLocation {
@@ -96,4 +134,5 @@ export interface GitLabOptions {
96
134
  }
97
135
  /** Sign-in and storage for a site whose repository is on GitLab. */
98
136
  export declare function gitlab(options: GitLabOptions): GitHost;
99
- //#endregion
137
+ //#endregion
138
+ export type { GitLabSetupOptions };