@livechat/developer-studio-api 2.0.58 → 2.0.59

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/dist/index.d.mts CHANGED
@@ -2183,6 +2183,7 @@ declare const api: {
2183
2183
  keys: GitHubRepositoryHook[];
2184
2184
  } | undefined>;
2185
2185
  getFile(path: string, repositoryName: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<any>;
2186
+ getCommits(repositoryName: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<{}[]>;
2186
2187
  commitFiles(data: {
2187
2188
  repositoryName: string;
2188
2189
  repositoryBranch: string;
package/dist/index.d.ts CHANGED
@@ -2183,6 +2183,7 @@ declare const api: {
2183
2183
  keys: GitHubRepositoryHook[];
2184
2184
  } | undefined>;
2185
2185
  getFile(path: string, repositoryName: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<any>;
2186
+ getCommits(repositoryName: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<{}[]>;
2186
2187
  commitFiles(data: {
2187
2188
  repositoryName: string;
2188
2189
  repositoryBranch: string;
package/dist/index.js CHANGED
@@ -405,6 +405,8 @@ var gitHubRepositoryApi = {
405
405
  })
406
406
  );
407
407
  repository = response2.data;
408
+ const commits = yield this.getCommits(repository.full_name);
409
+ console.log(commits);
408
410
  } else {
409
411
  const response2 = yield githubClientInstance.post(
410
412
  `/user/repos`,
@@ -455,7 +457,6 @@ var gitHubRepositoryApi = {
455
457
  return __async(this, null, function* () {
456
458
  const upsert = (sha) => __async(this, null, function* () {
457
459
  var _a;
458
- console.log("sha: ", sha);
459
460
  const response = yield githubClientInstance.put(
460
461
  `/repos/${repositoryName}/contents/livechat.config.json`,
461
462
  {
@@ -486,7 +487,6 @@ var gitHubRepositoryApi = {
486
487
  seed = yield this.getRepositorySeed(repositoryName, authorization);
487
488
  } catch (e) {
488
489
  }
489
- console.log("seed: ", seed);
490
490
  return yield upsert(seed == null ? void 0 : seed.sha);
491
491
  });
492
492
  },
@@ -565,6 +565,19 @@ var gitHubRepositoryApi = {
565
565
  return data;
566
566
  });
567
567
  },
568
+ getCommits(repositoryName, authorization) {
569
+ return __async(this, null, function* () {
570
+ var _a;
571
+ const { data: commits } = yield githubClientInstance.get(
572
+ `/repos/${repositoryName}/git/commits`,
573
+ getGithubClientRequestConfig({
574
+ token: (_a = authorization == null ? void 0 : authorization.tokens) == null ? void 0 : _a.app,
575
+ ensureAuthorizationToken: true
576
+ })
577
+ );
578
+ return commits;
579
+ });
580
+ },
568
581
  commitFiles(data, authorization) {
569
582
  return __async(this, null, function* () {
570
583
  var _a, _b, _c, _d, _e;
package/dist/index.mjs CHANGED
@@ -318,6 +318,8 @@ var gitHubRepositoryApi = {
318
318
  })
319
319
  );
320
320
  repository = response2.data;
321
+ const commits = yield this.getCommits(repository.full_name);
322
+ console.log(commits);
321
323
  } else {
322
324
  const response2 = yield githubClientInstance.post(
323
325
  `/user/repos`,
@@ -368,7 +370,6 @@ var gitHubRepositoryApi = {
368
370
  return __async(this, null, function* () {
369
371
  const upsert = (sha) => __async(this, null, function* () {
370
372
  var _a;
371
- console.log("sha: ", sha);
372
373
  const response = yield githubClientInstance.put(
373
374
  `/repos/${repositoryName}/contents/livechat.config.json`,
374
375
  {
@@ -399,7 +400,6 @@ var gitHubRepositoryApi = {
399
400
  seed = yield this.getRepositorySeed(repositoryName, authorization);
400
401
  } catch (e) {
401
402
  }
402
- console.log("seed: ", seed);
403
403
  return yield upsert(seed == null ? void 0 : seed.sha);
404
404
  });
405
405
  },
@@ -478,6 +478,19 @@ var gitHubRepositoryApi = {
478
478
  return data;
479
479
  });
480
480
  },
481
+ getCommits(repositoryName, authorization) {
482
+ return __async(this, null, function* () {
483
+ var _a;
484
+ const { data: commits } = yield githubClientInstance.get(
485
+ `/repos/${repositoryName}/git/commits`,
486
+ getGithubClientRequestConfig({
487
+ token: (_a = authorization == null ? void 0 : authorization.tokens) == null ? void 0 : _a.app,
488
+ ensureAuthorizationToken: true
489
+ })
490
+ );
491
+ return commits;
492
+ });
493
+ },
481
494
  commitFiles(data, authorization) {
482
495
  return __async(this, null, function* () {
483
496
  var _a, _b, _c, _d, _e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "2.0.58",
3
+ "version": "2.0.59",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "@types/node": "^17.0.12",
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
- "config": "0.0.0",
21
20
  "eslint-config-custom-lib": "0.0.1",
22
21
  "tsconfig": "0.0.0",
23
- "types": "0.0.1"
22
+ "types": "0.0.1",
23
+ "config": "0.0.0"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsup src/index.ts --format esm,cjs --dts",