@commitspark/git-adapter-github 0.4.0 → 0.6.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +29 -9
  3. package/dist/addition.model.js.map +1 -1
  4. package/dist/container.js +7 -3
  5. package/dist/container.js.map +1 -1
  6. package/dist/entries-to-actions-converter.service.d.ts +9 -0
  7. package/dist/{content-entries-to-actions-converter.service.js → entries-to-actions-converter.service.js} +10 -10
  8. package/dist/entries-to-actions-converter.service.js.map +1 -0
  9. package/dist/entry-factory.service.d.ts +12 -0
  10. package/dist/entry-factory.service.js +25 -0
  11. package/dist/entry-factory.service.js.map +1 -0
  12. package/dist/git-hub-adapter.service.d.ts +9 -6
  13. package/dist/git-hub-adapter.service.js +30 -34
  14. package/dist/git-hub-adapter.service.js.map +1 -1
  15. package/dist/graphql-query-factory.service.d.ts +3 -3
  16. package/dist/graphql-query-factory.service.js +29 -28
  17. package/dist/graphql-query-factory.service.js.map +1 -1
  18. package/dist/path-factory.service.d.ts +5 -0
  19. package/dist/path-factory.service.js +20 -0
  20. package/dist/path-factory.service.js.map +1 -0
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +17 -4
  23. package/src/addition.model.ts +4 -1
  24. package/src/container.ts +9 -4
  25. package/src/{content-entries-to-actions-converter.service.ts → entries-to-actions-converter.service.ts} +8 -8
  26. package/src/entry-factory.service.ts +35 -0
  27. package/src/git-hub-adapter.service.ts +42 -60
  28. package/src/graphql-query-factory.service.ts +29 -42
  29. package/src/path-factory.service.ts +21 -0
  30. package/.prettierrc +0 -6
  31. package/dist/content-entries-to-actions-converter.service.d.ts +0 -9
  32. package/dist/content-entries-to-actions-converter.service.js.map +0 -1
  33. package/tsconfig.json +0 -22
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.6.0] - 2024-08-17
8
+ ### Changed
9
+ - Upgrade to `@commitspark/git-adapter` 0.13.0
10
+ - Upgrade dependencies
11
+
12
+ ## [0.5.0] - 2023-12-12
13
+ ### Changed
14
+ - Add eslint
15
+ - Upgrade to `@commitspark/git-adapter` 0.10.0 with new default directories
16
+ - Reduce number of files included in NPM package
17
+
18
+ ### Fixed
19
+ - Switch to GraphQL query variables to prevent string escaping issues
20
+ - Fix build process to include only relevant files
21
+ - Refactor content entry instantiation to ignore non-blob objects
22
+
7
23
  ## [0.4.0] - 2023-05-12
8
24
  ### Changed
9
25
  - Rename organization
package/README.md CHANGED
@@ -1,21 +1,41 @@
1
1
  # Introduction
2
2
 
3
- **[Commitspark](https://commitspark.com) is a workflow-first Content Management System based on Git and GraphQL.**
3
+ [Commitspark](https://commitspark.com) is a set of tools to manage structured data with Git through a GraphQL API.
4
4
 
5
- This repository holds code that implements access to Git repositories hosted on GitHub.
5
+ This repository holds code for a [Commitspark Git adapter](https://github.com/commitspark/git-adapter) that provides
6
+ access to Git repositories hosted on GitHub.
6
7
 
7
8
  # Usage
8
9
 
9
10
  Instantiate the adapter with `createAdapter()` and then call `setRepositoryOptions()` with `GitHubRepositoryOptions` on
10
11
  the instance. These options are as follows:
11
12
 
12
- | Option name | Required | Default value | Description |
13
- |-----------------------|----------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
14
- | `repositoryOwner` | True | | GitHub repository owner, e.g. `commitspark` |
15
- | `repositoryName` | True | | GitHub repository name, e.g. `git-adapter-github` |
16
- | `personalAccessToken` | True | | GitHub [personal access token (classic)](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql) with at least `repo` scope |
17
- | `pathSchemaFile` | False | `schema/schema.graphql` | Path to schema file in repository |
18
- | `pathEntryFolder` | False | `entries/` | Path to folder for content entries |
13
+ | Option name | Required | Default value | Description |
14
+ |-----------------------|----------|-------------------------------------|---------------------------------------------------|
15
+ | `repositoryOwner` | True | | GitHub repository owner, e.g. `commitspark` |
16
+ | `repositoryName` | True | | GitHub repository name, e.g. `git-adapter-github` |
17
+ | `personalAccessToken` | True | | GitHub personal access token (see details below) |
18
+ | `pathSchemaFile` | False | `commitspark/schema/schema.graphql` | Path to schema file in repository |
19
+ | `pathEntryFolder` | False | `commitspark/entries/` | Path to folder for entries |
20
+
21
+ ## Personal Access Token
22
+
23
+ Both "Tokens (classic)" and "Fine-grained tokens" are supported.
24
+ See
25
+ the [GitHub documentation](https://docs.github.com/en/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql).
26
+
27
+ ### Tokens (classic)
28
+
29
+ A token with `repo` scope is required.
30
+
31
+ ### Fine-grained tokens
32
+
33
+ A token with the following repository permissions is required for read-only access:
34
+
35
+ | Permission | Access |
36
+ |------------|-----------|
37
+ | Contents | Read-only |
38
+ | Metadata | Read-only |
19
39
 
20
40
  # License
21
41
 
@@ -1 +1 @@
1
- {"version":3,"file":"addition.model.js","sourceRoot":"","sources":["../src/addition.model.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,MAAa,aAAa;IAExB,YAAqB,IAAY,EAAE,QAAgB;QAA9B,SAAI,GAAJ,IAAI,CAAQ;QAC/B,IAAI,CAAC,QAAQ,GAAG,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;CACF;AALD,sCAKC"}
1
+ {"version":3,"file":"addition.model.js","sourceRoot":"","sources":["../src/addition.model.ts"],"names":[],"mappings":";;;AAAA,mCAA+B;AAE/B,MAAa,aAAa;IAExB,YACW,IAAY,EACrB,QAAgB;QADP,SAAI,GAAJ,IAAI,CAAQ;QAGrB,IAAI,CAAC,QAAQ,GAAG,eAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;CACF;AARD,sCAQC"}
package/dist/container.js CHANGED
@@ -4,16 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.gitHubAdapterService = void 0;
7
- const content_entries_to_actions_converter_service_1 = require("./content-entries-to-actions-converter.service");
7
+ const entries_to_actions_converter_service_1 = require("./entries-to-actions-converter.service");
8
8
  const git_hub_adapter_service_1 = require("./git-hub-adapter.service");
9
9
  const graphql_query_factory_service_1 = require("./graphql-query-factory.service");
10
10
  const axios_1 = __importDefault(require("axios"));
11
11
  const axios_cache_interceptor_1 = require("axios-cache-interceptor");
12
+ const path_factory_service_1 = require("./path-factory.service");
13
+ const entry_factory_service_1 = require("./entry-factory.service");
12
14
  const cachedHttpAdapter = (0, axios_cache_interceptor_1.setupCache)(axios_1.default.create(), {
13
15
  ttl: git_hub_adapter_service_1.GitHubAdapterService.QUERY_CACHE_SECONDS * 1000,
14
16
  methods: ['get', 'post'],
15
17
  });
16
18
  const graphqlQueryFactoryService = new graphql_query_factory_service_1.GraphqlQueryFactoryService();
17
- const contentEntriesToActionsConverterService = new content_entries_to_actions_converter_service_1.ContentEntriesToActionsConverterService();
18
- exports.gitHubAdapterService = new git_hub_adapter_service_1.GitHubAdapterService(cachedHttpAdapter, graphqlQueryFactoryService, contentEntriesToActionsConverterService);
19
+ const entriesToActionsConverterService = new entries_to_actions_converter_service_1.EntriesToActionsConverterService();
20
+ const pathFactoryService = new path_factory_service_1.PathFactoryService();
21
+ const entryFactoryService = new entry_factory_service_1.EntryFactoryService();
22
+ exports.gitHubAdapterService = new git_hub_adapter_service_1.GitHubAdapterService(cachedHttpAdapter, graphqlQueryFactoryService, entriesToActionsConverterService, pathFactoryService, entryFactoryService);
19
23
  //# sourceMappingURL=container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.js","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":";;;;;;AAAA,iHAAwG;AACxG,uEAAgE;AAChE,mFAA4E;AAC5E,kDAAyB;AACzB,qEAAoD;AAEpD,MAAM,iBAAiB,GAAG,IAAA,oCAAU,EAAC,eAAK,CAAC,MAAM,EAAE,EAAE;IACnD,GAAG,EAAE,8CAAoB,CAAC,mBAAmB,GAAG,IAAI;IACpD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;CACzB,CAAC,CAAA;AAEF,MAAM,0BAA0B,GAAG,IAAI,0DAA0B,EAAE,CAAA;AACnE,MAAM,uCAAuC,GAC3C,IAAI,sFAAuC,EAAE,CAAA;AAElC,QAAA,oBAAoB,GAAG,IAAI,8CAAoB,CAC1D,iBAAiB,EACjB,0BAA0B,EAC1B,uCAAuC,CACxC,CAAA"}
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../src/container.ts"],"names":[],"mappings":";;;;;;AAAA,iGAAyF;AACzF,uEAAgE;AAChE,mFAA4E;AAC5E,kDAAyB;AACzB,qEAAoD;AACpD,iEAA2D;AAC3D,mEAA6D;AAE7D,MAAM,iBAAiB,GAAG,IAAA,oCAAU,EAAC,eAAK,CAAC,MAAM,EAAE,EAAE;IACnD,GAAG,EAAE,8CAAoB,CAAC,mBAAmB,GAAG,IAAI;IACpD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;CACzB,CAAC,CAAA;AAEF,MAAM,0BAA0B,GAAG,IAAI,0DAA0B,EAAE,CAAA;AACnE,MAAM,gCAAgC,GAAG,IAAI,uEAAgC,EAAE,CAAA;AAC/E,MAAM,kBAAkB,GAAG,IAAI,yCAAkB,EAAE,CAAA;AACnD,MAAM,mBAAmB,GAAG,IAAI,2CAAmB,EAAE,CAAA;AAExC,QAAA,oBAAoB,GAAG,IAAI,8CAAoB,CAC1D,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,CACpB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { EntryDraft } from '@commitspark/git-adapter';
2
+ import { AdditionModel } from './addition.model';
3
+ import { DeletionModel } from './deletion.model';
4
+ export declare class EntriesToActionsConverterService {
5
+ convert(entryDrafts: EntryDraft[], pathEntryFolder: string): {
6
+ additions: AdditionModel[];
7
+ deletions: DeletionModel[];
8
+ };
9
+ }
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContentEntriesToActionsConverterService = void 0;
3
+ exports.EntriesToActionsConverterService = void 0;
4
4
  const git_adapter_1 = require("@commitspark/git-adapter");
5
5
  const yaml_1 = require("yaml");
6
6
  const addition_model_1 = require("./addition.model");
7
7
  const deletion_model_1 = require("./deletion.model");
8
- class ContentEntriesToActionsConverterService {
9
- convert(contentEntries, pathEntryFolder) {
8
+ class EntriesToActionsConverterService {
9
+ convert(entryDrafts, pathEntryFolder) {
10
10
  const additions = [];
11
11
  const deletions = [];
12
- contentEntries.forEach((contentEntry) => {
13
- const entryPath = `${pathEntryFolder}/${contentEntry.id}${git_adapter_1.ENTRY_EXTENSION}`;
14
- if (contentEntry.deletion) {
12
+ entryDrafts.forEach((entryDraft) => {
13
+ const entryPath = `${pathEntryFolder}/${entryDraft.id}${git_adapter_1.ENTRY_EXTENSION}`;
14
+ if (entryDraft.deletion) {
15
15
  deletions.push(new deletion_model_1.DeletionModel(entryPath));
16
16
  }
17
17
  else {
18
18
  additions.push(new addition_model_1.AdditionModel(entryPath, (0, yaml_1.stringify)({
19
- metadata: contentEntry.metadata,
20
- data: contentEntry.data,
19
+ metadata: entryDraft.metadata,
20
+ data: entryDraft.data,
21
21
  })));
22
22
  }
23
23
  });
@@ -27,5 +27,5 @@ class ContentEntriesToActionsConverterService {
27
27
  };
28
28
  }
29
29
  }
30
- exports.ContentEntriesToActionsConverterService = ContentEntriesToActionsConverterService;
31
- //# sourceMappingURL=content-entries-to-actions-converter.service.js.map
30
+ exports.EntriesToActionsConverterService = EntriesToActionsConverterService;
31
+ //# sourceMappingURL=entries-to-actions-converter.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entries-to-actions-converter.service.js","sourceRoot":"","sources":["../src/entries-to-actions-converter.service.ts"],"names":[],"mappings":";;;AAAA,0DAAsE;AACtE,+BAAgC;AAChC,qDAAgD;AAChD,qDAAgD;AAEhD,MAAa,gCAAgC;IAC3C,OAAO,CACL,WAAyB,EACzB,eAAuB;QAKvB,MAAM,SAAS,GAAoB,EAAE,CAAA;QACrC,MAAM,SAAS,GAAoB,EAAE,CAAA;QACrC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,MAAM,SAAS,GAAG,GAAG,eAAe,IAAI,UAAU,CAAC,EAAE,GAAG,6BAAe,EAAE,CAAA;YACzE,IAAI,UAAU,CAAC,QAAQ,EAAE;gBACvB,SAAS,CAAC,IAAI,CAAC,IAAI,8BAAa,CAAC,SAAS,CAAC,CAAC,CAAA;aAC7C;iBAAM;gBACL,SAAS,CAAC,IAAI,CACZ,IAAI,8BAAa,CACf,SAAS,EACT,IAAA,gBAAS,EAAC;oBACR,QAAQ,EAAE,UAAU,CAAC,QAAQ;oBAC7B,IAAI,EAAE,UAAU,CAAC,IAAI;iBACtB,CAAC,CACH,CACF,CAAA;aACF;QACH,CAAC,CAAC,CAAA;QACF,OAAO;YACL,SAAS;YACT,SAAS;SACV,CAAA;IACH,CAAC;CACF;AA/BD,4EA+BC"}
@@ -0,0 +1,12 @@
1
+ import { Entry } from '@commitspark/git-adapter';
2
+ interface TreeEntry {
3
+ name: string;
4
+ object: {
5
+ __typename: string;
6
+ text: string;
7
+ };
8
+ }
9
+ export declare class EntryFactoryService {
10
+ createFromBlobsQueryResponseData(entries: TreeEntry[]): Entry[];
11
+ }
12
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntryFactoryService = void 0;
4
+ const yaml_1 = require("yaml");
5
+ const git_adapter_1 = require("@commitspark/git-adapter");
6
+ class EntryFactoryService {
7
+ createFromBlobsQueryResponseData(entries) {
8
+ {
9
+ return entries
10
+ .filter((entry) => entry.name.endsWith(git_adapter_1.ENTRY_EXTENSION) &&
11
+ entry.object['__typename'] === 'Blob')
12
+ .map((entry) => {
13
+ const fileContent = (0, yaml_1.parse)(entry.object.text);
14
+ const id = entry.name.substring(0, entry.name.length - git_adapter_1.ENTRY_EXTENSION.length);
15
+ return {
16
+ id: id,
17
+ metadata: fileContent.metadata,
18
+ data: fileContent.data,
19
+ };
20
+ });
21
+ }
22
+ }
23
+ }
24
+ exports.EntryFactoryService = EntryFactoryService;
25
+ //# sourceMappingURL=entry-factory.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-factory.service.js","sourceRoot":"","sources":["../src/entry-factory.service.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,0DAAiE;AAUjE,MAAa,mBAAmB;IACvB,gCAAgC,CAAC,OAAoB;QAC1D;YACE,OAAO,OAAO;iBACX,MAAM,CACL,CAAC,KAAgB,EAAE,EAAE,CACnB,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,6BAAe,CAAC;gBACpC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,MAAM,CACxC;iBACA,GAAG,CAAC,CAAC,KAAgB,EAAE,EAAE;gBACxB,MAAM,WAAW,GAAG,IAAA,YAAK,EAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBAC5C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAC7B,CAAC,EACD,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,6BAAe,CAAC,MAAM,CAC3C,CAAA;gBACD,OAAO;oBACL,EAAE,EAAE,EAAE;oBACN,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,IAAI,EAAE,WAAW,CAAC,IAAI;iBACd,CAAA;YACZ,CAAC,CAAC,CAAA;SACL;IACH,CAAC;CACF;AAvBD,kDAuBC"}
@@ -1,20 +1,23 @@
1
1
  import { GraphqlQueryFactoryService } from './graphql-query-factory.service';
2
- import { Commit, CommitDraft, ContentEntry, GitAdapter } from '@commitspark/git-adapter';
3
- import { ContentEntriesToActionsConverterService } from './content-entries-to-actions-converter.service';
2
+ import { Commit, CommitDraft, Entry, GitAdapter } from '@commitspark/git-adapter';
3
+ import { EntriesToActionsConverterService } from './entries-to-actions-converter.service';
4
4
  import { AxiosCacheInstance } from 'axios-cache-interceptor';
5
5
  import { GitHubRepositoryOptions } from './index';
6
+ import { PathFactoryService } from './path-factory.service';
7
+ import { EntryFactoryService } from './entry-factory.service';
6
8
  export declare class GitHubAdapterService implements GitAdapter {
7
9
  private readonly cachedHttpAdapter;
8
10
  private graphqlQueryFactory;
9
- private contentEntriesToActionsConverter;
11
+ private entriesToActionsConverter;
12
+ private pathFactory;
13
+ private entryFactory;
10
14
  static readonly QUERY_CACHE_SECONDS: number;
11
15
  static readonly API_URL = "https://api.github.com/graphql";
12
16
  private gitRepositoryOptions;
13
- constructor(cachedHttpAdapter: AxiosCacheInstance, graphqlQueryFactory: GraphqlQueryFactoryService, contentEntriesToActionsConverter: ContentEntriesToActionsConverterService);
17
+ constructor(cachedHttpAdapter: AxiosCacheInstance, graphqlQueryFactory: GraphqlQueryFactoryService, entriesToActionsConverter: EntriesToActionsConverterService, pathFactory: PathFactoryService, entryFactory: EntryFactoryService);
14
18
  setRepositoryOptions(repositoryOptions: GitHubRepositoryOptions): Promise<void>;
15
- getContentEntries(commitHash: string): Promise<ContentEntry[]>;
19
+ getEntries(commitHash: string): Promise<Entry[]>;
16
20
  getSchema(commitHash: string): Promise<string>;
17
21
  getLatestCommitHash(ref: string): Promise<string>;
18
22
  createCommit(commitDraft: CommitDraft): Promise<Commit>;
19
- private getPathEntryFolder;
20
23
  }
@@ -1,66 +1,65 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GitHubAdapterService = void 0;
4
- const git_adapter_1 = require("@commitspark/git-adapter");
5
- const yaml_1 = require("yaml");
6
4
  class GitHubAdapterService {
7
- constructor(cachedHttpAdapter, graphqlQueryFactory, contentEntriesToActionsConverter) {
5
+ constructor(cachedHttpAdapter, graphqlQueryFactory, entriesToActionsConverter, pathFactory, entryFactory) {
8
6
  this.cachedHttpAdapter = cachedHttpAdapter;
9
7
  this.graphqlQueryFactory = graphqlQueryFactory;
10
- this.contentEntriesToActionsConverter = contentEntriesToActionsConverter;
8
+ this.entriesToActionsConverter = entriesToActionsConverter;
9
+ this.pathFactory = pathFactory;
10
+ this.entryFactory = entryFactory;
11
11
  }
12
12
  async setRepositoryOptions(repositoryOptions) {
13
13
  this.gitRepositoryOptions = repositoryOptions;
14
14
  }
15
- async getContentEntries(commitHash) {
15
+ async getEntries(commitHash) {
16
16
  var _a, _b;
17
17
  if (this.gitRepositoryOptions === undefined) {
18
18
  throw new Error('Repository options must be set before reading');
19
19
  }
20
20
  const token = this.gitRepositoryOptions.personalAccessToken;
21
- const pathEntryFolder = this.getPathEntryFolder(this.gitRepositoryOptions);
22
- const queryFilesContent = this.graphqlQueryFactory.createBlobsContentQuery(this.gitRepositoryOptions.repositoryOwner, this.gitRepositoryOptions.repositoryName, commitHash, pathEntryFolder);
21
+ const pathEntryFolder = this.pathFactory.getPathEntryFolder(this.gitRepositoryOptions);
22
+ const queryFilesContent = this.graphqlQueryFactory.createBlobsContentQuery();
23
23
  const filesContentResponse = await this.cachedHttpAdapter.post(GitHubAdapterService.API_URL, {
24
24
  query: queryFilesContent,
25
+ variables: {
26
+ repositoryOwner: this.gitRepositoryOptions.repositoryOwner,
27
+ repositoryName: this.gitRepositoryOptions.repositoryName,
28
+ expression: `${commitHash}:${pathEntryFolder}`,
29
+ },
25
30
  }, {
26
31
  headers: {
27
32
  authorization: `Bearer ${token}`,
28
33
  },
29
34
  });
30
- const extensionLength = git_adapter_1.ENTRY_EXTENSION.length;
31
35
  if (!((_b = (_a = filesContentResponse.data.data.repository) === null || _a === void 0 ? void 0 : _a.object) === null || _b === void 0 ? void 0 : _b.entries)) {
32
36
  return [];
33
37
  }
34
- return filesContentResponse.data.data.repository.object.entries
35
- .filter((entry) => entry.name.endsWith(git_adapter_1.ENTRY_EXTENSION))
36
- .map((entry) => {
37
- const content = (0, yaml_1.parse)(entry.object.text);
38
- const id = entry.name.substring(0, entry.name.length - extensionLength);
39
- return {
40
- id: id,
41
- metadata: content.metadata,
42
- data: content.data,
43
- };
44
- });
38
+ return this.entryFactory.createFromBlobsQueryResponseData(filesContentResponse.data.data.repository.object.entries);
45
39
  }
46
40
  async getSchema(commitHash) {
47
- var _a, _b, _c, _d, _e;
41
+ var _a, _b, _c, _d;
48
42
  if (this.gitRepositoryOptions === undefined) {
49
43
  throw new Error('Repository options must be set before reading');
50
44
  }
51
45
  const repositoryOwner = this.gitRepositoryOptions.repositoryOwner;
52
46
  const repositoryName = this.gitRepositoryOptions.repositoryName;
53
47
  const token = this.gitRepositoryOptions.personalAccessToken;
54
- const schemaFilePath = (_a = this.gitRepositoryOptions.pathSchemaFile) !== null && _a !== void 0 ? _a : git_adapter_1.PATH_SCHEMA_FILE;
55
- const queryContent = this.graphqlQueryFactory.createBlobContentQuery(repositoryOwner, repositoryName, commitHash, schemaFilePath);
48
+ const schemaFilePath = this.pathFactory.getPathSchema(this.gitRepositoryOptions);
49
+ const queryContent = this.graphqlQueryFactory.createBlobContentQuery();
56
50
  const response = await this.cachedHttpAdapter.post(GitHubAdapterService.API_URL, {
57
51
  query: queryContent,
52
+ variables: {
53
+ repositoryOwner: repositoryOwner,
54
+ repositoryName: repositoryName,
55
+ expression: `${commitHash}:${schemaFilePath}`,
56
+ },
58
57
  }, {
59
58
  headers: {
60
59
  authorization: `Bearer ${token}`,
61
60
  },
62
61
  });
63
- const schema = (_e = (_d = (_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.repository) === null || _d === void 0 ? void 0 : _d.object) === null || _e === void 0 ? void 0 : _e.text;
62
+ const schema = (_d = (_c = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.repository) === null || _c === void 0 ? void 0 : _c.object) === null || _d === void 0 ? void 0 : _d.text;
64
63
  if (!schema) {
65
64
  throw new Error(`"${schemaFilePath}" not found in Git repository "${repositoryOwner}/${repositoryName}" at commit "${commitHash}"`);
66
65
  }
@@ -72,9 +71,14 @@ class GitHubAdapterService {
72
71
  throw new Error('Repository options must be set before reading');
73
72
  }
74
73
  const token = this.gitRepositoryOptions.personalAccessToken;
75
- const queryLatestCommit = this.graphqlQueryFactory.createLatestCommitQuery(this.gitRepositoryOptions.repositoryOwner, this.gitRepositoryOptions.repositoryName, ref);
74
+ const queryLatestCommit = this.graphqlQueryFactory.createLatestCommitQuery();
76
75
  const response = await this.cachedHttpAdapter.post(GitHubAdapterService.API_URL, {
77
76
  query: queryLatestCommit,
77
+ variables: {
78
+ repositoryOwner: this.gitRepositoryOptions.repositoryOwner,
79
+ repositoryName: this.gitRepositoryOptions.repositoryName,
80
+ ref: ref,
81
+ },
78
82
  }, {
79
83
  cache: false,
80
84
  headers: {
@@ -96,8 +100,8 @@ class GitHubAdapterService {
96
100
  throw new Error('Repository options must be set before committing');
97
101
  }
98
102
  const token = this.gitRepositoryOptions.personalAccessToken;
99
- const pathEntryFolder = this.getPathEntryFolder(this.gitRepositoryOptions);
100
- const { additions, deletions } = this.contentEntriesToActionsConverter.convert(commitDraft.contentEntries, pathEntryFolder);
103
+ const pathEntryFolder = this.pathFactory.getPathEntryFolder(this.gitRepositoryOptions);
104
+ const { additions, deletions } = this.entriesToActionsConverter.convert(commitDraft.entries, pathEntryFolder);
101
105
  const mutateCommit = this.graphqlQueryFactory.createCommitMutation();
102
106
  const response = await this.cachedHttpAdapter.post(GitHubAdapterService.API_URL, {
103
107
  query: mutateCommit,
@@ -124,14 +128,6 @@ class GitHubAdapterService {
124
128
  }
125
129
  return { ref: mutationResult.commit.oid };
126
130
  }
127
- getPathEntryFolder(gitRepositoryOptions) {
128
- var _a;
129
- const pathEntryFolder = (_a = gitRepositoryOptions.pathEntryFolder) !== null && _a !== void 0 ? _a : git_adapter_1.PATH_ENTRY_FOLDER;
130
- if (pathEntryFolder.endsWith('/')) {
131
- return pathEntryFolder.substring(0, pathEntryFolder.length - 1);
132
- }
133
- return pathEntryFolder;
134
- }
135
131
  }
136
132
  exports.GitHubAdapterService = GitHubAdapterService;
137
133
  GitHubAdapterService.QUERY_CACHE_SECONDS = 10 * 60;
@@ -1 +1 @@
1
- {"version":3,"file":"git-hub-adapter.service.js","sourceRoot":"","sources":["../src/git-hub-adapter.service.ts"],"names":[],"mappings":";;;AACA,0DAQiC;AAEjC,+BAA4B;AAI5B,MAAa,oBAAoB;IAO/B,YACmB,iBAAqC,EAC9C,mBAA+C,EAC/C,gCAAyE;QAFhE,sBAAiB,GAAjB,iBAAiB,CAAoB;QAC9C,wBAAmB,GAAnB,mBAAmB,CAA4B;QAC/C,qCAAgC,GAAhC,gCAAgC,CAAyC;IAChF,CAAC;IAEG,KAAK,CAAC,oBAAoB,CAC/B,iBAA0C;QAE1C,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAA;IAC/C,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,UAAkB;;QAC/C,IAAI,IAAI,CAAC,oBAAoB,KAAK,SAAS,EAAE;YAC3C,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;SACjE;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAA;QAC3D,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA;QAE1E,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC,uBAAuB,CACxE,IAAI,CAAC,oBAAoB,CAAC,eAAe,EACzC,IAAI,CAAC,oBAAoB,CAAC,cAAc,EACxC,UAAU,EACV,eAAe,CAChB,CAAA;QACD,MAAM,oB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S;gBACzC,SAAS,EAAE,SAAS;gBACpB,SAAS,EAAE,SAAS;aACrB;SACF,EACD;YACE,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;aACjC;SACF,CACF,CAAA;QAED,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;SACtD;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAA;QAEtD,IAAI,cAAc,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;SACvD;QAED,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;IAC3C,CAAC;;AA9LH,oDA+LC;AA9LiB,wCAAmB,GAAG,EAAE,GAAG,EAAE,CAAA;AAE7B,4BAAO,GAAG,gCAAgC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  export declare class GraphqlQueryFactoryService {
2
- createBlobsContentQuery(repositoryOwner: string, repositoryName: string, ref: string, path: string): string;
3
- createBlobContentQuery(repositoryOwner: string, repositoryName: string, ref: string, schemaFilePath: string): string;
2
+ createBlobsContentQuery(): string;
3
+ createBlobContentQuery(): string;
4
4
  createCommitMutation(): string;
5
- createLatestCommitQuery(repositoryOwner: string, repositoryName: string, ref: string): string;
5
+ createLatestCommitQuery(): string;
6
6
  }
@@ -2,15 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphqlQueryFactoryService = void 0;
4
4
  class GraphqlQueryFactoryService {
5
- createBlobsContentQuery(repositoryOwner, repositoryName, ref, path) {
5
+ createBlobsContentQuery() {
6
6
  return `
7
- query {
8
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
9
- object(expression:"${ref}:${path}") {
7
+ query ($repositoryOwner: String!, $repositoryName: String!, $expression: String!) {
8
+ repository(owner: $repositoryOwner, name: $repositoryName) {
9
+ object(expression: $expression) {
10
10
  ... on Tree {
11
11
  entries {
12
12
  name
13
13
  object {
14
+ __typename
14
15
  ... on Blob {
15
16
  text
16
17
  }
@@ -22,11 +23,11 @@ class GraphqlQueryFactoryService {
22
23
  }
23
24
  `;
24
25
  }
25
- createBlobContentQuery(repositoryOwner, repositoryName, ref, schemaFilePath) {
26
+ createBlobContentQuery() {
26
27
  return `
27
- query {
28
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
29
- object(expression:"${ref}:${schemaFilePath}") {
28
+ query ($repositoryOwner: String!, $repositoryName: String!, $expression: String!) {
29
+ repository(owner: $repositoryOwner, name: $repositoryName) {
30
+ object(expression: $expression) {
30
31
  ... on Blob {
31
32
  text
32
33
  }
@@ -38,26 +39,26 @@ class GraphqlQueryFactoryService {
38
39
  createCommitMutation() {
39
40
  return `
40
41
  mutation (
41
- $repositoryNameWithOwner:String!,
42
- $branchName:String!,
43
- $commitMessage:String!,
44
- $precedingCommitSha:GitObjectID!,
45
- $additions:[FileAddition!],
46
- $deletions:[FileDeletion!]
42
+ $repositoryNameWithOwner: String!,
43
+ $branchName: String!,
44
+ $commitMessage: String!,
45
+ $precedingCommitSha: GitObjectID!,
46
+ $additions: [FileAddition!],
47
+ $deletions: [FileDeletion!]
47
48
  ) {
48
- commitCreate: createCommitOnBranch(input:{
49
- branch:{
50
- repositoryNameWithOwner:$repositoryNameWithOwner
51
- branchName:$branchName
49
+ commitCreate: createCommitOnBranch(input: {
50
+ branch: {
51
+ repositoryNameWithOwner: $repositoryNameWithOwner
52
+ branchName: $branchName
52
53
  }
53
54
  message: {
54
- headline:$commitMessage
55
+ headline: $commitMessage
55
56
  body:""
56
57
  }
57
- expectedHeadOid:$precedingCommitSha
58
- fileChanges:{
59
- additions:$additions
60
- deletions:$deletions
58
+ expectedHeadOid: $precedingCommitSha
59
+ fileChanges: {
60
+ additions: $additions
61
+ deletions: $deletions
61
62
  }
62
63
  }) {
63
64
  commit {
@@ -67,16 +68,16 @@ class GraphqlQueryFactoryService {
67
68
  }
68
69
  `;
69
70
  }
70
- createLatestCommitQuery(repositoryOwner, repositoryName, ref) {
71
+ createLatestCommitQuery() {
71
72
  return `
72
- query Content {
73
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
74
- ref(qualifiedName:"${ref}") {
73
+ query ($repositoryOwner: String!, $repositoryName: String!, $ref: String!) {
74
+ repository(owner: $repositoryOwner, name: $repositoryName) {
75
+ ref(qualifiedName: $ref) {
75
76
  target {
76
77
  oid
77
78
  }
78
79
  }
79
- object(expression:"${ref}") {
80
+ object(expression: $ref) {
80
81
  oid
81
82
  }
82
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-query-factory.service.js","sourceRoot":"","sources":["../src/graphql-query-factory.service.ts"],"names":[],"mappings":";;;AAAA,MAAa,0BAA0B;IAC9B,uBAAuB,CAC5B,eAAuB,EACvB,cAAsB,EACtB,GAAW,EACX,IAAY;QAEZ,OAAO;;4BAEiB,eAAe,YAAY,cAAc;+BACtC,GAAG,IAAI,IAAI;;;;;;;;;;;;;;KAcrC,CAAA;IACH,CAAC;IAEM,sBAAsB,CAC3B,eAAuB,EACvB,cAAsB,EACtB,GAAW,EACX,cAAsB;QAEtB,OAAO;;4BAEiB,eAAe,YAAY,cAAc;+BACtC,GAAG,IAAI,cAAc;;;;;;;KAO/C,CAAA;IACH,CAAC;IAEM,oBAAoB;QACzB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BN,CAAA;IACH,CAAC;IAEM,uBAAuB,CAC5B,eAAuB,EACvB,cAAsB,EACtB,GAAW;QAEX,OAAO;;4BAEiB,eAAe,YAAY,cAAc;+BACtC,GAAG;;;;;+BAKH,GAAG;;;;;KAK7B,CAAA;IACH,CAAC;CACF;AAnGD,gEAmGC"}
1
+ {"version":3,"file":"graphql-query-factory.service.js","sourceRoot":"","sources":["../src/graphql-query-factory.service.ts"],"names":[],"mappings":";;;AAAA,MAAa,0BAA0B;IAC9B,uBAAuB;QAC5B,OAAO;;;;;;;;;;;;;;;;;;KAkBN,CAAA;IACH,CAAC;IAEM,sBAAsB;QAC3B,OAAO;;;;;;;;;;KAUN,CAAA;IACH,CAAC;IAEM,oBAAoB;QACzB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6BN,CAAA;IACH,CAAC;IAEM,uBAAuB;QAC5B,OAAO;;;;;;;;;;;;;KAaN,CAAA;IACH,CAAC;CACF;AAtFD,gEAsFC"}
@@ -0,0 +1,5 @@
1
+ import { GitHubRepositoryOptions } from './index';
2
+ export declare class PathFactoryService {
3
+ getPathSchema(gitRepositoryOptions: GitHubRepositoryOptions): string;
4
+ getPathEntryFolder(gitRepositoryOptions: GitHubRepositoryOptions): string;
5
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PathFactoryService = void 0;
4
+ const git_adapter_1 = require("@commitspark/git-adapter");
5
+ class PathFactoryService {
6
+ getPathSchema(gitRepositoryOptions) {
7
+ var _a;
8
+ return (_a = gitRepositoryOptions.pathSchemaFile) !== null && _a !== void 0 ? _a : git_adapter_1.PATH_SCHEMA_FILE;
9
+ }
10
+ getPathEntryFolder(gitRepositoryOptions) {
11
+ var _a;
12
+ const pathEntryFolder = (_a = gitRepositoryOptions.pathEntryFolder) !== null && _a !== void 0 ? _a : git_adapter_1.PATH_ENTRY_FOLDER;
13
+ if (pathEntryFolder.endsWith('/')) {
14
+ return pathEntryFolder.substring(0, pathEntryFolder.length - 1);
15
+ }
16
+ return pathEntryFolder;
17
+ }
18
+ }
19
+ exports.PathFactoryService = PathFactoryService;
20
+ //# sourceMappingURL=path-factory.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-factory.service.js","sourceRoot":"","sources":["../src/path-factory.service.ts"],"names":[],"mappings":";;;AACA,0DAA8E;AAE9E,MAAa,kBAAkB;IACtB,aAAa,CAAC,oBAA6C;;QAChE,OAAO,MAAA,oBAAoB,CAAC,cAAc,mCAAI,8BAAgB,CAAA;IAChE,CAAC;IAEM,kBAAkB,CACvB,oBAA6C;;QAE7C,MAAM,eAAe,GACnB,MAAA,oBAAoB,CAAC,eAAe,mCAAI,+BAAiB,CAAA;QAE3D,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACjC,OAAO,eAAe,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;SAChE;QAED,OAAO,eAAe,CAAA;IACxB,CAAC;CACF;AAjBD,gDAiBC"}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../node_modules/buffer/index.d.ts","../src/addition.model.ts","../node_modules/@commitspark/git-adapter/dist/model/content-entry-metadata.d.ts","../node_modules/@commitspark/git-adapter/dist/model/content-entry.d.ts","../node_modules/@commitspark/git-adapter/dist/model/content-entry-draft.d.ts","../node_modules/@commitspark/git-adapter/dist/model/commit-draft.d.ts","../node_modules/@commitspark/git-adapter/dist/model/commit.d.ts","../node_modules/@commitspark/git-adapter/dist/git-adapter.d.ts","../node_modules/@commitspark/git-adapter/dist/index.d.ts","../node_modules/yaml/dist/parse/line-counter.d.ts","../node_modules/yaml/dist/errors.d.ts","../node_modules/yaml/dist/doc/applyReviver.d.ts","../node_modules/yaml/dist/log.d.ts","../node_modules/yaml/dist/nodes/toJS.d.ts","../node_modules/yaml/dist/nodes/Scalar.d.ts","../node_modules/yaml/dist/nodes/Collection.d.ts","../node_modules/yaml/dist/nodes/YAMLMap.d.ts","../node_modules/yaml/dist/nodes/YAMLSeq.d.ts","../node_modules/yaml/dist/schema/types.d.ts","../node_modules/yaml/dist/schema/Schema.d.ts","../node_modules/yaml/dist/doc/createNode.d.ts","../node_modules/yaml/dist/nodes/addPairToJSMap.d.ts","../node_modules/yaml/dist/nodes/Pair.d.ts","../node_modules/yaml/dist/schema/tags.d.ts","../node_modules/yaml/dist/options.d.ts","../node_modules/yaml/dist/stringify/stringify.d.ts","../node_modules/yaml/dist/nodes/Node.d.ts","../node_modules/yaml/dist/parse/cst-scalar.d.ts","../node_modules/yaml/dist/parse/cst-stringify.d.ts","../node_modules/yaml/dist/parse/cst-visit.d.ts","../node_modules/yaml/dist/parse/cst.d.ts","../node_modules/yaml/dist/nodes/Alias.d.ts","../node_modules/yaml/dist/doc/Document.d.ts","../node_modules/yaml/dist/doc/directives.d.ts","../node_modules/yaml/dist/compose/composer.d.ts","../node_modules/yaml/dist/parse/lexer.d.ts","../node_modules/yaml/dist/parse/parser.d.ts","../node_modules/yaml/dist/public-api.d.ts","../node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts","../node_modules/yaml/dist/schema/yaml-1.1/set.d.ts","../node_modules/yaml/dist/visit.d.ts","../node_modules/yaml/dist/index.d.ts","../src/deletion.model.ts","../src/content-entries-to-actions-converter.service.ts","../src/graphql-query-factory.service.ts","../node_modules/axios/index.d.ts","../node_modules/fast-defer/dist/deferred.d.ts","../node_modules/fast-defer/dist/create-deferred.d.ts","../node_modules/fast-defer/dist/is-deferred.d.ts","../node_modules/fast-defer/dist/index.d.ts","../node_modules/axios-cache-interceptor/dist/header/types.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/build.d.ts","../node_modules/axios-cache-interceptor/dist/util/types.d.ts","../node_modules/axios-cache-interceptor/dist/storage/types.d.ts","../node_modules/axios-cache-interceptor/dist/cache/cache.d.ts","../node_modules/axios-cache-interceptor/dist/cache/axios.d.ts","../node_modules/axios-cache-interceptor/dist/cache/create.d.ts","../node_modules/axios-cache-interceptor/dist/header/headers.d.ts","../node_modules/axios-cache-interceptor/dist/header/interpreter.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/request.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/response.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/util.d.ts","../node_modules/axios-cache-interceptor/dist/storage/build.d.ts","../node_modules/axios-cache-interceptor/dist/storage/memory.d.ts","../node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts","../node_modules/axios-cache-interceptor/dist/util/cache-predicate.d.ts","../node_modules/axios-cache-interceptor/dist/util/key-generator.d.ts","../node_modules/axios-cache-interceptor/dist/util/update-cache.d.ts","../node_modules/axios-cache-interceptor/dist/index.d.ts","../src/index.ts","../src/git-hub-adapter.service.ts","../src/container.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188",{"version":"29a2385d4cdc2e78aeced2cd0f66b06eef95dbbeb0e4f09c61a017ba859efabe","signature":"89b04f42a9291feb49cfac8dc5b99e792bdde7462097d217b3f8318127ad8bd2"},"3525e7fa64365bf44ba82bf79b13a10ce1e78b3a92cb22fd98377e4663dcf7da","a0bdd2fd60487e6233d39964606158ac12a931bf8fde64ca1a3d816f306d8b86","2b3e9d284e89738cc7e256be71923592720ae463fb5488206482633acc27f18b","888e6eb5d13e636bdbe51357ce34fa7a14e41ebb3442944e0e7a31c02cf13d2c","fdf1c0f508657d404ee8a65540f71610ca29645e38c9175df70c05b6293affdb","d6f31277f878e17d6e02d24a27cfe3f57db08ef417e3542070154e11ac44c12f","ba3ce8962a91b70735056413855d6b08150b775bef48a9b0eed857e6162db6a0","3dfcd0a3bfa70b53135db3cf2e4ddcb7eccc3e4418ce833ae24eecd06928328f","b26f93d773cf3aa4dc421c45323adccaead92598594a56f4a84d77910ee4f510","bc41a8e33caf4d193b0c49ec70d1e8db5ce3312eafe5447c6c1d5a2084fece12","7c33f11a56ba4e79efc4ddae85f8a4a888e216d2bf66c863f344d403437ffc74","2bb86e343b4109c784b11070735fa881af5c870a409a3b87b13800ca2afef421","fc9d4e784c9e7569911d8a6a01e1de90617942639c7c260beffdef1548b1ce06","37c1aeea4ec8df37bbe5d96bda46831acab3f70b2001ec9f51cb3146a101de89","5ac83af1a323158abc8627462fe987f7c67f957f88cdcf2237ae4dddc26677a8","df486e591f21d229d75df323fb9cf34f4b5cdbccee6a9b42227be738a13755d6","69ebf923204206eecef4310dc8bf28ab07feddaa3542066cdafbe67adf45f811","ae8189514ed306971ac9aa7d917487ee51dc3590aa5735f23c1d71811c373ea6","6de9d8858034d3197c1525e1c29c942cf7912f807d4d7f14dea247b7c05b59b0","394b4927dcc6eda44eb759f395da17b6e07f4daf272216b5cfc92eb32239f561","1adcc285d2d477ec6c51d0282d891fdf9d04a5fa8dfa479eab153ae17376f1b4","0ad294cdc42fb1f99cc94db8f77364ddc516643d9c69d4e66942f2cfd783213b","3956f34170e48abf902bc81055fb35a7e8b87109dbf3ca272d096d6d42cf7b84","f3acf8cff186f71a3a9b2da63f1378de6fe68a8578cb47d097776143cc84cd7d","1db170e5dad144b639ddf3d32710491c583f48c6e522580c8d5a8c249a611338","960923ce078ecfef6e5c34468cdba5c552b064c0db7cb0fdd3eafd1bb9d3d7e9","42f034630b3a866d4a88b37cf0f8357b36af2f7298b319d536b7413ba99f979b","33d1d46d7789bebdf9b78cd54f39022aad5d7d1d03a58bdad4fe98658acfef06","b3956ba310c0bcd45b1c77455a9754a35b49642be91bfbb412e04d378fad83a1","052854468e3d8142f440fa9a0da1d743abef903dff09597025d07703c25b601e","284147c679272283a4bea7ccaecbbab198bb1854e19269b2e59d4b5cedd5894a","325994b6f6c7598c73bbd0294bf1e3f1e229772669b3c8a08fe3170442f600b8","581656e45b2555b764e2880a39859e25ac6c0c9a74cff83dd22d3859b2231982","843563f951d16e850a0be806010f630a4a71f0a55810bb9aced67c6d7774bf2f","9af1c478e5403b39b922df9132d779bc6e1ef88cafec17fcecf26356d90ecbd6","a95a6135f2d195c93d930ba01049c33579328e55612477c0ae5652429d3974ad","24ead5861f4400218aeaafa477082022f244e3df46d18831411f3a47fc3ff515","65ce9342063fcf793e7baea7526a5a9a2f6ce05dea0cf4ae726d02eae2b98fa3","b932682e049f41e294a3429aca3b0adb4d2eed8047b4c22f91565e9353d6940c","5a1755f317ac2c0d708fbf7c1dbf076ba3a31f624c534b44275c9c43033fdc2e",{"version":"2c96494b4ab2834248a1c71e0798e39a1754b57e3d5bdc87a2c15f8748f0fddd","signature":"c326042e25ba027385f0501a483ca939438bec254481190c4f3a26498b2da588"},{"version":"376dfde1b187f4e8494b87dfb2f5fab5ffea6fee37452751d3f98baed9d35e12","signature":"6f05188756ad21b77a4f6c0d3f5555fe236453336ccf8d1981d5a6c82151df3c"},{"version":"45ba73b236e68daa78ea25abc3d32a4a7012a77dd30dfb29737f01abb9a2ac7a","signature":"dbdf71f5d1394688e12a75a26640d2b9ccec310af4b4fa3167ceb9b4fb4d8a7c"},"17affcd8cc646e7f05e4b96d325b893d22542dd2c2c63ead572ca1bea346ebc9","20cfd3f265de121245f4e303186d4f9ac99694b5165059d43c92bf494e368fcb","32d782ffe891896f5507e5c0a459335a909085b0bd5d01f665217ac88e39061d","7843485677d4ecddf4c4a9af063bb174704c2524b89cc9baf31acba340cf5883","17035f33da424f147f9b71a485bcedc69259fa57da28d6b47d303270a56ae586","d1c5ae708ca53712e7f761aa5aef56613cea2a12649ba236d8e01a38158f20a1","0d874f837f0e757b7430cda012c2449f028d885857ab6bfb9260cb504f3dc526","08d5d34963c74cb25debac21053d4da99869447ac20d391348c8f614ed8c9125","8de0643adef9da014f2de936aa5bb26df21b5fa86fc5457c71fa8622369a7d82","0738e4b13b9c4f30e3b24866a6c450afe4b50ccd8285c865c0b1ba778160cf86","0d40edf4cd60571d4b61972768efc4832748a1d0370c96cec59fca22461f6f49","0dcc2de7ff7064735fa2619f142c6c3b182b8df27b3718f91dc0c12c2256252a","8698e5c166b98b0d75c0fb06553df6a27df69275b238fd3c4f3f534e03415523","b219d61f40f34e45a01f7c4cb3afac27e486b1672053ab7f9c8a5b2063ce95fb","e799e3e58dcefa1fbf7204883f0b5954055875287359289200da0b189420757f","e531dda5cfd2ca46af492cb98af92ecc0339f6f8c770d8d7afdf033b77d8fae6","86f0f8aa0aacb5f24a03922cfad0732c59dc703a52a38056229a6b373f47978f","9c963300aa9f0b8c0d61152d06d84a773a7f478b6c3e31c3678a3e81e974bb63","b856b895bdb28b396b5cf9b940c723de61afbf6dda0792afc9b716c5205d24ac","1be81084e824d6a9fc0fe5a9650998ff43548bce063d8bd265593ec3bc2ac3a0","e1c12ab2708279a56dc8cdb870647b384e6a60c1c056e7db87fd6071a92f438b","c0554fdfc7885397d22ad0a383575fd77e2cea5b1b59761bccd8b46c88bdd8dc","86f337397a07a8d851c6eda0de144eec0947501cd41b4ea4a301ab07b569b41f","c80d91e26836b6257433362adec238b0cf407b52944a5cf103d6149c997fa144",{"version":"97e4dc41c01c8112e10d5e5ecf7a4e8b0b618203218a4d7d33893d261012b717","signature":"6c23344ab224a6a6368c0c48f083a78d66cf871efa9138fd34a871c7af8b81e3"},{"version":"38f908a2c8d8dcad89352d7936dacce3dc4309bbcb8ad1a1093ecb6456955aed","signature":"9dbbd581ce4d65daca526671630c7cc414819fe78e19a6147a735dc0a5d20c5e"},{"version":"4e77900aa88e7f135bf37dd4cf757ad2c9f744466a3b06fb07892ff3bd025cea","signature":"a0743ad1a06bff9fbd877124d3f6ecd9241c1e083bb81bb81a3c02d79a3789ab"}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[28,30,31],[27,28,29,30,31,32],[29],[28],[27],[70,79],[70,74,75,76,77,78,80],[70,79,80],[75],[70],[75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92],[80],[76,80],[70,78,79,80],[77,78,80],[78],[70,77,80],[77,80],[78,80],[71],[71,72,73],[35,49,51,55,57,58],[35,39,41,42,44,47,49,51,56,58],[43,44,51,57],[57],[34],[34,35,39,41,42,43,44,47,48,49,51,55,56,57,59,60,61,62,63,64,65],[38,39,41,42,50,51,55,57],[44,51],[39,41,42,47,50,55,56,57],[38,39,41,42,44,45,46,50,51,55,56],[38,51,55],[38,39,40,44,47,50,51,55],[38,41,47],[50,51,57],[34,36,37,39,43,44,47,48,51,58],[35,39,51,55],[55],[52,53,54],[36,49,51,57,59],[43,47,49,51],[43,49],[39,41,42,44,45,49,50,51],[38,42,43,66],[38,39,41,43,44,47,50],[49,56,57],[39,41,42,47,51,56,57],[25],[68,69,70,93,95],[26,33,66,67],[33,66,68,69,93,94],[33,95,96],[95],[26,33,67],[33,68,69,93,94],[33,95]],"referencedMap":[[32,1],[33,2],[30,3],[29,4],[28,5],[80,6],[79,7],[81,8],[83,9],[75,10],[93,11],[76,12],[84,12],[85,13],[86,14],[87,15],[88,16],[78,17],[89,16],[90,18],[91,18],[77,19],[92,15],[72,20],[74,21],[73,20],[59,22],[57,23],[45,24],[58,25],[35,26],[66,27],[56,28],[40,29],[51,30],[47,31],[39,32],[41,33],[42,33],[46,34],[38,35],[49,36],[52,37],[53,38],[54,38],[55,39],[61,38],[62,40],[44,41],[48,42],[43,43],[63,44],[64,45],[50,46],[65,47],[26,48],[96,49],[68,50],[95,51],[94,52]],"exportedModulesMap":[[32,1],[33,2],[30,3],[29,4],[28,5],[80,6],[79,7],[81,8],[83,9],[75,10],[93,11],[76,12],[84,12],[85,13],[86,14],[87,15],[88,16],[78,17],[89,16],[90,18],[91,18],[77,19],[92,15],[72,20],[74,21],[73,20],[59,22],[57,23],[45,24],[58,25],[35,26],[66,27],[56,28],[40,29],[51,30],[47,31],[39,32],[41,33],[42,33],[46,34],[38,35],[49,36],[52,37],[53,38],[54,38],[55,39],[61,38],[62,40],[44,41],[48,42],[43,43],[63,44],[64,45],[50,46],[65,47],[96,53],[68,54],[95,55],[94,56]],"semanticDiagnosticsPerFile":[32,33,30,31,29,27,28,80,79,81,82,83,75,93,76,84,85,86,87,88,78,89,90,91,77,92,70,25,72,71,74,73,5,6,10,9,2,11,12,13,14,15,16,17,18,3,4,24,22,19,20,21,23,1,8,7,59,57,36,45,58,35,66,37,56,40,51,47,39,41,42,46,38,49,52,53,54,55,60,34,61,62,44,48,43,63,64,50,65,26,96,68,67,95,69,94]},"version":"4.8.4"}
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../node_modules/buffer/index.d.ts","../src/addition.model.ts","../node_modules/@commitspark/git-adapter/dist/model/entry.d.ts","../node_modules/@commitspark/git-adapter/dist/model/entry-draft.d.ts","../node_modules/@commitspark/git-adapter/dist/model/commit-draft.d.ts","../node_modules/@commitspark/git-adapter/dist/model/commit.d.ts","../node_modules/@commitspark/git-adapter/dist/git-adapter.d.ts","../node_modules/@commitspark/git-adapter/dist/index.d.ts","../node_modules/yaml/dist/parse/line-counter.d.ts","../node_modules/yaml/dist/errors.d.ts","../node_modules/yaml/dist/doc/applyReviver.d.ts","../node_modules/yaml/dist/log.d.ts","../node_modules/yaml/dist/nodes/toJS.d.ts","../node_modules/yaml/dist/nodes/Scalar.d.ts","../node_modules/yaml/dist/nodes/Collection.d.ts","../node_modules/yaml/dist/nodes/YAMLMap.d.ts","../node_modules/yaml/dist/nodes/YAMLSeq.d.ts","../node_modules/yaml/dist/schema/types.d.ts","../node_modules/yaml/dist/schema/Schema.d.ts","../node_modules/yaml/dist/doc/createNode.d.ts","../node_modules/yaml/dist/nodes/addPairToJSMap.d.ts","../node_modules/yaml/dist/nodes/Pair.d.ts","../node_modules/yaml/dist/schema/tags.d.ts","../node_modules/yaml/dist/options.d.ts","../node_modules/yaml/dist/stringify/stringify.d.ts","../node_modules/yaml/dist/nodes/Node.d.ts","../node_modules/yaml/dist/parse/cst-scalar.d.ts","../node_modules/yaml/dist/parse/cst-stringify.d.ts","../node_modules/yaml/dist/parse/cst-visit.d.ts","../node_modules/yaml/dist/parse/cst.d.ts","../node_modules/yaml/dist/nodes/Alias.d.ts","../node_modules/yaml/dist/doc/Document.d.ts","../node_modules/yaml/dist/doc/directives.d.ts","../node_modules/yaml/dist/compose/composer.d.ts","../node_modules/yaml/dist/parse/lexer.d.ts","../node_modules/yaml/dist/parse/parser.d.ts","../node_modules/yaml/dist/public-api.d.ts","../node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts","../node_modules/yaml/dist/schema/yaml-1.1/set.d.ts","../node_modules/yaml/dist/visit.d.ts","../node_modules/yaml/dist/index.d.ts","../src/deletion.model.ts","../src/entries-to-actions-converter.service.ts","../src/graphql-query-factory.service.ts","../node_modules/axios/index.d.ts","../node_modules/fast-defer/dist/deferred.d.ts","../node_modules/fast-defer/dist/create-deferred.d.ts","../node_modules/fast-defer/dist/is-deferred.d.ts","../node_modules/fast-defer/dist/index.d.ts","../node_modules/axios-cache-interceptor/dist/header/types.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/build.d.ts","../node_modules/axios-cache-interceptor/dist/util/types.d.ts","../node_modules/axios-cache-interceptor/dist/storage/types.d.ts","../node_modules/axios-cache-interceptor/dist/cache/cache.d.ts","../node_modules/axios-cache-interceptor/dist/cache/axios.d.ts","../node_modules/axios-cache-interceptor/dist/cache/create.d.ts","../node_modules/axios-cache-interceptor/dist/header/headers.d.ts","../node_modules/axios-cache-interceptor/dist/header/interpreter.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/request.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/response.d.ts","../node_modules/axios-cache-interceptor/dist/interceptors/util.d.ts","../node_modules/axios-cache-interceptor/dist/storage/build.d.ts","../node_modules/axios-cache-interceptor/dist/storage/memory.d.ts","../node_modules/axios-cache-interceptor/dist/storage/web-api.d.ts","../node_modules/axios-cache-interceptor/dist/util/cache-predicate.d.ts","../node_modules/axios-cache-interceptor/dist/util/key-generator.d.ts","../node_modules/axios-cache-interceptor/dist/util/update-cache.d.ts","../node_modules/axios-cache-interceptor/dist/index.d.ts","../src/index.ts","../src/path-factory.service.ts","../src/entry-factory.service.ts","../src/git-hub-adapter.service.ts","../src/container.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188",{"version":"2920b3f53f1b941d78c4a308c76cdbea75a3bd4b1e5a650916665b41a5791809","signature":"89b04f42a9291feb49cfac8dc5b99e792bdde7462097d217b3f8318127ad8bd2"},"c4f9f53678258c4f166e3032f10cb2fc910d76e5299006012eb3b09aaf4942b9","4fc87352d3aa14810ce6cf9f4cf260e6ec0211c6f39b7f54f950a8ff4628545c","c8eb5e8aadf53eb626bc92c241e683b37ac87218fce45f4f44e70c209ccc9cc5","fdf1c0f508657d404ee8a65540f71610ca29645e38c9175df70c05b6293affdb","b500be12d34dcb4ebe774b6b5156f237ac3e5d88904fb01b836c540351c8e76f","9262c8e0166e977f16a03e8d29c11847ea8fd80a460c146b1bf583adac649e6b","3dfcd0a3bfa70b53135db3cf2e4ddcb7eccc3e4418ce833ae24eecd06928328f","b26f93d773cf3aa4dc421c45323adccaead92598594a56f4a84d77910ee4f510","bc41a8e33caf4d193b0c49ec70d1e8db5ce3312eafe5447c6c1d5a2084fece12","7c33f11a56ba4e79efc4ddae85f8a4a888e216d2bf66c863f344d403437ffc74","2bb86e343b4109c784b11070735fa881af5c870a409a3b87b13800ca2afef421","fc9d4e784c9e7569911d8a6a01e1de90617942639c7c260beffdef1548b1ce06","37c1aeea4ec8df37bbe5d96bda46831acab3f70b2001ec9f51cb3146a101de89","5ac83af1a323158abc8627462fe987f7c67f957f88cdcf2237ae4dddc26677a8","df486e591f21d229d75df323fb9cf34f4b5cdbccee6a9b42227be738a13755d6","69ebf923204206eecef4310dc8bf28ab07feddaa3542066cdafbe67adf45f811","ae8189514ed306971ac9aa7d917487ee51dc3590aa5735f23c1d71811c373ea6","6de9d8858034d3197c1525e1c29c942cf7912f807d4d7f14dea247b7c05b59b0","394b4927dcc6eda44eb759f395da17b6e07f4daf272216b5cfc92eb32239f561","1adcc285d2d477ec6c51d0282d891fdf9d04a5fa8dfa479eab153ae17376f1b4","0ad294cdc42fb1f99cc94db8f77364ddc516643d9c69d4e66942f2cfd783213b","3956f34170e48abf902bc81055fb35a7e8b87109dbf3ca272d096d6d42cf7b84","f3acf8cff186f71a3a9b2da63f1378de6fe68a8578cb47d097776143cc84cd7d","1db170e5dad144b639ddf3d32710491c583f48c6e522580c8d5a8c249a611338","960923ce078ecfef6e5c34468cdba5c552b064c0db7cb0fdd3eafd1bb9d3d7e9","42f034630b3a866d4a88b37cf0f8357b36af2f7298b319d536b7413ba99f979b","33d1d46d7789bebdf9b78cd54f39022aad5d7d1d03a58bdad4fe98658acfef06","b3956ba310c0bcd45b1c77455a9754a35b49642be91bfbb412e04d378fad83a1","052854468e3d8142f440fa9a0da1d743abef903dff09597025d07703c25b601e","284147c679272283a4bea7ccaecbbab198bb1854e19269b2e59d4b5cedd5894a","325994b6f6c7598c73bbd0294bf1e3f1e229772669b3c8a08fe3170442f600b8","581656e45b2555b764e2880a39859e25ac6c0c9a74cff83dd22d3859b2231982","843563f951d16e850a0be806010f630a4a71f0a55810bb9aced67c6d7774bf2f","9af1c478e5403b39b922df9132d779bc6e1ef88cafec17fcecf26356d90ecbd6","a95a6135f2d195c93d930ba01049c33579328e55612477c0ae5652429d3974ad","24ead5861f4400218aeaafa477082022f244e3df46d18831411f3a47fc3ff515","65ce9342063fcf793e7baea7526a5a9a2f6ce05dea0cf4ae726d02eae2b98fa3","b932682e049f41e294a3429aca3b0adb4d2eed8047b4c22f91565e9353d6940c","5a1755f317ac2c0d708fbf7c1dbf076ba3a31f624c534b44275c9c43033fdc2e",{"version":"2c96494b4ab2834248a1c71e0798e39a1754b57e3d5bdc87a2c15f8748f0fddd","signature":"c326042e25ba027385f0501a483ca939438bec254481190c4f3a26498b2da588"},{"version":"e6cea404e8906c793cd8182e0b3dabf16b05b2d5949ed5526112fd38f9fb4fff","signature":"0602159fa4ee353e24b602d6493328587050f95431f06bd02c0205547ff94140"},{"version":"81a4173f701481b3b5bcb9c7cb24dd489cc341dcda859dbdce283800cbc91aed","signature":"9746e17659173db1db1ff2aacee80454d9ab852ae863a47de42ee8e0b71c147e"},"01ba761ce6d75a4142858a053f45d64d255e057049ab1cc4d9a93e76b8b5c444","20cfd3f265de121245f4e303186d4f9ac99694b5165059d43c92bf494e368fcb","32d782ffe891896f5507e5c0a459335a909085b0bd5d01f665217ac88e39061d","7843485677d4ecddf4c4a9af063bb174704c2524b89cc9baf31acba340cf5883","17035f33da424f147f9b71a485bcedc69259fa57da28d6b47d303270a56ae586","d1c5ae708ca53712e7f761aa5aef56613cea2a12649ba236d8e01a38158f20a1","0d874f837f0e757b7430cda012c2449f028d885857ab6bfb9260cb504f3dc526","08d5d34963c74cb25debac21053d4da99869447ac20d391348c8f614ed8c9125","8de0643adef9da014f2de936aa5bb26df21b5fa86fc5457c71fa8622369a7d82","0738e4b13b9c4f30e3b24866a6c450afe4b50ccd8285c865c0b1ba778160cf86","0d40edf4cd60571d4b61972768efc4832748a1d0370c96cec59fca22461f6f49","0dcc2de7ff7064735fa2619f142c6c3b182b8df27b3718f91dc0c12c2256252a","8698e5c166b98b0d75c0fb06553df6a27df69275b238fd3c4f3f534e03415523","b219d61f40f34e45a01f7c4cb3afac27e486b1672053ab7f9c8a5b2063ce95fb","e799e3e58dcefa1fbf7204883f0b5954055875287359289200da0b189420757f","e531dda5cfd2ca46af492cb98af92ecc0339f6f8c770d8d7afdf033b77d8fae6","86f0f8aa0aacb5f24a03922cfad0732c59dc703a52a38056229a6b373f47978f","9c963300aa9f0b8c0d61152d06d84a773a7f478b6c3e31c3678a3e81e974bb63","b856b895bdb28b396b5cf9b940c723de61afbf6dda0792afc9b716c5205d24ac","1be81084e824d6a9fc0fe5a9650998ff43548bce063d8bd265593ec3bc2ac3a0","e1c12ab2708279a56dc8cdb870647b384e6a60c1c056e7db87fd6071a92f438b","c0554fdfc7885397d22ad0a383575fd77e2cea5b1b59761bccd8b46c88bdd8dc","86f337397a07a8d851c6eda0de144eec0947501cd41b4ea4a301ab07b569b41f","c80d91e26836b6257433362adec238b0cf407b52944a5cf103d6149c997fa144",{"version":"97e4dc41c01c8112e10d5e5ecf7a4e8b0b618203218a4d7d33893d261012b717","signature":"6c23344ab224a6a6368c0c48f083a78d66cf871efa9138fd34a871c7af8b81e3"},{"version":"f89df8ba2ff223c5cedd3673f589cda88af660fc67bc4b1a11a92ef77a83ba7b","signature":"527c3f7678bf6b88a77bf107aca0b128bc89a8f7f57a31d304c007866e30a045"},{"version":"b868a92285eefb9a0b393aefba096ff50a0efbbe724514a52cda14879d94ea01","signature":"a57cdb78b8c9d37c03dad865f926da66a6eba1b74371dba4384ef68b8e91bcba"},{"version":"857098b64ebbd610d2bf61f3e8b885618b00c550a65bd96ca0c74de4444b2237","signature":"93e8ae872d620e3b1aa637cafdbb749eca8accca5c87e1f255b6ce654823b8e1"},{"version":"d9adcbc876ecb1bdeac5e5210d78e33045b39b576f042311c022d53f43aacaaa","signature":"a0743ad1a06bff9fbd877124d3f6ecd9241c1e083bb81bb81a3c02d79a3789ab"},"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","5b5337f28573ffdbc95c3653c4a7961d0f02fdf4788888253bf74a3b5a05443e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","85f8ebd7f245e8bf29da270e8b53dcdd17528826ffd27176c5fc7e426213ef5a"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[27,29,30],[27,28,29,30,31],[28],[27],[99,138],[99,123,138],[138],[99],[99,124,138],[99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137],[124,138],[69,78],[69,73,74,75,76,77,79],[69,78,79],[74],[69],[74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91],[79],[75,79],[69,77,78,79],[76,77,79],[77],[69,76,79],[76,79],[77,79],[70],[70,71,72],[34,48,50,54,56,57],[34,38,40,41,43,46,48,50,55,57],[42,43,50,56],[56],[33],[33,34,38,40,41,42,43,46,47,48,50,54,55,56,58,59,60,61,62,63,64],[37,38,40,41,49,50,54,56],[43,50],[38,40,41,46,49,54,55,56],[37,38,40,41,43,44,45,49,50,54,55],[37,50,54],[37,38,39,43,46,49,50,54],[37,40,46],[49,50,56],[33,35,36,38,42,43,46,47,50,57],[34,38,50,54],[54],[51,52,53],[35,48,50,56,58],[42,46,48,50],[42,48],[38,40,41,43,44,48,49,50],[37,41,42,65],[37,38,40,42,43,46,49],[48,55,56],[38,40,41,46,50,55,56],[25],[67,68,69,92,94,95,96],[26,32,65,66],[32,65],[32,67,68,92,93,94,95],[32,96,97],[32,93],[96],[26,32,66],[32],[32,96],[93]],"referencedMap":[[31,1],[32,2],[29,3],[28,4],[123,5],[124,6],[99,7],[102,7],[121,5],[122,5],[112,5],[111,8],[109,5],[104,5],[117,5],[115,5],[119,5],[103,5],[116,5],[120,5],[105,5],[106,5],[118,5],[100,5],[107,5],[108,5],[110,5],[114,5],[125,9],[113,5],[101,5],[138,10],[132,9],[134,11],[133,9],[126,9],[127,9],[129,9],[131,9],[135,11],[136,11],[128,11],[130,11],[79,12],[78,13],[80,14],[82,15],[74,16],[92,17],[75,18],[83,18],[84,19],[85,20],[86,21],[87,22],[77,23],[88,22],[89,24],[90,24],[76,25],[91,21],[71,26],[73,27],[72,26],[58,28],[56,29],[44,30],[57,31],[34,32],[65,33],[55,34],[39,35],[50,36],[46,37],[38,38],[40,39],[41,39],[45,40],[37,41],[48,42],[51,43],[52,44],[53,44],[54,45],[60,44],[61,46],[43,47],[47,48],[42,49],[62,50],[63,51],[49,52],[64,53],[26,54],[97,55],[67,56],[95,57],[96,58],[93,59],[94,60]],"exportedModulesMap":[[31,1],[32,2],[29,3],[28,4],[123,5],[124,6],[99,7],[102,7],[121,5],[122,5],[112,5],[111,8],[109,5],[104,5],[117,5],[115,5],[119,5],[103,5],[116,5],[120,5],[105,5],[106,5],[118,5],[100,5],[107,5],[108,5],[110,5],[114,5],[125,9],[113,5],[101,5],[138,10],[132,9],[134,11],[133,9],[126,9],[127,9],[129,9],[131,9],[135,11],[136,11],[128,11],[130,11],[79,12],[78,13],[80,14],[82,15],[74,16],[92,17],[75,18],[83,18],[84,19],[85,20],[86,21],[87,22],[77,23],[88,22],[89,24],[90,24],[76,25],[91,21],[71,26],[73,27],[72,26],[58,28],[56,29],[44,30],[57,31],[34,32],[65,33],[55,34],[39,35],[50,36],[46,37],[38,38],[40,39],[41,39],[45,40],[37,41],[48,42],[51,43],[52,44],[53,44],[54,45],[60,44],[61,46],[43,47],[47,48],[42,49],[62,50],[63,51],[49,52],[64,53],[97,61],[67,62],[95,63],[96,58],[93,64],[94,65]],"semanticDiagnosticsPerFile":[31,32,29,30,28,27,98,123,124,99,102,121,122,112,111,109,104,117,115,119,103,116,120,105,106,118,100,107,108,110,114,125,113,101,138,137,132,134,133,126,127,129,131,135,136,128,130,79,78,80,81,82,74,92,75,83,84,85,86,87,77,88,89,90,76,91,69,25,71,70,73,72,5,6,10,9,2,11,12,13,14,15,16,17,18,3,4,24,22,19,20,21,23,1,8,7,58,56,35,44,57,34,65,36,55,39,50,46,38,40,41,45,37,48,51,52,53,54,59,33,60,61,43,47,42,62,63,49,64,26,97,66,67,95,96,68,93,94]},"version":"4.8.4"}
package/package.json CHANGED
@@ -1,23 +1,36 @@
1
1
  {
2
2
  "name": "@commitspark/git-adapter-github",
3
3
  "description": "Adapter that provides GitHub repository access to Commitspark",
4
- "version": "0.4.0",
4
+ "version": "0.6.0",
5
5
  "license": "ISC",
6
6
  "private": false,
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist/**",
11
+ "src/**",
12
+ "README.md",
13
+ "LICENSE",
14
+ "package.json",
15
+ "CHANGELOG.md"
16
+ ],
9
17
  "scripts": {
10
- "build": "tsc"
18
+ "build": "tsc",
19
+ "lint": "eslint \"{src,tests}/**/*.ts\""
11
20
  },
12
21
  "dependencies": {
13
- "@commitspark/git-adapter": "^0.8.0",
22
+ "@commitspark/git-adapter": "^0.13.0",
14
23
  "axios": "^1.1.3",
15
24
  "axios-cache-interceptor": "^0.10.7",
16
25
  "buffer": "^6.0.3",
17
26
  "yaml": "^2.1.1"
18
27
  },
19
28
  "devDependencies": {
20
- "prettier": "^2.7.1",
29
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
30
+ "eslint": "^8.55.0",
31
+ "eslint-config-prettier": "^9.1.0",
32
+ "eslint-plugin-prettier": "^5.0.1",
33
+ "prettier": "^3.1.1",
21
34
  "typescript": "^4.8.4"
22
35
  }
23
36
  }
@@ -2,7 +2,10 @@ import { Buffer } from 'buffer'
2
2
 
3
3
  export class AdditionModel {
4
4
  readonly contents: string
5
- constructor(readonly path: string, contents: string) {
5
+ constructor(
6
+ readonly path: string,
7
+ contents: string,
8
+ ) {
6
9
  this.contents = Buffer.from(contents, 'utf8').toString('base64')
7
10
  }
8
11
  }
package/src/container.ts CHANGED
@@ -1,8 +1,10 @@
1
- import { ContentEntriesToActionsConverterService } from './content-entries-to-actions-converter.service'
1
+ import { EntriesToActionsConverterService } from './entries-to-actions-converter.service'
2
2
  import { GitHubAdapterService } from './git-hub-adapter.service'
3
3
  import { GraphqlQueryFactoryService } from './graphql-query-factory.service'
4
4
  import axios from 'axios'
5
5
  import { setupCache } from 'axios-cache-interceptor'
6
+ import { PathFactoryService } from './path-factory.service'
7
+ import { EntryFactoryService } from './entry-factory.service'
6
8
 
7
9
  const cachedHttpAdapter = setupCache(axios.create(), {
8
10
  ttl: GitHubAdapterService.QUERY_CACHE_SECONDS * 1000, // milliseconds
@@ -10,11 +12,14 @@ const cachedHttpAdapter = setupCache(axios.create(), {
10
12
  })
11
13
 
12
14
  const graphqlQueryFactoryService = new GraphqlQueryFactoryService()
13
- const contentEntriesToActionsConverterService =
14
- new ContentEntriesToActionsConverterService()
15
+ const entriesToActionsConverterService = new EntriesToActionsConverterService()
16
+ const pathFactoryService = new PathFactoryService()
17
+ const entryFactoryService = new EntryFactoryService()
15
18
 
16
19
  export const gitHubAdapterService = new GitHubAdapterService(
17
20
  cachedHttpAdapter,
18
21
  graphqlQueryFactoryService,
19
- contentEntriesToActionsConverterService,
22
+ entriesToActionsConverterService,
23
+ pathFactoryService,
24
+ entryFactoryService,
20
25
  )
@@ -1,11 +1,11 @@
1
- import { ContentEntryDraft, ENTRY_EXTENSION } from '@commitspark/git-adapter'
1
+ import { EntryDraft, ENTRY_EXTENSION } from '@commitspark/git-adapter'
2
2
  import { stringify } from 'yaml'
3
3
  import { AdditionModel } from './addition.model'
4
4
  import { DeletionModel } from './deletion.model'
5
5
 
6
- export class ContentEntriesToActionsConverterService {
6
+ export class EntriesToActionsConverterService {
7
7
  convert(
8
- contentEntries: ContentEntryDraft[],
8
+ entryDrafts: EntryDraft[],
9
9
  pathEntryFolder: string,
10
10
  ): {
11
11
  additions: AdditionModel[]
@@ -13,17 +13,17 @@ export class ContentEntriesToActionsConverterService {
13
13
  } {
14
14
  const additions: AdditionModel[] = []
15
15
  const deletions: DeletionModel[] = []
16
- contentEntries.forEach((contentEntry) => {
17
- const entryPath = `${pathEntryFolder}/${contentEntry.id}${ENTRY_EXTENSION}`
18
- if (contentEntry.deletion) {
16
+ entryDrafts.forEach((entryDraft) => {
17
+ const entryPath = `${pathEntryFolder}/${entryDraft.id}${ENTRY_EXTENSION}`
18
+ if (entryDraft.deletion) {
19
19
  deletions.push(new DeletionModel(entryPath))
20
20
  } else {
21
21
  additions.push(
22
22
  new AdditionModel(
23
23
  entryPath,
24
24
  stringify({
25
- metadata: contentEntry.metadata,
26
- data: contentEntry.data,
25
+ metadata: entryDraft.metadata,
26
+ data: entryDraft.data,
27
27
  }),
28
28
  ),
29
29
  )
@@ -0,0 +1,35 @@
1
+ import { parse } from 'yaml'
2
+ import { Entry, ENTRY_EXTENSION } from '@commitspark/git-adapter'
3
+
4
+ interface TreeEntry {
5
+ name: string
6
+ object: {
7
+ __typename: string
8
+ text: string
9
+ }
10
+ }
11
+
12
+ export class EntryFactoryService {
13
+ public createFromBlobsQueryResponseData(entries: TreeEntry[]): Entry[] {
14
+ {
15
+ return entries
16
+ .filter(
17
+ (entry: TreeEntry) =>
18
+ entry.name.endsWith(ENTRY_EXTENSION) &&
19
+ entry.object['__typename'] === 'Blob',
20
+ )
21
+ .map((entry: TreeEntry) => {
22
+ const fileContent = parse(entry.object.text)
23
+ const id = entry.name.substring(
24
+ 0,
25
+ entry.name.length - ENTRY_EXTENSION.length,
26
+ )
27
+ return {
28
+ id: id,
29
+ metadata: fileContent.metadata,
30
+ data: fileContent.data,
31
+ } as Entry
32
+ })
33
+ }
34
+ }
35
+ }
@@ -2,16 +2,14 @@ import { GraphqlQueryFactoryService } from './graphql-query-factory.service'
2
2
  import {
3
3
  Commit,
4
4
  CommitDraft,
5
- ContentEntry,
6
- ENTRY_EXTENSION,
5
+ Entry,
7
6
  GitAdapter,
8
- PATH_ENTRY_FOLDER,
9
- PATH_SCHEMA_FILE,
10
7
  } from '@commitspark/git-adapter'
11
- import { ContentEntriesToActionsConverterService } from './content-entries-to-actions-converter.service'
12
- import { parse } from 'yaml'
8
+ import { EntriesToActionsConverterService } from './entries-to-actions-converter.service'
13
9
  import { AxiosCacheInstance } from 'axios-cache-interceptor'
14
10
  import { GitHubRepositoryOptions } from './index'
11
+ import { PathFactoryService } from './path-factory.service'
12
+ import { EntryFactoryService } from './entry-factory.service'
15
13
 
16
14
  export class GitHubAdapterService implements GitAdapter {
17
15
  static readonly QUERY_CACHE_SECONDS = 10 * 60
@@ -23,7 +21,9 @@ export class GitHubAdapterService implements GitAdapter {
23
21
  constructor(
24
22
  private readonly cachedHttpAdapter: AxiosCacheInstance,
25
23
  private graphqlQueryFactory: GraphqlQueryFactoryService,
26
- private contentEntriesToActionsConverter: ContentEntriesToActionsConverterService,
24
+ private entriesToActionsConverter: EntriesToActionsConverterService,
25
+ private pathFactory: PathFactoryService,
26
+ private entryFactory: EntryFactoryService,
27
27
  ) {}
28
28
 
29
29
  public async setRepositoryOptions(
@@ -32,24 +32,26 @@ export class GitHubAdapterService implements GitAdapter {
32
32
  this.gitRepositoryOptions = repositoryOptions
33
33
  }
34
34
 
35
- public async getContentEntries(commitHash: string): Promise<ContentEntry[]> {
35
+ public async getEntries(commitHash: string): Promise<Entry[]> {
36
36
  if (this.gitRepositoryOptions === undefined) {
37
37
  throw new Error('Repository options must be set before reading')
38
38
  }
39
39
 
40
40
  const token = this.gitRepositoryOptions.personalAccessToken
41
- const pathEntryFolder = this.getPathEntryFolder(this.gitRepositoryOptions)
42
-
43
- const queryFilesContent = this.graphqlQueryFactory.createBlobsContentQuery(
44
- this.gitRepositoryOptions.repositoryOwner,
45
- this.gitRepositoryOptions.repositoryName,
46
- commitHash,
47
- pathEntryFolder,
41
+ const pathEntryFolder = this.pathFactory.getPathEntryFolder(
42
+ this.gitRepositoryOptions,
48
43
  )
44
+
45
+ const queryFilesContent = this.graphqlQueryFactory.createBlobsContentQuery()
49
46
  const filesContentResponse = await this.cachedHttpAdapter.post(
50
47
  GitHubAdapterService.API_URL,
51
48
  {
52
49
  query: queryFilesContent,
50
+ variables: {
51
+ repositoryOwner: this.gitRepositoryOptions.repositoryOwner,
52
+ repositoryName: this.gitRepositoryOptions.repositoryName,
53
+ expression: `${commitHash}:${pathEntryFolder}`,
54
+ },
53
55
  },
54
56
  {
55
57
  headers: {
@@ -58,23 +60,13 @@ export class GitHubAdapterService implements GitAdapter {
58
60
  },
59
61
  )
60
62
 
61
- const extensionLength = ENTRY_EXTENSION.length
62
-
63
63
  if (!filesContentResponse.data.data.repository?.object?.entries) {
64
64
  return []
65
65
  }
66
66
 
67
- return filesContentResponse.data.data.repository.object.entries
68
- .filter((entry: any) => entry.name.endsWith(ENTRY_EXTENSION))
69
- .map((entry: any) => {
70
- const content = parse(entry.object.text)
71
- const id = entry.name.substring(0, entry.name.length - extensionLength)
72
- return {
73
- id: id,
74
- metadata: content.metadata,
75
- data: content.data,
76
- } as ContentEntry
77
- })
67
+ return this.entryFactory.createFromBlobsQueryResponseData(
68
+ filesContentResponse.data.data.repository.object.entries,
69
+ )
78
70
  }
79
71
 
80
72
  public async getSchema(commitHash: string): Promise<string> {
@@ -85,19 +77,20 @@ export class GitHubAdapterService implements GitAdapter {
85
77
  const repositoryOwner = this.gitRepositoryOptions.repositoryOwner
86
78
  const repositoryName = this.gitRepositoryOptions.repositoryName
87
79
  const token = this.gitRepositoryOptions.personalAccessToken
88
- const schemaFilePath =
89
- this.gitRepositoryOptions.pathSchemaFile ?? PATH_SCHEMA_FILE
90
-
91
- const queryContent = this.graphqlQueryFactory.createBlobContentQuery(
92
- repositoryOwner,
93
- repositoryName,
94
- commitHash,
95
- schemaFilePath,
80
+ const schemaFilePath = this.pathFactory.getPathSchema(
81
+ this.gitRepositoryOptions,
96
82
  )
83
+
84
+ const queryContent = this.graphqlQueryFactory.createBlobContentQuery()
97
85
  const response = await this.cachedHttpAdapter.post(
98
86
  GitHubAdapterService.API_URL,
99
87
  {
100
88
  query: queryContent,
89
+ variables: {
90
+ repositoryOwner: repositoryOwner,
91
+ repositoryName: repositoryName,
92
+ expression: `${commitHash}:${schemaFilePath}`,
93
+ },
101
94
  },
102
95
  {
103
96
  headers: {
@@ -123,16 +116,17 @@ export class GitHubAdapterService implements GitAdapter {
123
116
 
124
117
  const token = this.gitRepositoryOptions.personalAccessToken
125
118
 
126
- const queryLatestCommit = this.graphqlQueryFactory.createLatestCommitQuery(
127
- this.gitRepositoryOptions.repositoryOwner,
128
- this.gitRepositoryOptions.repositoryName,
129
- ref,
130
- )
119
+ const queryLatestCommit = this.graphqlQueryFactory.createLatestCommitQuery()
131
120
 
132
121
  const response = await this.cachedHttpAdapter.post(
133
122
  GitHubAdapterService.API_URL,
134
123
  {
135
124
  query: queryLatestCommit,
125
+ variables: {
126
+ repositoryOwner: this.gitRepositoryOptions.repositoryOwner,
127
+ repositoryName: this.gitRepositoryOptions.repositoryName,
128
+ ref: ref,
129
+ },
136
130
  },
137
131
  {
138
132
  cache: false, // must not use cache, so we always get the branch's current head
@@ -165,13 +159,14 @@ export class GitHubAdapterService implements GitAdapter {
165
159
  }
166
160
 
167
161
  const token = this.gitRepositoryOptions.personalAccessToken
168
- const pathEntryFolder = this.getPathEntryFolder(this.gitRepositoryOptions)
162
+ const pathEntryFolder = this.pathFactory.getPathEntryFolder(
163
+ this.gitRepositoryOptions,
164
+ )
169
165
 
170
- const { additions, deletions } =
171
- this.contentEntriesToActionsConverter.convert(
172
- commitDraft.contentEntries,
173
- pathEntryFolder,
174
- )
166
+ const { additions, deletions } = this.entriesToActionsConverter.convert(
167
+ commitDraft.entries,
168
+ pathEntryFolder,
169
+ )
175
170
 
176
171
  const mutateCommit = this.graphqlQueryFactory.createCommitMutation()
177
172
  const response: any = await this.cachedHttpAdapter.post(
@@ -207,17 +202,4 @@ export class GitHubAdapterService implements GitAdapter {
207
202
 
208
203
  return { ref: mutationResult.commit.oid }
209
204
  }
210
-
211
- private getPathEntryFolder(
212
- gitRepositoryOptions: GitHubRepositoryOptions,
213
- ): string {
214
- const pathEntryFolder =
215
- gitRepositoryOptions.pathEntryFolder ?? PATH_ENTRY_FOLDER
216
-
217
- if (pathEntryFolder.endsWith('/')) {
218
- return pathEntryFolder.substring(0, pathEntryFolder.length - 1)
219
- }
220
-
221
- return pathEntryFolder
222
- }
223
205
  }
@@ -1,18 +1,14 @@
1
1
  export class GraphqlQueryFactoryService {
2
- public createBlobsContentQuery(
3
- repositoryOwner: string,
4
- repositoryName: string,
5
- ref: string,
6
- path: string,
7
- ): string {
2
+ public createBlobsContentQuery(): string {
8
3
  return `
9
- query {
10
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
11
- object(expression:"${ref}:${path}") {
4
+ query ($repositoryOwner: String!, $repositoryName: String!, $expression: String!) {
5
+ repository(owner: $repositoryOwner, name: $repositoryName) {
6
+ object(expression: $expression) {
12
7
  ... on Tree {
13
8
  entries {
14
9
  name
15
10
  object {
11
+ __typename
16
12
  ... on Blob {
17
13
  text
18
14
  }
@@ -25,16 +21,11 @@ export class GraphqlQueryFactoryService {
25
21
  `
26
22
  }
27
23
 
28
- public createBlobContentQuery(
29
- repositoryOwner: string,
30
- repositoryName: string,
31
- ref: string,
32
- schemaFilePath: string,
33
- ): string {
24
+ public createBlobContentQuery(): string {
34
25
  return `
35
- query {
36
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
37
- object(expression:"${ref}:${schemaFilePath}") {
26
+ query ($repositoryOwner: String!, $repositoryName: String!, $expression: String!) {
27
+ repository(owner: $repositoryOwner, name: $repositoryName) {
28
+ object(expression: $expression) {
38
29
  ... on Blob {
39
30
  text
40
31
  }
@@ -47,26 +38,26 @@ export class GraphqlQueryFactoryService {
47
38
  public createCommitMutation(): string {
48
39
  return `
49
40
  mutation (
50
- $repositoryNameWithOwner:String!,
51
- $branchName:String!,
52
- $commitMessage:String!,
53
- $precedingCommitSha:GitObjectID!,
54
- $additions:[FileAddition!],
55
- $deletions:[FileDeletion!]
41
+ $repositoryNameWithOwner: String!,
42
+ $branchName: String!,
43
+ $commitMessage: String!,
44
+ $precedingCommitSha: GitObjectID!,
45
+ $additions: [FileAddition!],
46
+ $deletions: [FileDeletion!]
56
47
  ) {
57
- commitCreate: createCommitOnBranch(input:{
58
- branch:{
59
- repositoryNameWithOwner:$repositoryNameWithOwner
60
- branchName:$branchName
48
+ commitCreate: createCommitOnBranch(input: {
49
+ branch: {
50
+ repositoryNameWithOwner: $repositoryNameWithOwner
51
+ branchName: $branchName
61
52
  }
62
53
  message: {
63
- headline:$commitMessage
54
+ headline: $commitMessage
64
55
  body:""
65
56
  }
66
- expectedHeadOid:$precedingCommitSha
67
- fileChanges:{
68
- additions:$additions
69
- deletions:$deletions
57
+ expectedHeadOid: $precedingCommitSha
58
+ fileChanges: {
59
+ additions: $additions
60
+ deletions: $deletions
70
61
  }
71
62
  }) {
72
63
  commit {
@@ -77,20 +68,16 @@ export class GraphqlQueryFactoryService {
77
68
  `
78
69
  }
79
70
 
80
- public createLatestCommitQuery(
81
- repositoryOwner: string,
82
- repositoryName: string,
83
- ref: string,
84
- ): string {
71
+ public createLatestCommitQuery(): string {
85
72
  return `
86
- query Content {
87
- repository(owner:"${repositoryOwner}", name:"${repositoryName}") {
88
- ref(qualifiedName:"${ref}") {
73
+ query ($repositoryOwner: String!, $repositoryName: String!, $ref: String!) {
74
+ repository(owner: $repositoryOwner, name: $repositoryName) {
75
+ ref(qualifiedName: $ref) {
89
76
  target {
90
77
  oid
91
78
  }
92
79
  }
93
- object(expression:"${ref}") {
80
+ object(expression: $ref) {
94
81
  oid
95
82
  }
96
83
  }
@@ -0,0 +1,21 @@
1
+ import { GitHubRepositoryOptions } from './index'
2
+ import { PATH_ENTRY_FOLDER, PATH_SCHEMA_FILE } from '@commitspark/git-adapter'
3
+
4
+ export class PathFactoryService {
5
+ public getPathSchema(gitRepositoryOptions: GitHubRepositoryOptions) {
6
+ return gitRepositoryOptions.pathSchemaFile ?? PATH_SCHEMA_FILE
7
+ }
8
+
9
+ public getPathEntryFolder(
10
+ gitRepositoryOptions: GitHubRepositoryOptions,
11
+ ): string {
12
+ const pathEntryFolder =
13
+ gitRepositoryOptions.pathEntryFolder ?? PATH_ENTRY_FOLDER
14
+
15
+ if (pathEntryFolder.endsWith('/')) {
16
+ return pathEntryFolder.substring(0, pathEntryFolder.length - 1)
17
+ }
18
+
19
+ return pathEntryFolder
20
+ }
21
+ }
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "tabWidth": 2,
5
- "trailingComma": "all"
6
- }
@@ -1,9 +0,0 @@
1
- import { ContentEntryDraft } from '@commitspark/git-adapter';
2
- import { AdditionModel } from './addition.model';
3
- import { DeletionModel } from './deletion.model';
4
- export declare class ContentEntriesToActionsConverterService {
5
- convert(contentEntries: ContentEntryDraft[], pathEntryFolder: string): {
6
- additions: AdditionModel[];
7
- deletions: DeletionModel[];
8
- };
9
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-entries-to-actions-converter.service.js","sourceRoot":"","sources":["../src/content-entries-to-actions-converter.service.ts"],"names":[],"mappings":";;;AAAA,0DAA6E;AAC7E,+BAAgC;AAChC,qDAAgD;AAChD,qDAAgD;AAEhD,MAAa,uCAAuC;IAClD,OAAO,CACL,cAAmC,EACnC,eAAuB;QAKvB,MAAM,SAAS,GAAoB,EAAE,CAAA;QACrC,MAAM,SAAS,GAAoB,EAAE,CAAA;QACrC,cAAc,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACtC,MAAM,SAAS,GAAG,GAAG,eAAe,IAAI,YAAY,CAAC,EAAE,GAAG,6BAAe,EAAE,CAAA;YAC3E,IAAI,YAAY,CAAC,QAAQ,EAAE;gBACzB,SAAS,CAAC,IAAI,CAAC,IAAI,8BAAa,CAAC,SAAS,CAAC,CAAC,CAAA;aAC7C;iBAAM;gBACL,SAAS,CAAC,IAAI,CACZ,IAAI,8BAAa,CACf,SAAS,EACT,IAAA,gBAAS,EAAC;oBACR,QAAQ,EAAE,YAAY,CAAC,QAAQ;oBAC/B,IAAI,EAAE,YAAY,CAAC,IAAI;iBACxB,CAAC,CACH,CACF,CAAA;aACF;QACH,CAAC,CAAC,CAAA;QACF,OAAO;YACL,SAAS;YACT,SAAS;SACV,CAAA;IACH,CAAC;CACF;AA/BD,0FA+BC"}
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "declaration": true,
5
- "removeComments": true,
6
- "emitDecoratorMetadata": true,
7
- "experimentalDecorators": true,
8
- "allowSyntheticDefaultImports": true,
9
- "target": "es2017",
10
- "sourceMap": true,
11
- "outDir": "./dist",
12
- "baseUrl": "./",
13
- "incremental": true,
14
- "skipLibCheck": true,
15
- "strict": true,
16
- "esModuleInterop": true
17
- },
18
- "exclude": [
19
- "node_modules",
20
- "dist"
21
- ]
22
- }