@heroku/buildpack-registry 1.0.2 → 1.0.4

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.
@@ -110,10 +110,10 @@ class BuildpackRegistry {
110
110
  }
111
111
  const bp_body = await response.json();
112
112
  const result = await this.listVersions(buildpack);
113
- if (result.isErr()) {
114
- return true_myth_1.Result.err(result.unsafelyUnwrapErr());
113
+ if (result.isErr) {
114
+ return true_myth_1.Result.err(result.error);
115
115
  }
116
- const revisions = result.unsafelyUnwrap();
116
+ const revisions = result.value;
117
117
  const revision = revisions.sort((a, b) => {
118
118
  return a.release > b.release ? -1 : 1;
119
119
  })[0];
@@ -211,8 +211,8 @@ class BuildpackRegistry {
211
211
  while (running) {
212
212
  status_count += 1;
213
213
  const result = await this.revisionInfo(buildpack_id, revision_id);
214
- if (result.isOk()) {
215
- const revision = result.unsafelyUnwrap();
214
+ if (result.isOk) {
215
+ const revision = result.value;
216
216
  status = revision.status;
217
217
  if (status !== 'pending') {
218
218
  break;
@@ -1,2 +1 @@
1
1
  export { BuildpackBody, BuildpackRegistry, BuildpackSlugResult, Category, InfoData, ReadmeBody, ResponseError, RevisionBody, RevisionStatus, } from './buildpack-registry';
2
- export { Fixture } from '../test/helpers/fixture';
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fixture = exports.BuildpackRegistry = void 0;
3
+ exports.BuildpackRegistry = void 0;
4
4
  var buildpack_registry_1 = require("./buildpack-registry");
5
5
  Object.defineProperty(exports, "BuildpackRegistry", { enumerable: true, get: function () { return buildpack_registry_1.BuildpackRegistry; } });
6
- var fixture_1 = require("../test/helpers/fixture");
7
- Object.defineProperty(exports, "Fixture", { enumerable: true, get: function () { return fixture_1.Fixture; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heroku/buildpack-registry",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Node.js/TypeScript library for interfacing with the Heroku Buildpack Registry",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@types/node": "^20.14.8",
25
25
  "@types/node-fetch": "^2.1.2",
26
26
  "@vitest/coverage-v8": "^4.0.0",
27
- "eslint": "^9.0.0",
27
+ "eslint": "^10.7.0",
28
28
  "nock": "^13.3",
29
29
  "typescript": "^5.7",
30
30
  "typescript-eslint": "^8.0.0",
@@ -32,10 +32,11 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "node-fetch": "^2.2.0",
35
- "true-myth": "^2.0.0"
35
+ "true-myth": "^9.4.0",
36
+ "tslib": "^2.8.1"
36
37
  },
37
38
  "engines": {
38
- "node": ">= 20"
39
+ "node": ">= 20.19"
39
40
  },
40
41
  "files": [
41
42
  "/dist"
@@ -1,6 +0,0 @@
1
- import { BuildpackBody, ReadmeBody, RevisionBody } from '../../src/buildpack-registry-api';
2
- export declare namespace Fixture {
3
- function buildpack(options?: Partial<BuildpackBody>): BuildpackBody;
4
- function revision(options?: Partial<RevisionBody>): RevisionBody;
5
- function readme(options?: Partial<ReadmeBody>): ReadmeBody;
6
- }
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fixture = void 0;
4
- var Fixture;
5
- (function (Fixture) {
6
- function buildpack(options) {
7
- const base = {
8
- id: '3ef8f543-b953-4a26-b410-8807d1b45eb1',
9
- name: 'scala',
10
- created_at: new Date(),
11
- updated_at: new Date(),
12
- description: 'Official Heroku Buildpack for Scala',
13
- category: 'languages',
14
- two_factor_authentication: false,
15
- blob_url: 'https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/scala.tgz',
16
- source: {
17
- type: 'github',
18
- owner: 'heroku',
19
- repo: 'heroku-buildpack-scala'
20
- },
21
- support: { method: 'github', address: null },
22
- namespace: 'heroku',
23
- logo: {
24
- small: {
25
- url: 'https://s3.amazonaws.com/buildpack-registry/images/buildpacks/logos/3ef/8f5/43-/small/data?1526489067',
26
- width: 64,
27
- height: 64
28
- },
29
- medium: {
30
- url: 'https://s3.amazonaws.com/buildpack-registry/images/buildpacks/logos/3ef/8f5/43-/medium/data?1526489067',
31
- width: 128,
32
- height: 128
33
- }
34
- }
35
- };
36
- if (options) {
37
- return Object.assign(Object.assign({}, base), options);
38
- }
39
- else {
40
- return base;
41
- }
42
- }
43
- Fixture.buildpack = buildpack;
44
- function revision(options) {
45
- const base = {
46
- id: '8de70dbe-e862-4d51-b906-123ef3bf2fc5',
47
- buildpack_id: '71a3c00a-d6c7-4393-94c5-d5d71531720e',
48
- published_by_email: undefined,
49
- ref: undefined,
50
- tarball: 'https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/scala-v151.tgz',
51
- status: 'published',
52
- error: undefined,
53
- created_at: new Date(),
54
- updated_at: new Date(),
55
- release: 151,
56
- checksum: '3fc5aa90fcdc97b2a22a9bba1dac07323dd12d3d4e0abc1984fb06e6e15bc649',
57
- published_by_id: 'bebd5adc-2194-41c9-a246-d97af547a3f9',
58
- license: 'MIT'
59
- };
60
- if (options) {
61
- return Object.assign(Object.assign({}, base), options);
62
- }
63
- else {
64
- return base;
65
- }
66
- }
67
- Fixture.revision = revision;
68
- function readme(options) {
69
- const base = {
70
- content: 'IyBIZXJva3UgRXhlYyBCdWlsZHBhY2sKClRoaXMgaXMgYSBbSGVyb2t1IEJ1\naWxkcGFja10oaHR0cHM6Ly9kZXZjZW50ZXIuaGVyb2t1LmNvbS9hcnRpY2xl\ncy9idWlsZHBhY2tzKQp0aGF0IHdvcmtzIHdpdGggdGhlIFtIZXJva3UgRXhl\nY10oaHR0cHM6Ly9kZXZjZW50ZXIuaGVyb2t1LmNvbS9hcnRpY2xlcy9oZXJv\na3UtZXhlYykgZmVhdHVyZS4K\n',
71
- encoding: 'base64',
72
- sha: 'a5e1e5f5eb76095087b32b31caf5ccaee0c2cae6'
73
- };
74
- if (options) {
75
- return Object.assign(Object.assign({}, base), options);
76
- }
77
- else {
78
- return base;
79
- }
80
- }
81
- Fixture.readme = readme;
82
- })(Fixture || (exports.Fixture = Fixture = {}));